From ee83e5acfbc42a91d2a512fcaf7207f507871aaa Mon Sep 17 00:00:00 2001 From: Jay Moore Date: Wed, 12 Apr 2023 16:13:52 +0000 Subject: [PATCH] Updated getv4 --- getv4.php | 10 +++++++--- getv4.sh | 9 ++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/getv4.php b/getv4.php index 777b0d4..48de508 100644 --- a/getv4.php +++ b/getv4.php @@ -1,12 +1,16 @@ /* -GetV4: Check IP Service for pfSense -10-APR-2023 - dewdude@pickmy.org +GetV4: Self-Hosted Check IP Service +12-APR-2023 - dewdude@pickmy.org https://git.pickmy.org/dewdude/HEDyn */ -// Place this file along with getv4.sh in /usr/local/www +// Place this file along with getv4.sh in /usr/local/www on pFSense +// or elsewhere if running on different system. Change script path. +// Change comments for "old" style display if needed. + diff --git a/getv4.sh b/getv4.sh index 7cf47eb..af2c915 100755 --- a/getv4.sh +++ b/getv4.sh @@ -1,12 +1,15 @@ #!/bin/sh # GetV4 IP Check Service for pfSense - shell script -# APR-10-2023 - Jay Moore (dewdude@pickmy.org) +# APR-12-2023 - Jay Moore (dewdude@pickmy.org) # https://git.pickmy.org/dewdude/HEDyn -# Modify "em0" to match your interface name. Place in +# Modify `dev` to match your interface name. Place in # /usr/local/www along with getv4.php. # Make sure script is +x -ifconfig em0 | grep inet | awk -F '[ \t]+|/' '{print $3}' | grep -v ^fe80 +dev=em0 + +ifconfig $dev | awk '/inet/ && !/inet6/ {print $2}' +#ip -4 addr show dev $dev | awk '/inet/ {print $2}' # for machines using `ip`