How can I have a systemd script wait enough to check a connection to the internet?
I've got a script that I've made into a oneshot systemd service. This runs on a raspberry pi and the point is that if it cannot connect to the internet it reconfigures the wifi adapter (?) to create an ad hoc network and reboots.
The problem I'm experiencing is that when it checks it hasn't yet received an IP address and thus thinks that it cannot connect.
I tried using the After= parameter to be network-online.target but that didn't change anything and I tried introducing a sleep command in the script itself but again no change.
Any ideas?
This is the script check_connection.sh:
/etc/systemd/system/check_connection.service:
EDIT
The OS I'm running is: Linux raspberrypi 4.1.7+ #817 PREEMPT Sat Sep 19 15:25:36 BST 2015 armv6l GNU/Linux
评论
?
参与讨论