diff --git a/files/etc/gl-switch.d/sim.sh b/files/etc/gl-switch.d/sim.sh index cf71e8e..97324d8 100644 --- a/files/etc/gl-switch.d/sim.sh +++ b/files/etc/gl-switch.d/sim.sh @@ -10,8 +10,7 @@ logger -p notice -t blue-merle-toggle "Called... ${action}" if [ "$action" = "on" ];then mcu_send_message "Blue Merle ${action}" echo "on" > /tmp/sim_change_switch - flock -n /tmp/blue-merle-switch.lock timeout 90 /usr/bin/blue-merle-switch || logger -p notice -t blue-merle-toggle "Lockfile busy" & - logger -p notice -t blue-merle-toggle "Finished Switch" + ubus call file exec '{ "command": "flock", "params": ["-n", "/tmp/blue-merle-switch.lock", "timeout", "90", "/usr/bin/blue-merle-switch"] }' elif [ "$action" = "off" ];then mcu_send_message "Blue Merle ${action}" @@ -20,4 +19,5 @@ elif [ "$action" = "off" ];then else echo "off" > /tmp/sim_change_switch fi +logger -p notice -t blue-merle-toggle "Finished Switch" sleep 1