]>
Commit | Line | Data |
---|---|---|
711ffac1 MT |
1 | #!/bin/bash |
2 | ############################################################################### | |
3 | # # | |
4 | # IPFire.org - A linux based firewall # | |
5 | # Copyright (C) 2010 Michael Tremer & Christian Schmidt # | |
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 as published by # | |
9 | # the Free Software Foundation, either version 3 of the License, or # | |
10 | # (at your option) any later version. # | |
11 | # # | |
12 | # This program is distributed in the hope that it will be useful, # | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
15 | # GNU General Public License for more details. # | |
16 | # # | |
17 | # You should have received a copy of the GNU General Public License # | |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
19 | # # | |
20 | ############################################################################### | |
21 | ||
22 | . /lib/network/functions | |
23 | ||
24 | HOOK=$(basename ${0}) | |
25 | ||
26 | while [ $# -gt 0 ]; do | |
27 | case "${1}" in | |
28 | -*) | |
29 | error "Unrecognized option: ${1}" | |
30 | exit ${EXIT_ERROR} | |
31 | ;; | |
32 | *) | |
33 | action=${1} | |
34 | ;; | |
35 | esac | |
36 | shift | |
37 | [ -n "${action}" ] && break | |
38 | done | |
39 | ||
40 | function run() { | |
41 | case "${action}" in | |
a5ebb169 | 42 | edit|create|rem|up|down|status) |
711ffac1 MT |
43 | _${action} $@ |
44 | ;; | |
45 | esac | |
46 | ||
a5ebb169 | 47 | error "Config hook '${HOOK}' didn't exit properly." |
711ffac1 MT |
48 | exit ${EXIT_ERROR} |
49 | } |