赞
踩
#!/vendor/bin/sh
action=$1
RESULT="1"
qlog_mounted=`getprop vendor.nfs.qlog.mounted`
log -t "mount_nfs" "$action"
##### action umount #############
if [ "$action" == "umount" ]; then
log -t "mount_nfs" "starting umount qlog"
if [ "$qlog_mounted" != "true" ]; then
log -t "mount_nfs" "qlog not mounted, exit"
exit 0
fi
umount /qlog
RESULT=$?
if [ $RESULT == "0" ]; then
log -t "mount_nfs" "qlog umount success"
setprop vendor.nfs.qlog.mounted false
exit 0
else
log -t "mount_nfs" "qlog umount failed"
exit 1
fi
fi
##### action mount #############
if [ "$qlog_mounted" == "true" ]; then
log -t "mount_nfs" "qlog mounted, exit"
exit 0
fi
QNX_IP=$(cat /etc/hosts |grep cdc-qnx | awk '{print $1}')
count=1
RESULT="1"
while [ $RESULT != "0" ];
do
log -t "mount_nfs" "try to mount qlog $count"
mount -o nolock,vers=3,noacl,noexec,nosuid,noatime,nodev,nodiratime,dirsync,norelatime,timeo=10,retrans=30,addr=$QNX_IP -t nfs $QNX_IP:/log/qlog /qlog
RESULT=$?
if [ $RESULT == "0" ]; then
break
fi
let count++
if [ $count -gt 60 ]; then
break
fi
sleep 1
done
echo "mount result: $RESULT"
if [ $RESULT != "0" ]; then
echo "mount qlog failed"
log -t "mount_nfs" "mount qlog failed"
setprop vendor.nfs.qlog.mounted false
exit 1
fi
if [ -f /qlog/.qlog.nfs ]; then
echo "mount qlog success"
log -t "mount_nfs" "mount qlog success"
setprop vendor.nfs.qlog.mounted true
fi
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。