]> git.ipfire.org Git - people/arne_f/network.git/blame - header-port
network: STP: Make protocol version configureable.
[people/arne_f/network.git] / header-port
CommitLineData
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
24HOOK=$(basename ${0})
25
26while [ $# -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
38done
39
1848564d
MT
40function run() {
41 case "${action}" in
e5f78859 42 edit|add|create|rem|up|down|status)
1848564d
MT
43 _${action} $@
44 ;;
45 esac
5b20e43a 46
1848564d 47 error "Port hook '${HOOK}' didn't exit properly."
5b20e43a 48 exit ${EXIT_ERROR}
1848564d 49}