# 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 <<eof
-mkdir gen
+if [ ! -d gen ]; then
+ mkdir gen
+fi
cd gen
put $ip_file $(hostname | sed -e "s/\..*$//")_ip.txt
eof