File: rtpengine-recording-nfs-setup

package info (click to toggle)
rtpengine 12.5.1.35-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,628 kB
  • sloc: ansic: 80,617; perl: 43,314; python: 3,041; sh: 1,092; makefile: 630; asm: 211
file content (42 lines) | stat: -rwxr-xr-x 921 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

set -e

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DEFAULTS=/etc/default/rtpengine-recording-daemon
DESC="RTP engine recording NFS share"

. /lib/lsb/init-functions

# Load startup options if available
if [ -f "$DEFAULTS" ]; then
  . "$DEFAULTS" || true
fi

[ -z "$NFS_OPTIONS" ] && NFS_OPTIONS="hard,tcp,intr"

###

case "$1" in
  start)
    if [ "$MUST_NFS" = yes ]; then
      if ! grep -E -q "^[^ :]+:[^ :]+ $NFS_LOCAL_MOUNT nfs.? " /proc/mounts; then
        log_action_msg "Mounting $DESC"
        test -d "$NFS_LOCAL_MOUNT" || mkdir -p "$NFS_LOCAL_MOUNT"
        mount -t nfs -o "$NFS_OPTIONS" "$NFS_HOST:$NFS_REMOTE_PATH" "$NFS_LOCAL_MOUNT"
      fi
    fi
    ;;
  stop)
    if grep -E -q "^[^ :]+:[^ :]+ $NFS_LOCAL_MOUNT nfs.? " /proc/mounts; then
      log_action_msg "Unmounting $DESC"
      umount "$NFS_LOCAL_MOUNT"
    fi
    ;;
  *)
    echo "Usage: $0 {start|stop}" >&2
    exit 1
    ;;
esac

exit 0