When I do bash scripts I would usually just use && to chain processes that depend on the one before.
I connect my network to an open wireless AP with this simple one liner from bash:
I connect my network to an open wireless AP with this simple one liner from bash:
root@ obarun ~ # ip link set [interface] up && iw dev [interface] connect [SSID] && dhcpcd -b [interface]
How would I make a frontend exec statement out of this? I have tried this before and the chaining doesn't work as expected. I don't want to set up three separate services though. I would like to have a "wireless" service and have that enabled on boot.[main]
@ type = classic
@ name = wifi
@ description = "bring wireless interface up and connect to open home network"
@ user = ( root )
[start]
@ build = auto
@ execute = ( ip link set wlp4s0 up && iw dev wlp4s0 connect openhome && dhcpcd -b wlp4s0 )
Should I use bash for shebang instead?
@ build = custom
@ shebang = "/usr/bin/bash"
@ execute = (
exec 2>&1
ip link set wlp4s0 up &&
iw dev wlp4s0 connect openhome &&
dhcpcd -b wlp4s0
)