Skip to content

Commit c6f8bd1

Browse files
committed
Create cdr_parser
1 parent be110e0 commit c6f8bd1

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

init.d/cdr_parser

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# /etc/init.d/cdr_parser
2+
#
3+
### BEGIN INIT INFO
4+
# Provides: cdr_daemon
5+
# Required-Start:
6+
# Should-Start:
7+
# Required-Stop:
8+
# Should-Stop:
9+
# Default-Start: 3 5
10+
# Default-Stop: 0 1 2 6
11+
# Short-Description: CDR Parser Daemon
12+
# Description: Runs the CDR Parser Daemon
13+
### END INIT INFO
14+
15+
case "$1" in
16+
start)
17+
echo "Starting server"
18+
# Start the daemon
19+
python /opt/cdr_parser/cdr_parser.py start
20+
;;
21+
stop)
22+
echo "Stopping server"
23+
# Stop the daemon
24+
python /opt/cdr_parser/cdr_parser.py stop
25+
;;
26+
restart)
27+
echo "Restarting server"
28+
python /opt/cdr_parser/cdr_parser.py restart
29+
;;
30+
*)
31+
# Refuse to do other stuff
32+
echo "Usage: /etc/init.d/cdr_parser {start|stop|restart}"
33+
exit 1
34+
;;
35+
esac
36+
37+
exit 0

0 commit comments

Comments
 (0)