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
|