LaFonera Software Heartbeat

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 15:06, 11 February 2007 (edit)
Wildblue (Talk | contribs)

← Previous diff
Revision as of 17:53, 11 February 2007 (edit) (undo)
Wildblue (Talk | contribs)

Next diff →
Line 47: Line 47:
cat /tmp/simthefon/known_hosts >> /tmp/root/.ssh/known_hosts cat /tmp/simthefon/known_hosts >> /tmp/root/.ssh/known_hosts
chmod a+x /tmp/simthefon/simthefon chmod a+x /tmp/simthefon/simthefon
-( /tmp/simthefon/simthefon >/tmp/simthefon/simthefon.log & ) &' >> /tmp/simthefon/heartbeat+( /tmp/simthefon/simthefon cron >/tmp/simthefon/simthefon.log & ) &' >> /tmp/simthefon/heartbeat
-echo '0 * * * * root /tmp/simthefon/simthefon >/tmp/simthefon/simthefon.log & ) &' >> /tmp/cron.d/heartbeat+echo '0 * * * * root /tmp/simthefon/simthefon cron >/tmp/simthefon/simthefon.log' >> /tmp/cron.d/heartbeat
chmod a+x /tmp/simthefon/heartbeat chmod a+x /tmp/simthefon/heartbeat

Revision as of 17:53, 11 February 2007

Back to La Fonera

The Fon heartbeat

This is the way to simulate the fon heartbeat, so that the fonera with dd-wrt is shown as active on the fon maps.

It is based on the work of freddy (http://fon.freddy.eu.org), futejia (http://futejia.blogspot.com) and krikkit (http://www.krikkit.net)

There are two ways you can enable your activity on the fon maps.

The easy way by wildblue (This guide is also available on http://www.wildblue.de/fonera/heartbeat/howto) :

  1. Open your web-based configuration on your DD-WRT-Fonera (e.g. 192.168.1.1)
  2. Go to the "Administration" section, then to "Commands" (German: "Diagnose")
  3. paste the follwing commands and select "Save Startup" (German: "Startup speichern")
#!/bin/sh
sleep 60
mkdir /tmp/simthefon
cd /tmp/simthefon
/usr/bin/wget http://www.wildblue.de/fonera/heartbeat/key
/usr/bin/wget http://www.wildblue.de/fonera/heartbeat/simthefon
/usr/bin/wget http://www.wildblue.de/fonera/heartbeat/known_hosts
cat /tmp/simthefon/known_hosts >> /tmp/root/.ssh/known_hosts
chmod a+x /tmp/simthefon/simthefon
( /tmp/simthefon/simthefon >/tmp/simthefon/simthefon.log & ) &

4. Now you can reboot your router or simply past the commands again and select "Run Commands" (German: "Kommandos ausführen")


Thats` is. Your Router is now active on maps.fon.com

* Keep in mind that it can take some time before your router gets active on the maps, it doesnt update immediately as what I have noticed. Be sure to also clean your web browser cache in between your visits at the maps.

This works for execution every hour, but creates a lot of instances of simthefon (every hour) in the ProcessList (ps). Maybe i will remove the sleep function in simthefon in the future (on www.wildblue.de)

#!/bin/sh
mkdir /tmp/simthefon

echo '#!/bin/sh
sleep 10
cd /tmp/simthefon
/usr/bin/wget http://www.wildblue.de/fonera/heartbeat/key
/usr/bin/wget http://www.wildblue.de/fonera/heartbeat/simthefon
/usr/bin/wget http://www.wildblue.de/fonera/heartbeat/known_hosts
cat /tmp/simthefon/known_hosts >> /tmp/root/.ssh/known_hosts
chmod a+x /tmp/simthefon/simthefon
( /tmp/simthefon/simthefon cron >/tmp/simthefon/simthefon.log & ) &' >> /tmp/simthefon/heartbeat

echo '0 * * * * root /tmp/simthefon/simthefon cron >/tmp/simthefon/simthefon.log' >> /tmp/cron.d/heartbeat

chmod a+x /tmp/simthefon/heartbeat
/tmp/simthefon/heartbeat

stopservice cron && startservice cron

Security Warning:

The method shown above is dangerous. If somebody could make the router think that he (the attacker) is www.wildblue.de or if the www.wildblue.de server gets compromised, he is able to do *anything* as root on your router! I recommend not to choose that approach. Copy the scripts to a local ftp/web server instead! Maybe in the near future this script will be included in the DD-WRT source. All you can read here in this wiki are howto-solutions and not final!.


Second, more difficult way by Krikkit (I don't now why he made it that difficult, even if he changed the original script):

1. download my script from http://www.krikkit.net/download/simthefon/simthefon.sh (thanks to futejia http://futejia.blogspot.com/ for his script)

2. download the fon key (you can get the fon key from here: http://fon.freddy.eu.org/fonera/fon-0.7.0-rev4/etc/dropbear/key )

3. download known_hosts file ( http://fon.freddy.eu.org/fonera/fon-0.7.0-rev4/etc/dropbear/known_hosts )

4. save the script and the fon key and fon known_hosts on your local ftp server or any location where you can download it with wget afterwards...

5. find out your MAC-addresses and change them in the file simthefon.sh

WLMAC
ifconfig ath0|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g"

MAC
ifconfig eth0|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g"

6. paste the text below into Administration --> Commands --> Commands input field and click "Save startup"

startup script:

#!/bin/sh
sleep 60
mkdir /tmp/simthefon
cd /tmp/simthefon
/usr/bin/wget ftp://192.168.1.2/simthefon/key
/usr/bin/wget ftp://192.168.1.2/simthefon/simthefon.sh
/usr/bin/wget ftp://192.168.1.2/simthefon/known_hosts
cat /tmp/simthefon/known_hosts >> /tmp/root/.ssh/known_hosts
chmod a+x /tmp/simthefon/simthefon.sh
( /tmp/simthefon/simthefon.sh >/tmp/simthefon/simthefon.log & ) &

do not forget to edit the wget commands, to fit your locations...

reboot your fonera...

your hotspot should now be ACTIVE on http://maps.fon.com