View Single Post
Posts: 35 | Thanked: 13 times | Joined on Oct 2008
#7
To complete this thread the following was used after installing wireless-tools. This allows running multiple user scripts from the MyDocs location. Found this an easier way keeping track / backups of the scripts while also allowing me to be lazy and use leafpad as editor.

in if-up.d/50_upscripts
Code:
#!/bin/sh
ssid=`iwgetid -s`
if [ -z $ssid ]; then
   exit
fi

if [ $ssid == "my_network_ssid" ]; then
   list=`ls /home/user/MyDocs/scripts/up_*.sh`
   for script in $list
   do
      /home/user/MyDocs/scripts/$script
   done
fi
in if-post-down.d/50_downscripts
Code:
#!/bin/sh
ssid=`iwgetid -s`
if [ -z $ssid ]; then
   exit
fi

if [ $ssid == "my_network_ssid" ]; then
   list=`ls /home/user/MyDocs/scripts/down_*.sh`
   for script in $list
   do
      /home/user/MyDocs/scripts/$script
   done
fi

Then create a folder /home/user/MyDocs/scripts/ and prefix your script up_***.sh or down_***.sh

With this ive created all the scripts needed to start/stop each time I go or leave home :-
..torrent automatically download and stop
..ftp daemon
..web daemon
..sound on / off
__________________
topsmileys - Free forum smileys

Last edited by purg; 2009-04-23 at 12:12.
 

The Following 2 Users Say Thank You to purg For This Useful Post: