mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-12-14 11:13:27 +01:00
[HOTFIX] NetVisor: backup OIDC config before update (#9895)
This commit is contained in:
@ -36,6 +36,9 @@ function update_script() {
|
|||||||
|
|
||||||
msg_info "Backing up configurations"
|
msg_info "Backing up configurations"
|
||||||
cp /opt/netvisor/.env /opt/netvisor.env.bak
|
cp /opt/netvisor/.env /opt/netvisor.env.bak
|
||||||
|
if [[ -f /opt/netvisor/oidc.toml ]]; then
|
||||||
|
cp /opt/netvisor/oidc.toml /opt/netvisor.oidc.toml
|
||||||
|
fi
|
||||||
msg_ok "Backed up configurations"
|
msg_ok "Backed up configurations"
|
||||||
|
|
||||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "netvisor" "netvisor-io/netvisor" "tarball" "latest" "/opt/netvisor"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "netvisor" "netvisor-io/netvisor" "tarball" "latest" "/opt/netvisor"
|
||||||
@ -49,7 +52,10 @@ function update_script() {
|
|||||||
TOOLCHAIN="$(grep "channel" /opt/netvisor/backend/rust-toolchain.toml | awk -F\" '{print $2}')"
|
TOOLCHAIN="$(grep "channel" /opt/netvisor/backend/rust-toolchain.toml | awk -F\" '{print $2}')"
|
||||||
RUST_TOOLCHAIN=$TOOLCHAIN setup_rust
|
RUST_TOOLCHAIN=$TOOLCHAIN setup_rust
|
||||||
|
|
||||||
cp /opt/netvisor.env.bak /opt/netvisor/.env
|
mv /opt/netvisor.env.bak /opt/netvisor/.env
|
||||||
|
if [[ -f /opt/netvisor.oidc.toml ]]; then
|
||||||
|
mv /opt/netvisor.oidc.toml /opt/netvisor/oidc.toml
|
||||||
|
fi
|
||||||
LOCAL_IP="$(hostname -I | awk '{print $1}')"
|
LOCAL_IP="$(hostname -I | awk '{print $1}')"
|
||||||
if ! grep -q "PUBLIC_URL" /opt/netvisor/.env; then
|
if ! grep -q "PUBLIC_URL" /opt/netvisor/.env; then
|
||||||
sed -i "\|_PATH=|a\NETVISOR_PUBLIC_URL=http://${LOCAL_IP}:60072" /opt/netvisor/.env
|
sed -i "\|_PATH=|a\NETVISOR_PUBLIC_URL=http://${LOCAL_IP}:60072" /opt/netvisor/.env
|
||||||
|
|||||||
Reference in New Issue
Block a user