From 0d1471a5f16f9f626521635f82a6aab2d9830b37 Mon Sep 17 00:00:00 2001 From: Jesus Date: Sat, 22 Jul 2023 11:44:00 -0500 Subject: [PATCH] Add hyperrc service --- contrib/hyperrc/hyperbot | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 contrib/hyperrc/hyperbot diff --git a/contrib/hyperrc/hyperbot b/contrib/hyperrc/hyperbot new file mode 100644 index 0000000..4878ce6 --- /dev/null +++ b/contrib/hyperrc/hyperbot @@ -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 $? +}