Add hyperrc service

This commit is contained in:
Jesus 2023-07-22 11:44:00 -05:00
parent 17a599a4c3
commit 0d1471a5f1
No known key found for this signature in database
GPG Key ID: E607CE7149F4D71C

25
contrib/hyperrc/hyperbot Normal file
View 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 $?
}