]>
git.ipfire.org Git - people/arne_f/network.git/blob - hooks/zones/aiccu
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 .
/lib
/network
/header-zone
24 HOOK_SETTINGS
="HOOK PROTOCOL USER SECRET SERVER TUNNEL_ID"
28 SERVER
="tic.sixxs.net"
39 function _parse_cmdline
() {
42 while [ $# -gt 0 ]; do
45 USER
=$
(cli_get_val
${1})
48 SECRET
=$
(cli_get_val
${1})
51 SERVER
=$
(cli_get_val
${1})
54 PROTOCOL
=$
(cli_get_val
${1})
57 TUNNEL_ID
=$
(cli_get_val
${1})
60 echo "Unknown option: $1" >&2
74 zone_config_read
${zone}
77 --server="${SERVER}" \
78 --protocol="${PROTOCOL}" \
80 --secret="${SECRET}" \
81 --tunnel-id="${TUNNEL_ID}"
100 cli_status_headline
${zone}
102 zone_config_read
${zone}
104 cli_headline
" Configuration:"
105 printf "${DEVICE_PRINT_LINE1}" "User:" "${USER}"
106 printf "${DEVICE_PRINT_LINE1}" "Secret:" "<hidden>"
108 printf "${DEVICE_PRINT_LINE1}" "Server:" "${SERVER}"
109 printf "${DEVICE_PRINT_LINE1}" "Protocol:" "${PROTOCOL}"
110 if isset TUNNEL_ID
; then
112 printf "${DEVICE_PRINT_LINE1}" "Tunnel ID:" "${TUNNEL_ID}"
115 printf "${DEVICE_PRINT_LINE1}" "Use default route?" "$(enabled DEFAULTROUTE && echo "enabled
" || echo "disabled
")"
116 printf "${DEVICE_PRINT_LINE1}" "Use peer DNS?" "$(enabled PEERDNS && echo "enabled
" || echo "disabled
")"
118 # Exit if zone is down
119 if ! zone_is_up
${zone}; then
124 cli_headline
" Protocol information:"
125 printf "${DEVICE_PRINT_LINE1}" "MTU:" "$(device_get_mtu ${zone})"