diff --git a/ct/livebook.sh b/ct/livebook.sh index 3afc43531..496503a30 100755 --- a/ct/livebook.sh +++ b/ct/livebook.sh @@ -20,35 +20,36 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources + header_info + check_container_storage + check_container_resources - if [[ ! -f /opt/livebook/.mix/escripts/livebook ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - if check_for_gh_release "livebook" "livebook-dev/livebook"; then - msg_info "Stopping ${APP}" - systemctl stop livebook - msg_info "Service stopped" - - msg_info "Updating container" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated container" - - msg_info "Updating ${APP}" - source /opt/livebook/.env - cd /opt/livebook - $STD mix escript.install hex livebook --force - - chown -R livebook:livebook /opt/livebook /data - systemctl start livebook - msg_ok "Updated ${APP}" - fi + if [[ ! -f /opt/livebook/.mix/escripts/livebook ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + if check_for_gh_release "livebook" "livebook-dev/livebook"; then + msg_info "Stopping Service" + systemctl stop livebook + msg_info "Stopped Service" + + msg_info "Updating Container" + $STD apt update + $STD apt upgrade -y + msg_ok "Updated Container" + + msg_info "Updating Livebook" + source /opt/livebook/.env + cd /opt/livebook + $STD mix escript.install hex livebook --force + + chown -R livebook:livebook /opt/livebook /data + systemctl start livebook + msg_ok "Updated Livebook" + msg_ok "Updated Successfully!" + fi + exit } start diff --git a/install/livebook-install.sh b/install/livebook-install.sh index 902d86d2b..95f46c137 100644 --- a/install/livebook-install.sh +++ b/install/livebook-install.sh @@ -15,11 +15,11 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - build-essential \ - ca-certificates \ - cmake \ - git \ - libncurses5-dev + build-essential \ + ca-certificates \ + cmake \ + git \ + libncurses5-dev msg_ok "Installed Dependencies" msg_info "Creating livebook user" @@ -28,7 +28,6 @@ export HOME=/opt/livebook $STD adduser --system --group --home /opt/livebook --shell /bin/bash livebook msg_ok "Created livebook user" - msg_warn "WARNING: This script will run an external installer from a third-party source (https://elixir-lang.org)." msg_warn "The following code is NOT maintained or audited by our repository." msg_warn "If you have any doubts or concerns, please review the installer code before proceeding:" @@ -39,7 +38,8 @@ if [[ ! "$CONFIRM" =~ ^([yY][eE][sS]|[yY])$ ]]; then msg_error "Aborted by user. No changes have been made." exit 10 fi -bash <(curl -sL https://elixir-lang.org/install.sh) +curl -fsSO https://elixir-lang.org/install.sh +$STD sh install.sh elixir@latest otp@latest msg_info "Setup Erlang and Elixir" ERLANG_VERSION=$(ls /opt/livebook/.elixir-install/installs/otp/ | head -n1) @@ -99,7 +99,8 @@ msg_ok "Installed Livebook" motd_ssh customize -msg_info "Cleaning Up" -$STD apt-get autoremove -y -$STD apt-get autoclean +msg_info "Cleaning Up" +$STD apt autoremove -y +$STD apt autoclean -y +$STD apt clean -y msg_ok "Cleaned Up"