Implement required reload/force-reload parameters in init script. Make the DEBIAN and PREFIX environment variable not be mutually exclusive.

This commit is contained in:
Roberto C. Sanchez 2010-05-23 17:10:50 -04:00
parent b9f7965a40
commit f564a3f981
2 changed files with 21 additions and 5 deletions

View File

@ -115,8 +115,12 @@ case "$1" in
stop) stop)
shorewall_stop shorewall_stop
;; ;;
reload|force-reload)
shorewall_start
shorewall_stop
;;
*) *)
echo "Usage: /etc/init.d/shorewall-init {start|stop}" echo "Usage: /etc/init.d/shorewall-init {start|stop|reload|force-reload}"
exit 1 exit 1
esac esac

View File

@ -5,6 +5,7 @@
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt] # This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# #
# (c) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net) # (c) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
# (c) 2010 - Roberto C. Sanchez (roberto@connexer.com)
# #
# Shorewall documentation is available at http://shorewall.net # Shorewall documentation is available at http://shorewall.net
# #
@ -149,7 +150,9 @@ if [ -n "$PREFIX" ]; then
fi fi
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
elif [ -f /etc/debian_version ]; then fi
if [ -f /etc/debian_version ]; then
DEBIAN=yes DEBIAN=yes
elif [ -f /etc/SuSE-release ]; then elif [ -f /etc/SuSE-release ]; then
SUSE=Yes SUSE=Yes
@ -194,7 +197,7 @@ fi
# Install the Init Script # Install the Init Script
# #
if [ -n "$DEBIAN" ]; then if [ -n "$DEBIAN" ]; then
install_file init.debian.sh /etc/init.d/shorewall-init 0544 install_file init.debian.sh ${PREFIX}/etc/init.d/shorewall-init 0544
#elif [ -n "$ARCHLINUX" ]; then #elif [ -n "$ARCHLINUX" ]; then
# install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 # install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544
else else
@ -229,8 +232,8 @@ fi
run_install $OWNERSHIP -m 744 ifupdown.sh ${PREFIX}/usr/share/shorewall-init/ifupdown run_install $OWNERSHIP -m 744 ifupdown.sh ${PREFIX}/usr/share/shorewall-init/ifupdown
if [ -n "$DEBIAN" ]; then if [ -n "$DEBIAN" ]; then
if [ ! -f /etc/default/shorewall-init ]; then if [ ! -f ${PREFIX}/etc/default/shorewall-init ]; then
run_install $OWNERSHIP -m 0644 sysconfig /etc/default/shorewall-init run_install $OWNERSHIP -m 0644 sysconfig ${PREFIX}/etc/default/shorewall-init
fi fi
else else
if [ -n "$PREFIX" ]; then if [ -n "$PREFIX" ]; then
@ -293,6 +296,15 @@ if [ -z "$PREFIX" ]; then
fi fi
fi fi
fi fi
else
if [ -n "$first_install" ]; then
if [ -n "$DEBIAN" ]; then
ln -sf ../init.d/shorewall-init ${PREFIX}/etc/rcS.d/S09shorewall-init
ln -sf /usr/share/shorewall-init/ifupdown ${PREFIX}/etc/network/if-up.d/shorewall
ln -sf /usr/share/shorewall-init/ifupdown ${PREFIX}/etc/network/if-post-down.d/shorewall
echo "Shorewall Init will start automatically at boot"
fi
fi
fi fi
# #