summaryrefslogtreecommitdiff
path: root/etc/functions/off
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-11-17 18:20:19 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2008-11-17 18:20:19 +0100
commit1d3b36d78a82c422c7dec77f81c0d6d4bc76395c (patch)
treea9a6fae95bae2f8b33158492b9eed05f4948ceed /etc/functions/off
parent8a2d238bf2d0906e0b33155ee161656a2216f4ad (diff)
off: Show filesystems to be checked at next boot
Diffstat (limited to 'etc/functions/off')
-rw-r--r--etc/functions/off17
1 files changed, 17 insertions, 0 deletions
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