This commit is contained in:
CanbiZ
2025-09-15 15:37:56 +02:00
parent 8d687ba9ab
commit 3f69160fb9
48 changed files with 685 additions and 688 deletions

View File

@@ -18,7 +18,7 @@ header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -18,7 +18,7 @@ var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -17,42 +17,42 @@ var_unprivileged="1"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info
check_container_storage
check_container_resources
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/jumpserver ]]; then
msg_error "No ${APP} Installation Found!"
if [[ ! -d /opt/jumpserver ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/jumpserver/installer/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Updating ${APP} to ${RELEASE}"
if [[ -d /opt/jumpserver/config ]]; then
cp -r /opt/jumpserver/config /opt/jumpserver_config_backup
fi
echo "${RELEASE}" >/opt/${APP}_version.txt
rm -rf /opt/jumpserver
cd /opt
curl -fsSL "https://github.com/jumpserver/installer/releases/download/${RELEASE}/jumpserver-installer-${RELEASE}.tar.gz" -o jumpserver-installer-${RELEASE}.tar.gz
mkdir -p /opt/jumpserver
$STD tar -xzvf jumpserver-installer-${RELEASE}.tar.gz -C /opt/jumpserver --strip-components=1
if [[ -d /opt/jumpserver_config_backup ]]; then
cp -r /opt/jumpserver_config_backup /opt/jumpserver/config
rm -rf /opt/jumpserver_config_backup
fi
cd /opt/jumpserver
yes y | head -n 3 | $STD ./jmsctl.sh upgrade
$STD ./jmsctl.sh start
rm -rf /opt/jumpserver-installer-${RELEASE}.tar.gz
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}."
fi
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/jumpserver/installer/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Updating ${APP} to ${RELEASE}"
if [[ -d /opt/jumpserver/config ]]; then
cp -r /opt/jumpserver/config /opt/jumpserver_config_backup
fi
echo "${RELEASE}" >/opt/${APP}_version.txt
rm -rf /opt/jumpserver
cd /opt
curl -fsSL "https://github.com/jumpserver/installer/releases/download/${RELEASE}/jumpserver-installer-${RELEASE}.tar.gz" -o jumpserver-installer-${RELEASE}.tar.gz
mkdir -p /opt/jumpserver
$STD tar -xzvf jumpserver-installer-${RELEASE}.tar.gz -C /opt/jumpserver --strip-components=1
if [[ -d /opt/jumpserver_config_backup ]]; then
cp -r /opt/jumpserver_config_backup /opt/jumpserver/config
rm -rf /opt/jumpserver_config_backup
fi
cd /opt/jumpserver
yes y | head -n 3 | $STD ./jmsctl.sh upgrade
$STD ./jmsctl.sh start
rm -rf /opt/jumpserver-installer-${RELEASE}.tar.gz
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}."
fi
exit
}
start

View File

@@ -19,41 +19,41 @@ var_tun="${var_tun:-yes}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info
check_container_storage
check_container_resources
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/kasm ]]; then
msg_error "No ${APP} Installation Found!"
if [[ ! -d /opt/kasm ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL 'https://www.kasmweb.com/downloads' | grep -o 'https://kasm-static-content.s3.amazonaws.com/kasm_release_[^"]*\.tar\.gz' | head -n 1 | sed -E 's/.*release_(.*)\.tar\.gz/\1/')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
msg_info "Updating ${APP} to v${RELEASE}"
temp_file=$(mktemp)
curl -fsSL "https://kasm-static-content.s3.amazonaws.com/kasm_release_${RELEASE}.tar.gz" -o "$temp_file"
tar zxf "$temp_file"
mkdir -p /opt/kasm/backups/
chmod 777 /opt/kasm/backups/
mv /opt/kasm/1.*/certs/kasm_nginx.crt /opt/kasm/kasm_nginx.crt_bak
printf 'y\n' | $STD sudo bash /tmp/kasm_release/upgrade.sh
$STD sudo bash /tmp/kasm_release/upgrade.sh
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to v${RELEASE}"
msg_info "Cleaning up"
rm -f "$temp_file"
rm -rf /tmp/kasm_release
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
fi
RELEASE=$(curl -fsSL 'https://www.kasmweb.com/downloads' | grep -o 'https://kasm-static-content.s3.amazonaws.com/kasm_release_[^"]*\.tar\.gz' | head -n 1 | sed -E 's/.*release_(.*)\.tar\.gz/\1/')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
msg_info "Updating ${APP} to v${RELEASE}"
temp_file=$(mktemp)
curl -fsSL "https://kasm-static-content.s3.amazonaws.com/kasm_release_${RELEASE}.tar.gz" -o "$temp_file"
tar zxf "$temp_file"
mkdir -p /opt/kasm/backups/
chmod 777 /opt/kasm/backups/
mv /opt/kasm/1.*/certs/kasm_nginx.crt /opt/kasm/kasm_nginx.crt_bak
printf 'y\n' | $STD sudo bash /tmp/kasm_release/upgrade.sh
$STD sudo bash /tmp/kasm_release/upgrade.sh
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to v${RELEASE}"
msg_info "Cleaning up"
rm -f "$temp_file"
rm -rf /tmp/kasm_release
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
}
start

View File

