check requirements in the installer

This commit is contained in:
alfrix committed 2023-09-27 23:03:43 -03:00
1 parent f49a619e41
commit 0fada32c4b
1 file changed
+11
+11
View File
@@ -94,6 +94,16 @@ install_packages()
sudo systemctl mask ModemManager.service
}
check_requirements()
{
echo_text "Checking Python version"
python --version
if ! python -c 'import sys; exit(1) if sys.version_info <= (3,7) else exit(0)'; then
echo_text 'Not supported'
exit 1
fi
}
create_virtualenv()
{
echo_text "Creating virtual environment"
@@ -178,6 +188,7 @@ if [ "$EUID" == 0 ]
exit 1
fi
install_packages
check_requirements
create_virtualenv
modify_user
install_systemd_service