
| Current Path : /var/lib/dpkg/info/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/lib/dpkg/info/lxdm.prerm |
#!/bin/sh
# Debian lxdm package pre-removal script
# Based on xdm.prerm
# Copyright 1998-2004 Branden Robinson.
# Licensed under the GNU General Public License, version 2. See the file
# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
# Acknowledgements to Stephen Early, Mark Eichin, and Manoj Srivastava.
set -e
THIS_PACKAGE=lxdm
DAEMON=/usr/bin/lxdm
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
if [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
# disown this question
db_unregister shared/default-x-display-manager
# does the question still exist?
if db_get shared/default-x-display-manager; then
db_metaget shared/default-x-display-manager owners
db_subst shared/default-x-display-manager choices "$RET"
db_get shared/default-x-display-manager
# are we removing the currently selected display manager?
if [ "$THIS_PACKAGE" = "$RET" ]; then
if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
if db_get "$RET"/daemon_name; then
if [ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" = "$RET" ]; then
rm "$DEFAULT_DISPLAY_MANAGER_FILE"
fi
else
if [ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" = "$DAEMON" ]; then
rm "$DEFAULT_DISPLAY_MANAGER_FILE"
fi
fi
fi
# ask the user to choose a new default
db_fset shared/default-x-display-manager seen false
db_input critical shared/default-x-display-manager || true
db_go
# if the display manager file doesn't exist, write it with the path
# to the new default display manager
if [ ! -e $DEFAULT_DISPLAY_MANAGER_FILE ]; then
db_get shared/default-x-display-manager
db_get "$RET"/daemon_name
echo "$RET" > "$DEFAULT_DISPLAY_MANAGER_FILE"
fi
fi
fi
fi
fi
# Remove /etc/lxdm/lxdm.conf from alternative of lxdm configuration
if [ "$1" = "remove" ] ; then
update-alternatives --remove lxdm.conf /etc/lxdm/lxdm.conf
fi
exit 0