Provide STARTOPTIONS and RESTARTOPTIONS in all cases

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2014-10-30 10:22:39 -07:00
parent 3454e10525
commit 113f95c11e
12 changed files with 24 additions and 22 deletions

View File

@ -39,7 +39,7 @@ fi
start() { start() {
echo -n $"Starting Shorewall: " echo -n $"Starting Shorewall: "
$shorewall $OPTIONS start 2>&1 | $logger $shorewall $OPTIONS start $STARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]} retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then if [[ $retval == 0 ]]; then
touch $lockfile touch $lockfile
@ -69,7 +69,7 @@ restart() {
# Note that we don't simply stop and start since shorewall has a built in # Note that we don't simply stop and start since shorewall has a built in
# restart which stops the firewall if running and then starts it. # restart which stops the firewall if running and then starts it.
echo -n $"Restarting Shorewall: " echo -n $"Restarting Shorewall: "
$shorewall $OPTIONS restart 2>&1 | $logger $shorewall $OPTIONS restart $RESTARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]} retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then if [[ $retval == 0 ]]; then
touch $lockfile touch $lockfile

View File

@ -13,7 +13,7 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall-lite EnvironmentFile=-/etc/sysconfig/shorewall-lite
StandardOutput=syslog StandardOutput=syslog
ExecStart=/sbin/shorewall-lite $OPTIONS start ExecStart=/sbin/shorewall-lite $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall-lite $OPTIONS stop ExecStop=/sbin/shorewall-lite $OPTIONS stop
[Install] [Install]

View File

@ -13,7 +13,7 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall-lite EnvironmentFile=-/etc/sysconfig/shorewall-lite
StandardOutput=syslog StandardOutput=syslog
ExecStart=/sbin/shorewall-lite $OPTIONS start ExecStart=/sbin/shorewall-lite $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall-lite $OPTIONS stop ExecStop=/sbin/shorewall-lite $OPTIONS stop
[Install] [Install]

View File

@ -39,7 +39,7 @@ fi
start() { start() {
echo -n $"Starting Shorewall: " echo -n $"Starting Shorewall: "
$shorewall $OPTIONS start 2>&1 | $logger $shorewall $OPTIONS start $STARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]} retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then if [[ $retval == 0 ]]; then
touch $lockfile touch $lockfile
@ -69,7 +69,7 @@ restart() {
# Note that we don't simply stop and start since shorewall has a built in # Note that we don't simply stop and start since shorewall has a built in
# restart which stops the firewall if running and then starts it. # restart which stops the firewall if running and then starts it.
echo -n $"Restarting Shorewall: " echo -n $"Restarting Shorewall: "
$shorewall $OPTIONS restart 2>&1 | $logger $shorewall $OPTIONS restart $RESTARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]} retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then if [[ $retval == 0 ]]; then
touch $lockfile touch $lockfile

View File

