mirror of
https://gitlab.com/shorewall/code.git
synced 2025-08-13 01:33:24 +02:00
Switch Debian installs to use STARTUP_LOG
This commit is contained in:
@ -13,18 +13,11 @@
|
|||||||
|
|
||||||
|
|
||||||
SRWL=/sbin/shorewall
|
SRWL=/sbin/shorewall
|
||||||
SRWL_OPTS="-tvv"
|
SRWL_OPTS="-v-1"
|
||||||
WAIT_FOR_IFUP=/usr/share/shorewall/wait4ifup
|
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 $SRWL || exit 0
|
||||||
test -x $WAIT_FOR_IFUP || 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" ]
|
if [ "$(id -u)" != "0" ]
|
||||||
then
|
then
|
||||||
@ -33,13 +26,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo_notdone () {
|
echo_notdone () {
|
||||||
|
|
||||||
if [ "$INITLOG" = "/dev/null" ] ; then
|
|
||||||
echo "not done."
|
echo "not done."
|
||||||
else
|
|
||||||
echo "not done (check $INITLOG)."
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
not_configured () {
|
not_configured () {
|
||||||
@ -83,28 +70,28 @@ wait_for_pppd () {
|
|||||||
shorewall_start () {
|
shorewall_start () {
|
||||||
echo -n "Starting \"Shorewall firewall\": "
|
echo -n "Starting \"Shorewall firewall\": "
|
||||||
wait_for_pppd
|
wait_for_pppd
|
||||||
$SRWL $SRWL_OPTS start >> $INITLOG 2>&1 && echo "done." || echo_notdone
|
$SRWL $SRWL_OPTS start && echo "done." || echo_notdone
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# stop the firewall
|
# stop the firewall
|
||||||
shorewall_stop () {
|
shorewall_stop () {
|
||||||
echo -n "Stopping \"Shorewall firewall\": "
|
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
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# restart the firewall
|
# restart the firewall
|
||||||
shorewall_restart () {
|
shorewall_restart () {
|
||||||
echo -n "Restarting \"Shorewall firewall\": "
|
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
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# refresh the firewall
|
# refresh the firewall
|
||||||
shorewall_refresh () {
|
shorewall_refresh () {
|
||||||
echo -n "Refreshing \"Shorewall firewall\": "
|
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
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
if [ ! -f ${PREFIX}/etc/shorewall/shorewall.conf ]; then
|
||||||
run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${PREFIX}/etc/shorewall/shorewall.conf
|
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"
|
echo "Config file installed as ${PREFIX}/etc/shorewall/shorewall.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user