Since bluetoothctl is still missing the feature of power-on on start-up, I would like to use a command-chain
to start it before the snap daemon is started. I made a shell script, added it as a part and added the following command-chain
:
command-chain: [bluetooth_on.sh]
with bluetooth_on.sh:
#!/bin/sh -e
{ printf 'power on\n\n'
sleep 2
printf 'exit\n\n'
} | bluetoothctl
However, this leads to the error:
May 14 01:11:37 localhost my_snap.daemon[30626]: /snap/my_snap/75/bluetooth_on.sh: 6: /snap/my_snap/75/bluetooth_on.sh: bluetoothctl: not found
May 14 01:11:39 localhost systemd[1]: snap.my_snap.daemon.service: Main process exited, code=exited, status=127/n/a
May 14 01:11:39 localhost systemd[1]: snap.my_snap.daemon.service: Failed with result 'exit-code'.
If I manually execute the script, which is placed in $SNAP with
./bluetooth_on
it works perfectly fine. I’m not so sure if I understand the command-chains, but I thought this would be exactly a use-case for them.