diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index 4b659df9b..6027c4594 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -453,10 +453,17 @@ esac if [ -z "$DESTDIR" ]; then if [ -n "$first_install" ]; then if [ $HOST = debian ]; then - - update-rc.d shorewall-init enable - - echo "Shorewall Init will start automatically at boot" + if mywhich insserv; then + if insserv enable; then + echo "Shorewall Init will start automatically at boot" + else + cant_autostart + fi + elif rc-update add $PRODUCT default; then + echo "Shorewall Init will start automatically at boot" + else + cant_autostart + fi elif [ $HOST = gentoo ]; then # On Gentoo, a service must be enabled manually by the user, # not by the installer diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index 96e9d8e28..9da791987 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -527,20 +527,20 @@ if [ ${SHAREDIR} != /usr/share ]; then fi if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then - if mywhich update-rc.d ; then - echo "$PRODUCT will start automatically at boot" - echo "Set startup=1 in ${SYSCONFDIR}/$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 defaults - elif [ -n "$SYSTEMD" ]; then + if [ -n "$SYSTEMD" ]; then if systemctl enable ${PRODUCT}.service; then echo "$Product will start automatically at boot" fi elif mywhich insserv; then if insserv ${INITDIR}/${INITFILE} ; then echo "$PRODUCT will start automatically at boot" - echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/${PRODUCT}.conf to enable" + if [ $HOST = debian ]; then + 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 + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" + fi else cant_autostart fi @@ -555,7 +555,13 @@ if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then elif mywhich rc-update ; then if rc-update add $PRODUCT default; then echo "$PRODUCT will start automatically at boot" - echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" + if [ $HOST = debian ]; then + 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 + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" + fi else cant_autostart fi diff --git a/Shorewall/install.sh b/Shorewall/install.sh index c32211695..f9cda6d4b 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -1168,20 +1168,20 @@ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PR fi if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then - if 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 [ -n "$SYSTEMD" ]; then + if [ -n "$SYSTEMD" ]; then if systemctl enable ${PRODUCT}.service; then echo "$Product will start automatically at boot" fi elif mywhich insserv; then if insserv ${CONFDIR}/init.d/$PRODUCT ; then echo "$PRODUCT will start automatically at boot" - echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" + if [ $HOST = debian ]; then + 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 + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" + fi else cant_autostart fi @@ -1196,7 +1196,13 @@ if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then elif mywhich rc-update ; then if rc-update add $PRODUCT default; then echo "$PRODUCT will start automatically at boot" - echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" + if [ $HOST = debian ]; then + 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 + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" + fi else cant_autostart fi