You've already forked DDNS-Client
1
This commit is contained in:
@@ -73,23 +73,23 @@ case "${NETWORK}" in
|
|||||||
if type ip >/dev/null 2>&1; then
|
if type ip >/dev/null 2>&1; then
|
||||||
IP4_ADDRESS=$(/usr/bin/ip -4 addr show "${INTERFACE}" | /usr/bin/grep ---only-matching --perl-regexp '(?<=inet\s)\d+(\.\d+){3}')
|
IP4_ADDRESS=$(/usr/bin/ip -4 addr show "${INTERFACE}" | /usr/bin/grep ---only-matching --perl-regexp '(?<=inet\s)\d+(\.\d+){3}')
|
||||||
elif type ifconfig >/dev/null 2>&1; then
|
elif type ifconfig >/dev/null 2>&1; then
|
||||||
IP4_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep 'inet ' | /usr/bin/mawk '{print $2}')
|
IP4_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep 'inet ' | /usr/bin/awk '{print $2}')
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
IP6)
|
IP6)
|
||||||
if type ip >/dev/null 2>&1; then
|
if type ip >/dev/null 2>&1; then
|
||||||
IP6_ADDRESS=$(/usr/bin/ip -6 addr show "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/mawk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --extended-regexp '^fd[0-9a-fA-F]{2}::')
|
IP6_ADDRESS=$(/usr/bin/ip -6 addr show "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/awk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --extended-regexp '^fd[0-9a-fA-F]{2}::')
|
||||||
elif type ifconfig >/dev/null 2>&1; then
|
elif type ifconfig >/dev/null 2>&1; then
|
||||||
IP6_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep --extended-regexp 'inet6 (fd[0-9a-fA-F]{2}::|::1)' | /usr/bin/mawk '{split($2,a,"/"); print a[1]}')
|
IP6_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep --extended-regexp 'inet6 (fd[0-9a-fA-F]{2}::|::1)' | /usr/bin/awk '{split($2,a,"/"); print a[1]}')
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
IP64)
|
IP64)
|
||||||
if type ip >/dev/null 2>&1; then
|
if type ip >/dev/null 2>&1; then
|
||||||
IP4_ADDRESS=$(/usr/bin/ip -4 addr show "${INTERFACE}" | /usr/bin/grep ---only-matching --perl-regexp '(?<=inet\s)\d+(\.\d+){3}')
|
IP4_ADDRESS=$(/usr/bin/ip -4 addr show "${INTERFACE}" | /usr/bin/grep ---only-matching --perl-regexp '(?<=inet\s)\d+(\.\d+){3}')
|
||||||
IP6_ADDRESS=$(/usr/bin/ip -6 addr show "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/mawk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --extended-regexp '^fd[0-9a-fA-F]{2}::')
|
IP6_ADDRESS=$(/usr/bin/ip -6 addr show "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/awk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --extended-regexp '^fd[0-9a-fA-F]{2}::')
|
||||||
elif type ifconfig >/dev/null 2>&1; then
|
elif type ifconfig >/dev/null 2>&1; then
|
||||||
IP4_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep 'inet ' | /usr/bin/mawk '{print $2}')
|
IP4_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep 'inet ' | /usr/bin/awk '{print $2}')
|
||||||
IP6_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep --extended-regexp 'inet6 (fd[0-9a-fA-F]{2}::|::1)' | /usr/bin/mawk '{split($2,a,"/"); print a[1]}')
|
IP6_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep --extended-regexp 'inet6 (fd[0-9a-fA-F]{2}::|::1)' | /usr/bin/awk '{split($2,a,"/"); print a[1]}')
|
||||||
fi
|
fi
|
||||||
esac
|
esac
|
||||||
ip_check
|
ip_check
|
||||||
@@ -101,17 +101,17 @@ case "${NETWORK}" in
|
|||||||
;;
|
;;
|
||||||
IP6)
|
IP6)
|
||||||
if type ip >/dev/null 2>&1; then
|
if type ip >/dev/null 2>&1; then
|
||||||
IP6_ADDRESS=$(/usr/bin/ip -6 addr show "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/mawk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --invert-match --extended-regexp '^(fd[0-9a-fA-F]{2}::|fe[0-9a-fA-F]{2}::)')
|
IP6_ADDRESS=$(/usr/bin/ip -6 addr show "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/awk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --invert-match --extended-regexp '^(fd[0-9a-fA-F]{2}::|fe[0-9a-fA-F]{2}::)')
|
||||||
elif type ifconfig >/dev/null 2>&1; then
|
elif type ifconfig >/dev/null 2>&1; then
|
||||||
IP6_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/mawk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --invert-match --extended-regexp '^(fd[0-9a-fA-F]{2}::|fe[0-9a-fA-F]{2}::)')
|
IP6_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/awk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --invert-match --extended-regexp '^(fd[0-9a-fA-F]{2}::|fe[0-9a-fA-F]{2}::)')
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
IP64)
|
IP64)
|
||||||
IP4_ADDRESS=$(/usr/bin/wget --quiet --output-document='-' --timeout='3' --inet4-only --https-only --no-hsts 'ident.me')
|
IP4_ADDRESS=$(/usr/bin/wget --quiet --output-document='-' --timeout='3' --inet4-only --https-only --no-hsts 'ident.me')
|
||||||
if type ip >/dev/null 2>&1; then
|
if type ip >/dev/null 2>&1; then
|
||||||
IP6_ADDRESS=$(/usr/bin/ip -6 addr show "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/mawk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --invert-match --extended-regexp '^(fd[0-9a-fA-F]{2}::|fe[0-9a-fA-F]{2}::)')
|
IP6_ADDRESS=$(/usr/bin/ip -6 addr show "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/awk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --invert-match --extended-regexp '^(fd[0-9a-fA-F]{2}::|fe[0-9a-fA-F]{2}::)')
|
||||||
elif type ifconfig >/dev/null 2>&1; then
|
elif type ifconfig >/dev/null 2>&1; then
|
||||||
IP6_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/mawk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --invert-match --extended-regexp '^(fd[0-9a-fA-F]{2}::|fe[0-9a-fA-F]{2}::)')
|
IP6_ADDRESS=$(/usr/sbin/ifconfig "${INTERFACE}" | /usr/bin/grep 'inet6' | /usr/bin/awk '{split($2,a,"/"); print a[1]}' | /usr/bin/grep --invert-match --extended-regexp '^(fd[0-9a-fA-F]{2}::|fe[0-9a-fA-F]{2}::)')
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user