modified: install.sh

This commit is contained in:
xbl
2026-06-14 14:15:44 +02:00
parent a87533fead
commit d14c268178

View File

@ -81,12 +81,17 @@ download_and_extract() {
wget -qO "$TMP_TAR" "$TAR_URL" || die "Download failed" wget -qO "$TMP_TAR" "$TAR_URL" || die "Download failed"
fi fi
if ! file "$TMP_TAR" | grep -q 'gzip'; then
rm -f "$TMP_TAR"
die "Download failed or URL returned invalid content"
fi
# Preserve existing config if updating # Preserve existing config if updating
if [[ -f "$INSTALL_DIR/qlpycon.conf" ]]; then if [[ -f "$INSTALL_DIR/qlpycon.conf" ]]; then
warn "Existing qlpycon.conf found - keeping it" warn "Existing qlpycon.conf found - keeping it"
tar -xzf "$TMP_TAR" -C "$INSTALL_DIR" --exclude='qlpycon.conf' tar -xzf "$TMP_TAR" -C "$INSTALL_DIR" --exclude='qlpycon.conf' || die "Extraction failed"
else else
tar -xzf "$TMP_TAR" -C "$INSTALL_DIR" tar -xzf "$TMP_TAR" -C "$INSTALL_DIR" || die "Extraction failed"
fi fi
rm -f "$TMP_TAR" rm -f "$TMP_TAR"