mirror of
https://github.com/Balshgit/mosgortrans.git
synced 2025-09-11 13:00:40 +03:00
add deamon service
This commit is contained in:
parent
da0fb1a090
commit
f79e3ff861
11
scripts/mosgortrans.service
Normal file
11
scripts/mosgortrans.service
Normal file
@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=MosGorTrans bot
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
WorkingDirectory=/opt/mosgortrans
|
||||
ExecStart=scripts/start-bot.sh
|
||||
ExecStop=scripts/shutdown-bot.sh
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
6
scripts/shutdown-bot.sh
Normal file
6
scripts/shutdown-bot.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
echo "shutting down the bot"
|
||||
bash killall python;
|
||||
bash killall firefox;
|
5
scripts/start-bot.sh
Normal file
5
scripts/start-bot.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
echo "starting the bot"
|
||||
cd /opt/mosgortrans && poetry shell && python main.py
|
Loading…
x
Reference in New Issue
Block a user