X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsecurity%2Ftell_zooty_our_ip.sh;h=359050b419edf1c85187b3796f89850fd4a5c70b;hb=47898c86d34ba851288b62281c14f18f7090df19;hp=28107a249a54deb4d1c19a9d69a3a173cd9b8791;hpb=dbe3a7d9104352d69efdaa5eca600908ecc9bba8;p=feisty_meow.git diff --git a/scripts/security/tell_zooty_our_ip.sh b/scripts/security/tell_zooty_our_ip.sh index 28107a24..359050b4 100644 --- a/scripts/security/tell_zooty_our_ip.sh +++ b/scripts/security/tell_zooty_our_ip.sh @@ -5,44 +5,40 @@ #hmmm: none of the user info below will work for others: parameterize it. -server=zooty.koeritz.com +server=serene.feistymeow.org username=fred local_user=fred tempdir=/tmp # where we generate our files. -source $HOME/yeti/scripts/core/profile.sh +source $HOME/feisty_meow/scripts/core/launch_feisty_meow.sh soundfile=$FEISTY_MEOW_DIR/database/sounds/woouoo.wav if [ ! -z "$1" ]; then soundfile=$1 fi -ip_file="$(mktemp ${tempdir}/$(hostname | sed -e "s/\..*$//")_ip.XXXXXX)_${USER}" +ip_file="$(mktemp ${tempdir}/ip_${USER}_$(hostname | sed -e "s/\..*$//").XXXXXX)" -# iterate forever, since we want to keep running this. -while true; do +# get live ip address +pushd $tempdir +wget http://automation.whatismyip.com/n09230945.asp -O "$ip_file" - # get live ip address - pushd $tempdir - wget http://automation.whatismyip.com/n09230945.asp -O "$ip_file" +chmod 644 "$ip_file" +my_ip=$(head "$ip_file") - chmod 644 "$ip_file" - my_ip=$(head "$ip_file") +echo "my ip is [$my_ip]" - echo "my ip is [$my_ip]" - - # send the file over to the server. - # note that the local_user here is expected to have a certificate that - # gets us access to the server. this needs to be on the local machine - # for sftp to run without a login prompt. - sudo -u $local_user sftp $username@$server <