File: rtpengine-recording.init

package info (click to toggle)
rtpengine 13.5.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,676 kB
  • sloc: ansic: 86,764; perl: 59,422; python: 3,193; sh: 1,030; makefile: 693; asm: 211
file content (91 lines) | stat: -rw-r--r-- 1,870 bytes parent folder | download | duplicates (3)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
#
# rtpengine-recording		Startup script for NGCP rtpengine-recording
#
# chkconfig: 345 84 16
# description: NGCP rtpengine-recording
#
# processname: rtpengine-recording
# config: /etc/sysconfig/rtpengine-recording
# pidfile: /run/rtpengine-recording.pid
#
### BEGIN INIT INFO
# Provides: rtpengine
# Required-Start: $local_fs $network
# Short-Description: NGCP rtpengine-recording
# Description: NGCP rtpengine-recording 
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/rtpengine-recording ]
then
        . /etc/sysconfig/rtpengine-recording
else
	echo "Error: /etc/sysconfig/rtpengine-recording not present" >&2
	exit 6
fi

prog=rtpengine-recording
runfile=/usr/bin/${prog}
pidfile=${PIDFILE-/run/rtpengine-recording.pid}
lockfile=${LOCKFILE-/var/lock/subsys/rtpengine-recording}

RETVAL=0
OPTS=""

[ -z "$CONFIG_FILE" ] || OPTS+=" --config-file=$CONFIG_FILE"
[ -z "$PIDFILE" ] || OPTS+=" --pidfile=$PIDFILE"

start() {
        echo -n $"Starting $prog: "
	if [[ -n "$RE_USER" ]]
	then
		# shellcheck disable=SC2086
		daemon --user "$RE_USER" --pidfile="${pidfile}" "$runfile" $OPTS
	else
		# shellcheck disable=SC2086
		daemon --pidfile="${pidfile}" "$runfile" $OPTS
	fi
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch "${lockfile}"
        return $RETVAL
}

stop() {
	echo -n $"Stopping $prog: "
	killproc -p "${pidfile}" "$runfile"
	RETVAL=$?
	[ $RETVAL = 0 ] && rm -f "${lockfile}" "${pidfile}"
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
        status -p "${pidfile}" "$runfile"
	RETVAL=$?
	;;
  restart)
	stop
	start
	;;
  condrestart|try-restart)
	if status -p "${pidfile}" "$runfile" >&/dev/null; then
		stop
		start
	fi
	;;
  *)
	echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|status}"
	RETVAL=2
esac

exit $RETVAL