Ver código fonte

Change dns used for external IP address detection

Bob Mottram 7 anos atrás
pai
commit
021a850a5e
1 arquivos alterados com 8 adições e 2 exclusões
  1. 8
    2
      src/freedombone-utils-network

+ 8
- 2
src/freedombone-utils-network Ver arquivo

31
 # If the system is on an IPv6 network
31
 # If the system is on an IPv6 network
32
 IPV6_NETWORK='2001:470:26:307'
32
 IPV6_NETWORK='2001:470:26:307'
33
 
33
 
34
+# Destinations used to get the external IP address of this system
35
+# Google ipv6 DNS is 2001:4860:4860::8888
36
+IPV4_ADDRESS_TEST_DESTINATION='85.214.73.63'
37
+IPV6_ADDRESS_TEST_DESTINATION='2620:0:ccc::2'
38
+
39
+
34
 # The static IP address of the system within the local network
40
 # The static IP address of the system within the local network
35
 # By default the IP address is dynamic within your LAN
41
 # By default the IP address is dynamic within your LAN
36
 LOCAL_NETWORK_STATIC_IP_ADDRESS=
42
 LOCAL_NETWORK_STATIC_IP_ADDRESS=
65
 }
71
 }
66
 
72
 
67
 function get_ipv4_address {
73
 function get_ipv4_address {
68
-    IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}')
74
+    IPv4dev=$(ip route get $IPV4_ADDRESS_TEST_DESTINATION | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}')
69
     echo $(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
75
     echo $(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
70
 }
76
 }
71
 
77
 
72
 function get_ipv6_address {
78
 function get_ipv6_address {
73
-    echo $(ip -6 route get 2001:4860:4860::8888 | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }')
79
+    echo $(ip -6 route get $IPV6_ADDRESS_TEST_DESTINATION | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }')
74
 }
80
 }
75
 
81
 
76
 # NOTE: deliberately no exit 0
82
 # NOTE: deliberately no exit 0