]>
Commit | Line | Data |
---|---|---|
711ffac1 | 1 | #!/bin/bash |
5b20e43a MT |
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 | ||
22 | umask 022 | |
23 | export PATH=/usr/sbin:/sbin:/usr/bin:/bin | |
24 | ||
711ffac1 MT |
25 | exec &>/tmp/network.$(basename $0) |
26 | ||
27 | # Give the variables we get passed by pppd an own namespace | |
28 | for i in IFNAME IPLOCAL IPREMOTE DNS1 DNS2 MACREMOTE; do | |
29 | export PPP_${i}=${!i} | |
30 | unset ${i} | |
31 | done | |
32 | ||
5b20e43a | 33 | . /lib/network/functions |
5b20e43a | 34 | |
1848564d | 35 | # Zone equals IFNAME |
711ffac1 MT |
36 | ZONE=${PPP_IFNAME} |
37 | ||
38 | assert isset ZONE | |
5b20e43a | 39 | |
1848564d MT |
40 | if ! zone_exists ${ZONE}; then |
41 | error "Zone '${ZONE}' does not exist." | |
42 | exit ${EXIT_ERROR} | |
5b20e43a MT |
43 | fi |
44 | ||
711ffac1 MT |
45 | HOOK=$(zone_get_hook ${ZONE}) |
46 | ||
47 | assert isset HOOK | |
1848564d | 48 | |
711ffac1 | 49 | if ! hook_zone_exists ${HOOK}; then |
1848564d MT |
50 | error "Hook '${HOOK}' does not exist." |
51 | exit ${EXIT_ERROR} | |
52 | fi | |
53 | ||
711ffac1 | 54 | hook_zone_exec ${HOOK} ppp-$(basename ${0}) ${ZONE} |