mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-06-10 13:16:43 +01:00
Glance: Use separate directory for configuration files (#14906)
* Refactor * FIX
This commit is contained in:
+9
-12
@@ -29,25 +29,22 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if [[ ! -d /opt/glance_data ]]; then
|
||||
msg_info "Creating config directory"
|
||||
mkdir -p /opt/glance_data/
|
||||
cp /opt/glance/*.yml /opt/glance_data/
|
||||
sed -i 's|/opt/glance/glance\.yml|/opt/glance_data/glance.yml|' /etc/systemd/system/glance.service
|
||||
systemctl daemon-reload
|
||||
msg_ok "Created config directory"
|
||||
fi
|
||||
|
||||
if check_for_gh_release "glance" "glanceapp/glance"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop glance
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
if [[ -f /opt/glance/glance.yml ]]; then
|
||||
msg_info "Backing up glance.yml"
|
||||
cp /opt/glance/glance.yml /tmp/glance.yml.bak
|
||||
msg_ok "Backed up glance.yml"
|
||||
fi
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "glance" "glanceapp/glance" "prebuild" "latest" "/opt/glance" "glance-linux-amd64.tar.gz"
|
||||
|
||||
if [[ -f /tmp/glance.yml.bak ]]; then
|
||||
msg_info "Restoring glance.yml"
|
||||
mv /tmp/glance.yml.bak /opt/glance/glance.yml
|
||||
msg_ok "Restored glance.yml"
|
||||
fi
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start glance
|
||||
msg_ok "Started Service"
|
||||
|
||||
Reference in New Issue
Block a user