Add hyperrc service
This commit is contained in:
25
contrib/hyperrc/hyperbot
Normal file
25
contrib/hyperrc/hyperbot
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
command="/srv/hyperbot/hyperbot"
|
||||
command_args="start"
|
||||
command_user="hyperbot"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --directory --owner "$command_user" "/srv/hyperbot"
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting #hyperbola bot"
|
||||
start-stop-daemon --start --exec "$command" --user "$command_user"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping #hyperbola bot"
|
||||
start-stop-daemon --stop --exec "$command" --user "$command_user"
|
||||
eend $?
|
||||
}
|
||||
Reference in New Issue
Block a user