mirror of
https://github.com/RobotechLille/cdf2018-principal
synced 2024-11-25 09:36:04 +01:00
42 lines
537 B
Bash
Executable file
42 lines
537 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# Start main program
|
|
#
|
|
|
|
SHELL=$(which sh)
|
|
EXECDIR=/opt/chef
|
|
EXECNAME=premier
|
|
EXECPATH=bin/$EXECNAME
|
|
PIDFILE=/var/run/chef.pid
|
|
|
|
start() {
|
|
printf "Starting chef: "
|
|
cd "$EXECDIR"; /sbin/start-stop-daemon -p "$PIDFILE" -x "$EXECPATH" -b -m -S
|
|
echo "OK"
|
|
}
|
|
|
|
stop() {
|
|
printf "Stopping chef: "
|
|
/sbin/start-stop-daemon -x "$EXECPATH" -K
|
|
/opt/chef/lcdOff.sh
|
|
echo "OK"
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|reload)
|
|
stop
|
|
start
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|