mirror of
https://git.phreedom.club/localhost_frssoft/mastodon-group-bot.git
synced 2025-05-10 22:28:39 +00:00
add services
This commit is contained in:
parent
fe88a07676
commit
f013670852
4 changed files with 53 additions and 8 deletions
18
services/openrc/mastodon-group-bot
Normal file
18
services/openrc/mastodon-group-bot
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/sbin/openrc-run
|
||||
name=$RC_SVCNAME
|
||||
command="/usr/bin/$name"
|
||||
command_args="-config"
|
||||
cfgfile="/etc/$name.json"
|
||||
pidfile="/run/$name.pid"
|
||||
user="nobody:nobody"
|
||||
description="Mastodon group bot which reposts toots"
|
||||
start() {
|
||||
ebegin "Starting $name"
|
||||
start-stop-daemon -bm -S -u $user -p $pidfile -x $command -- $command_args $cfgfile
|
||||
eend $?
|
||||
}
|
||||
stop() {
|
||||
ebegin "Stopping $name"
|
||||
start-stop-daemon -K -p $pidfile
|
||||
eend $?
|
||||
}
|
12
services/systemd/mastodon-group-bot.service
Normal file
12
services/systemd/mastodon-group-bot.service
Normal file
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=Mastodon group bot which reposts toots
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=nobody
|
||||
ExecStart=/usr/bin/mastodon-group-bot -config /etc/mastodon-group-bot.json
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue