%PDF- %PDF-
| Direktori : /var/lib/dpkg/info/ |
| Current 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