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 function aiccu_init
() {
23 log INFO
"Initializing aiccu."
24 mkdir
-p $
(aiccu_config_dir
)
27 init_register aiccu_init
29 function aiccu_config_dir
() {
32 echo "${RUN_DIR}/aiccu/${device}"
35 function aiccu_start
() {
41 local config_dir
=$
(aiccu_config_dir
${device})
42 mkdir
-p ${config_dir}
44 local config_file
=${config_dir}/config
45 aiccu_configure
${device} $@
> ${config_file}
47 aiccu start
${config_file} &>/dev
/null
52 log DEBUG
"Aiccu was successfully started for '${device}'."
56 error_log
"Could not start aiccu properly for '${device}'."
58 error_log
"Configuration file dump:"
69 function aiccu_stop
() {
74 aiccu stop $
(aiccu_config_dir
${device})/config
76 rm -rf $
(aiccu_config_dir
${device})
79 function aiccu_configure
() {
90 while [ $# -gt 0 ]; do
93 user
=$
(cli_get_val
${1})
96 secret
=$
(cli_get_val
${1})
99 server
=$
(cli_get_val
${1})
102 protocol
=$
(cli_get_val
${1})
105 tunnel_id
=$
(cli_get_val
${1})
114 assert isset protocol
115 assert isoneof protocol tic tsp l2tp
118 ## AICCU configuration for ${zone}
126 $(isset tunnel_id && echo "tunnel_id ${tunnel_id}")
128 ipv6_interface ${device}
134 pidfile $(aiccu_config_dir ${zone})/pid
136 #setupscript /tmp/aiccu.sh