diff options
author | Robby Workman <rworkman@slackbuilds.org> | 2017-06-08 10:21:36 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-06-10 10:47:40 +0700 |
commit | 480f6c050a0f87c53c970def4159a234707ad479 (patch) | |
tree | 480c58ec7a1482a71c8aaa12a799f5339a0b9884 /network/firewalld/rc.FireWallD | |
parent | 4b321577fd243c5fb8b0d9d7997caa58b7999d8a (diff) | |
download | slackbuilds-480f6c050a0f87c53c970def4159a234707ad479.tar.gz |
network/firewalld: Added (dynamically managed firewall gui).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'network/firewalld/rc.FireWallD')
-rw-r--r-- | network/firewalld/rc.FireWallD | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/network/firewalld/rc.FireWallD b/network/firewalld/rc.FireWallD new file mode 100644 index 0000000000..84d981f8ea --- /dev/null +++ b/network/firewalld/rc.FireWallD @@ -0,0 +1,56 @@ +#!/bin/sh +# Start/stop/restart firewalld. + +# Start firewalld: +firewalld_start() { + [ -r /etc/sysconfig/firewalld ] && source /etc/sysconfig/firewalld + echo -n "Starting FireWallD daemon: /usr/sbin/firewalld " + /usr/sbin/firewalld $FIREWALLD_ARGS + echo +} + +# Stop firewalld: +firewalld_stop() { + echo -n "Stopping FireWallD daemon..." + if [ -r /var/run/firewalld.pid ]; then + kill -HUP $(cat /var/run/firewalld.pid) + rm -f /var/run/firewalld.pid + else + killall -HUP -q firewalld + fi + echo +} + +# Restart firewalld: +firewalld_restart() { + firewalld_stop + sleep 1 + firewalld_start +} + +# Check if firewalld is running +firewalld_status() { + if [ -e /var/run/firewalld.pid ]; then + echo "firewalld is running as pid $(cat /var/run/firewalld.pid)." + else + echo "firewalld is stopped." + exit 1 + fi +} + +case "$1" in +'start') + firewalld_start + ;; +'stop') + firewalld_stop + ;; +'restart') + firewalld_restart + ;; +'status') + firewalld_status + ;; +*) + echo "usage $0 start|stop|restart|status" +esac |