@@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -17,34 +17,34 @@ var_unprivileged="1"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info
check_container_storage
check_container_resources
header_info
check_container_storage
check_container_resources
if [[ ! -f /opt/librespeed/index.html ]]; then
msg_error "No ${APP} Installation Found!"
if [[ ! -f /opt/librespeed/index.html ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/librespeed/speedtest/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
if [[ ! -f /opt/librespeed/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt//librespeed/${APP}_version.txt)" ]]; then
msg_info "Updating $APP..."
temp_file=$(mktemp)
curl -fsSL "https://github.com/librespeed/speedtest/archive/refs/tags/${RELEASE}.zip" -o "$temp_file"
mkdir -p /temp
unzip -qu "$temp_file" -d /temp
cd /temp/speedtest-"${RELEASE}"
cp -u favicon.ico index.html speedtest.js speedtest_worker.js /opt/librespeed/
cp -ru backend /opt/librespeed/
echo "${RELEASE}" >/opt/"${APP}"_version.txt
systemctl restart caddy
msg_ok "$APP has been updated."
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/librespeed/speedtest/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
if [[ ! -f /opt/librespeed/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt//librespeed/${APP}_version.txt)" ]]; then
msg_info "Updating $APP..."
temp_file=$(mktemp)
curl -fsSL "https://github.com/librespeed/speedtest/archive/refs/tags/${RELEASE}.zip" -o "$temp_file"
mkdir -p /temp
unzip -qu "$temp_file" -d /temp
cd /temp/speedtest-"${RELEASE}"
cp -u favicon.ico index.html speedtest.js speedtest_worker.js /opt/librespeed/
cp -ru backend /opt/librespeed/
echo "${RELEASE}" >/opt/"${APP}"_version.txt
systemctl restart caddy
msg_ok "$APP has been updated."
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
}
start
build_container

View File

@@ -26,7 +26,7 @@ var_os="${var_os:-debian}"
var_version="${var_version:-12}"
variables
color
catch_errors
init_error_traps
function default_settings() {
CT_TYPE="1"

View File

@@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -16,7 +16,7 @@ var_version="${var_version:-12}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -16,7 +16,7 @@ var_unprivileged="${var_unprivileged:-1}"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info

View File

@@ -17,55 +17,54 @@ var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
init_error_traps
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/vikunja ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/vikunja ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if whiptail --backtitle "Vikunja Update" --title "🔄 VERSION SELECTION" --yesno \
"Choose the version type to update to:\n\n• STABLE: Recommended for production use\n• UNSTABLE: Latest development version\n\n⚠ WARNING: Unstable versions may contain bugs,\nbe incomplete, or cause system instability.\nOnly use for testing purposes.\n\nDo you want to use the UNSTABLE version?\n(No = Stable, Yes = Unstable)" 16 70 --defaultno
then
msg_info "Selecting version"
RELEASE="unstable"
FILENAME="vikunja-${RELEASE}-x86_64.deb"
msg_ok "Selected UNSTABLE version"
else
msg_info "Selecting version"
RELEASE=$(curl -fsSL https://dl.vikunja.io/vikunja/ | grep -oP 'href="/vikunja/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)
FILENAME="vikunja-${RELEASE}-amd64.deb"
msg_ok "Selected STABLE version: ${RELEASE}"
fi
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop vikunja
msg_ok "Stopped ${APP}"
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt
rm -rf /opt/vikunja/vikunja
rm -rf "/opt/$FILENAME"
curl -fsSL "https://dl.vikunja.io/vikunja/$RELEASE/$FILENAME" -o $(basename "https://dl.vikunja.io/vikunja/$RELEASE/$FILENAME")
export DEBIAN_FRONTEND=noninteractive
$STD dpkg -i $FILENAME
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
systemctl start vikunja
msg_ok "Started ${APP}"
msg_info "Cleaning Up"
rm -rf /opt/$FILENAME
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
if whiptail --backtitle "Vikunja Update" --title "🔄 VERSION SELECTION" --yesno \
"Choose the version type to update to:\n\n• STABLE: Recommended for production use\n• UNSTABLE: Latest development version\n\n⚠ WARNING: Unstable versions may contain bugs,\nbe incomplete, or cause system instability.\nOnly use for testing purposes.\n\nDo you want to use the UNSTABLE version?\n(No = Stable, Yes = Unstable)" 16 70 --defaultno; then
msg_info "Selecting version"
RELEASE="unstable"
FILENAME="vikunja-${RELEASE}-x86_64.deb"
msg_ok "Selected UNSTABLE version"
else
msg_info "Selecting version"
RELEASE=$(curl -fsSL https://dl.vikunja.io/vikunja/ | grep -oP 'href="/vikunja/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)
FILENAME="vikunja-${RELEASE}-amd64.deb"
msg_ok "Selected STABLE version: ${RELEASE}"
fi
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop vikunja
msg_ok "Stopped ${APP}"
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt
rm -rf /opt/vikunja/vikunja
rm -rf "/opt/$FILENAME"
curl -fsSL "https://dl.vikunja.io/vikunja/$RELEASE/$FILENAME" -o $(basename "https://dl.vikunja.io/vikunja/$RELEASE/$FILENAME")
export DEBIAN_FRONTEND=noninteractive
$STD dpkg -i $FILENAME
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
systemctl start vikunja
msg_ok "Started ${APP}"
msg_info "Cleaning Up"
rm -rf /opt/$FILENAME
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
}
start