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/yeti/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}/$(hostname | sed -e "s/\..*$//")_ip.XXXXXX)_${USER}"
22 # iterate forever, since we want to keep running this.
27 wget http://automation.whatismyip.com/n09230945.asp -O "$ip_file"
30 my_ip=$(head "$ip_file")
32 echo "my ip is [$my_ip]"
34 # send the file over to the server.
35 # note that the local_user here is expected to have a certificate that
36 # gets us access to the server. this needs to be on the local machine
37 # for sftp to run without a login prompt.
38 sudo -u $local_user sftp $username@$server <<eof
41 put $ip_file $(hostname | sed -e "s/\..*$//")_ip.txt