]>
Commit | Line | Data |
---|---|---|
1848564d 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 | ||
e9ea243e MT |
22 | # Set gettext text domain. |
23 | TEXTDOMAIN="network" | |
24 | ||
1848564d | 25 | # Enable colors by default |
6dbd51ba | 26 | COLOURS="auto" |
1848564d | 27 | |
65c75fad | 28 | BASE_DIR=/usr/lib/network |
1848564d MT |
29 | CONFIG_DIR=/etc/network |
30 | HOOKS_DIR=${BASE_DIR}/hooks | |
059469a8 | 31 | LOG_DIR=/var/log/network |
65c75fad | 32 | RUN_DIR=/run/network |
1848564d MT |
33 | ZONE_DIR=${CONFIG_DIR} |
34 | ||
059469a8 | 35 | RED_RUN=${RUN_DIR}/red |
1848564d MT |
36 | PPP_SECRETS=/etc/ppp/secrets |
37 | ||
38 | CONFIG_FILE=${CONFIG_DIR}/network_config | |
ff8ec5ef | 39 | CONFIG_FILE_PARAMS="COLOURS DEBUG SHELL TIMEOUT_RESTART" |
31e59f2b | 40 | CONFIG_HOSTNAME="/etc/hostname" |
ff8ec5ef MT |
41 | |
42 | RED_DB_DIR=${RUN_DIR}/red | |
b816e04b | 43 | ROUTING_DB_DIR=${RUN_DIR}/routing |
1848564d | 44 | |
059469a8 MT |
45 | DB_CONNECTION_FILE="${LOG_DIR}/connections.db" |
46 | ||
1848564d MT |
47 | # Proper error codes |
48 | EXIT_OK=0 | |
49 | EXIT_ERROR=1 | |
50 | EXIT_CONF_ERROR=2 | |
1578dae9 | 51 | EXIT_ERROR_ASSERT=3 |
1848564d | 52 | |
2eaf16f3 MT |
53 | EXIT_TRUE=0 |
54 | EXIT_FALSE=1 | |
55 | ||
1848564d MT |
56 | STATUS_UP=0 |
57 | STATUS_DOWN=1 | |
711ffac1 MT |
58 | STATUS_NOCARRIER=2 |
59 | ||
60 | STATUS_TEXT[${STATUS_UP}]="UP" | |
61 | STATUS_TEXT[${STATUS_DOWN}]="DOWN" | |
62 | STATUS_TEXT[${STATUS_NOCARRIER}]="NO CARRIER" | |
63 | ||
64 | STATUS_COLOUR[${STATUS_UP}]=${COLOUR_GREEN} | |
65 | STATUS_COLOUR[${STATUS_DOWN}]=${COLOUR_RED} | |
66 | STATUS_COLOUR[${STATUS_NOCARRIER}]=${COLOUR_YELLOW} | |
1848564d MT |
67 | |
68 | DISCOVER_OK=0 | |
69 | DISCOVER_ERROR=1 | |
70 | DISCOVER_NOT_SUPPORTED=2 | |
71 | ||
7de0637a MT |
72 | # The user is able to create zones that begin |
73 | # with these names followed by a number. | |
74 | ZONE_LOCAL="lan" | |
75 | ZONE_NONLOCAL="upl" | |
76 | VALID_ZONES="${ZONE_LOCAL} ${ZONE_NONLOCAL}" | |
1848564d MT |
77 | |
78 | SYS_CLASS_NET="/sys/class/net" | |
2ae4f579 MT |
79 | |
80 | # Timeout values | |
81 | TIMEOUT_RESTART=2 | |
711ffac1 | 82 | |
feb76eaf | 83 | DEVICE_PRINT_LINE1=" %-24s %s\n" |
a1a8f0f4 | 84 | |
8c63fa13 | 85 | PORT_PATTERN="pN" |
8ee92277 MT |
86 | PORT_PATTERN_ACCESSPOINT="apN" |
87 | PORT_PATTERN_WIRELESS="wN" |