• Home
  • Help
  • Search
  • Login
  • Register
Pages: 1 2 [3]
Author Topic: Setting up sheevaplug with wlan  (Read 13484 times)
atomic
Newbie
*

Karma: 0
Posts: 5


View Profile WWW
« Reply #30 on: September 20, 2009, 07:19:33 AM »

I blogged about getting the sheevaplug running on wifi with the 3com officeconnect usb dongle here: http://plug.noloop.net/sheevaplug-hacks/installing-debian/prism54usb-3com-officeconnect-3CRWE254G72-wlan-wpa-without-nw
Haven't had any stability problems, with very light load the plug's been online for days.
Logged

ljones
Newbie
*

Karma: 0
Posts: 20


View Profile
« Reply #31 on: February 13, 2010, 10:23:58 PM »

I really must get back to doing this. Never finished all this off because the hard drive I had plugged into the sheevaplug .... I needed it for other stuff! But must get back into all of this. Smiley

ljones
Logged

ljones
Newbie
*

Karma: 0
Posts: 20


View Profile
« Reply #32 on: February 28, 2010, 07:54:58 AM »

Ok, I've not tired it yet but here's a stab at a script. Snag is though I am not sure how the script "runs". Let me explain -- once the script has finished do all the variables (I'm using one called $count) get cleared out or will they remain once the script ends (not sure). Anyways here's my first attempt at a better script. This one saves the variable count as well, as I'm not sure if it gets wiped once the script ends ....

Code:
#!/bin/sh
#
# Tidied up script which checks if the sheevaplug is conencted, if it isn't
# then a connection is made for five attempts, and if it fails on the fifth
# go then the sheevaplug is reset.
#
# Uses a file called "count.var" to store the variable count into a file
#

# First check to see if the file count.var exists, and if not - make it!
if [ -e "count.var" ]
then
 :                      #  The file exists, so no need for any action
else
 echo 0 > count.var     #  No file, so put 0 into the file count.var
fi

# Read count.var and put it into variable count
count=`cat count.var`

# Check to see if the connection has been lost
if=wlan0
if iwconfig $if | grep -q Not-Associated ;
then
 :                      # Uh oh, lost connection so ....
else
 count=0                # We're connected so set count to 0
 rm count.var           # Get rid of count.var
 exit
fi

# Since we're not connected carry on....
# Has the counter reached 5 yet? If so, reboot.
if [ $count -eq 5 ] then
 count=0                # Set counter to 0
 rm count.var           # Get rid of count.var
 shutdown -r now        # Not connected :-( so restart sheevaplug
 exit                   
fi

# Counter hasn't gotten to 5 yet, so add 1 to count
count=$(($count +1))

# Save it to count.var
echo $count > count.var

# And try to reconnect ....
iwconfig $if ap auto

EDIT: Found 1 error. Missed off "-" off "-eq" (if [ $count -eq 5 ] ) .

ljoens
« Last Edit: March 03, 2010, 08:23:24 AM by ljones » Logged

Pages: 1 2 [3]
Print
Jump to: