test
This commit is contained in:
parent
8d687ba9ab
commit
3f69160fb9
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
24
ct/debian.sh
24
ct/debian.sh
@ -19,21 +19,21 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /var ]]; then
|
if [[ ! -d /var ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
msg_info "Updating $APP LXC"
|
||||||
|
$STD apt-get update
|
||||||
|
$STD apt-get -y upgrade
|
||||||
|
msg_ok "Updated $APP LXC"
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
msg_info "Updating $APP LXC"
|
|
||||||
$STD apt-get update
|
|
||||||
$STD apt-get -y upgrade
|
|
||||||
msg_ok "Updated $APP LXC"
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -18,7 +18,7 @@ header_info "$APP"
|
|||||||
|
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -18,7 +18,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,42 +17,42 @@ var_unprivileged="1"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -d /opt/jumpserver ]]; then
|
if [[ ! -d /opt/jumpserver ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
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
|
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
|
start
|
||||||
|
@ -19,41 +19,41 @@ var_tun="${var_tun:-yes}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -d /opt/kasm ]]; then
|
if [[ ! -d /opt/kasm ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
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
|
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
|
start
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,34 +17,34 @@ var_unprivileged="1"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -f /opt/librespeed/index.html ]]; then
|
if [[ ! -f /opt/librespeed/index.html ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
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
|
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
|
start
|
||||||
build_container
|
build_container
|
||||||
|
@ -26,7 +26,7 @@ var_os="${var_os:-debian}"
|
|||||||
var_version="${var_version:-12}"
|
var_version="${var_version:-12}"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function default_settings() {
|
function default_settings() {
|
||||||
CT_TYPE="1"
|
CT_TYPE="1"
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -16,7 +16,7 @@ var_version="${var_version:-12}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -16,7 +16,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
|
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,55 +17,54 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /opt/vikunja ]]; then
|
if [[ ! -d /opt/vikunja ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
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
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -18,96 +18,94 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -d "/opt/dispatcharr" ]]; then
|
if [[ ! -d "/opt/dispatcharr" ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
RELEASE=$(curl -fsSL https://api.github.com/repos/Dispatcharr/Dispatcharr/releases/latest | jq -r '.tag_name' | sed 's/^v//')
|
||||||
|
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||||
|
msg_ok "Starting update"
|
||||||
|
APP_DIR="/opt/dispatcharr"
|
||||||
|
APP_USER="dispatcharr"
|
||||||
|
APP_GROUP="dispatcharr"
|
||||||
|
|
||||||
|
msg_info "Stopping $APP"
|
||||||
|
systemctl stop dispatcharr-celery
|
||||||
|
systemctl stop dispatcharr-celerybeat
|
||||||
|
systemctl stop dispatcharr-daphne
|
||||||
|
systemctl stop dispatcharr
|
||||||
|
msg_ok "Stopped $APP"
|
||||||
|
|
||||||
|
msg_info "Creating Backup"
|
||||||
|
BACKUP_FILE="/opt/dispatcharr_$(date +%F).tar.gz"
|
||||||
|
msg_info "Source and Database backup"
|
||||||
|
set -o allexport
|
||||||
|
source /etc/$APP_NAME/$APP_NAME.env
|
||||||
|
set +o allexport
|
||||||
|
PGPASSWORD=$POSTGRES_PASSWORD pg_dump -U $POSTGRES_USER -h $POSTGRES_HOST $POSTGRES_DB >/opt/$POSTGRES_DB-$(date +%F).sql
|
||||||
|
$STD tar -czf "$BACKUP_FILE" /opt/dispatcharr /opt/Dispatcharr_version.txt /opt/$POSTGRES_DB-$(date +%F).sql &>/dev/null
|
||||||
|
msg_ok "Backup Created"
|
||||||
|
|
||||||
|
msg_info "Updating $APP to v${RELEASE}"
|
||||||
|
rm -rf /opt/dispatcharr
|
||||||
|
fetch_and_deploy_gh_release "dispatcharr" "Dispatcharr/Dispatcharr"
|
||||||
|
chown -R "$APP_USER:$APP_GROUP" "$APP_DIR"
|
||||||
|
sed -i 's/program\[\x27channel_id\x27\]/program["channel_id"]/g' "${APP_DIR}/apps/output/views.py"
|
||||||
|
|
||||||
|
msg_ok "Dispatcharr Updated to $RELEASE"
|
||||||
|
|
||||||
|
msg_info "Creating Python Virtual Environment"
|
||||||
|
cd $APP_DIR
|
||||||
|
python3 -m venv env
|
||||||
|
source env/bin/activate
|
||||||
|
$STD pip install --upgrade pip
|
||||||
|
$STD pip install -r requirements.txt
|
||||||
|
$STD pip install gunicorn
|
||||||
|
ln -sf /usr/bin/ffmpeg $APP_DIR/env/bin/ffmpeg
|
||||||
|
msg_ok "Python Environment Setup"
|
||||||
|
|
||||||
|
msg_info "Building Frontend"
|
||||||
|
cd $APP_DIR/frontend
|
||||||
|
$STD npm install --legacy-peer-deps
|
||||||
|
$STD npm run build
|
||||||
|
msg_ok "Built Frontend"
|
||||||
|
|
||||||
|
msg_info "Running Django Migrations"
|
||||||
|
cd $APP_DIR
|
||||||
|
source env/bin/activate
|
||||||
|
set -o allexport
|
||||||
|
source /etc/$APP_NAME/$APP_NAME.env
|
||||||
|
set +o allexport
|
||||||
|
$STD python manage.py migrate --noinput
|
||||||
|
$STD python manage.py collectstatic --noinput
|
||||||
|
msg_ok "Migrations Complete"
|
||||||
|
|
||||||
|
msg_info "Starting $APP"
|
||||||
|
systemctl start dispatcharr-celery
|
||||||
|
systemctl start dispatcharr-celerybeat
|
||||||
|
systemctl start dispatcharr-daphne
|
||||||
|
systemctl start dispatcharr
|
||||||
|
msg_ok "Started $APP"
|
||||||
|
echo "${RELEASE}" >"/opt/${APP}_version.txt"
|
||||||
|
|
||||||
|
msg_info "Cleaning Up"
|
||||||
|
rm -rf /opt/$POSTGRES_DB-$(date +%F).sql
|
||||||
|
msg_ok "Cleanup Completed"
|
||||||
|
|
||||||
|
msg_ok "Update Successful, Backup saved to $BACKUP_FILE"
|
||||||
|
|
||||||
|
else
|
||||||
|
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Dispatcharr/Dispatcharr/releases/latest | jq -r '.tag_name' | sed 's/^v//')
|
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
|
||||||
msg_ok "Starting update"
|
|
||||||
APP_DIR="/opt/dispatcharr"
|
|
||||||
APP_USER="dispatcharr"
|
|
||||||
APP_GROUP="dispatcharr"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
msg_info "Stopping $APP"
|
|
||||||
systemctl stop dispatcharr-celery
|
|
||||||
systemctl stop dispatcharr-celerybeat
|
|
||||||
systemctl stop dispatcharr-daphne
|
|
||||||
systemctl stop dispatcharr
|
|
||||||
msg_ok "Stopped $APP"
|
|
||||||
|
|
||||||
msg_info "Creating Backup"
|
|
||||||
BACKUP_FILE="/opt/dispatcharr_$(date +%F).tar.gz"
|
|
||||||
msg_info "Source and Database backup"
|
|
||||||
set -o allexport
|
|
||||||
source /etc/$APP_NAME/$APP_NAME.env
|
|
||||||
set +o allexport
|
|
||||||
PGPASSWORD=$POSTGRES_PASSWORD pg_dump -U $POSTGRES_USER -h $POSTGRES_HOST $POSTGRES_DB > /opt/$POSTGRES_DB-`date +%F`.sql
|
|
||||||
$STD tar -czf "$BACKUP_FILE" /opt/dispatcharr /opt/Dispatcharr_version.txt /opt/$POSTGRES_DB-`date +%F`.sql &>/dev/null
|
|
||||||
msg_ok "Backup Created"
|
|
||||||
|
|
||||||
msg_info "Updating $APP to v${RELEASE}"
|
|
||||||
rm -rf /opt/dispatcharr
|
|
||||||
fetch_and_deploy_gh_release "dispatcharr" "Dispatcharr/Dispatcharr"
|
|
||||||
chown -R "$APP_USER:$APP_GROUP" "$APP_DIR"
|
|
||||||
sed -i 's/program\[\x27channel_id\x27\]/program["channel_id"]/g' "${APP_DIR}/apps/output/views.py"
|
|
||||||
|
|
||||||
msg_ok "Dispatcharr Updated to $RELEASE"
|
|
||||||
|
|
||||||
msg_info "Creating Python Virtual Environment"
|
|
||||||
cd $APP_DIR
|
|
||||||
python3 -m venv env
|
|
||||||
source env/bin/activate
|
|
||||||
$STD pip install --upgrade pip
|
|
||||||
$STD pip install -r requirements.txt
|
|
||||||
$STD pip install gunicorn
|
|
||||||
ln -sf /usr/bin/ffmpeg $APP_DIR/env/bin/ffmpeg
|
|
||||||
msg_ok "Python Environment Setup"
|
|
||||||
|
|
||||||
msg_info "Building Frontend"
|
|
||||||
cd $APP_DIR/frontend
|
|
||||||
$STD npm install --legacy-peer-deps
|
|
||||||
$STD npm run build
|
|
||||||
msg_ok "Built Frontend"
|
|
||||||
|
|
||||||
msg_info "Running Django Migrations"
|
|
||||||
cd $APP_DIR
|
|
||||||
source env/bin/activate
|
|
||||||
set -o allexport
|
|
||||||
source /etc/$APP_NAME/$APP_NAME.env
|
|
||||||
set +o allexport
|
|
||||||
$STD python manage.py migrate --noinput
|
|
||||||
$STD python manage.py collectstatic --noinput
|
|
||||||
msg_ok "Migrations Complete"
|
|
||||||
|
|
||||||
msg_info "Starting $APP"
|
|
||||||
systemctl start dispatcharr-celery
|
|
||||||
systemctl start dispatcharr-celerybeat
|
|
||||||
systemctl start dispatcharr-daphne
|
|
||||||
systemctl start dispatcharr
|
|
||||||
msg_ok "Started $APP"
|
|
||||||
echo "${RELEASE}" > "/opt/${APP}_version.txt"
|
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
|
||||||
rm -rf /opt/$POSTGRES_DB-`date +%F`.sql
|
|
||||||
msg_ok "Cleanup Completed"
|
|
||||||
|
|
||||||
msg_ok "Update Successful, Backup saved to $BACKUP_FILE"
|
|
||||||
|
|
||||||
else
|
|
||||||
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
24
ct/ente.sh
24
ct/ente.sh
@ -17,21 +17,21 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /var ]]; then
|
if [[ ! -d /var ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
msg_info "Updating $APP LXC"
|
||||||
|
$STD apt-get update
|
||||||
|
$STD apt-get -y upgrade
|
||||||
|
msg_ok "Updated $APP LXC"
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
msg_info "Updating $APP LXC"
|
|
||||||
$STD apt-get update
|
|
||||||
$STD apt-get -y upgrade
|
|
||||||
msg_ok "Updated $APP LXC"
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -18,44 +18,44 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
|
if [[ ! -f /lib/systemd/system/freepbx.service ]]; then
|
||||||
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg_info "Updating $APP LXC"
|
||||||
|
$STD apt-get update
|
||||||
|
$STD apt-get -y upgrade
|
||||||
|
msg_ok "Updated $APP LXC"
|
||||||
|
|
||||||
|
msg_info "Updating $APP Modules"
|
||||||
|
$STD fwconsole ma updateall
|
||||||
|
$STD fwconsole reload
|
||||||
|
msg_ok "Updated $APP Modules"
|
||||||
|
|
||||||
if [[ ! -f /lib/systemd/system/freepbx.service ]]; then
|
|
||||||
msg_error "No ${APP} Installation Found!"
|
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
|
|
||||||
msg_info "Updating $APP LXC"
|
|
||||||
$STD apt-get update
|
|
||||||
$STD apt-get -y upgrade
|
|
||||||
msg_ok "Updated $APP LXC"
|
|
||||||
|
|
||||||
msg_info "Updating $APP Modules"
|
|
||||||
$STD fwconsole ma updateall
|
|
||||||
$STD fwconsole reload
|
|
||||||
msg_ok "Updated $APP Modules"
|
|
||||||
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
|
||||||
if whiptail --title "Commercial Modules" --yesno "Remove Commercial modules?" --defaultno 10 50; then
|
if whiptail --title "Commercial Modules" --yesno "Remove Commercial modules?" --defaultno 10 50; then
|
||||||
export ONLY_OPENSOURCE="yes"
|
export ONLY_OPENSOURCE="yes"
|
||||||
|
|
||||||
if whiptail --title "Firewall Module" --yesno "Do you want to KEEP the Firewall module (and sysadmin)?" 10 50; then
|
if whiptail --title "Firewall Module" --yesno "Do you want to KEEP the Firewall module (and sysadmin)?" 10 50; then
|
||||||
export REMOVE_FIREWALL="no"
|
export REMOVE_FIREWALL="no"
|
||||||
else
|
else
|
||||||
export REMOVE_FIREWALL="yes"
|
export REMOVE_FIREWALL="yes"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
export ONLY_OPENSOURCE="no"
|
export ONLY_OPENSOURCE="no"
|
||||||
export REMOVE_FIREWALL="no"
|
export REMOVE_FIREWALL="no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build_container
|
build_container
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-0}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,78 +17,78 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
# this only updates garmin-grafana, not influxdb or grafana, which are upgraded with apt
|
# this only updates garmin-grafana, not influxdb or grafana, which are upgraded with apt
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -d /opt/garmin-grafana/ ]]; then
|
if [[ ! -d /opt/garmin-grafana/ ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
RELEASE=$(curl -fsSL https://api.github.com/repos/arpanghosh8453/garmin-grafana/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||||
|
if [[ ! -d /opt/garmin-grafana/ ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||||
|
msg_info "Stopping $APP"
|
||||||
|
systemctl stop garmin-grafana
|
||||||
|
systemctl stop grafana-server
|
||||||
|
systemctl stop influxdb
|
||||||
|
msg_ok "Stopped $APP"
|
||||||
|
|
||||||
|
if [[ ! -f /opt/garmin-grafana/.env ]]; then
|
||||||
|
msg_error "No .env file found in /opt/garmin-grafana/.env"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
source /opt/garmin-grafana/.env
|
||||||
|
if [[ -z "${INFLUXDB_USER}" || -z "${INFLUXDB_PASSWORD}" || -z "${INFLUXDB_NAME}" ]]; then
|
||||||
|
msg_error "INFLUXDB_USER, INFLUXDB_PASSWORD, or INFLUXDB_NAME not set in .env file"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg_info "Creating Backup"
|
||||||
|
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/garmin-grafana/.garminconnect /opt/garmin-grafana/.env
|
||||||
|
mv /opt/garmin-grafana/ /opt/garmin-grafana-backup/
|
||||||
|
msg_ok "Backup Created"
|
||||||
|
|
||||||
|
msg_info "Updating $APP to v${RELEASE}"
|
||||||
|
curl -fsSL -o "${RELEASE}.zip" "https://github.com/arpanghosh8453/garmin-grafana/archive/refs/tags/${RELEASE}.zip"
|
||||||
|
unzip -q "${RELEASE}.zip"
|
||||||
|
mv "garmin-grafana-${RELEASE}/" "/opt/garmin-grafana"
|
||||||
|
rm -f "${RELEASE}.zip"
|
||||||
|
$STD uv sync --locked --project /opt/garmin-grafana/
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
sed -i 's/\${DS_GARMIN_STATS}/garmin_influxdb/g' /opt/garmin-grafana/Grafana_Dashboard/Garmin-Grafana-Dashboard.json
|
||||||
|
sed -i 's/influxdb:8086/localhost:8086/' /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml
|
||||||
|
sed -i "s/influxdb_user/${INFLUXDB_USER}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml
|
||||||
|
sed -i "s/influxdb_secret_password/${INFLUXDB_PASSWORD}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml
|
||||||
|
sed -i "s/GarminStats/${INFLUXDB_NAME}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml
|
||||||
|
# Copy across grafana data
|
||||||
|
cp -r /opt/garmin-grafana/Grafana_Datasource/* /etc/grafana/provisioning/datasources
|
||||||
|
cp -r /opt/garmin-grafana/Grafana_Dashboard/* /etc/grafana/provisioning/dashboards
|
||||||
|
# Copy back the env and token files
|
||||||
|
cp /opt/garmin-grafana-backup/.env /opt/garmin-grafana/.env
|
||||||
|
cp -r /opt/garmin-grafana-backup/.garminconnect /opt/garmin-grafana/.garminconnect
|
||||||
|
msg_ok "Updated $APP to v${RELEASE}"
|
||||||
|
|
||||||
|
msg_info "Starting $APP"
|
||||||
|
systemctl start garmin-grafana
|
||||||
|
systemctl start grafana-server
|
||||||
|
systemctl start influxdb
|
||||||
|
msg_ok "Started $APP"
|
||||||
|
|
||||||
|
msg_info "Cleaning Up"
|
||||||
|
rm -rf /opt/garmin-grafana-backup
|
||||||
|
msg_ok "Cleanup Completed"
|
||||||
|
|
||||||
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||||
|
msg_ok "Update Successful"
|
||||||
|
else
|
||||||
|
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/arpanghosh8453/garmin-grafana/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
|
||||||
if [[ ! -d /opt/garmin-grafana/ ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
|
||||||
msg_info "Stopping $APP"
|
|
||||||
systemctl stop garmin-grafana
|
|
||||||
systemctl stop grafana-server
|
|
||||||
systemctl stop influxdb
|
|
||||||
msg_ok "Stopped $APP"
|
|
||||||
|
|
||||||
if [[ ! -f /opt/garmin-grafana/.env ]]; then
|
|
||||||
msg_error "No .env file found in /opt/garmin-grafana/.env"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
source /opt/garmin-grafana/.env
|
|
||||||
if [[ -z "${INFLUXDB_USER}" || -z "${INFLUXDB_PASSWORD}" || -z "${INFLUXDB_NAME}" ]]; then
|
|
||||||
msg_error "INFLUXDB_USER, INFLUXDB_PASSWORD, or INFLUXDB_NAME not set in .env file"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg_info "Creating Backup"
|
|
||||||
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/garmin-grafana/.garminconnect /opt/garmin-grafana/.env
|
|
||||||
mv /opt/garmin-grafana/ /opt/garmin-grafana-backup/
|
|
||||||
msg_ok "Backup Created"
|
|
||||||
|
|
||||||
msg_info "Updating $APP to v${RELEASE}"
|
|
||||||
curl -fsSL -o "${RELEASE}.zip" "https://github.com/arpanghosh8453/garmin-grafana/archive/refs/tags/${RELEASE}.zip"
|
|
||||||
unzip -q "${RELEASE}.zip"
|
|
||||||
mv "garmin-grafana-${RELEASE}/" "/opt/garmin-grafana"
|
|
||||||
rm -f "${RELEASE}.zip"
|
|
||||||
$STD uv sync --locked --project /opt/garmin-grafana/
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
sed -i 's/\${DS_GARMIN_STATS}/garmin_influxdb/g' /opt/garmin-grafana/Grafana_Dashboard/Garmin-Grafana-Dashboard.json
|
|
||||||
sed -i 's/influxdb:8086/localhost:8086/' /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml
|
|
||||||
sed -i "s/influxdb_user/${INFLUXDB_USER}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml
|
|
||||||
sed -i "s/influxdb_secret_password/${INFLUXDB_PASSWORD}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml
|
|
||||||
sed -i "s/GarminStats/${INFLUXDB_NAME}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml
|
|
||||||
# Copy across grafana data
|
|
||||||
cp -r /opt/garmin-grafana/Grafana_Datasource/* /etc/grafana/provisioning/datasources
|
|
||||||
cp -r /opt/garmin-grafana/Grafana_Dashboard/* /etc/grafana/provisioning/dashboards
|
|
||||||
# Copy back the env and token files
|
|
||||||
cp /opt/garmin-grafana-backup/.env /opt/garmin-grafana/.env
|
|
||||||
cp -r /opt/garmin-grafana-backup/.garminconnect /opt/garmin-grafana/.garminconnect
|
|
||||||
msg_ok "Updated $APP to v${RELEASE}"
|
|
||||||
|
|
||||||
msg_info "Starting $APP"
|
|
||||||
systemctl start garmin-grafana
|
|
||||||
systemctl start grafana-server
|
|
||||||
systemctl start influxdb
|
|
||||||
msg_ok "Started $APP"
|
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
|
||||||
rm -rf /opt/garmin-grafana-backup
|
|
||||||
msg_ok "Cleanup Completed"
|
|
||||||
|
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
|
||||||
msg_ok "Update Successful"
|
|
||||||
else
|
|
||||||
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -17,56 +17,56 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -f /opt/ghostfolio/dist/apps/api/main.js ]]; then
|
if [[ ! -f /opt/ghostfolio/dist/apps/api/main.js ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
|
|
||||||
msg_info "Stopping $APP"
|
|
||||||
systemctl stop ghostfolio
|
|
||||||
msg_ok "Stopped $APP"
|
|
||||||
|
|
||||||
msg_info "Creating Backup"
|
|
||||||
tar -czf "/opt/ghostfolio_backup_$(date +%F).tar.gz" /opt/ghostfolio
|
|
||||||
msg_ok "Backup Created"
|
|
||||||
|
|
||||||
msg_info "Updating $APP"
|
|
||||||
systemctl stop ghostfolio
|
|
||||||
|
|
||||||
if [[ -d /opt/ghostfolio ]]; then
|
|
||||||
rm -rf /opt/ghostfolio_backup
|
|
||||||
mv /opt/ghostfolio /opt/ghostfolio_backup
|
|
||||||
fi
|
|
||||||
|
|
||||||
if fetch_and_deploy_gh_release "ghostfolio" "ghostfolio/ghostfolio" "tarball" "latest" "/opt/ghostfolio"; then
|
|
||||||
cd /opt/ghostfolio
|
|
||||||
npm ci
|
|
||||||
npm run build:production
|
|
||||||
npx prisma migrate deploy
|
|
||||||
msg_ok "Updated $APP"
|
|
||||||
else
|
|
||||||
if [[ -d /opt/ghostfolio_backup ]]; then
|
|
||||||
rm -rf /opt/ghostfolio
|
|
||||||
mv /opt/ghostfolio_backup /opt/ghostfolio
|
|
||||||
fi
|
fi
|
||||||
msg_ok "No update required or update failed. ${APP} is up to date"
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg_info "Starting $APP"
|
msg_info "Stopping $APP"
|
||||||
systemctl start ghostfolio
|
systemctl stop ghostfolio
|
||||||
msg_ok "Started $APP"
|
msg_ok "Stopped $APP"
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
msg_info "Creating Backup"
|
||||||
npm cache clean --force
|
tar -czf "/opt/ghostfolio_backup_$(date +%F).tar.gz" /opt/ghostfolio
|
||||||
msg_ok "Cleanup Completed"
|
msg_ok "Backup Created"
|
||||||
exit
|
|
||||||
|
msg_info "Updating $APP"
|
||||||
|
systemctl stop ghostfolio
|
||||||
|
|
||||||
|
if [[ -d /opt/ghostfolio ]]; then
|
||||||
|
rm -rf /opt/ghostfolio_backup
|
||||||
|
mv /opt/ghostfolio /opt/ghostfolio_backup
|
||||||
|
fi
|
||||||
|
|
||||||
|
if fetch_and_deploy_gh_release "ghostfolio" "ghostfolio/ghostfolio" "tarball" "latest" "/opt/ghostfolio"; then
|
||||||
|
cd /opt/ghostfolio
|
||||||
|
npm ci
|
||||||
|
npm run build:production
|
||||||
|
npx prisma migrate deploy
|
||||||
|
msg_ok "Updated $APP"
|
||||||
|
else
|
||||||
|
if [[ -d /opt/ghostfolio_backup ]]; then
|
||||||
|
rm -rf /opt/ghostfolio
|
||||||
|
mv /opt/ghostfolio_backup /opt/ghostfolio
|
||||||
|
fi
|
||||||
|
msg_ok "No update required or update failed. ${APP} is up to date"
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg_info "Starting $APP"
|
||||||
|
systemctl start ghostfolio
|
||||||
|
msg_ok "Started $APP"
|
||||||
|
|
||||||
|
msg_info "Cleaning Up"
|
||||||
|
npm cache clean --force
|
||||||
|
msg_ok "Cleanup Completed"
|
||||||
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -16,21 +16,21 @@ var_version="${var_version:-12}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -f /usr/sbin/globaleaks ]]; then
|
if [[ ! -f /usr/sbin/globaleaks ]]; then
|
||||||
msg_error "No ${APP} installation found!"
|
msg_error "No ${APP} installation found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "Updating $APP LXC"
|
msg_info "Updating $APP LXC"
|
||||||
$STD apt-get update
|
$STD apt-get update
|
||||||
$STD apt-get -y upgrade
|
$STD apt-get -y upgrade
|
||||||
msg_ok "Updated $APP LXC"
|
msg_ok "Updated $APP LXC"
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,39 +17,39 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /opt/joplin-server ]]; then
|
if [[ ! -d /opt/joplin-server ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if check_for_gh_release "joplin-server" "laurent22/joplin"; then
|
||||||
|
msg_info "Stopping Services"
|
||||||
|
systemctl stop joplin-server
|
||||||
|
msg_ok "Stopped Services"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "joplin-server" "laurent22/joplin" "tarball" "latest"
|
||||||
|
|
||||||
|
msg_info "Updating ${APP}"
|
||||||
|
cd /opt/joplin-server
|
||||||
|
sed -i "/onenote-converter/d" packages/lib/package.json
|
||||||
|
$STD yarn config set --home enableTelemetry 0
|
||||||
|
export BUILD_SEQUENCIAL=1
|
||||||
|
$STD yarn install --inline-builds
|
||||||
|
msg_ok "Updated $APP"
|
||||||
|
|
||||||
|
msg_info "Starting Services"
|
||||||
|
systemctl start joplin-server
|
||||||
|
msg_ok "Started Services"
|
||||||
|
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
|
|
||||||
if check_for_gh_release "joplin-server" "laurent22/joplin"; then
|
|
||||||
msg_info "Stopping Services"
|
|
||||||
systemctl stop joplin-server
|
|
||||||
msg_ok "Stopped Services"
|
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "joplin-server" "laurent22/joplin" "tarball" "latest"
|
|
||||||
|
|
||||||
msg_info "Updating ${APP}"
|
|
||||||
cd /opt/joplin-server
|
|
||||||
sed -i "/onenote-converter/d" packages/lib/package.json
|
|
||||||
$STD yarn config set --home enableTelemetry 0
|
|
||||||
export BUILD_SEQUENCIAL=1
|
|
||||||
$STD yarn install --inline-builds
|
|
||||||
msg_ok "Updated $APP"
|
|
||||||
|
|
||||||
msg_info "Starting Services"
|
|
||||||
systemctl start joplin-server
|
|
||||||
msg_ok "Started Services"
|
|
||||||
|
|
||||||
msg_ok "Updated Successfully"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,39 +17,39 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -d /opt/leantime ]]; then
|
if [[ ! -d /opt/leantime ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if check_for_gh_release "leantime" "Leantime/leantime"; then
|
||||||
|
msg_info "Creating Backup"
|
||||||
|
mariadb-dump leantime >"/opt/${APP}_db_backup_$(date +%F).sql"
|
||||||
|
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" "/opt/${APP}"
|
||||||
|
mv /opt/leantime /opt/leantime_bak
|
||||||
|
msg_ok "Backup Created"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "leantime" "Leantime/leantime" "prebuild" "latest" "/opt/leantime" Leantime*.tar.gz
|
||||||
|
|
||||||
|
msg_info "Restoring Config & Permissions"
|
||||||
|
mv /opt/leantime_bak/config/.env /opt/leantime/config/.env
|
||||||
|
chown -R www-data:www-data "/opt/leantime"
|
||||||
|
chmod -R 750 "/opt/leantime"
|
||||||
|
msg_ok "Restored Config & Permissions"
|
||||||
|
|
||||||
|
msg_info "Removing Backup"
|
||||||
|
rm -rf /opt/leantime_bak
|
||||||
|
msg_ok "Removed Backup"
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
|
|
||||||
if check_for_gh_release "leantime" "Leantime/leantime"; then
|
|
||||||
msg_info "Creating Backup"
|
|
||||||
mariadb-dump leantime >"/opt/${APP}_db_backup_$(date +%F).sql"
|
|
||||||
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" "/opt/${APP}"
|
|
||||||
mv /opt/leantime /opt/leantime_bak
|
|
||||||
msg_ok "Backup Created"
|
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "leantime" "Leantime/leantime" "prebuild" "latest" "/opt/leantime" Leantime*.tar.gz
|
|
||||||
|
|
||||||
msg_info "Restoring Config & Permissions"
|
|
||||||
mv /opt/leantime_bak/config/.env /opt/leantime/config/.env
|
|
||||||
chown -R www-data:www-data "/opt/leantime"
|
|
||||||
chmod -R 750 "/opt/leantime"
|
|
||||||
msg_ok "Restored Config & Permissions"
|
|
||||||
|
|
||||||
msg_info "Removing Backup"
|
|
||||||
rm -rf /opt/leantime_bak
|
|
||||||
msg_ok "Removed Backup"
|
|
||||||
msg_ok "Updated Successfully"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,38 +17,38 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -f /opt/livebook/.mix/escripts/livebook ]]; then
|
if [[ ! -f /opt/livebook/.mix/escripts/livebook ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
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
|
||||||
exit
|
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
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,35 +17,35 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "UPDATE MODE" --radiolist --cancel-button Exit-Script "Spacebar = Select" 14 60 2 \
|
UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "UPDATE MODE" --radiolist --cancel-button Exit-Script "Spacebar = Select" 14 60 2 \
|
||||||
"1" "Check for Alpine Updates" OFF \
|
"1" "Check for Alpine Updates" OFF \
|
||||||
"2" "Update NPMplus Docker Container" ON \
|
"2" "Update NPMplus Docker Container" ON \
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
|
|
||||||
case "$UPD" in
|
case "$UPD" in
|
||||||
"1")
|
"1")
|
||||||
msg_info "Updating Alpine OS"
|
msg_info "Updating Alpine OS"
|
||||||
$STD apk -U upgrade
|
$STD apk -U upgrade
|
||||||
msg_ok "System updated"
|
msg_ok "System updated"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
"2")
|
"2")
|
||||||
msg_info "Updating NPMplus Container"
|
msg_info "Updating NPMplus Container"
|
||||||
cd /opt
|
cd /opt
|
||||||
msg_info "Pulling latest container image"
|
msg_info "Pulling latest container image"
|
||||||
$STD docker compose pull
|
$STD docker compose pull
|
||||||
msg_info "Recreating container"
|
msg_info "Recreating container"
|
||||||
$STD docker compose up -d
|
$STD docker compose up -d
|
||||||
msg_ok "NPMplus container updated"
|
msg_ok "NPMplus container updated"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
@ -30,7 +30,7 @@ function update_script() {
|
|||||||
|
|
||||||
if grep -q 'Debian GNU/Linux 12' /etc/os-release && [ -f /etc/apt/sources.list.d/proxmox-release-bookworm.list ] && [ -f /etc/apt/sources.list.d/pdm-test.list ]; then
|
if grep -q 'Debian GNU/Linux 12' /etc/os-release && [ -f /etc/apt/sources.list.d/proxmox-release-bookworm.list ] && [ -f /etc/apt/sources.list.d/pdm-test.list ]; then
|
||||||
msg_info "Updating outdated outdated source formats"
|
msg_info "Updating outdated outdated source formats"
|
||||||
echo "deb [signed-by=/usr/share/keyrings/proxmox-archive-keyring.gpg] http://download.proxmox.com/debian/pdm bookworm pdm-test" > /etc/apt/sources.list.d/pdm-test.list
|
echo "deb [signed-by=/usr/share/keyrings/proxmox-archive-keyring.gpg] http://download.proxmox.com/debian/pdm bookworm pdm-test" >/etc/apt/sources.list.d/pdm-test.list
|
||||||
curl -fsSL https://enterprise.proxmox.com/debian/proxmox-archive-keyring-trixie.gpg -o /usr/share/keyrings/proxmox-archive-keyring.gpg
|
curl -fsSL https://enterprise.proxmox.com/debian/proxmox-archive-keyring-trixie.gpg -o /usr/share/keyrings/proxmox-archive-keyring.gpg
|
||||||
rm -f /etc/apt/keyrings/proxmox-release-bookworm.gpg /etc/apt/sources.list.d/proxmox-release-bookworm.list
|
rm -f /etc/apt/keyrings/proxmox-release-bookworm.gpg /etc/apt/sources.list.d/proxmox-release-bookworm.list
|
||||||
$STD apt-get update
|
$STD apt-get update
|
||||||
|
76
ct/romm.sh
76
ct/romm.sh
@ -18,48 +18,48 @@ var_fuse="${var_fuse:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -d /opt/romm ]]; then
|
if [[ ! -d /opt/romm ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg_info "Stopping $APP"
|
||||||
|
systemctl stop romm
|
||||||
|
systemctl stop nginx
|
||||||
|
msg_ok "Stopped $APP"
|
||||||
|
|
||||||
|
msg_info "Updating $APP"
|
||||||
|
cd /opt/romm/app
|
||||||
|
git pull
|
||||||
|
|
||||||
|
# Update backend
|
||||||
|
cd /opt/romm/app
|
||||||
|
source /opt/romm/venv/bin/activate
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install poetry
|
||||||
|
poetry install
|
||||||
|
|
||||||
|
# Update frontend
|
||||||
|
cd /opt/romm/app/frontend
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
echo "Updated on $(date)" >/opt/romm/version.txt
|
||||||
|
msg_ok "Updated $APP"
|
||||||
|
|
||||||
|
msg_info "Starting $APP"
|
||||||
|
systemctl start romm
|
||||||
|
systemctl start nginx
|
||||||
|
msg_ok "Started $APP"
|
||||||
|
msg_ok "Update Successful"
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
|
|
||||||
msg_info "Stopping $APP"
|
|
||||||
systemctl stop romm
|
|
||||||
systemctl stop nginx
|
|
||||||
msg_ok "Stopped $APP"
|
|
||||||
|
|
||||||
msg_info "Updating $APP"
|
|
||||||
cd /opt/romm/app
|
|
||||||
git pull
|
|
||||||
|
|
||||||
# Update backend
|
|
||||||
cd /opt/romm/app
|
|
||||||
source /opt/romm/venv/bin/activate
|
|
||||||
pip install --upgrade pip
|
|
||||||
pip install poetry
|
|
||||||
poetry install
|
|
||||||
|
|
||||||
# Update frontend
|
|
||||||
cd /opt/romm/app/frontend
|
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
echo "Updated on $(date)" >/opt/romm/version.txt
|
|
||||||
msg_ok "Updated $APP"
|
|
||||||
|
|
||||||
msg_info "Starting $APP"
|
|
||||||
systemctl start romm
|
|
||||||
systemctl start nginx
|
|
||||||
msg_ok "Started $APP"
|
|
||||||
msg_ok "Update Successful"
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -17,7 +17,7 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -17,40 +17,40 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -d /opt/scraparr/ ]]; then
|
if [[ ! -d /opt/scraparr/ ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
if check_for_gh_release "scraparr" "thecfu/scraparr"; then
|
||||||
|
msg_info "Stopping Services"
|
||||||
|
systemctl stop scraparr
|
||||||
|
msg_ok "Services Stopped"
|
||||||
|
|
||||||
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
|
fetch_and_deploy_gh_release "scrappar" "thecfu/scraparr" "tarball" "latest" "/opt/scraparr"
|
||||||
|
|
||||||
|
msg_info "Updating Scraparr"
|
||||||
|
cd /opt/scraparr
|
||||||
|
$STD uv venv /opt/scraparr/.venv
|
||||||
|
$STD /opt/scraparr/.venv/bin/python -m ensurepip --upgrade
|
||||||
|
$STD /opt/scraparr/.venv/bin/python -m pip install --upgrade pip
|
||||||
|
$STD /opt/scraparr/.venv/bin/python -m pip install -r /opt/scraparr/src/scraparr/requirements.txt
|
||||||
|
chmod -R 755 /opt/scraparr
|
||||||
|
msg_ok "Updated Scraparr"
|
||||||
|
|
||||||
|
msg_info "Starting Services"
|
||||||
|
systemctl start scraparr
|
||||||
|
msg_ok "Services Started"
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
if check_for_gh_release "scraparr" "thecfu/scraparr"; then
|
|
||||||
msg_info "Stopping Services"
|
|
||||||
systemctl stop scraparr
|
|
||||||
msg_ok "Services Stopped"
|
|
||||||
|
|
||||||
PYTHON_VERSION="3.12" setup_uv
|
|
||||||
fetch_and_deploy_gh_release "scrappar" "thecfu/scraparr" "tarball" "latest" "/opt/scraparr"
|
|
||||||
|
|
||||||
msg_info "Updating Scraparr"
|
|
||||||
cd /opt/scraparr
|
|
||||||
$STD uv venv /opt/scraparr/.venv
|
|
||||||
$STD /opt/scraparr/.venv/bin/python -m ensurepip --upgrade
|
|
||||||
$STD /opt/scraparr/.venv/bin/python -m pip install --upgrade pip
|
|
||||||
$STD /opt/scraparr/.venv/bin/python -m pip install -r /opt/scraparr/src/scraparr/requirements.txt
|
|
||||||
chmod -R 755 /opt/scraparr
|
|
||||||
msg_ok "Updated Scraparr"
|
|
||||||
|
|
||||||
msg_info "Starting Services"
|
|
||||||
systemctl start scraparr
|
|
||||||
msg_ok "Services Started"
|
|
||||||
msg_ok "Updated Successfully"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
64
ct/signoz.sh
64
ct/signoz.sh
@ -17,41 +17,41 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /opt/signoz ]]; then
|
if [[ ! -d /opt/signoz ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if check_for_gh_release "signoz" "SigNoz/signoz"; then
|
||||||
|
msg_info "Stopping Services"
|
||||||
|
systemctl stop signoz
|
||||||
|
systemctl stop signoz-otel-collector
|
||||||
|
msg_ok "Stopped Services"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "signoz" "SigNoz/signoz" "prebuild" "latest" "/opt/signoz" "signoz-community_linux_amd64.tar.gz"
|
||||||
|
fetch_and_deploy_gh_release "signoz-otel-collector" "SigNoz/signoz-otel-collector" "prebuild" "latest" "/opt/signoz-otel-collector" "signoz-otel-collector_linux_amd64.tar.gz"
|
||||||
|
fetch_and_deploy_gh_release "signoz-schema-migrator" "SigNoz/signoz-otel-collector" "prebuild" "latest" "/opt/signoz-schema-migrator" "signoz-schema-migrator_linux_amd64.tar.gz"
|
||||||
|
|
||||||
|
msg_info "Updating ${APP}"
|
||||||
|
cd /opt/signoz-schema-migrator/bin
|
||||||
|
$STD ./signoz-schema-migrator sync --dsn="tcp://localhost:9000?password=" --replication=true --up=
|
||||||
|
$STD ./signoz-schema-migrator async --dsn="tcp://localhost:9000?password=" --replication=true --up=
|
||||||
|
msg_ok "Updated $APP"
|
||||||
|
|
||||||
|
msg_info "Starting Services"
|
||||||
|
systemctl start signoz-otel-collector
|
||||||
|
systemctl start signoz
|
||||||
|
msg_ok "Started Services"
|
||||||
|
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
|
|
||||||
if check_for_gh_release "signoz" "SigNoz/signoz"; then
|
|
||||||
msg_info "Stopping Services"
|
|
||||||
systemctl stop signoz
|
|
||||||
systemctl stop signoz-otel-collector
|
|
||||||
msg_ok "Stopped Services"
|
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "signoz" "SigNoz/signoz" "prebuild" "latest" "/opt/signoz" "signoz-community_linux_amd64.tar.gz"
|
|
||||||
fetch_and_deploy_gh_release "signoz-otel-collector" "SigNoz/signoz-otel-collector" "prebuild" "latest" "/opt/signoz-otel-collector" "signoz-otel-collector_linux_amd64.tar.gz"
|
|
||||||
fetch_and_deploy_gh_release "signoz-schema-migrator" "SigNoz/signoz-otel-collector" "prebuild" "latest" "/opt/signoz-schema-migrator" "signoz-schema-migrator_linux_amd64.tar.gz"
|
|
||||||
|
|
||||||
msg_info "Updating ${APP}"
|
|
||||||
cd /opt/signoz-schema-migrator/bin
|
|
||||||
$STD ./signoz-schema-migrator sync --dsn="tcp://localhost:9000?password=" --replication=true --up=
|
|
||||||
$STD ./signoz-schema-migrator async --dsn="tcp://localhost:9000?password=" --replication=true --up=
|
|
||||||
msg_ok "Updated $APP"
|
|
||||||
|
|
||||||
msg_info "Starting Services"
|
|
||||||
systemctl start signoz-otel-collector
|
|
||||||
systemctl start signoz
|
|
||||||
msg_ok "Started Services"
|
|
||||||
|
|
||||||
msg_ok "Updated Successfully"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
90
ct/tunarr.sh
90
ct/tunarr.sh
@ -17,53 +17,53 @@ var_unprivileged="${var_unprivileged:-1}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /opt/tunarr ]]; then
|
if [[ ! -d /opt/tunarr ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
if check_for_gh_release "tunarr" "chrisbenincasa/tunarr"; then
|
||||||
|
msg_info "Stopping ${APP}"
|
||||||
|
systemctl stop tunarr
|
||||||
|
msg_ok "Stopped ${APP}"
|
||||||
|
|
||||||
|
msg_info "Creating Backup"
|
||||||
|
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /usr/.local/share/tunarr
|
||||||
|
msg_ok "Backup Created"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "tunarr" "chrisbenincasa/tunarr" "singlefile" "latest" "/opt/tunarr" "*linux-x64"
|
||||||
|
|
||||||
|
msg_info "Starting ${APP}"
|
||||||
|
systemctl start tunarr
|
||||||
|
msg_ok "Started ${APP}"
|
||||||
|
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if check_for_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg"; then
|
||||||
|
msg_info "Stopping ${APP}"
|
||||||
|
systemctl stop tunarr
|
||||||
|
msg_ok "Stopped ${APP}"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg" "prebuild" "latest" "/opt/ErsatzTV-ffmpeg" "*-linux64-gpl-7.1.tar.xz"
|
||||||
|
|
||||||
|
msg_info "Set ErsatzTV-ffmpeg links"
|
||||||
|
chmod +x /opt/ErsatzTV-ffmpeg/bin/*
|
||||||
|
ln -sf /opt/ErsatzTV-ffmpeg/bin/ffmpeg /usr/local/bin/ffmpeg
|
||||||
|
ln -sf /opt/ErsatzTV-ffmpeg/bin/ffplay /usr/local/bin/ffplay
|
||||||
|
ln -sf /opt/ErsatzTV-ffmpeg/bin/ffprobe /usr/local/bin/ffprobe
|
||||||
|
msg_ok "ffmpeg links set"
|
||||||
|
|
||||||
|
msg_info "Starting ${APP}"
|
||||||
|
systemctl start tunarr
|
||||||
|
msg_ok "Started ${APP}"
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
if check_for_gh_release "tunarr" "chrisbenincasa/tunarr"; then
|
|
||||||
msg_info "Stopping ${APP}"
|
|
||||||
systemctl stop tunarr
|
|
||||||
msg_ok "Stopped ${APP}"
|
|
||||||
|
|
||||||
msg_info "Creating Backup"
|
|
||||||
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /usr/.local/share/tunarr
|
|
||||||
msg_ok "Backup Created"
|
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "tunarr" "chrisbenincasa/tunarr" "singlefile" "latest" "/opt/tunarr" "*linux-x64"
|
|
||||||
|
|
||||||
msg_info "Starting ${APP}"
|
|
||||||
systemctl start tunarr
|
|
||||||
msg_ok "Started ${APP}"
|
|
||||||
|
|
||||||
msg_ok "Updated Successfully"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if check_for_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg"; then
|
|
||||||
msg_info "Stopping ${APP}"
|
|
||||||
systemctl stop tunarr
|
|
||||||
msg_ok "Stopped ${APP}"
|
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg" "prebuild" "latest" "/opt/ErsatzTV-ffmpeg" "*-linux64-gpl-7.1.tar.xz"
|
|
||||||
|
|
||||||
msg_info "Set ErsatzTV-ffmpeg links"
|
|
||||||
chmod +x /opt/ErsatzTV-ffmpeg/bin/*
|
|
||||||
ln -sf /opt/ErsatzTV-ffmpeg/bin/ffmpeg /usr/local/bin/ffmpeg
|
|
||||||
ln -sf /opt/ErsatzTV-ffmpeg/bin/ffplay /usr/local/bin/ffplay
|
|
||||||
ln -sf /opt/ErsatzTV-ffmpeg/bin/ffprobe /usr/local/bin/ffprobe
|
|
||||||
msg_ok "ffmpeg links set"
|
|
||||||
|
|
||||||
msg_info "Starting ${APP}"
|
|
||||||
systemctl start tunarr
|
|
||||||
msg_ok "Started ${APP}"
|
|
||||||
msg_ok "Updated Successfully"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -19,7 +19,7 @@ var_unprivileged="${var_unprivileged:-0}"
|
|||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
@ -14,18 +14,18 @@ header_info "$APP"
|
|||||||
|
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -f /etc/systemd/system/viseron.service ]]; then
|
if [[ ! -f /etc/systemd/system/viseron.service ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
msg_error "To update Viseron, create a new container and transfer your configuration."
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
msg_error "To update Viseron, create a new container and transfer your configuration."
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
@ -22,7 +22,7 @@ base_settings
|
|||||||
# Core
|
# Core
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
init_error_traps
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user