-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: svn+ssh://s4.hekkelman.net/home/maarten/svnroot/energyd/trunk@570 eb168f56-b88a-429f-bc04-022912e7fcb5
- Loading branch information
maarten
committed
Jan 21, 2020
1 parent
763e38f
commit e6e40e8
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/sh | ||
|
||
### BEGIN INIT INFO | ||
# Provides: enerygd | ||
# Required-Start: $network | ||
# Required-Stop: $network | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: | ||
# Short-Description: Start enerygd daemon | ||
### END INIT INFO | ||
|
||
PATH=/bin:/usr/local/sbin | ||
|
||
. /lib/lsb/init-functions | ||
|
||
DAEMON=/usr/local/sbin/energyd | ||
PIDFILE=/var/run/energyd | ||
|
||
test -x $DAEMON || exit 5 | ||
|
||
ENERGYD_OPTS="--port 10333" | ||
|
||
if [ -r /etc/default/energyd ]; then | ||
. /etc/default/energyd | ||
fi | ||
|
||
RUNASUSER=www-data | ||
|
||
case $1 in | ||
start) | ||
log_daemon_msg "Starting energyd server" "energyd" | ||
$DAEMON start $ENERGYD_OPTS | ||
log_end_msg $? | ||
;; | ||
stop) | ||
log_daemon_msg "Stopping energyd server" "energyd" | ||
$DAEMON stop | ||
log_end_msg $? | ||
;; | ||
restart|force-reload) | ||
$0 stop && sleep 2 && $0 start | ||
;; | ||
status) | ||
$DAEMON status | ||
;; | ||
*) | ||
echo "Usage: $0 {start|stop|restart|force-reload|status}" | ||
exit 2 | ||
;; | ||
esac |