Skip to content

Commit dde7a5f

Browse files
CLOUDSTACK-5559 Add CIFS support in ssvm-check script
1 parent bd639bf commit dde7a5f

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

systemvm/scripts/ssvm-check.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ do
3434
esac
3535
done
3636

37+
isCifs() {
38+
mount | grep "type cifs" > /dev/null
39+
echo $?
40+
}
3741

3842
# ping dns server
3943
echo ================================================
@@ -67,12 +71,18 @@ fi
6771

6872
# check to see if we have the NFS volume mounted
6973
echo ================================================
70-
mount|grep -v sunrpc|grep -v rpc_pipefs|grep nfs 1> /dev/null 2>&1
74+
storage="cifs"
75+
if [ $(isCifs) -ne 0 ] ;
76+
then
77+
storage="nfs"
78+
fi
79+
80+
mount|grep -v sunrpc|grep -v rpc_pipefs|grep $storage 1> /dev/null 2>&1
7181
if [ $? -eq 0 ]
7282
then
73-
echo "NFS is currently mounted"
83+
echo "$storage is currently mounted"
7484
# check for write access
75-
for MOUNTPT in `mount|grep -v sunrpc|grep -v rpc_pipefs|grep nfs| awk '{print $3}'`
85+
for MOUNTPT in `mount|grep -v sunrpc|grep -v rpc_pipefs|grep $storage| awk '{print $3}'`
7686
do
7787
if [ $MOUNTPT != "/proc/xen" ] # mounted by xen
7888
then
@@ -96,9 +106,9 @@ else
96106
ping -c 2 $NFSSERVER
97107
if [ $? -eq 0 ]
98108
then
99-
echo "Good: Can ping NFS server"
109+
echo "Good: Can ping $storage server"
100110
else
101-
echo "WARNING: cannot ping NFS server"
111+
echo "WARNING: cannot ping $storage server"
102112
echo routing table follows
103113
route -n
104114
fi

0 commit comments

Comments
 (0)