Skip to content

Instantly share code, notes, and snippets.

@anuragpeshne
Last active December 14, 2015 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anuragpeshne/1fd2386df002950c5b8c to your computer and use it in GitHub Desktop.
Save anuragpeshne/1fd2386df002950c5b8c to your computer and use it in GitHub Desktop.
bash script to
#!/bin/sh
let sleepTime="15*60";
while [ 1 ]
do
if [ $(( $RANDOM % 2)) == 0 ]
then
echo "switching to NTWRK1";
networksetup -setairportnetwork en1 {NTWRK_NAME} {NTWRK_PSWD}
else
echo "switching to NTWRK2";
networksetup -setairportnetwork en1 {NTWRK_NAME} {NTWRK_PSWD}
fi
sleep $sleepTime;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment