From 992aae0a09be16871cd6e77d7c4ebbf3df677df1 Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 1 Feb 2024 21:57:34 -0500 Subject: [PATCH] Update homeassistant-core-install.sh --- install/homeassistant-core-install.sh | 32 ++++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/install/homeassistant-core-install.sh b/install/homeassistant-core-install.sh index b55d6c41..1b5022d6 100644 --- a/install/homeassistant-core-install.sh +++ b/install/homeassistant-core-install.sh @@ -45,17 +45,27 @@ $STD apt-get install -y \ libatlas-base-dev msg_ok "Installed Dependencies" -msg_info "Installing Python3.12.1 (Patience, building from source)" -$STD apt-get remove -y python3 -curl -sL https://www.python.org/ftp/python/3.12.1/Python-3.12.1.tar.xz | tar xJf - -cd Python-3.12.1 -$STD ./configure --enable-optimizations -$STD make -j $(nproc) -$STD make altinstall -$STD update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.12 1 -cd ~ -rm -rf Python-3.12.1 -msg_ok "Installed Python3.12.1" +read -r -p "Would you like to build Python 3.12.1 (default 3.11.2)? " prompt + if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + msg_info "Installing Python 3.12.1 (Patience, building from source.)" + $STD apt-get remove -y python3 + curl -sL https://www.python.org/ftp/python/3.12.1/Python-3.12.1.tar.xz | tar xJf - + cd Python-3.12.1 + $STD ./configure --enable-optimizations + $STD make -j $(nproc) + $STD make altinstall + $STD update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.12 1 + cd ~ + rm -rf Python-3.12.1 + msg_ok "Installed Python 3.12.1" + else + msg_info "Updating Python3" + $STD apt-get install -y \ + python3-dev \ + python3-pip \ + python3-venv + msg_ok "Updated Python3" + fi msg_info "Installing Home Assistant-Core" mkdir /srv/homeassistant