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_config_dir
() {
25 echo "${RUN_DIR}/aiccu/${device}"
28 function aiccu_start
() {
34 local config_dir
=$
(aiccu_config_dir
${device})
35 mkdir
-p ${config_dir}
37 local config_file
=${config_dir}/config
38 aiccu_configure
${device} $@
> ${config_file}
40 aiccu start
${config_file} &>/dev
/null
45 log DEBUG
"Aiccu was successfully started for '${device}'."
49 error_log
"Could not start aiccu properly for '${device}'."
51 error_log
"Configuration file dump:"
62 function aiccu_stop
() {
67 aiccu stop $
(aiccu_config_dir
${device})/config
69 rm -rf $
(aiccu_config_dir
${device})
72 function aiccu_configure
() {
83 while [ $# -gt 0 ]; do
86 user
=$
(cli_get_val
${1})
89 secret
=$
(cli_get_val
${1})
92 server
=$
(cli_get_val
${1})
95 protocol
=$
(cli_get_val
${1})
98 tunnel_id
=$
(cli_get_val
${1})
107 assert isset protocol
108 assert isoneof protocol tic tsp l2tp
111 ## AICCU configuration for ${zone}
119 $(isset tunnel_id && echo "tunnel_id ${tunnel_id}")
121 ipv6_interface ${device}
127 pidfile $(aiccu_config_dir ${zone})/pid
129 #setupscript /tmp/aiccu.sh