mirror of https://github.com/01-edu/public.git
xpetit
3 years ago
4 changed files with 35 additions and 13 deletions
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash |
||||
|
||||
# Log stdout & stderr |
||||
exec > >(tee -i /tmp/reset_home.log) 2>&1 |
||||
|
||||
# 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 |
||||
|
||||
# Make sure the mountpoints are free |
||||
loginctl terminate-user student |
||||
sleep 0.1 |
||||
|
||||
umount /home/student/.cache /home/student /mnt |
||||
umount /dev/disk/by-partlabel/01-home ||: |
||||
/usr/sbin/wipefs -a /dev/disk/by-partlabel/01-tmp-home |
Loading…
Reference in new issue