Created
February 14, 2011 16:21
-
-
Save PHLAK/826099 to your computer and use it in GitHub Desktop.
Simple script for getting your external IP and uploading it to a server via SCP.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Define your server information here | |
SERVER="<hostname_or_ip>" | |
PORT="22" | |
USER="<user_name>" | |
FILEPATH="<file_path>" | |
# Get IP from whatismyip.com and store it in a file | |
wget http://www.whatismyip.com/automation/n09230945.asp -O ip.txt | |
# Copy ip.txt to your server | |
scp -P $PORT ip.txt $USER@$SERVER:$FILEPATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment