Love BTT. Hoping to get some assistance with the "Execute Shell Script / Task" action.
I have written a shell script that toggles my VPN on/off and verified that it works as expected using the terminal. My intention is to execute this script via a BTT keyboard shortcut. Unfortunately, I have been unsuccessful copy/pasting the code below into the "Execute Shell Script / Task" configuration as well as trying to execute the script as a fie using "Execute Terminal Command".
#!/bin/bash piactl=`which piactl` status=`$piactl get connectionstate` if [[ $status == "Disconnect"* ]]; then $piactl connect else $piactl disconnect fi status=`$piactl get connectionstate` while [[ $status != *"onnected" ]]; do sleep 1 progress=`$piactl get connectionstate` if [[ $progress != $status ]]; then echo $progress fi status=$progress done
Any idea what I might be doing wrong? I have other BTT keyboard shortcuts that execute AppleScript without issue, but for some reason the above shell script just isn't work (i.e., nothing happens when I use the keyboard shortcut or click the "Run Script Now" button).
Thanks in advance for any help you can provide.