mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 18:42:12 +08:00
Added new app: ufw - Uncomplicated Firewall, version 0.30
This commit is contained in:
parent
cdcc304c27
commit
cdf2faad32
64
ufw/ufw.rc
Normal file
64
ufw/ufw.rc
Normal file
@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
|
||||
[ -x /usr/bin/ufw ] || exit 0
|
||||
|
||||
for s in "/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
|
||||
|
Loading…
Reference in New Issue
Block a user