comparison Templates/rc @ 620:80faeb51a8f7

templates: update rc
author David Demelier <markand@malikania.fr>
date Tue, 23 Jul 2019 21:00:00 +0200
parents 030ebf8e0a69
children 657ee4987f4d
comparison
equal deleted inserted replaced
619:a4dd42f62111 620:80faeb51a8f7
6 . /etc/rc.conf 6 . /etc/rc.conf
7 fi 7 fi
8 8
9 : ${TEMPLATE_CMD:=/bin/template} 9 : ${TEMPLATE_CMD:=/bin/template}
10 : ${TEMPLATE_ARGS:=--foo} 10 : ${TEMPLATE_ARGS:=--foo}
11 : ${TEMPLATE_PID:=/var/run/template/template.pid} 11 : ${TEMPLATE_PID:=/var/run/template.pid}
12 12
13 template_start() 13 template_start()
14 { 14 {
15 echo "Starting template: $TEMPLATE_CMD $TEMPLATE_ARGS" 15 echo "Starting template: $TEMPLATE_CMD $TEMPLATE_ARGS"
16 $TEMPLATE_CMD $TEMPLATE_ARGS -p $TEMPLATE_PID 16 $TEMPLATE_CMD $TEMPLATE_ARGS -p $TEMPLATE_PID
17 } 17 }
18 18
19 template_status() 19 template_status()
20 { 20 {
21 if [ -s $TEMPLATE_PID ]; then 21 if [ -s $TEMPLATE_PID ]; then
22 echo "template is running with pid: `cat $TEMPLATE_PID`" 22 echo "template is running with pid: $(cat $TEMPLATE_PID)"
23 else 23 else
24 echo "template is not running" 24 echo "template is not running"
25 fi 25 fi
26 } 26 }
27 27
28 template_stop() 28 template_stop()
29 { 29 {
30 if [ -s $TEMPLATE_PID ]; then 30 if [ -s $TEMPLATE_PID ]; then
31 echo "Stopping template." 31 echo "Stopping template."
32 kill -QUIT `cat $TEMPLATE_PID` 32 kill -QUIT $(cat $TEMPLATE_PID)
33 fi 33 fi
34 } 34 }
35 35
36 template_restart() 36 template_restart()
37 { 37 {