From: Felix Fietkau Date: Mon, 14 May 2012 20:58:16 +0000 (+0000) Subject: pptp: use resolveip, schedule restart if dns lookups fail X-Git-Tag: reboot~13934 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=189c25d31875d8f4ad901fa71912fcbd099f37e2;p=openwrt%2Fstaging%2Fchunkeey.git pptp: use resolveip, schedule restart if dns lookups fail SVN-Revision: 31724 --- diff --git a/package/pptp/files/pptp.sh b/package/pptp/files/pptp.sh index 00239850cc..347df346c0 100755 --- a/package/pptp/files/pptp.sh +++ b/package/pptp/files/pptp.sh @@ -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=