]>
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 | ||
6c74a64c MT |
22 | LOG_FACILITY=$(basename ${0}) |
23 | ||
5b20e43a | 24 | umask 022 |
5b20e43a | 25 | |
6c74a64c MT |
26 | PPP_VARIABLES="IFNAME IPLOCAL IPREMOTE DNS1 DNS2 MACREMOTE LLLOCAL LLREMOTE" |
27 | ||
711ffac1 | 28 | # Give the variables we get passed by pppd an own namespace |
6c74a64c | 29 | for i in ${PPP_VARIABLES}; do |
711ffac1 MT |
30 | export PPP_${i}=${!i} |
31 | unset ${i} | |
32 | done | |
33 | ||
b58484f8 | 34 | . /usr/lib/network/functions |
5b20e43a | 35 | |
6c74a64c MT |
36 | log DEBUG "Called." |
37 | for i in ${PPP_VARIABLES}; do | |
38 | i="PPP_${i}" | |
39 | log DEBUG " ${i} = ${!i}" | |
40 | done | |
41 | ||
1848564d | 42 | # Zone equals IFNAME |
711ffac1 | 43 | ZONE=${PPP_IFNAME} |
5b20e43a | 44 | |
e814246d MT |
45 | # If the given device is a known zone, we will call the required |
46 | # hook methods. If we don't know about any zone with name ${ZONE}, | |
47 | # we do nothing. | |
48 | ||
6c74a64c | 49 | if isset ZONE && zone_exists ${ZONE}; then |
e814246d MT |
50 | HOOK=$(zone_get_hook ${ZONE}) |
51 | ||
52 | assert isset HOOK | |
53 | assert hook_zone_exists ${HOOK} | |
54 | ||
55 | PROGNAME=$(basename ${0}) | |
56 | assert isset PROGNAME | |
711ffac1 | 57 | |
e814246d MT |
58 | log DEBUG "${PROGNAME} was called with the following parameters:" |
59 | log DEBUG " $@" | |
1848564d | 60 | |
e814246d | 61 | hook_zone_exec ${HOOK} ppp-${PROGNAME} ${ZONE} |
6c74a64c | 62 | ret=$? |
201b7dff | 63 | |
e814246d MT |
64 | exit ${ret} |
65 | fi | |
201b7dff | 66 | |
e814246d | 67 | exit ${EXIT_OK} |