various updates
[distro-setup] / vpn-static-ip
index 8d04891667d64990acd8c2bd112d280fcf08260a..bef79330f453bc4992f3267cc6e779f38b16d29c 100755 (executable)
@@ -15,9 +15,10 @@ conf=$1
 main() {
   while read -r host port; do
     while read -r ip; do
+      echo $ip | egrep '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' &>/dev/null || continue
       printf "remote %s %s\n" "$ip" "$port" >>$conf
       ret=0
-    done < <(dig +short $host ||:)
+    done < <(timeout -s 9 1 dig +short $host ||:)
   done < <(sed -rn 's/^ *# *remote //p' $conf)
 
 }