aboutsummaryrefslogtreecommitdiff
path: root/nfsmount
blob: 5e8e2622dec062988cc1ae0dcd66b458a8f4696c (plain)
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
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
  start)
    stat_busy "Mounting NFS filesystems"
    if [ ! -f /var/run/daemons/portmap ]; then
      stat_fail
      exit 1
    fi
    mount -a -t nfs
    add_daemon nfsmount
    stat_done
    ;;
  stop)
    stat_busy "Unmounting NFS filesystems"
    umount -a -t nfs
    sleep 1
    if [ ! -z `mount -t nfs` ]; then
      stat_fail
      exit 1
    fi
    rm_daemon nfsmount
    stat_done
    ;;
  restart)
    $0 stop
    sleep 2
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
exit 0