commit dd5672ebd0917373637bde106b5a856b340ca0cd Author: Marcus Summers Date: Tue Oct 15 10:34:07 2024 -0400 First commit diff --git a/pubIP.sh b/pubIP.sh new file mode 100755 index 0000000..5e95c52 --- /dev/null +++ b/pubIP.sh @@ -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