summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-09-28 19:20:53 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-09-28 19:20:53 +0200
commit3d0fea554ba4df550d52625763f48febdd8d0c95 (patch)
tree39397a121df0eb5b9711a45184fe66893526c911
parente3b2e920b569b68bbecd81b36ec29fcde1f9e95d (diff)
off: Add -l
-rw-r--r--etc/functions/off9
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/functions/off b/etc/functions/off
index 7f1f2fd..8f0a1fd 100644
--- a/etc/functions/off
+++ b/etc/functions/off
@@ -7,7 +7,7 @@
typeset filesystem garbage file
typeset -a filesystems
typeset tune2fs
-typeset -i force reboot simulate exit_ok=1
+typeset -i force leave reboot simulate exit_ok=1
function execute {
if (( simulate )) {
@@ -19,6 +19,7 @@ function execute {
while [[ ${1} == -* ]] {
case ${1} in
+ -l) leave=1 ;;
-n) simulate=1 ;;
-r) reboot=1 ;;
--force) force=1 ;;
@@ -57,6 +58,12 @@ while read filesystem garbage; do
fi
done < /etc/fstab
+if (( leave )) {
+ execute unisync with-all
+ execute mra push
+ execute ct push
+}
+
for filesystem in ${filesystems}; {
tune2fs=($(sudo tune2fs -l ${filesystem} | fgrep -i 'mount count' | grep -o '[0-9]*'))
if (( tune2fs[2] - tune2fs[1] < 5 )) {