From ed5dc806cc8c7990ea83b5eb5ba4e47c67ced9a5 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 5 Jun 2009 08:46:58 -0700 Subject: [PATCH] Switch Debian installs to use STARTUP_LOG --- Shorewall/init.debian.sh | 25 ++++++------------------- Shorewall/install.sh | 10 ++++++++++ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Shorewall/init.debian.sh b/Shorewall/init.debian.sh index 7f5667c85..3932f6dcc 100755 --- a/Shorewall/init.debian.sh +++ b/Shorewall/init.debian.sh @@ -13,18 +13,11 @@ SRWL=/sbin/shorewall -SRWL_OPTS="-tvv" +SRWL_OPTS="-v-1" WAIT_FOR_IFUP=/usr/share/shorewall/wait4ifup -# Note, set INITLOG to /dev/null if you do not want to -# keep logs of the firewall (not recommended) -INITLOG=/var/log/shorewall-init.log test -x $SRWL || exit 0 test -x $WAIT_FOR_IFUP || exit 0 -test -n $INITLOG || { - echo "INITLOG cannot be empty, please configure $0" ; - exit 1; -} if [ "$(id -u)" != "0" ] then @@ -33,13 +26,7 @@ then fi echo_notdone () { - - if [ "$INITLOG" = "/dev/null" ] ; then - echo "not done." - else - echo "not done (check $INITLOG)." - fi - + echo "not done." } not_configured () { @@ -83,28 +70,28 @@ wait_for_pppd () { shorewall_start () { echo -n "Starting \"Shorewall firewall\": " wait_for_pppd - $SRWL $SRWL_OPTS start >> $INITLOG 2>&1 && echo "done." || echo_notdone + $SRWL $SRWL_OPTS start && echo "done." || echo_notdone return 0 } # stop the firewall shorewall_stop () { echo -n "Stopping \"Shorewall firewall\": " - $SRWL $SRWL_OPTS clear >> $INITLOG 2>&1 && echo "done." || echo_notdone + $SRWL $SRWL_OPTS clear && echo "done." || echo_notdone return 0 } # restart the firewall shorewall_restart () { echo -n "Restarting \"Shorewall firewall\": " - $SRWL $SRWL_OPTS restart >> $INITLOG 2>&1 && echo "done." || echo_notdone + $SRWL $SRWL_OPTS restart && echo "done." || echo_notdone return 0 } # refresh the firewall shorewall_refresh () { echo -n "Refreshing \"Shorewall firewall\": " - $SRWL $SRWL_OPTS refresh >> $INITLOG 2>&1 && echo "done." || echo_notdone + $SRWL $SRWL_OPTS refresh && echo "done." || echo_notdone return 0 } diff --git a/Shorewall/install.sh b/Shorewall/install.sh index d90d410ea..328234da3 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -238,6 +238,16 @@ qt mywhich perl && perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/sh if [ ! -f ${PREFIX}/etc/shorewall/shorewall.conf ]; then run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${PREFIX}/etc/shorewall/shorewall.conf + + if [ -n "$DEBIAN" ] && mywhich perl; then + # + # Make a Debian-like shorewall.conf + # + perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|; + s|^STARTUP_LOG=.*|STARTUP_LOG=/var/lib/shorewall-init.log|; + s|^LOG_VERBOSITY=.*|LOG_VERBOSITY=2|;' ${PREFIX}/etc/shorewall.conf + fi + echo "Config file installed as ${PREFIX}/etc/shorewall/shorewall.conf" fi