# #
###############################################################################
+# Define protocols which are supported by aiccu.
+AICCU_SUPPORTED_PROTOCOLS="tic tsp l2tp"
+
function aiccu_start() {
local device=${1}
assert isset device
assert isset server
assert isset protocol
assert isset require_tls
- assert isoneof protocol tic tsp l2tp
+ assert isoneof ${protocol} ${AICCU_SUPPORTED_PROTOCOLS}
# Write configuration file header.
config_header "aiccu configuration file for ${zone}" > ${file}
assert isset SERVER
assert isset PROTOCOL
assert isset REQUIRE_TLS
+
+ # Check if a supported protocol has been given.
+ if ! list_match "${PROTOCOL}" ${AICCU_SUPPORTED_PROTOCOLS}; then
+ log ERROR "This protocol is not supported by aiccu: ${PROTOCOL}"
+ log ERROR "Valid protocols are: ${AICCU_SUPPORTED_PROTOCOLS}"
+ return ${EXIT_ERROR}
+ fi
}
function _parse_cmdline() {