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 # Define protocols which are supported by aiccu.
23 AICCU_SUPPORTED_PROTOCOLS
="tic tsp l2tp"
25 function aiccu_start
() {
29 # Tell systemd to start aiccu on this device.
30 service_start
"aiccu@${device}.service"
33 if [ ${ret} -eq ${EXIT_OK} ]; then
34 log DEBUG
"aiccu was successfully started on '${device}'."
36 log ERROR
"Could not start aiccu properly on '${device}': ${ret}"
43 function aiccu_stop
() {
47 # Tell sysemd to stop aiccu on this device.
48 service_stop
"aiccu@${device}.service"
51 function aiccu_write_config
() {
66 while [ $# -gt 0 ]; do
69 username
="$(cli_get_val ${1})"
72 password
="$(cli_get_val ${1})"
75 server
="$(cli_get_val ${1})"
78 protocol
="$(cli_get_val ${1})"
81 tunnel_id
="$(cli_get_val ${1})"
84 require_tls
="$(cli_get_val ${1})"
100 assert isset require_tls
101 assert isoneof
${protocol} ${AICCU_SUPPORTED_PROTOCOLS}
103 # Write configuration file header.
104 config_header
"aiccu configuration file for ${zone}" > ${file}
107 print
"# Server info"
108 print
"server ${server}"
109 print
"protocol ${protocol}"
112 if isset tunnel_id
; then
114 print
"tunnel_id ${tunnel_id}"
118 print
"# Credentials"
119 print
"username ${username}"
120 print
"password ${password}"
123 print
"ipv6_interface ${device}"
127 print
"requiretls ${require_tls}"
132 print
"daemonize false"
133 print
"automatic true"