diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-05-14 20:58:16 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-05-14 20:58:16 +0000 |
commit | 189c25d31875d8f4ad901fa71912fcbd099f37e2 (patch) | |
tree | 87d531d139753d4a983b27e923387e7436aed9b4 | |
parent | 89532e64373f181f426f29a7b833f4e3c1a93a91 (diff) | |
download | mtk-20170518-189c25d31875d8f4ad901fa71912fcbd099f37e2.zip mtk-20170518-189c25d31875d8f4ad901fa71912fcbd099f37e2.tar.gz mtk-20170518-189c25d31875d8f4ad901fa71912fcbd099f37e2.tar.bz2 |
pptp: use resolveip, schedule restart if dns lookups fail
SVN-Revision: 31724
-rwxr-xr-x | package/pptp/files/pptp.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/package/pptp/files/pptp.sh b/package/pptp/files/pptp.sh index 0023985..347df34 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= |