3
# ufw-init: helper script to be used by ufw itself
5
# Copyright 2008-2009 Canonical Ltd.
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License version 3,
9
# as published by the Free Software Foundation.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
if [ -s "#STATE_PREFIX#/ufw-init-functions" ]; then
22
. "#STATE_PREFIX#/ufw-init-functions"
24
echo "Could not find $s (aborting)"
30
# process multiple error strings
32
output=`ufw_start` || ret="$?"
33
test -n "$output" && echo "$output" | while read line ; do
34
if [ "$2" = "quiet" ] || [ "$QUIET" = "yes" ]; then
35
echo "$line" | grep -q "Skip starting" && continue
45
ufw_stop --force || exit "$?"
48
ufw_reload || exit "$?"
51
ufw_status || exit "$?"
54
# Use sparingly. It flushes the built-in chains, deletes all non-builtin
55
# chains and resets the policy to ACCEPT
56
flush_builtins || exit "$?"
59
echo "Usage: #STATE_PREFIX#/ufw-init {start|stop|restart|force-reload|force-stop|flush-all|status}"