From bbfbcbf504a7c4edc63653869dc1549f6e13ab61 Mon Sep 17 00:00:00 2001 From: Jay Moore Date: Tue, 11 Apr 2023 16:02:35 +0000 Subject: [PATCH] Add ifconfig option --- README.md | 15 +++++++++------ hedyn.sh | 3 ++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 03c80f7..2851eb5 100644 --- a/README.md +++ b/README.md @@ -12,17 +12,19 @@ DMZ, you'll have to use an external service. ## Installation & Usage If you are using the pfSense IP Check Service, copy both the .sh and -.php file in to /usr/local/www. It will be available at +.php file in to /usr/local/www on pfSense. It will be available at: - https://[LAN.IP]/getv4.php - http://[LAN.IP]/getv4.php -depending on if you use https or not. +depending on if you use https or not. Accessing this file does not +require logging in to the admin panel. -Copy hedyn.sh to your server using the hostname; then make a copy -of it if you're updating/hosting multiple names. Edit the script -with your hostname, APIKey, the device you want to use for IPv6, -and which IPv4 check service you want to use. Add it to cron. +Copy hedyn.sh to your server using the hostname; make copies for +each hostname you want to update with your hostname, APIKey, the +device you want to use for IPv6, and which IPv4 check service you +want to use. Add it to cron. If using multiple, it's easiest to +add commands to all scripts in to another script called by cron. The script will only update either v4 or v6 if the records don't match the machine's IP addresses. @@ -38,6 +40,7 @@ is done at your own risk. ``` 10-APR-2023: Initial Version +11-APR-2023: Mirror to Github. Add 'ifconfig' command ``` ## License diff --git a/hedyn.sh b/hedyn.sh index 6a0b7df..ab83977 100755 --- a/hedyn.sh +++ b/hedyn.sh @@ -18,7 +18,8 @@ v4=$(curl -s http://freemyip.com/checkip) # v4=$(curl -s http://192.168.1.1/getv4.php) # This uses my scripts on pfSense # Pull IPv6 from interface - Pulls first non-local v6 from specified device -v6=$(/sbin/ip -6 addr show dev $dev | awk '/inet6/ && !/fe80|::1/ {print $2}' | cut -f1 -d'/') +v6=$(/sbin/ip -6 addr show dev $dev | awk '/inet6/ && !/fe80|::1/ {print $2}' | cut -f1 -d'/') # systems using 'ip' +#v6=$(ifconfig $dev | awk '/inet6/ && !/fe80|::1/ {print $2}') # systems using 'ifconfig' # Commands for curl curl="curl -s -S -q -f https://dyn.dns.he.net/nic/update -d hostname=$hostname -d password=$APIkey"