Add hyperrc service
This commit is contained in:
parent
17a599a4c3
commit
0d1471a5f1
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 $?
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user