I made runit service:
unblock_wifi
It works. But last line seems not right.
Isn't unblock_wifi/
once suppose to do the same?
The main goal is to link airplane button to
But without previously putting service down rfkill
toggle wifi doesn't work.
unblock_wifi service unblocks wifi again. Despite its status is down.
is this also your post about blocked wifi?
https://forum.artixlinux.org/index.php/topic,3845.msg25054.html#msg25054
did you install tlp?
Thanks, it works.
Would be better if you can set airplane button to restore previous state. Now the only option is enable everything.
If you run
help exec on a shell, you'll find out what's the problem:
exec: exec [-cl] [-a name] [command [argument ...]] [redirection ...]
Replace the shell with the given command.
So the script stops as soon as
rfkill unblock wifi is spawned. Rfkill then exits after unblocking wifi, but the shell isn't there anymore to read
sv down unblock_wifi. Since runit always restarts the service after the process it's monitoring exits, the script is spawned again, and the cycle repeats.
You'd want to write it like this:
#!/bin/sh
rfkill unblock wifi
# pause literally does nothing, it doesn't even exit.
# It's there so runit doesn't start the service again.
exec pause