mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
910 B
27 lines
910 B
5 years ago
|
#!/usr/bin/env bash
|
||
6 years ago
|
|
||
|
# Log stdout & stderr
|
||
6 years ago
|
exec > >(tee -i /tmp/gdm3_postsession.log) 2>&1
|
||
6 years ago
|
|
||
|
# Exit immediately if a command exits with a non-zero status.
|
||
|
set -e
|
||
|
|
||
|
# The value of this parameter is expanded like PS1 and the expanded value is the
|
||
|
# prompt printed before the command line is echoed when the -x option is set
|
||
|
# (see The Set Builtin). The first character of the expanded value is replicated
|
||
|
# multiple times, as necessary, to indicate multiple levels of indirection.
|
||
|
# \D{%F %T} prints date like this : 2019-12-31 23:59:59
|
||
|
PS4='-\D{%F %T} '
|
||
|
|
||
|
# Print commands and their arguments as they are executed.
|
||
|
set -x
|
||
|
|
||
5 years ago
|
passwd -d "$USER" ||:
|
||
5 years ago
|
systemctl stop user@1000.service
|
||
|
|
||
|
# Make sure the mountpoints are free
|
||
5 years ago
|
kill $(lsof -t "$HOME" /mnt) $(ps --no-headers -u "$USER" -o pid)
|
||
5 years ago
|
umount "$HOME"/.cache "$HOME" /mnt
|
||
5 years ago
|
umount /dev/disk/by-partlabel/01-home ||:
|
||
5 years ago
|
/usr/sbin/wipefs -a /dev/disk/by-partlabel/01-tmp-home
|