HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux host 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: w230 (1248)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/lib/dpkg/info/network-manager.preinst
#!/bin/sh

set -e

# Automatically added by dh_installdeb/13.14.1ubuntu5
dpkg-maintscript-helper rm_conffile /etc/NetworkManager/dispatcher.d/01-ifupdown 1.44.2-2\~ -- "$@"
# End automatically added section
# Automatically added by dh_installsystemd/13.14.1ubuntu5
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then
	deb-systemd-invoke stop 'NetworkManager-dispatcher.service' 'NetworkManager-wait-online.service' 'nm-priv-helper.service' >/dev/null || true
fi
# End automatically added section


DIR="/etc/NetworkManager/system-connections"
BACKUP_DIR="/var/lib/NetworkManager/backups"
CNT=$(ls -1 "$DIR" | wc -l)
if ([ "$1" = "upgrade" ] || [ "$1" = "install" ]) && [ -d "$DIR" ] && [ "$CNT" -ge 1 ]; then
    # create backup directory if it does not yet exist
    mkdir -p "$BACKUP_DIR" || true
    BAK="$BACKUP_DIR/system-connections_$2"
    if [ -d "$BAK" ]; then
	rm -r "$BAK"
    fi
    # copy current system-connections to the backup directory
    cp -r "$DIR" "$BAK"
fi