summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2014-12-04 13:59:13 +0100
committerSimon Rettberg2014-12-04 13:59:13 +0100
commitf886cea4c11b47d47480afbd446f5390f46e1cc1 (patch)
treef16746f4bb13a6b573e025d3482d5242ece50ff9
parent[cups] Fix Dell PPD (diff)
downloadtm-scripts-f886cea4c11b47d47480afbd446f5390f46e1cc1.tar.gz
tm-scripts-f886cea4c11b47d47480afbd446f5390f46e1cc1.tar.xz
tm-scripts-f886cea4c11b47d47480afbd446f5390f46e1cc1.zip
Use 3 seconds timeout for reverse lookups everywhere
-rwxr-xr-xremote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx2
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/inc/udhcpc-trigger4
2 files changed, 3 insertions, 3 deletions
diff --git a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
index 66ab2189..dd8cd8ba 100755
--- a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
+++ b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
@@ -78,7 +78,7 @@ case "$1" in
fi
# get domain, hostname and thus fqdn from DNS
- dns_fqdn=$(rdns "$ip")
+ dns_fqdn=$(/opt/openslx/bin/busybox timeout -t 3 rdns "$ip")
dns_short="${dns_fqdn%%.*}"
# check if it is fqdn
if [ "$dns_fqdn" == "$dns_short" ]; then
diff --git a/remote/rootfs/rootfs-stage31/data/inc/udhcpc-trigger b/remote/rootfs/rootfs-stage31/data/inc/udhcpc-trigger
index dfed3168..02987f21 100755
--- a/remote/rootfs/rootfs-stage31/data/inc/udhcpc-trigger
+++ b/remote/rootfs/rootfs-stage31/data/inc/udhcpc-trigger
@@ -59,7 +59,7 @@ done
if [ -z "$domain" ]; then
# try to get domain via reverse lookup if empty
echo "..trying to get domain via DNS, as DHCP didn't supply one.."
- fqdn=$(nslookup "$ip" | grep -E "^Address +[0-9]+: +$ip " | head -n 1 | awk '{print $4}')
+ fqdn=$(timeout -t 3 nslookup "$ip" | grep -E "^Address +[0-9]+: +$ip " | head -n 1 | awk '{print $4}')
domain="${fqdn#*.}"
fi
if [ -n "$domain" ]; then
@@ -76,7 +76,7 @@ fi
if [ -z "$hostname" ]; then
# as with domain, if there's no hostname, try to get via DNS
echo "..trying to get hostname via DNS, as DHCP didn't supply one.."
- [ -z "$fqdn" ] && fqdn=$(nslookup "$ip" | grep -E "^Address +[0-9]+: +$ip " | head -n 1 | awk '{print $4}')
+ [ -z "$fqdn" ] && fqdn=$(timeout -t 3 nslookup "$ip" | grep -E "^Address +[0-9]+: +$ip " | head -n 1 | awk '{print $4}')
hostname="${fqdn%%.*}"
elif [ -n "$domain" ]; then
fqdn="${hostname}.${domain%% *}" # in case domain is a list