Skip to content

Commit

Permalink
pptp: use resolveip, schedule restart if dns lookups fail
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31724 3c298f89-4303-0410-b956-a3cf2f4a3e73
  • Loading branch information
nbd committed May 14, 2012
1 parent 0547603 commit 3040f27
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion package/pptp/files/pptp.sh
Expand Up @@ -21,7 +21,18 @@ proto_pptp_setup() {
local load

json_get_var server server
proto_add_host_dependency "$config" "$server"

serv_addr=
for ip in $(resolveip -t 5 "$server"); do
proto_add_host_dependency "$config" "$server"
serv_addr=1
done
[ -n "$serv_addr" ] || {
echo "Could not resolve server address"
sleep 5
proto_setup_failed "$config"
exit 1
}

json_get_var buffering buffering
[ "${buffering:-1}" == 0 ] && buffering="--nobuffer" || buffering=
Expand Down

0 comments on commit 3040f27

Please sign in to comment.