aboutsummaryrefslogtreecommitdiffstats
path: root/package/pptp/files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-05-14 20:58:16 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-05-14 20:58:16 +0000
commit6b0f54f030e36ee02a2329095f8d0007cc82c0d6 (patch)
treedca76f36e5afe538fa4c40ba2d98d009b06e9429 /package/pptp/files
parent30b6d0f19984b28d0a218912572856788cb8e1ed (diff)
downloadupstream-6b0f54f030e36ee02a2329095f8d0007cc82c0d6.tar.gz
upstream-6b0f54f030e36ee02a2329095f8d0007cc82c0d6.tar.bz2
upstream-6b0f54f030e36ee02a2329095f8d0007cc82c0d6.zip
pptp: use resolveip, schedule restart if dns lookups fail
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31724 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/pptp/files')
-rwxr-xr-xpackage/pptp/files/pptp.sh13
1 files changed, 12 insertions, 1 deletions
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=