You are not logged in.
I would like to write a script to run at login that would sync the files on my laptop with those on another machine after a wireless connection is established. This needs to work on at least two networks (if I need to supply a network id). I need this script on my Ubuntu laptop, on which I have Hardy with the default wireless network manager, though I could change if I need to.
I managed to cobble together a fairly inelegant solution:
Q = "0"
while [ $Q = "0" ]; do
Q=$(ping -c1 www.google.com 2> /dev/null | grep -c google);
done
echo Connected!
Really, though, there has to be a better way to do this! I looked through some of the iw* functions, but they all seem to return the same things in the "connecting" and "connected" stages. Any ideas?
Offline
This might interest you:
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
Using netcfg2 you could just put the command in the POST_UP="" variable, which will be run after a successful connection to the network.
Offline