Add ifconfig option

main
Jay Moore/NQ4T 1 year ago
parent 72ca9636e5
commit bbfbcbf504

@ -12,17 +12,19 @@ DMZ, you'll have to use an external service.
## Installation & Usage ## Installation & Usage
If you are using the pfSense IP Check Service, copy both the .sh and 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 - https://[LAN.IP]/getv4.php
- http://[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 Copy hedyn.sh to your server using the hostname; make copies for
of it if you're updating/hosting multiple names. Edit the script each hostname you want to update with your hostname, APIKey, the
with your hostname, APIKey, the device you want to use for IPv6, device you want to use for IPv6, and which IPv4 check service you
and which IPv4 check service you want to use. Add it to cron. 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 The script will only update either v4 or v6 if the records don't
match the machine's IP addresses. match the machine's IP addresses.
@ -38,6 +40,7 @@ is done at your own risk.
``` ```
10-APR-2023: Initial Version 10-APR-2023: Initial Version
11-APR-2023: Mirror to Github. Add 'ifconfig' command
``` ```
## License ## License

@ -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 # 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 # 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 # Commands for curl
curl="curl -s -S -q -f https://dyn.dns.he.net/nic/update -d hostname=$hostname -d password=$APIkey" curl="curl -s -S -q -f https://dyn.dns.he.net/nic/update -d hostname=$hostname -d password=$APIkey"

Loading…
Cancel
Save