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