-
Notifications
You must be signed in to change notification settings - Fork 115
/
S90onvif_srvd
executable file
·63 lines (48 loc) · 1.33 KB
/
S90onvif_srvd
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
#! /bin/sh
DAEMON=onvif_srvd_debug
DAEMON_PATH=.
PID_FILE=$DAEMON.pid
DAEMON_ARGS="--pid_file $PID_FILE"
# ONVIF Device Service param (more details see help)
DAEMON_ARGS="$DAEMON_ARGS --ifs eth0"
DAEMON_ARGS="$DAEMON_ARGS --scope onvif://www.onvif.org/name/TestDev"
DAEMON_ARGS="$DAEMON_ARGS --scope onvif://www.onvif.org/location/Unknow"
DAEMON_ARGS="$DAEMON_ARGS --scope onvif://www.onvif.org/Profile/Streaming"
DAEMON_ARGS="$DAEMON_ARGS --scope onvif://www.onvif.org/Profile/S"
DAEMON_ARGS="$DAEMON_ARGS --name RTSP --width 800 --height 600 --url rtsp://%s:554/unicast --type JPEG"
d_start()
{
if [ -f $PID_FILE ] && kill -0 $(cat $PID_FILE); then
echo "$DAEMON already running"
return 1
fi
echo "Starting $DAEMON..."
$DAEMON_PATH/$DAEMON $DAEMON_ARGS && echo "$DAEMON started"
}
d_stop()
{
if [ ! -f "$PID_FILE" ] || ! kill -0 $(cat "$PID_FILE"); then
echo "$DAEMON not running"
return 1
fi
echo "Stopping $DAEMON..."
kill -15 $(cat $PID_FILE) && rm -f $PID_FILE
echo "$DAEMON stopped"
}
case "$1" in
start)
d_start
;;
stop)
d_stop
;;
restart)
echo "Restarting $DAEMON"
d_stop
d_start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac