summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2016-01-30 21:52:26 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2016-01-30 21:52:26 (GMT)
commitf409ce18e8d56ec30e842059c2c74a0d49907ab9 (patch)
treed17b2536e585cb86d4414c239da4828ba7951745
parent2df7bb4de058ba7489de3be8054bcc692ecaf974 (diff)
fixed systemd reload and initscript path
-rwxr-xr-xinitscript6
-rwxr-xr-xsaswall6
-rw-r--r--systemd.service1
3 files changed, 9 insertions, 4 deletions
diff --git a/initscript b/initscript
index 296e48d..dcae870 100755
--- a/initscript
+++ b/initscript
@@ -13,7 +13,7 @@
# edit /etc/saswall/rules.sh instead
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
-FIREWALL_SCRIPT="/usr/local/sbin/saswall"
+FIREWALL_SCRIPT="/usr/sbin/saswall"
. /lib/lsb/init-functions
@@ -29,12 +29,12 @@ stop)
$FIREWALL_SCRIPT down
log_action_end_msg $?
;;
-force-reload|restart)
+reload)
echo "Reloading Firewall"
$FIREWALL_SCRIPT reload
;;
*)
- echo "Usage: /etc/init.d/firewall {start|stop|force-reload|restart}"
+ echo "Usage: /etc/init.d/firewall {start|stop|reload}"
exit 1
;;
esac
diff --git a/saswall b/saswall
index 1027b6d..69232f8 100755
--- a/saswall
+++ b/saswall
@@ -109,7 +109,11 @@ saswall_restore()
saswall_check_or_fallback()
{
set +e
- read -t $SASWALL_CONFIRM_TIMEOUT -p "To confirm changes type yes [ENTER]: " saswall_confirmation
+ if [ -z "$SASWALL_USE_SYSTEM_ASK_PASSWD" ]; then
+ read -t $SASWALL_CONFIRM_TIMEOUT -p "To confirm changes type yes [ENTER]: " saswall_confirmation
+ else
+ saswall_confirmation=`systemd-ask-password --timeout=$SASWALL_CONFIRM_TIMEOUT "To confirm saswall changes type yes [ENTER]: "`
+ fi
if [ "$saswall_confirmation" != "yes" ]; then
echo "no or wrong confirmation received"
saswall_restore
diff --git a/systemd.service b/systemd.service
index 5cf9c45..2fab722 100644
--- a/systemd.service
+++ b/systemd.service
@@ -4,6 +4,7 @@ Description=simple and safe firewall loader
[Service]
Type=oneshot
RemainAfterExit=yes
+Environment="SASWALL_USE_SYSTEM_ASK_PASSWD=1"
ExecStart=/usr/sbin/saswall up
ExecStop=/usr/sbin/saswall down
ExecReload=/usr/sbin/saswall reload