X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsecurity%2Ftell_zooty_our_ip.sh;h=359050b419edf1c85187b3796f89850fd4a5c70b;hb=bffe9fba70b7ea1ab1b5d963b811d4637b021ee1;hp=c616a1ab10adab720aae4b47b1abf04890541bc3;hpb=9203a21637787c0fbdb1465c7e12300ba5efd875;p=feisty_meow.git diff --git a/scripts/security/tell_zooty_our_ip.sh b/scripts/security/tell_zooty_our_ip.sh index c616a1ab..359050b4 100644 --- a/scripts/security/tell_zooty_our_ip.sh +++ b/scripts/security/tell_zooty_our_ip.sh @@ -5,7 +5,7 @@ #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. @@ -17,32 +17,28 @@ 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 <