From dde7a5f43e9b3522db5bbb1a577daa97ee70e890 Mon Sep 17 00:00:00 2001 From: Rajesh Battala Date: Thu, 19 Dec 2013 17:42:37 +0530 Subject: [PATCH] CLOUDSTACK-5559 Add CIFS support in ssvm-check script --- systemvm/scripts/ssvm-check.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/systemvm/scripts/ssvm-check.sh b/systemvm/scripts/ssvm-check.sh index 7b83c989218..2ab51c549f9 100644 --- a/systemvm/scripts/ssvm-check.sh +++ b/systemvm/scripts/ssvm-check.sh @@ -34,6 +34,10 @@ do esac done +isCifs() { + mount | grep "type cifs" > /dev/null + echo $? +} # ping dns server echo ================================================ @@ -67,12 +71,18 @@ fi # check to see if we have the NFS volume mounted echo ================================================ -mount|grep -v sunrpc|grep -v rpc_pipefs|grep nfs 1> /dev/null 2>&1 +storage="cifs" +if [ $(isCifs) -ne 0 ] ; + then + storage="nfs" +fi + +mount|grep -v sunrpc|grep -v rpc_pipefs|grep $storage 1> /dev/null 2>&1 if [ $? -eq 0 ] then - echo "NFS is currently mounted" + echo "$storage is currently mounted" # check for write access - for MOUNTPT in `mount|grep -v sunrpc|grep -v rpc_pipefs|grep nfs| awk '{print $3}'` + for MOUNTPT in `mount|grep -v sunrpc|grep -v rpc_pipefs|grep $storage| awk '{print $3}'` do if [ $MOUNTPT != "/proc/xen" ] # mounted by xen then @@ -96,9 +106,9 @@ else ping -c 2 $NFSSERVER if [ $? -eq 0 ] then - echo "Good: Can ping NFS server" + echo "Good: Can ping $storage server" else - echo "WARNING: cannot ping NFS server" + echo "WARNING: cannot ping $storage server" echo routing table follows route -n fi