add systemd service
This commit is contained in:
parent
520793050c
commit
2eac87dfcd
22
README.md
22
README.md
|
@ -5,6 +5,7 @@ Un bot qui récupère une image random en local et la publie
|
|||
Copiez le fichier `config.sample.txt` en `config.txt`, ajoutez le chemin de votre dossier image.
|
||||
Remplissez le fichier `secrets/secrets.txt` et remplissez le avec les code que vous trouverez dans l'onglet développeur de votre compte Mastodon.
|
||||
|
||||
## Use it
|
||||
|
||||
```
|
||||
usage: bot.py [-h] [-i] [-s]
|
||||
|
@ -19,3 +20,24 @@ optional arguments:
|
|||
|
||||
`--img` option send image.
|
||||
`--stream` option send image on mention
|
||||
|
||||
|
||||
## Create a systemd service
|
||||
|
||||
On `/etc/systemd/system/bot.service` copy paste code behind
|
||||
```
|
||||
[Unit]
|
||||
Description=Image bot Mastodon
|
||||
Documentation=https://git.drycat.fr/Dryusdan/masto-random-local-image-bot/src/branch/master
|
||||
Requires=network.target
|
||||
After=network.target
|
||||
#Requires=postgresql.service
|
||||
#After=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=masto-bot
|
||||
TimeoutSec=15
|
||||
WorkingDirectory=/home/masto-bot/
|
||||
ExecStart=/usr/bin/python3 bot.py --stream
|
||||
```
|
||||
|
|
Reference in a new issue