diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2012-11-25 21:24:58 +0100 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2012-11-25 21:24:58 +0100 |
commit | 16262790cb6ddacf6c632625cc865e03b1b8671f (patch) | |
tree | 09898d65deef518380915ecdc7575756c9ca8595 /src/ufw | |
parent | 7bb1499a7cd539f714bb7f603d7fc0a38fd8a963 (diff) | |
download | rcdscripts-16262790cb6ddacf6c632625cc865e03b1b8671f.tar.xz |
rcdscripts: import first snapshot of rc.d scripts as of 11.25.20122012.11.25
In 30 days these scripts will start dissapearing from official Arch
Linux packages. This is an attempt to conserve them, and keep sysvinit
usable.
Diffstat (limited to 'src/ufw')
-rwxr-xr-x | src/ufw/rc.d | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/ufw/rc.d b/src/ufw/rc.d new file mode 100755 index 0000000..bd8c3e3 --- /dev/null +++ b/src/ufw/rc.d @@ -0,0 +1,64 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +[ -x /usr/bin/ufw ] || exit 0 + +for s in "/usr/lib/ufw/ufw-init-functions" "/etc/ufw/ufw.conf" ; do + if [ -s "$s" ]; then + . "$s" + else + echo "Could not find $s (aborting)" + exit 1 + fi +done + +error=0 +case "$1" in +start) + if [ "$ENABLED" = "yes" ] || [ "$ENABLED" = "YES" ]; then + stat_busy "Starting ufw" + if ! ufw_start; then + stat_fail + else + add_daemon ufw + stat_done + fi + + else + echo "Skip starting firewall:" "ufw (not enabled)" + fi + ;; +stop) + if [ "$ENABLED" = "yes" ] || [ "$ENABLED" = "YES" ]; then + stat_busy "Stopping ufw" + if ! ufw_stop; then + stat_fail + else + rm_daemon ufw + stat_done + fi + else + echo "Skip stopping firewall:" "ufw (not enabled)" + fi + ;; +restart|force-reload) + stat_busy "Reloading ufw" + if ! ufw_reload; then + stat_fail + else + stat_done + fi + ;; +status) + ufw_status + ;; +*) + echo "Usage: /etc/rc.d/ufw {start|stop|restart|force-reload|status}" + exit 1 + ;; +esac + +exit 0 + |