diff options
-rw-r--r-- | etc/functions/off | 9 |
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 )) { |