-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlabel-uninstall
executable file
·46 lines (38 loc) · 1.72 KB
/
label-uninstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh -eu
# This is the uninstall script for gdm when run in a privileged
# container.
#
# The host file system must be mounted at /host
cd /
PATH="/usr/bin:/usr/sbin"
if [ ! -d /host/etc ] || [ ! -d /host/proc ] || [ ! -d /host/run ]; then
echo "gdm-uninstall: host file system is not mounted at /host"
exit 1
fi
if [ "${container:-}" = podman -a -e /run/dbus/system_bus_socket ]; then
systemctl --quiet stop gdm gdm-systemd display-manger gdm-display-manager 2> /dev/null
fi
# removing installed files
if [ -r /host/etc/tmpfiles.d/gdm.conf ]; then
if [ "${container:-}" = podman ]; then
chroot /host /usr/bin/systemd-tmpfiles --remove /etc/tmpfiles.d/gdm.conf
else
systemd-tmpfiles --root=/host --remove /etc/tmpfiles.d/gdm.conf || true
fi
fi
rm -fr /host/{etc/sysconfig/displaymanager,etc/systemd/system/{gdm,gdm-systemd}.service,/etc/gdm,etc/dbus-1/system.d/gdm.conf} /host/etc/userdb/{gdm.group,gdm.user} /host/etc/tmpfiles.d/gdm.conf
if [ -x /host/usr/bin/userdbctl ]; then
USERID=$(chroot /host userdbctl --output classic | grep gdm | cut -d : -f 3)
GROUPID=$(chroot /host userdbctl --output classic | grep gdm | cut -d : -f 4)
rm -f /host/etc/userdb/{$USERID.user,$GROUPID.group}
fi
if [ "${container:-}" = podman -a -e /run/dbus/system_bus_socket ]; then
chroot /host /usr/bin/systemd-sysext unmerge 2>/dev/null
chroot /host /usr/bin/portablectl detach gdm 2>/dev/null
systemctl -q is-active nscd || systemctl --quiet try-reload-or-restart nscd 2> /dev/null
systemctl daemon-reload
systemctl reload dbus
systemctl -q is-active accounts-daemon || systemctl restart accounts-daemon 2>/dev/null
fi
rm -fr /host/var/lib/extensions/gdm /host/var/lib/portables/gdm
# Everything else is settings and should remain