mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-08 22:58:50 +01:00
More work on installers
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
75b57b926a
commit
766370e22a
@ -140,6 +140,9 @@ if [ $# -eq 0 ]; then
|
|||||||
if [ -f ~/.shorewallrc ]; then
|
if [ -f ~/.shorewallrc ]; then
|
||||||
. ~/.shorewallrc
|
. ~/.shorewallrc
|
||||||
file=~/.shorewallrc
|
file=~/.shorewallrc
|
||||||
|
elif [ -f ./.shorewallrc ]; then
|
||||||
|
. ./.shorewallrc || exit 1
|
||||||
|
file=./.shorewallrc
|
||||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||||
. /usr/share/shorewall/shorewallrc
|
. /usr/share/shorewall/shorewallrc
|
||||||
file=/usr/share/shorewall/shorewallrc
|
file=/usr/share/shorewall/shorewallrc
|
||||||
|
@ -139,7 +139,10 @@ if [ $# -eq 0 ]; then
|
|||||||
if [ -f ~/.shorewallrc ]; then
|
if [ -f ~/.shorewallrc ]; then
|
||||||
. ~/.shorewallrc || exit 1
|
. ~/.shorewallrc || exit 1
|
||||||
file=~/.shorewallrc
|
file=~/.shorewallrc
|
||||||
else
|
elif [ -f ./.shorewallrc ]; then
|
||||||
|
. ./.shorewallrc || exit 1
|
||||||
|
file=./.shorewallrc
|
||||||
|
else
|
||||||
fatal_error "No configuration file specified and ~/.shorewallrc not found"
|
fatal_error "No configuration file specified and ~/.shorewallrc not found"
|
||||||
fi
|
fi
|
||||||
elif [ $# -eq 1 ]; then
|
elif [ $# -eq 1 ]; then
|
||||||
@ -321,20 +324,20 @@ if [ $HOST = debian ]; then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ -n "$DESTDIR" ]; then
|
if [ -n "$DESTDIR" ]; then
|
||||||
mkdir -p ${DESTDIR}/etc/sysconfig
|
mkdir -p ${DESTDIR}${SYSCONFDIR}
|
||||||
|
|
||||||
if [ -z "$RPM" ]; then
|
if [ -z "$RPM" ]; then
|
||||||
if [ $HOST = suse ]; then
|
if [ $HOST = suse ]; then
|
||||||
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
|
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
|
||||||
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d
|
mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d
|
||||||
else
|
else
|
||||||
mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d
|
mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d ${DESTDIR}/etc/sysconfig -a ! -f ${DESTDIR}/etc/sysconfig/shorewall-init ]; then
|
if [ -d ${DESTDIR}${SYSCONFDIR} -a ! -f ${DESTDIR}${SYSCONFDIR}/shorewall-init ]; then
|
||||||
install_file sysconfig ${DESTDIR}/etc/sysconfig/shorewall-init 0644
|
install_file sysconfig ${DESTDIR}${SYSCONFDIR}/shorewall-init 0644
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -342,31 +345,35 @@ fi
|
|||||||
# Install the ifupdown script
|
# Install the ifupdown script
|
||||||
#
|
#
|
||||||
|
|
||||||
|
cp ifupdown.sh ifupdown
|
||||||
|
|
||||||
|
d[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ifupdown
|
||||||
|
|
||||||
mkdir -p ${DESTDIR}${LIBEXECDIR}/shorewall-init
|
mkdir -p ${DESTDIR}${LIBEXECDIR}/shorewall-init
|
||||||
|
|
||||||
install_file ifupdown.sh ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown 0544
|
install_file ifupdown ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown 0544
|
||||||
|
|
||||||
if [ -d ${DESTDIR}/etc/NetworkManager ]; then
|
if [ -d ${DESTDIR}/etc/NetworkManager ]; then
|
||||||
install_file ifupdown.sh ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
|
install_file ifupdown ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $HOST in
|
case $HOST in
|
||||||
debian)
|
debian)
|
||||||
install_file ifupdown.sh ${DESTDIR}/etc/network/if-up.d/shorewall 0544
|
install_file ifupdown ${DESTDIR}/etc/network/if-up.d/shorewall 0544
|
||||||
install_file ifupdown.sh ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
|
install_file ifupdown ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
|
||||||
;;
|
;;
|
||||||
suse)
|
suse)
|
||||||
if [ -z "$RPM" ]; then
|
if [ -z "$RPM" ]; then
|
||||||
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-up.d/shorewall 0544
|
install_file ifupdown ${DESTDIR}${SYSCONFDIR}/network/if-up.d/shorewall 0544
|
||||||
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-down.d/shorewall 0544
|
install_file ifupdown ${DESTDIR}${SYSCONFDIR}/network/if-down.d/shorewall 0544
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
redhat)
|
redhat)
|
||||||
if [ -f ${DESTDIR}${SBINDIR}/ifup-local -o -f ${DESTDIR}${SBINDIR}/ifdown-local ]; then
|
if [ -f ${DESTDIR}${SBINDIR}/ifup-local -o -f ${DESTDIR}${SBINDIR}/ifdown-local ]; then
|
||||||
echo "WARNING: ${SBINDIR}/ifup-local and/or ${SBINDIR}/ifdown-local already exist; up/down events will not be handled"
|
echo "WARNING: ${SBINDIR}/ifup-local and/or ${SBINDIR}/ifdown-local already exist; up/down events will not be handled"
|
||||||
elif [ -z "$DESTDIR" ]; then
|
elif [ -z "$DESTDIR" ]; then
|
||||||
install_file ifupdown.sh ${DESTDIR}${SBINDIR}/ifup-local 0544
|
install_file ifupdown ${DESTDIR}${SBINDIR}/ifup-local 0544
|
||||||
install_file ifupdown.sh ${DESTDIR}${SBINDIR}/ifdown-local 0544
|
install_file ifupdown ${DESTDIR}${SBINDIR}/ifdown-local 0544
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -384,7 +391,7 @@ if [ -z "$DESTDIR" ]; then
|
|||||||
echo "Shorewall Init will start automatically at boot"
|
echo "Shorewall Init will start automatically at boot"
|
||||||
fi
|
fi
|
||||||
elif [ -x ${SBINDIR}/insserv -o -x /usr${SBINDIR}/insserv ]; then
|
elif [ -x ${SBINDIR}/insserv -o -x /usr${SBINDIR}/insserv ]; then
|
||||||
if insserv /etc/init.d/shorewall-init ; then
|
if insserv ${INITDIR}/shorewall-init ; then
|
||||||
echo "Shorewall Init will start automatically at boot"
|
echo "Shorewall Init will start automatically at boot"
|
||||||
else
|
else
|
||||||
cant_autostart
|
cant_autostart
|
||||||
@ -414,7 +421,7 @@ else
|
|||||||
mkdir -p ${DESTDIR}/etc/rcS.d
|
mkdir -p ${DESTDIR}/etc/rcS.d
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ln -sf ../init.d/shorewall-init ${DESTDIR}/etc/rcS.d/S38shorewall-init
|
ln -sf ../init.d/shorewall-init ${DESTDIR}${CONFDIR}/rcS.d/S38shorewall-init
|
||||||
echo "Shorewall Init will start automatically at boot"
|
echo "Shorewall Init will start automatically at boot"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -427,7 +434,7 @@ if [ -f ${DESTDIR}/etc/ppp ]; then
|
|||||||
debian|suse)
|
debian|suse)
|
||||||
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
|
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
|
||||||
mkdir -p ${DESTDIR}/etc/ppp/$directory #SuSE doesn't create the IPv6 directories
|
mkdir -p ${DESTDIR}/etc/ppp/$directory #SuSE doesn't create the IPv6 directories
|
||||||
cp -fp ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown ${DESTDIR}/etc/ppp/$directory/shorewall
|
cp -fp ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown ${DESTDIR}${CONFDIR}/ppp/$directory/shorewall
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
redhat)
|
redhat)
|
||||||
|
@ -148,6 +148,9 @@ done
|
|||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
if [ -f ~/.shorewallrc ]; then
|
if [ -f ~/.shorewallrc ]; then
|
||||||
. ~/.shorewallrc
|
. ~/.shorewallrc
|
||||||
|
elif [ -f ./.shorewallrc ]; then
|
||||||
|
. ./.shorewallrc || exit 1
|
||||||
|
file=./.shorewallrc
|
||||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||||
. /usr/share/shorewall/shorewallrc
|
. /usr/share/shorewall/shorewallrc
|
||||||
else
|
else
|
||||||
|
@ -170,6 +170,9 @@ done
|
|||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
if [ -f ~/.shorewallrc ]; then
|
if [ -f ~/.shorewallrc ]; then
|
||||||
. ~/.shorewallrc
|
. ~/.shorewallrc
|
||||||
|
elif [ -f ./.shorewallrc ]; then
|
||||||
|
. ./.shorewallrc || exit 1
|
||||||
|
file=./.shorewallrc
|
||||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||||
. /usr/share/shorewall/shorewallrc
|
. /usr/share/shorewall/shorewallrc
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user