From 6b7e11137b53e632975577c4e4311cc07420558b Mon Sep 17 00:00:00 2001 From: Tobias Mueller Date: Tue, 17 Oct 2023 09:57:47 +0200 Subject: [PATCH] switch: send SIM swap script to background I think we can only toggle while the handler is not active. I toggled to ON and got the script running. But then I couldn't toggle OFF, presumingly because the script was still running. By sending it to the background I hope it will allow me to toggle OFF. --- files/etc/gl-switch.d/sim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/etc/gl-switch.d/sim.sh b/files/etc/gl-switch.d/sim.sh index e972918..6e25810 100644 --- a/files/etc/gl-switch.d/sim.sh +++ b/files/etc/gl-switch.d/sim.sh @@ -9,7 +9,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 - /usr/bin/blue-merle-switch + flock -n /tmp/blue-merle-switch.lock /usr/bin/blue-merle-switch || logger -p notice -t blue-merle-toggle "Lockfile busy" & elif [ "$action" = "off" ];then mcu_send_message "Blue Merle ${action}"