diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index 3da0d27c7..62f0869a0 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -59,7 +59,6 @@ mywhich() { for dir in $(split $PATH); do if [ -x $dir/$1 ]; then - echo $dir/$1 return 0 fi done @@ -175,6 +174,8 @@ done PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin +[ -n "$BUILD" ] || BUILD=$HOST + if [ -z "$BUILD" ]; then case $(uname) in cygwin*) @@ -194,9 +195,6 @@ if [ -z "$BUILD" ]; then debian) BUILD=debian ;; - gentoo) - BUILD=gentoo - ;; opensuse) BUILD=suse ;; @@ -459,8 +457,12 @@ if [ -z "$DESTDIR" ]; then else cant_autostart fi - elif rc-update add $PRODUCT default; then - echo "Shorewall Init will start automatically at boot" + elif mywhich update-rc.d ; then + if update-rc.d $PRODUCT enable; then + echo "$PRODUCT will start automatically at boot" + echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable" + else + cant_autostart else cant_autostart fi diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index 9da791987..128a25f01 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -552,6 +552,12 @@ if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then else cant_autostart fi + elif mywhich update-rc.d ; then + echo "$PRODUCT will start automatically at boot" + echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable" + touch /var/log/$PRODUCT-init.log + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf + update-rc.d $PRODUCT enable elif mywhich rc-update ; then if rc-update add $PRODUCT default; then echo "$PRODUCT will start automatically at boot" diff --git a/Shorewall/install.sh b/Shorewall/install.sh index f9cda6d4b..bf12507c8 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -1193,6 +1193,12 @@ if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then else cant_autostart fi + elif mywhich update-rc.d ; then + echo "$PRODUCT will start automatically at boot" + echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable" + touch /var/log/$PRODUCT-init.log + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf + update-rc.d $PRODUCT enable elif mywhich rc-update ; then if rc-update add $PRODUCT default; then echo "$PRODUCT will start automatically at boot"