Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

Miscellany
Monday, January 1st, 2007 at 9:17:35pm UTC 

  1. #!/bin/bash
  2. # Remove the old log file and create the new one
  3. LOGFILE="/var/log/wifiSetup.log"
  4. touch $LOGFILE
  5. rm $LOGFILE
  6. touch $LOGFILE
  7. chmod a+r $LOGFILE
  8.  
  9. # Set some test variables
  10. IS_HOME=`iwlist ath0 scan | grep langside`
  11. IS_MDS=`iwlist ath0 scan | grep MDS_Global`
  12.  
  13. # Test those variables
  14. if [ $IS_HOME = 'ESSID:"langside"' ]; then
  15.         echo "Logging onto the 'langside' network." > $LOGFILE
  16.         ESSID="langside"
  17.         ENC="homekey"
  18.         MODE="managed"
  19. else
  20.         if [ $IS_MDS = 'ESSID:"MDS_Global"' ]; then
  21.                 echo "Logging on the 'MDS_Global' network." > $LOGFILE
  22.                 ESSID="MDS_Global"
  23.                 ENC="workkey"
  24.                 MODE="managed"
  25.         fi
  26. fi
  27.  
  28. # Now run the command!
  29. echo "iwconfig ath0 essid $ESSID enc $ENC mode $MODE"
  30. iwconfig ath0 essid $ESSID enc $ENC mode $MODE && dhclient ath0 && echo "Connected successfully to '$ESSID'!" > $LOGFILE

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right