forked from whyistheinternetbroken/k8s-kerberos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure-nfs.sh
61 lines (49 loc) · 1.1 KB
/
configure-nfs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
###########################
# Define script variables #
###########################
idmap_pid=$(pgrep -x rpc.idmapd)
rpcbind_pid=$(pgrep -x rpcbind)
gss_pid=$(pgrep -x rpc.gssd)
statd_pid=$(pgrep -x rpc.statd)
RPCBIND_PATH=/sbin/rpcbind
IDMAP_PATH=/usr/sbin/rpc.idmapd
NFS_RESTART="service nfs-common restart"
GSS_PATH=/usr/sbin/rpc.gssd
mount="/nfs"
mountpath="/twosigmakrb"
### change perms for SSSD script
sudo chmod +x /usr/bin/run_in_sssd_container
### restart processes as needed
if [ -z $rpcbind_pid ] ; then
$RPCBIND_PATH
else
echo "rpcbind is running"
fi
if [ -z $statd_pid ] ; then
$NFS_RESTART
else
echo "statd is running"
fi
if [ -z $idmap_pid ] ; then
$NFS_RESTART
else
echo "rpc.idmapd is running"
fi
if [ -z $gss_pid ] ; then
$NFS_RESTART
else
echo "rpc.gssd is running"
fi
sudo service sssd restart
if grep -qs "$mountpath" /proc/mounts; then
echo "/nfs is mounted."
else
echo "/nfs is not mounted. Mounting /nfs..."
mount "$mount"
if [ $? -eq 0 ]; then
echo "Mount success!"
else
echo "Something went wrong with the mount..."
fi
fi