aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus <heckyel@riseup.net>2023-07-22 11:44:00 -0500
committerJesus <heckyel@riseup.net>2023-07-22 11:44:00 -0500
commit0d1471a5f16f9f626521635f82a6aab2d9830b37 (patch)
treea795cc910833b9cc098df238a8a17f9f818c6350
parent17a599a4c3dec3cb3ef580ee408f3f21865a3329 (diff)
downloadhyperbot-0d1471a5f16f9f626521635f82a6aab2d9830b37.tar.lz
hyperbot-0d1471a5f16f9f626521635f82a6aab2d9830b37.tar.xz
hyperbot-0d1471a5f16f9f626521635f82a6aab2d9830b37.zip
Add hyperrc serviceHEADmaster
-rw-r--r--contrib/hyperrc/hyperbot25
1 files changed, 25 insertions, 0 deletions
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 $?
+}