mastodon-group-bot/services/openrc/mastodon-group-bot

19 lines
510 B
Text
Raw Normal View History

2022-08-26 02:34:01 +03:00
#!/sbin/openrc-run
name=$RC_SVCNAME
command="/usr/bin/$name"
2022-08-26 13:56:21 +03:00
command_arg1="-config /etc/$name/config.json"
2022-09-01 14:31:27 +03:00
command_arg2="-db /var/lib/$name/$name.db"
2022-08-28 19:37:43 +03:00
command_arg3="-log /var/log/$name/$name.log"
2022-08-26 02:34:01 +03:00
pidfile="/run/$name.pid"
2022-08-26 13:56:21 +03:00
user="nobody"
2022-08-26 02:34:01 +03:00
description="Mastodon group bot which reposts toots"
start() {
ebegin "Starting $name"
2022-08-26 13:56:21 +03:00
start-stop-daemon -bm -S -u $user -p $pidfile -x $command -- $command_arg1 $command_arg2
2022-08-26 02:34:01 +03:00
eend $?
}
stop() {
ebegin "Stopping $name"
start-stop-daemon -K -p $pidfile
eend $?
2022-08-26 13:56:21 +03:00
}