function version
{
- echo iodine-client-start 1.0.4
+ echo iodine-client-start 1.0.5
}
case $# in
## ipcalc (for /usr/bin/ipcalc)
## dnsutils (for /usr/bin/dig)
## fping (for /usr/bin/fping)
+## or oping (for /usr/bin/oping)
## gawk (for /usr/bin/gawk, to use gensub())
+if type -P fping > /dev/null; then
+ ping_cmd="fping -C1"
+elif type -P oping > /dev/null; then
+ ping_cmd="oping -c1"
+else
+ ping_cmd="echo would ping"
+fi
+
## TO DO
## - avoid double ping when DNS server and local router are the same
## - option to not kill existing iodine DNS tunnels, in case there
if ${test_ping_localnet}; then
echo ==== Ping test of local network router and DNS servers...
- fping -C1 ${router} ${nameservers} \
+ ${ping_cmd} ${router} ${nameservers} \
|| echo WARNING: Ping test failed.
fi
if ${test_ping_tunnel}; then
echo ==== Ping test of local router, nameserver, and DNS tunnel...
- fping -C1 ${router} ${nameservers} ${tunnel_remote} \
+ ${ping_cmd} ${router} ${nameservers} ${tunnel_remote} \
|| echo WARNING: Ping test failed.
fi
if ${test_ping_final}; then
echo ==== Ping test of local router, nameserver, DNS tunnel, external test host...
- fping -C1 ${router} ${nameservers} ${tunnel_remote} ${testhost_ip:-${testhost}} \
+ ${ping_cmd} ${router} ${nameservers} ${tunnel_remote} ${testhost_ip:-${testhost}} \
|| echo WARNING: Ping test failed.
fi