~ubuntu-branches/ubuntu/trusty/ufw/trusty-proposed

« back to all changes in this revision

Viewing changes to .pc/0001-optimize-boot.patch/src/ufw-init

  • Committer: Package Import Robot
  • Author(s): Jamie Strandboge
  • Date: 2012-04-04 12:12:25 UTC
  • mfrom: (30.1.13)
  • mto: This revision was merged to the branch mainline in revision 65.
  • Revision ID: package-import@ubuntu.com-20120404121225-pjt6j7hm3ua0q580
Tags: 0.31.1-1
* New upstream release (Closes: 663677, Closes: 625681)
* debian/control: update to standards 3.9.3
* convert to source format 3.0 (quilt)
* 0001-optimize-boot.patch: only read in /etc/ufw/ufw.conf when disabled
* debian/rules: adjust to only install the application profiles when not
  Ubuntu
* debian/po/nl.po: add Dutch translation of debconf templates. Thanks to
  Jeroen Schot (Closes: 658495)
* debian/po/da.po: add Danish translation of debconf templates. Thanks to
  Joe Dalton (Closes: 666557)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# ufw-init: helper script to be used by ufw itself
 
4
#
 
5
# Copyright 2008-2009 Canonical Ltd.
 
6
#
 
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.
 
10
#
 
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.
 
15
#
 
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/>.
 
18
#
 
19
set -e
 
20
 
 
21
if [ -s "#STATE_PREFIX#/ufw-init-functions" ]; then
 
22
    . "#STATE_PREFIX#/ufw-init-functions"
 
23
else
 
24
    echo "Could not find $s (aborting)"
 
25
    exit 1
 
26
fi
 
27
 
 
28
case "$1" in
 
29
start)
 
30
    # process multiple error strings
 
31
    ret=0
 
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
 
36
        fi
 
37
        echo "$line"
 
38
    done
 
39
    exit "$ret"
 
40
    ;;
 
41
stop)
 
42
    ufw_stop || exit "$?"
 
43
    ;;
 
44
force-stop)
 
45
    ufw_stop --force || exit "$?"
 
46
    ;;
 
47
restart|force-reload)
 
48
    ufw_reload || exit "$?"
 
49
    ;;
 
50
status)
 
51
    ufw_status || exit "$?"
 
52
    ;;
 
53
flush-all)
 
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 "$?"
 
57
    ;;
 
58
*)
 
59
    echo "Usage: #STATE_PREFIX#/ufw-init {start|stop|restart|force-reload|force-stop|flush-all|status}"
 
60
    exit 1
 
61
    ;;
 
62
esac
 
63