]>
Commit | Line | Data |
---|---|---|
5b20e43a MT |
1 | #!/bin/bash |
2 | ############################################################################### | |
3 | # # | |
4 | # IPFire.org - A linux based firewall # | |
1848564d | 5 | # Copyright (C) 2010 Michael Tremer & Christian Schmidt # |
5b20e43a MT |
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 | ||
5b20e43a MT |
22 | . /lib/network/functions |
23 | ||
1848564d MT |
24 | HOOK=$(basename ${0}) |
25 | ||
26 | while [ $# -gt 0 ]; do | |
5b20e43a | 27 | case "${1}" in |
1848564d MT |
28 | -*) |
29 | error "Unrecognized option: ${1}" | |
30 | exit ${EXIT_ERROR} | |
5b20e43a MT |
31 | ;; |
32 | *) | |
33 | action=${1} | |
1848564d | 34 | ;; |
5b20e43a MT |
35 | esac |
36 | shift | |
1848564d | 37 | [ -n "${action}" ] && break |
5b20e43a MT |
38 | done |
39 | ||
1848564d MT |
40 | function run() { |
41 | case "${action}" in | |
42 | create|rem|up|down) | |
43 | _${action} $@ | |
44 | ;; | |
45 | esac | |
5b20e43a | 46 | |
1848564d | 47 | error "Port hook '${HOOK}' didn't exit properly." |
5b20e43a | 48 | exit ${EXIT_ERROR} |
1848564d | 49 | } |