mirror of
https://github.com/Balshgit/mosgortrans.git
synced 2025-12-16 21:50:39 +03:00
add deamon service
This commit is contained in:
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
|
||||||
Reference in New Issue
Block a user