mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-03 20:03:25 +01:00
core: Add config file handling options | Fix Vikunja update with interactive overwrite (#11317)
This commit is contained in:
committed by
GitHub
parent
e1f02bfa77
commit
8e7dc349ac
@@ -46,6 +46,20 @@ function update_script() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if check_for_gh_release "vikunja" "go-vikunja/vikunja"; then
|
if check_for_gh_release "vikunja" "go-vikunja/vikunja"; then
|
||||||
|
echo
|
||||||
|
msg_warn "The package update may include config file changes."
|
||||||
|
echo -e "${TAB}${YW}How do you want to handle /etc/vikunja/config.yml?${CL}"
|
||||||
|
echo -e "${TAB} 1) Keep your current config"
|
||||||
|
echo -e "${TAB} 2) Install the new package maintainer's config"
|
||||||
|
read -rp " Choose [1/2] (default: 1): " -t 60 CONFIG_CHOICE || CONFIG_CHOICE="1"
|
||||||
|
[[ -z "$CONFIG_CHOICE" ]] && CONFIG_CHOICE="1"
|
||||||
|
|
||||||
|
if [[ "$CONFIG_CHOICE" == "2" ]]; then
|
||||||
|
export DPKG_FORCE_CONFNEW="1"
|
||||||
|
else
|
||||||
|
export DPKG_FORCE_CONFOLD="1"
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop vikunja
|
systemctl stop vikunja
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
|
|||||||
@@ -1846,7 +1846,11 @@ function fetch_and_deploy_gh_release() {
|
|||||||
|
|
||||||
chmod 644 "$tmpdir/$filename"
|
chmod 644 "$tmpdir/$filename"
|
||||||
# SYSTEMD_OFFLINE=1 prevents systemd-tmpfiles failures in unprivileged LXC (Debian 13+/systemd 257+)
|
# SYSTEMD_OFFLINE=1 prevents systemd-tmpfiles failures in unprivileged LXC (Debian 13+/systemd 257+)
|
||||||
SYSTEMD_OFFLINE=1 $STD apt install -y "$tmpdir/$filename" || {
|
# Support DPKG_CONFOLD/DPKG_CONFNEW env vars for config file handling during .deb upgrades
|
||||||
|
local dpkg_opts=""
|
||||||
|
[[ "${DPKG_FORCE_CONFOLD:-}" == "1" ]] && dpkg_opts="-o Dpkg::Options::=--force-confold"
|
||||||
|
[[ "${DPKG_FORCE_CONFNEW:-}" == "1" ]] && dpkg_opts="-o Dpkg::Options::=--force-confnew"
|
||||||
|
DEBIAN_FRONTEND=noninteractive SYSTEMD_OFFLINE=1 $STD apt install -y $dpkg_opts "$tmpdir/$filename" || {
|
||||||
SYSTEMD_OFFLINE=1 $STD dpkg -i "$tmpdir/$filename" || {
|
SYSTEMD_OFFLINE=1 $STD dpkg -i "$tmpdir/$filename" || {
|
||||||
msg_error "Both apt and dpkg installation failed"
|
msg_error "Both apt and dpkg installation failed"
|
||||||
rm -rf "$tmpdir"
|
rm -rf "$tmpdir"
|
||||||
|
|||||||
Reference in New Issue
Block a user