finalize livebook

This commit is contained in:
CanbiZ 2025-10-30 08:35:10 +01:00
parent acbaa7ce7d
commit ffe61d7590
2 changed files with 39 additions and 37 deletions

View File

@ -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

View File

@ -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"