um-service-config.sh: Reduce availibility check time
Do status check before ping and exit immediately. Add timeout to ping of 1s (-W option) Reduce retry from max 3min down to 1min BugzID: 63535 Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
This commit is contained in:
parent
1d71261e61
commit
4a2e98bee8
|
|
@ -24,19 +24,22 @@ done
|
||||||
|
|
||||||
source $UM_CONFIG
|
source $UM_CONFIG
|
||||||
|
|
||||||
max_retry=90
|
if [[ $USER_MODULE_status = "disabled" ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
max_retry=30
|
||||||
counter=0
|
counter=0
|
||||||
|
|
||||||
until [[ counter -ge $max_retry ]]
|
until [[ counter -ge $max_retry ]]
|
||||||
do
|
do
|
||||||
sleep 1
|
sleep 1
|
||||||
echo "Probing um. #$counter"
|
echo "Probing um. #$counter"
|
||||||
ping -qc 1 $USER_MODULE_ipv4_addr && break
|
ping -qc 1 -W 1 $USER_MODULE_ipv4_addr && break
|
||||||
((counter++))
|
((counter++))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Decide which config to load depending on the sw revision
|
# Decide which config to load depending on the sw revision
|
||||||
if `nc -z $USER_MODULE_ipv4_addr 7000` ; then
|
if `nc -z $USER_MODULE_ipv4_addr 7000` ; then
|
||||||
echo "New UM software detected"
|
echo "New UM software detected"
|
||||||
|
|
@ -46,11 +49,4 @@ else
|
||||||
cat $UM_PORTS_V1 >> $UM_CONFIG
|
cat $UM_PORTS_V1 >> $UM_CONFIG
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# source all fetched informations
|
exit 0
|
||||||
source $UM_CONFIG
|
|
||||||
|
|
||||||
if [[ $USER_MODULE_status = "disabled" ]]; then
|
|
||||||
exit 1
|
|
||||||
elif [[ $USER_MODULE_status = "okay" ]]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue