]>
git.ipfire.org Git - people/stevee/network.git/blob - src/hooks/zones/aiccu
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2013 IPFire Network Development Team #
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-zone
24 HOOK_SETTINGS
="HOOK PASSWORD PROTOCOL REQUIRE_TLS USERNAME SERVER TUNNEL_ID"
28 SERVER
="tic.sixxs.net"
33 function hook_check_settings
() {
38 assert isset REQUIRE_TLS
40 # Check if a supported protocol has been given.
41 if ! list_match
"${PROTOCOL}" ${AICCU_SUPPORTED_PROTOCOLS}; then
42 log ERROR
"This protocol is not supported by aiccu: ${PROTOCOL}"
43 log ERROR
"Valid protocols are: ${AICCU_SUPPORTED_PROTOCOLS}"
48 function hook_parse_cmdline
() {
51 while [ $# -gt 0 ]; do
54 USERNAME
="$(cli_get_val ${1})"
57 PASSWORD
="$(cli_get_val ${1})"
60 SERVER
="$(cli_get_val ${1})"
63 PROTOCOL
="$(cli_get_val ${1})"
66 TUNNEL_ID
="$(cli_get_val ${1})"
69 REQUIRE_TLS
="$(cli_get_val ${1})"
78 echo "Unknown option: $1" >&2
90 # Start aiccu on this zone.
96 function hook_down
() {
100 # Stop aiccu on this zone.
106 function hook_status
() {
110 cli_device_headline
${zone}
112 zone_settings_read
"${zone}"
114 cli_headline
2 "Configuration"
115 cli_print_fmt1
2 "User" "${USERNAME}"
116 cli_print_fmt1
2 "Secret" "<hidden>"
118 cli_print_fmt1
2 "Server" "${SERVER}"
119 cli_print_fmt1
2 "Protocol" "${PROTOCOL}"
120 if isset TUNNEL_ID
; then
122 cli_print_fmt1
2 "Tunnel ID" "${TUNNEL_ID}"