install python3-venv if necessary

This commit is contained in:
b068931cc450442b63f5b3d276ea4297 2024-01-24 16:11:25 +01:00
parent 4f1bf5b09c
commit 65e7cfcd45

View File

@ -1,5 +1,4 @@
#!/bin/bash #!/bin/bash
CURRENT_USER="${SUDO_USER}" CURRENT_USER="${SUDO_USER}"
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
HOST="$( hostname )" HOST="$( hostname )"
@ -80,7 +79,6 @@ generate_certificate() {
create_services() { create_services() {
# Create services to launch the two servers. # Create services to launch the two servers.
echo -e "\e[39m[+] Creating services\e[39m" echo -e "\e[39m[+] Creating services\e[39m"
echo -e "\e[92m [✔] Creating frontend service\e[39m" echo -e "\e[92m [✔] Creating frontend service\e[39m"
@ -140,7 +138,6 @@ EOL
systemctl start spyguard-backend systemctl start spyguard-backend
} }
change_hostname() { change_hostname() {
# Changing the hostname to spyguard # Changing the hostname to spyguard
echo -e "[+] Changing the hostname to spyguard" echo -e "[+] Changing the hostname to spyguard"
@ -184,7 +181,8 @@ check_dependencies() {
install_package ${bin##*/} install_package ${bin##*/}
fi fi
done done
echo -e "\e[39m[+] Create and activate Virtual Environment for Python packages\e[39m" echo -e "\e[39m[+] Install and prepare Virtual Environment for Python packages\e[39m"
apt install python3-venv
python3 -m venv /usr/share/spyguard/spyguard-venv python3 -m venv /usr/share/spyguard/spyguard-venv
source /usr/share/spyguard/spyguard-venv/bin/activate source /usr/share/spyguard/spyguard-venv/bin/activate
echo -e "\e[39m[+] Install Python packages...\e[39m" echo -e "\e[39m[+] Install Python packages...\e[39m"