diff options
Diffstat (limited to 'files/halt.pre')
-rw-r--r-- | files/halt.pre | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/files/halt.pre b/files/halt.pre new file mode 100644 index 0000000..8b2583e --- /dev/null +++ b/files/halt.pre @@ -0,0 +1,20 @@ +#!/bin/bash + +mypath=$_ +roottype=`awk '$2 == "/" { print $3 }' /etc/fstab` + +maybe_umount() { + eval d=\$$# + awk "\$2 == \"$d\" { system(\"umount \" \$d) }" /proc/mounts +} + +if [ "$roottype" == unionfs ]; then + maybe_umount /var/lib/rpm + maybe_umount /tmp/rpm/real + maybe_umount /tmp/rpm +fi + +# disable self during first halt when installed +rm -f $mypath + +/bin/plymouth quit |