Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
list_match "${!param}" yes on true 1
}
+disabled() {
+ local param="${1}"
+
+ list_match "${!param}" no off false 0
+}
+
mac_generate() {
local b="$(random 12)"
if enabled OFFLOADING; then
OFFLOADING="on"
- else
+ elif disabled OFFLOADING; then
OFFLOADING="off"
+ else
+ error "Invalid value for offloading: ${OFFLOADING}"
+ return ${EXIT_ERROR}
fi
;;
+*)
if enabled OFFLOADING; then
OFFLOADING="on"
- else
+ elif disabled OFFLOADING; then
OFFLOADING="off"
+ else
+ error "Invalid value for offloading: ${OFFLOADING}"
+ return ${EXIT_ERROR}
fi
;;