Removed header,
Fixed discopanel.sh indent Fixed source
This commit is contained in:
parent
52de32f56e
commit
9b80646c04
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
# Author: DragoQC
|
# Author: DragoQC
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
@ -20,56 +20,56 @@ color
|
|||||||
catch_errors
|
catch_errors
|
||||||
|
|
||||||
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/discopanel" ]]; then
|
if [[ ! -d "/opt/discopanel" ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LATEST=$(curl -fsSL https://api.github.com/repos/nickheyer/discopanel/releases/latest \
|
LATEST=$(curl -fsSL https://api.github.com/repos/nickheyer/discopanel/releases/latest \
|
||||||
grep '"tag_name":' | cut -d'"' -f4)
|
grep '"tag_name":' | cut -d'"' -f4)
|
||||||
|
|
||||||
CURRENT=$(cat /opt/${APP}_version.txt 2>/dev/null || echo "none")
|
CURRENT=$(cat /opt/${APP}_version.txt 2>/dev/null || echo "none")
|
||||||
|
|
||||||
if [[ "$LATEST" == "$CURRENT" ]]; then
|
if [[ "$LATEST" == "$CURRENT" ]]; then
|
||||||
msg_ok "${APP} is already at ${LATEST}"
|
msg_ok "${APP} is already at ${LATEST}"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "Updating ${APP} from ${CURRENT} → ${LATEST}"
|
msg_info "Updating ${APP} from ${CURRENT} → ${LATEST}"
|
||||||
|
|
||||||
systemctl stop "${APP}"
|
systemctl stop "${APP}"
|
||||||
|
|
||||||
msg_info "Creating Backup"
|
msg_info "Creating Backup"
|
||||||
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" "/opt/${APP}"
|
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" "/opt/${APP}"
|
||||||
msg_ok "Backup Created"
|
msg_ok "Backup Created"
|
||||||
|
|
||||||
rm -rf /opt/${APP}
|
rm -rf /opt/${APP}
|
||||||
|
|
||||||
msg_info "Downloading ${APP} ${LATEST}"
|
msg_info "Downloading ${APP} ${LATEST}"
|
||||||
git clone --branch "$LATEST" --depth 1 \
|
git clone --branch "$LATEST" --depth 1 \
|
||||||
https://github.com/nickheyer/discopanel.git \
|
https://github.com/nickheyer/discopanel.git \
|
||||||
/opt/${APP}
|
/opt/${APP}
|
||||||
msg_ok "Downloaded ${APP} ${LATEST}"
|
msg_ok "Downloaded ${APP} ${LATEST}"
|
||||||
|
|
||||||
|
|
||||||
msg_info "Building frontend"
|
msg_info "Building frontend"
|
||||||
cd /opt/${APP}/web/discopanel || exit
|
cd /opt/${APP}/web/discopanel || exit
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
msg_ok "Frontend Built"
|
msg_ok "Frontend Built"
|
||||||
|
|
||||||
msg_info "Building backend"
|
msg_info "Building backend"
|
||||||
cd /opt/${APP} || exit
|
cd /opt/${APP} || exit
|
||||||
go build -o discopanel cmd/discopanel/main.go
|
go build -o discopanel cmd/discopanel/main.go
|
||||||
msg_ok "Backend Built"
|
msg_ok "Backend Built"
|
||||||
|
|
||||||
echo "$LATEST" >/opt/${APP}_version.txt
|
echo "$LATEST" >/opt/${APP}_version.txt
|
||||||
|
|
||||||
systemctl start "${APP}"
|
systemctl start "${APP}"
|
||||||
msg_ok "Update Successful → now at ${LATEST}"
|
msg_ok "Update Successful → now at ${LATEST}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
_________ _ ____
|
|
||||||
/ __ \(_)_________ ____ / __ \____ __________ __
|
|
||||||
/ / / / / ___/ ___/ __ \ / /_/ / __ \/ __ / _ \/ /
|
|
||||||
/ /_/ / (__ \ / |_ | /_/ / / ___/ /_/ / / / / ___/ /
|
|
||||||
/_____/\/____/ \___| \___/ /__/ /___, _/_/ /_/\____/_/
|
|
||||||
Loading…
x
Reference in New Issue
Block a user