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 function aiccu_start
() {
26 # Tell systemd to start aiccu on this device.
27 service_start
"aiccu@${device}.service"
30 if [ ${ret} -eq ${EXIT_OK} ]; then
31 log DEBUG
"aiccu was successfully started on '${device}'."
33 log ERROR
"Could not start aiccu properly on '${device}': ${ret}"
40 function aiccu_stop
() {
44 # Tell sysemd to stop aiccu on this device.
45 service_stop
"aiccu@${device}.service"
48 function aiccu_write_config
() {
63 while [ $# -gt 0 ]; do
66 username
="$(cli_get_val ${1})"
69 password
="$(cli_get_val ${1})"
72 server
="$(cli_get_val ${1})"
75 protocol
="$(cli_get_val ${1})"
78 tunnel_id
="$(cli_get_val ${1})"
81 require_tls
="$(cli_get_val ${1})"
97 assert isset require_tls
98 assert isoneof protocol tic tsp l2tp
100 # Write configuration file header.
101 config_header
"aiccu configuration file for ${zone}" > ${file}
104 print
"# Server info"
105 print
"server ${server}"
106 print
"protocol ${protocol}"
109 if isset tunnel_id
; then
111 print
"tunnel_id ${tunnel_id}"
115 print
"# Credentials"
116 print
"username ${username}"
117 print
"password ${password}"
120 print
"ipv6_interface ${device}"
124 print
"requiretls ${require_tls}"
129 print
"daemonize false"
130 print
"automatic true"