-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcouvctl
executable file
·39 lines (37 loc) · 922 Bytes
/
couvctl
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
#!/bin/bash
COUVSTREAMUSER="couvstream"
NICE=-2
if test `whoami` = "root"
then
case "$1" in
start)
echo "starting couvstream..."
sudo -u $COUVSTREAMUSER /usr/bin/strcond.py > /dev/null
PID=`ps aux | grep strcond | grep -v grep | awk '{ print $2 }'`
renice $NICE -p $PID
sudo -u $COUVSTREAMUSER /usr/bin/ircutd.py > /dev/null
PID=`ps aux | grep ircutd | grep -v grep | awk '{ print $2 }'`
renice $NICE -p $PID
sudo -u $COUVSTREAMUSER /usr/bin/selfmon.py > /dev/null
PID=`ps aux | grep selfmon | grep -v grep | awk '{ print $2 }'`
renice $NICE -p $PID
echo "couvstream started"
;;
stop)
echo "stopping couvstream..."
killall selfmon.py
killall ircutd.py
killall strcond.py
echo "couvstream stopped"
;;
restart)
couvctl stop
couvctl start
;;
*)
echo "usage: couvctl [start|stop|restart]"
;;
esac
else
echo "run this startup script as root!"
fi