From 1d3b36d78a82c422c7dec77f81c0d6d4bc76395c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 17 Nov 2008 18:20:19 +0100 Subject: off: Show filesystems to be checked at next boot --- etc/alias/short | 2 -- etc/functions/off | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 etc/functions/off (limited to 'etc') diff --git a/etc/alias/short b/etc/alias/short index 0ddc010..2c1431e 100644 --- a/etc/alias/short +++ b/etc/alias/short @@ -64,8 +64,6 @@ alias lsz='unzip -l' alias nb='newsbeuter' alias nbr='newsbeuter -r' -alias off='uinit stop-all; sudo halt' - alias rd='rmdir' alias rsync-serve="rsync --daemon --port=10873 --no-detach --config=/dev/stdin --log-file=/dev/stdout -v <<< $'[.]\n\tpath = .\n\tuse chroot = no'" diff --git a/etc/functions/off b/etc/functions/off new file mode 100644 index 0000000..8369de9 --- /dev/null +++ b/etc/functions/off @@ -0,0 +1,17 @@ +## vim:ft=zsh +typeset filesystem line IFS=$'\n' +typeset -a filesystems +typeset tune2fs +uinit stop-all +for line in $(cat /etc/fstab); { + if [[ $line == *[12] ]] { + filesystems+=${${(s: :)line}[1]} + } +} +for filesystem in $filesystems; { + tune2fs=($(sudo tune2fs -l $filesystem | fgrep -i 'mount count' | grep -o '[0-9]*')) + if (( tune2fs[2] - tune2fs[1] < 2 )) { + echo "notice: filesystem $filesystem due to check at next boot" + } +} +sudo halt -- cgit v1.2.3