This commit is contained in:
SpudGunMan
2024-09-25 22:56:01 -07:00
parent bf1613ba66
commit 22f63e1056
3 changed files with 9 additions and 14 deletions
+2 -2
View File
@@ -11,8 +11,8 @@ 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
ExecStart=python3 mesh_bot.py
ExecStop=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
+2 -2
View File
@@ -11,8 +11,8 @@ 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
ExecStart=python3 pong_bot.py
ExecStop=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
+5 -10
View File
@@ -2,6 +2,9 @@
# install.sh
cd "$(dirname "$0")"
program_path=$(pwd)
cp etc/pong_bot.tmp etc/pong_bot.service
cp etc/mesh_bot.tmp etc/mesh_bot.service
printf "\nMeshing Around Installer\n"
printf "\nThis script will install the Meshing Around bot and its dependencies works best in debian/ubuntu\n"
@@ -58,13 +61,9 @@ if [ $venv == "y" ]; then
fi
# config service files for virtual environment
replace="s|python3 mesh_bot.py|/dir/launch.sh mesh|g"
replace="s|python3 mesh_bot.py|launch.sh mesh|g"
sed -i "$replace" etc/mesh_bot.service
replace="s|python3 pong_bot.py|/dir/launch.sh pong|g"
sed -i "$replace" etc/pong_bot.service
replace="s|pkill -f mesh_bot.py|pkill -f launch.sh|g"
sed -i "$replace" etc/mesh_bot.service
replace="s|pkill -f pong_bot.py|pkill -f launch.sh|g"
replace="s|python3 pong_bot.py|launch.sh pong|g"
sed -i "$replace" etc/pong_bot.service
# install dependencies
@@ -86,10 +85,6 @@ printf "\n\n"
echo "Which bot do you want to install as a service? Pong Mesh or None? (pong/mesh/n)"
read bot
#set the correct path in the service file
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