2019-09-12 11:33:22 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# chkconfig: 35 90 12
|
2021-11-18 06:08:14 -06:00
|
|
|
# description: coolwsd server
|
2019-09-12 11:33:22 -05:00
|
|
|
#
|
|
|
|
|
|
|
|
# Get function from functions library
|
|
|
|
. /etc/init.d/functions
|
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
# Start the service coolwsd
|
2019-09-12 11:33:22 -05:00
|
|
|
start() {
|
2021-11-18 06:08:14 -06:00
|
|
|
echo -n $"Starting coolwsd server: "
|
|
|
|
su cool -c "/usr/bin/coolwsd --version --o:logging.file[@enable]=true" &
|
2019-09-12 11:33:22 -05:00
|
|
|
### Create the lock file ###
|
2021-11-18 06:08:14 -06:00
|
|
|
touch /var/lock/subsys/coolwsd
|
|
|
|
success $"coolwsd server startup"
|
2019-09-12 11:33:22 -05:00
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
# Stop the service coolwsd
|
2019-09-12 11:33:22 -05:00
|
|
|
stop() {
|
2021-11-18 06:08:14 -06:00
|
|
|
echo -n $"Stopping coolwsd server: "
|
|
|
|
killproc coolwsd
|
2019-09-12 11:33:22 -05:00
|
|
|
### Now, delete the lock file ###
|
2021-11-18 06:08:14 -06:00
|
|
|
rm -f /var/lock/subsys/coolwsd
|
2019-09-12 11:33:22 -05:00
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
|
|
|
### main logic ###
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
status)
|
2021-11-18 06:08:14 -06:00
|
|
|
status coolwsd
|
2019-09-12 11:33:22 -05:00
|
|
|
;;
|
|
|
|
restart|reload|condrestart)
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $"Usage: $0 {start|stop|restart|reload|status}"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|