First commit
This commit is contained in:
commit
dd5672ebd0
1 changed files with 15 additions and 0 deletions
15
pubIP.sh
Executable file
15
pubIP.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
ip=$(curl -s icanhazip.com)
|
||||
|
||||
echo "$ip"
|
||||
|
||||
existing=$(cat ip.txt)
|
||||
|
||||
echo "$existing"
|
||||
|
||||
if [ $ip != $existing ]
|
||||
then
|
||||
echo The new IP address is "$ip" | mail -s "MajorHome IP address changed" marcus@majorshouse.com
|
||||
echo "$ip" > ip.txt
|
||||
fi
|
||||
Loading…
Add table
Reference in a new issue