Increase wait time for mounting remote

develop
Mike Hiretsky 14 years ago
parent 05bcf23f91
commit 3869f55dfa

@ -13,31 +13,26 @@ start() {
# Mount remote Samba filesystems. # Mount remote Samba filesystems.
ebegin "Mounting domain resources" ebegin "Mounting domain resources"
# Identifing domen server by env file # Identifing domen server by env file
SERVER=`cat /var/calculate/calculate.env | grep cl_remote_host | awk '{print \$3}'` local env_file=/var/calculate/calculate.env
let COUNT=20 if [[ -f $env_file ]]
while let "${COUNT} > 0"; then
do local SERVER=$( sed -rn 's/^cl_remote_host\s*=\s*(\S+)$/\1/p' $env_file )
if ping -w2 -c1 $SERVER &>/dev/null; for COUNT in $( seq 0 1 )
then do
break; ping -w2 -c1 $SERVER &>/dev/null && break || sleep 1
else done
sleep 1; fi
fi
let COUNT=COUNT-1
done
cl-client --mount cl-client --mount
eend $? "Some samba remote resources to mount" eend $? "Some samba remote resources to mount"
} }
stop(){ stop(){
ebegin "Unmount domain resources" ebegin "Unmount domain resources"
if [[ `mount | grep ' /var/calculate/remote '` ]]; [[ $( mount | grep ' /var/calculate/remote ' ) ]] &&
then umount /var/calculate/remote
umount /var/calculate/remote [[ $( mount | grep '/var/calculate/client-home on /home ' ) ]] &&
fi umount /home
if [[ `mount | grep '/var/calculate/client-home on /home '` ]]; eend 0
then
umount /home
fi
} }
# vim:ts=4 # vim:ts=4

Loading…
Cancel
Save