mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-06-24 12:01:35 +02:00
enhance
This commit is contained in:
@@ -7,8 +7,12 @@ Description=MESH-BOT
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=pi
|
||||
Group=pi
|
||||
WorkingDirectory=/dir/
|
||||
ExecStart=/usr/bin/bash python3 mesh_bot.py
|
||||
ExecStop=/usr/bin/bash pkill -f mesh_bot.py
|
||||
|
||||
# Disable Python's buffering of STDOUT and STDERR, so that output from the
|
||||
# service shows up immediately in systemd's logs
|
||||
|
||||
@@ -7,8 +7,12 @@ Description=PONG-BOT
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=pi
|
||||
Group=pi
|
||||
WorkingDirectory=/dir/
|
||||
ExecStart=/usr/bin/bash python3 pong_bot.py
|
||||
ExecStop=/usr/bin/bash pkill -f pong_bot.py
|
||||
|
||||
# Disable Python's buffering of STDOUT and STDERR, so that output from the
|
||||
# service shows up immediately in systemd's logs
|
||||
|
||||
+10
@@ -62,6 +62,10 @@ if [ $venv == "y" ]; then
|
||||
sed -i $replace etc/mesh_bot.service
|
||||
replace="python3 pong_bot.py|/dir/launch.sh pong"
|
||||
sed -i $replace etc/pong_bot.service
|
||||
replace="pkill -f mesh_bot.py|pkill -f launch.sh"
|
||||
sed -i $replace etc/mesh_bot.service
|
||||
replace="pkill -f pong_bot.py|pkill -f launch.sh"
|
||||
sed -i $replace etc/pong_bot.service
|
||||
|
||||
# install dependencies
|
||||
pip install -U -r requirements.txt
|
||||
@@ -86,9 +90,15 @@ read bot
|
||||
program_path=$(pwd)
|
||||
cp etc/pong_bot.tmp etc/pong_bot.service
|
||||
cp etc/mesh_bot.tmp etc/mesh_bot.service
|
||||
# set the correct path in the service file
|
||||
replace="s|/dir/|$program_path/|g"
|
||||
sed -i $replace etc/pong_bot.service
|
||||
sed -i $replace etc/mesh_bot.service
|
||||
# set the correct user in the service file?
|
||||
whoami=$(whoami)
|
||||
replace="s|user=pi|user=$whoami|g"
|
||||
sed -i $replace etc/pong_bot.service
|
||||
sed -i $replace etc/mesh_bot.service
|
||||
printf "\n service files updated\n"
|
||||
|
||||
# ask if emoji font should be installed for linux
|
||||
|
||||
Reference in New Issue
Block a user