[ -n "$INTERFACE" ] || exit 2
if [ "$ACTION" == "ifup" ]; then
- [ -n "$DEVICE" ] || exit 3
+ [ -n "$DEVICE" ] || exit 3
fi
mwan3_lock "$ACTION" "$INTERFACE"
config_load mwan3
config_get_bool enabled globals 'enabled' '0'
-[ ${enabled} -gt 0 ] || {
+[ "${enabled}" -gt 0 ] || {
mwan3_unlock "$ACTION" "$INTERFACE"
exit 0
}
mwan3_set_connected_iptables
mwan3_set_custom_ipset
-config_get enabled $INTERFACE enabled 0
config_get initial_state $INTERFACE initial_state "online"
-[ "${enabled}" == "1" ] || {
+config_get_bool enabled $INTERFACE 'enabled' '0'
+[ "${enabled}" -eq 1 ] || {
mwan3_unlock "$ACTION" "$INTERFACE"
exit 0
}
-if [ "$ACTION" == "ifup" ]; then
+if [ "$ACTION" = "ifup" ]; then
config_get family $INTERFACE family ipv4
if [ "$family" = "ipv4" ]; then
ubus call network.interface.${INTERFACE}_4 status &>/dev/null
mwan3_create_iface_iptables $INTERFACE $DEVICE
mwan3_create_iface_rules $INTERFACE $DEVICE
mwan3_create_iface_route $INTERFACE $DEVICE
- if [ ${running} -eq 1 -a "${status}" = "online" ]; then
+ if [ "${running}" -eq 1 ] && [ "${status}" = "online" ]; then
$LOG notice "Starting tracker on interface $INTERFACE (${DEVICE:-unknown})"
mwan3_set_iface_hotplug_state $INTERFACE "online"
mwan3_track $INTERFACE $DEVICE "online" "$src_ip"
config_load mwan3
config_get_bool enabled globals 'enabled' '0'
-[ ${enabled} -gt 0 ] || {
+[ "${enabled}" -gt 0 ] || {
mwan3_unlock "$ACTION" "mwan3rtmon"
exit 0
}
-if [ "$ACTION" == "ifup" ]; then
+if [ "$ACTION" = "ifup" ]; then
mwan3_rtmon
fi
-config_get enabled $INTERFACE enabled 0
-[ "${enabled}" = "0" ] || {
+config_get_bool enabled "$INTERFACE" 'enabled' '0'
+[ "${enabled}" -eq 0 ] || {
mwan3_flush_conntrack "$INTERFACE" "$ACTION"
}
config_load mwan3
config_get_bool enabled globals 'enabled' '0'
- [ ${enabled} -gt 0 ] || {
+ [ "${enabled}" -gt 0 ] || {
mwan3_unlock "$ACTION" "user"
exit 0
}
- config_get enabled "$INTERFACE" enabled 0
- [ "${enabled}" = "1" ] || {
+ config_get_bool enabled "$INTERFACE" enabled 0
+ [ "${enabled}" -eq 1 ] || {
mwan3_unlock "$ACTION" "user"
exit 0
}