From 8369b4d205b1341abc2bef8c45aaa1f9d7ab1ff3 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:26:37 -0700 Subject: [PATCH] Update install.sh --- install.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index 0829c31..e2317c7 100755 --- a/install.sh +++ b/install.sh @@ -35,21 +35,12 @@ printf "\nConfig file generated\n" # set virtual environment and install dependencies printf "\nMeshing Around Installer\n" -#check if python3 has venv module -if [ -f venv/bin/activate ]; then - printf "\nFpund virtual environment for python\n" -else - sudo apt-get install python3-venv - exit 1 -fi - echo "Do you want to install the bot in a virtual environment? (y/n)" read venv if [ $venv == "y" ]; then # set virtual environment - if ! python3 -m venv --help &> /dev/null - then + if ! python3 -m venv --help &> /dev/null; then printf "Python3 venv module not found, please install python3-venv with your OS\n" exit 1 else @@ -57,6 +48,15 @@ if [ $venv == "y" ]; then python3 -m venv venv source venv/bin/activate + #check if python3 has venv module + if [ -f venv/bin/activate ]; then + printf "\nFpund virtual environment for python\n" + else + sudo apt-get install python3-venv + printf "\nPython3 venv module not found, please install python3-venv with your OS if not already done. re-run the script\n" + exxt 1 + fi + # config service files for virtual environment replace="python3 mesh_bot.py|/dir/launch.sh mesh" sed -i $replace etc/mesh_bot.service