The Following 6 Users Say Thank You to dannemil For This Useful Post: | ||
![]() |
2008-07-11
, 20:03
|
Posts: 566 |
Thanked: 150 times |
Joined on Dec 2007
|
#2
|
The Following User Says Thank You to iamthewalrus For This Useful Post: | ||
![]() |
2008-07-11
, 20:08
|
Posts: 1,224 |
Thanked: 1,763 times |
Joined on Jul 2007
|
#3
|
The Following 2 Users Say Thank You to Matan For This Useful Post: | ||
![]() |
2008-07-11
, 20:09
|
|
Posts: 1,310 |
Thanked: 820 times |
Joined on Mar 2006
@ Irving, TX
|
#4
|
![]() |
2008-07-11
, 20:27
|
Posts: 100 |
Thanked: 38 times |
Joined on Apr 2008
|
#5
|
In case of N810, the GPS last known position might be useful information. Doesn't the A-GPS save the coordinates to some file that could be read and reported back?
![]() |
2008-07-11
, 20:35
|
Posts: 60 |
Thanked: 17 times |
Joined on Feb 2008
|
#6
|
![]() |
2008-07-11
, 20:38
|
Posts: 60 |
Thanked: 17 times |
Joined on Feb 2008
|
#7
|
![]() |
2008-07-11
, 20:42
|
|
Posts: 228 |
Thanked: 30 times |
Joined on Mar 2008
@ Ontario & Iceland
|
#8
|
The Following User Says Thank You to IcelandDreams For This Useful Post: | ||
![]() |
2008-07-11
, 20:45
|
Posts: 60 |
Thanked: 17 times |
Joined on Feb 2008
|
#9
|
Looks useful! Would be nice if we had an automatic 'mugshot' funtion as well.
The Following User Says Thank You to dannemil For This Useful Post: | ||
![]() |
2008-07-11
, 20:56
|
Posts: 60 |
Thanked: 17 times |
Joined on Feb 2008
|
#10
|
I think it would be torturous to have the IP of my stolen NIT but unable to do a thing about it. Don't say that you could inform the authorities, ya right. Perhaps if you could set a flag at the server end that when set would do something useful on the NIT when it phoned home. The NIT ssh connection could be setup to allow that to happen securely. I can think of a lot of things but I'll leave that to your imagination.
http://snippets.dzone.com/search/get_results?q=callhome
By having crond run this script hourly, it will make your Nokia "call home" by securely copying a file with its current IP address and other info to a site of your choosing that is set up to accept ssh connections. This is useful in case your Nokia gets stolen; you can track it down by it's current IP if the thief manages to connect to the internet.
You will need to have installed and functioning correctly
bash shell
sed
wget
traceroute
ssh
crond
whois
ifconfig
who <--- not really necessary - can be cut from script
The script below should be modified with the correct paths to the various files. You can change the base directory for various files as well as the name of the file that gets sent via scp in the first two lines of code.
The last line of the script does a secure copy to send the information to your site. It assumes that you have set up ssh to work without the need for a password by using a private-public keypair.
Replace the parts of the script between the [...] with relevant variables for your situation (and REMOVE the brackets []). If it works correctly, you should find the hidden file ~/.locate-laptop at your ssh receiving site, updated hourly with your wayward Nokia's current IP address.
Jim
#!/bin/bash
#script to have nokia tablet "call home" hourly with its current ip address
#"calling home" means securely copying a file with ip info to a computer set up to receive this file
base="/home/user/"
rfile=".locate-laptop"
rm -f $base$rfile
date > $base$rfile
who >> $base$rfile
ipnameit=$(wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//')
echo "My IP address is $ipnameit" >> $base$rfile
/usr/local/bin/whois $ipnameit | egrep -A 8 'OrgName|Email' 2>&1 >> $base$rfile
/sbin/ifconfig -a 2>&1 >> $base$rfile
/usr/sbin/traceroute [put a known, static ip address here] 2>&1 | head -15 >> $base$rfile
scp -q -i $base.ssh/[path to private key] $base$rfile [username]@[ssh receiving ip address]:~
#make this script executable <gain root then chmod +x> and put it into /etc/cron.hourly
#I hope you never have to use it...