]>
git.ipfire.org Git - people/ms/network.git/blob - hooks/zones/bridge.configs/ipv4-dhcp
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2010 Michael Tremer & Christian Schmidt #
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. #
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. #
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/>. #
20 ###############################################################################
22 .
/usr
/lib
/network
/header-config
24 HOOK_SETTINGS
="HOOK DELAY"
31 assert isinteger DELAY
38 while [ $# -gt 0 ]; do
47 config_write $
(zone_dir
${zone})/configs/${HOOK} ${HOOK_SETTINGS}
57 if ! device_exists
${zone}; then
58 error
"Zone '${zone}' doesn't exist."
62 # Start dhclient for IPv4 on this zone.
63 dhclient_start
${zone} ipv4
73 if ! device_exists
${zone}; then
74 error
"Zone '${zone}' doesn't exist."
78 # Stop dhclient for IPv4 on this zone.
79 dhclient_stop
${zone} ipv4
89 if ! device_exists
${zone}; then
90 error
"Zone '${zone}' doesn't exist."
94 config_read $
(zone_dir
${zone})/configs
/${config}
96 printf " %10s - " "${HOOK}"
97 if zone_has_ip
${zone} ${ADDRESS}/${PREFIX}; then
98 echo -ne "${COLOUR_UP} UP ${COLOUR_NORMAL}"
100 echo -ne "${COLOUR_DOWN}DOWN${COLOUR_NORMAL}"
102 echo " - ${ADDRESS}/${PREFIX}"
104 if [ -n "${GATEWAY}" ]; then
105 echo " Gateway: ${GATEWAY}"