* Unmount filesystem(s) and flush write cache before poweroff/reboot * Also adjusted timouts to maybe fix issue #52
21 lines
362 B
Bash
Executable file
21 lines
362 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
## Wizard Kit: Wrapper for logout, reboot, & poweroff
|
|
|
|
# Unmount filesystems
|
|
find /media -maxdepth 1 -mindepth 1 -type d \
|
|
-exec udevil umount "{}" \;
|
|
|
|
# Flush write cache
|
|
sudo sync
|
|
|
|
# Perform requested action
|
|
case "${1:-x}" in
|
|
poweroff)
|
|
sudo systemctl poweroff;;
|
|
reboot)
|
|
sudo systemctl reboot;;
|
|
*)
|
|
openbox --exit;;
|
|
esac
|
|
exit 0
|