+get_wan_ifnames()
+{
+ local wanifnames word catch_next
+
+ which ip >/dev/null || return 1
+
+ set -- $( ip route list exact 0.0.0.0/0 table all )
+ for word in $*; do
+ case "$word" in
+ dev)
+ catch_next="true"
+ ;;
+ *)
+ [ -n "$catch_next" ] && {
+ case "$wanifnames" in
+ *" $word "*)
+ ;;
+ *)
+ wanifnames="$wanifnames $word "
+ ;;
+ esac
+
+ catch_next=
+ }
+ ;;
+ esac
+ done
+
+ echo "$wanifnames"
+}
+