reconnect_inet.sh: fix error in determin ip address.
This commit is contained in:
parent
8d81bd8667
commit
1dbf123f47
@ -33,11 +33,11 @@ reconnect() {
|
||||
#echo -n "`hostname --long` reconnected at `date +\"%d.%m.%Y %H:%M:%S\"`"
|
||||
|
||||
declare -i _number=0
|
||||
ptp_addr=`ifconfig $device 2>/dev/null | grep -e "P-[tz]-P" | cut -d":" -f3 | cut -d " " -f1`
|
||||
ptp_addr="$(ip addr show $device 2>/dev/null | grep -E "^\s*inet" | awk '{print$2}')"
|
||||
while [ -z "$ptp_addr" ]; do
|
||||
[[ $_number -eq 90 ]] && break
|
||||
sleep 1
|
||||
ptp_addr=`ifconfig $device 2>/dev/null | grep -e "P-[tz]-P" | cut -d":" -f3 | cut -d " " -f1`
|
||||
ptp_addr="$(ip addr show $device 2>/dev/null | grep -E "^\s*inet" | awk '{print$2}')"
|
||||
let _number++
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user