2 # this script acquires our local IP address and connects over to zooty
3 # to write a status file there. this enables us to later connect backwards
4 # to our home system without being hosed by the floating IP address.
6 #hmmm: none of the user info below will work for others: parameterize it.
8 server=zooty.koeritz.com
11 tempdir=/tmp # where we generate our files.
13 source $HOME/feisty_meow/scripts/core/launch_feisty_meow.sh
15 soundfile=$FEISTY_MEOW_DIR/database/sounds/woouoo.wav
16 if [ ! -z "$1" ]; then
20 ip_file="$(mktemp ${tempdir}/ip_${USER}_$(hostname | sed -e "s/\..*$//").XXXXXX)"
24 wget http://automation.whatismyip.com/n09230945.asp -O "$ip_file"
27 my_ip=$(head "$ip_file")
29 echo "my ip is [$my_ip]"
31 # send the file over to the server.
32 # note that the local_user here is expected to have a certificate that
33 # gets us access to the server. this needs to be on the local machine
34 # for sftp to run without a login prompt.
35 sudo -u $local_user sftp $username@$server <<eof
38 put $ip_file $(hostname | sed -e "s/\..*$//")_ip.txt