@ -10,15 +10,16 @@
OPTIONS="" OPTIONS=""
# Use /etc/default shorewall to specify $OPTIONS to run at startup, however this # Use /etc/default shorewall to specify $OPTIONS and STARTOPTIONS to
# this might prevent shorewall from starting. use at your own risk # run at startup, however this this might prevent shorewall from
# starting. use at your own risk
if [ -f /etc/default/shorewall ] ; then if [ -f /etc/default/shorewall ] ; then
. /etc/default/shorewall . /etc/default/shorewall
fi fi
start() { start() {
echo "Starting IPv4 shorewall rules..." echo "Starting IPv4 shorewall rules..."
exec /sbin/shorewall $OPTIONS start exec /sbin/shorewall $OPTIONS start $STARTOPTIONS
} }
stop() { stop() {
@ -28,7 +29,7 @@ stop() {
restart() { restart() {
echo "Restarting IPv4 shorewall rules..." echo "Restarting IPv4 shorewall rules..."
exec /sbin/shorewall restart exec /sbin/shorewall restart $RESTARTOPTIONS
} }
status() { status() {

View File

@ -13,7 +13,7 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall EnvironmentFile=-/etc/sysconfig/shorewall
StandardOutput=syslog StandardOutput=syslog
ExecStart=/sbin/shorewall $OPTIONS start ExecStart=/sbin/shorewall $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall $OPTIONS stop ExecStop=/sbin/shorewall $OPTIONS stop
[Install] [Install]

View File

@ -13,7 +13,7 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall EnvironmentFile=-/etc/sysconfig/shorewall
StandardOutput=syslog StandardOutput=syslog
ExecStart=/sbin/shorewall $OPTIONS start ExecStart=/sbin/shorewall $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall $OPTIONS stop ExecStop=/sbin/shorewall $OPTIONS stop
[Install] [Install]

View File

@ -39,7 +39,7 @@ fi
start() { start() {
echo -n $"Starting Shorewall: " echo -n $"Starting Shorewall: "
$shorewall $OPTIONS start 2>&1 | $logger $shorewall $OPTIONS start $STARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]} retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then if [[ $retval == 0 ]]; then
touch $lockfile touch $lockfile
@ -69,7 +69,7 @@ restart() {
# Note that we don't simply stop and start since shorewall has a built in # Note that we don't simply stop and start since shorewall has a built in
# restart which stops the firewall if running and then starts it. # restart which stops the firewall if running and then starts it.
echo -n $"Restarting Shorewall: " echo -n $"Restarting Shorewall: "
$shorewall $OPTIONS restart 2>&1 | $logger $shorewall $OPTIONS restart $RESTARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]} retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then if [[ $retval == 0 ]]; then
touch $lockfile touch $lockfile

View File

@ -39,7 +39,7 @@ fi
start() { start() {
echo -n $"Starting Shorewall: " echo -n $"Starting Shorewall: "
$shorewall $OPTIONS start 2>&1 | $logger $shorewall $OPTIONS start $STARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]} retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then if [[ $retval == 0 ]]; then
touch $lockfile touch $lockfile
@ -69,7 +69,7 @@ restart() {
# Note that we don't simply stop and start since shorewall has a built in # Note that we don't simply stop and start since shorewall has a built in
# restart which stops the firewall if running and then starts it. # restart which stops the firewall if running and then starts it.
echo -n $"Restarting Shorewall: " echo -n $"Restarting Shorewall: "
$shorewall $OPTIONS restart 2>&1 | $logger $shorewall $OPTIONS restart $RESTARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]} retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then if [[ $retval == 0 ]]; then
touch $lockfile touch $lockfile

View File

@ -10,8 +10,9 @@
OPTIONS="" OPTIONS=""
# Use /etc/default shorewall6 to specify $OPTIONS to run at startup, however this # Use /etc/default shorewall6 to specify $OPTIONS and STARTOPTIONS to
# this might prevent shorewall6 from starting. use at your own risk # run at startup, however this this might prevent shorewall6 from
# starting. use at your own risk
if [ -f /etc/default/shorewall6 ] ; then if [ -f /etc/default/shorewall6 ] ; then
. /etc/default/shorewall6 . /etc/default/shorewall6
fi fi
@ -19,7 +20,7 @@ fi
start() { start() {
echo "Starting IPv6 shorewall rules..." echo "Starting IPv6 shorewall rules..."
exec /sbin/shorewall6 $OPTIONS start exec /sbin/shorewall6 $OPTIONS start $STARTOPTIONS
} }
stop() { stop() {
@ -29,7 +30,7 @@ stop() {
restart() { restart() {
echo "Restarting IPv6 shorewall rules..." echo "Restarting IPv6 shorewall rules..."
exec /sbin/shorewall6 restart exec /sbin/shorewall6 restart $RESTARTOPTIONS
} }
status() { status() {

View File

@ -13,7 +13,7 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall6 EnvironmentFile=-/etc/sysconfig/shorewall6
StandardOutput=syslog StandardOutput=syslog
ExecStart=/sbin/shorewall6 $OPTIONS start ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall6 $OPTIONS stop ExecStop=/sbin/shorewall6 $OPTIONS stop
[Install] [Install]

View File

@ -13,7 +13,7 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall6 EnvironmentFile=-/etc/sysconfig/shorewall6
StandardOutput=syslog StandardOutput=syslog
ExecStart=/sbin/shorewall6 $OPTIONS start ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall6 $OPTIONS stop ExecStop=/sbin/shorewall6 $OPTIONS stop
[Install] [Install]