From f374df980982f59185a3de2b9cef8164bf837593 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 3 Jul 2017 09:12:36 +0200 Subject: bin/cleanup: skip auto-cleanup if users are logged in --- bin/cleanup | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bin/cleanup') diff --git a/bin/cleanup b/bin/cleanup index aa93004..f84d687 100755 --- a/bin/cleanup +++ b/bin/cleanup @@ -4,6 +4,13 @@ . "${0%/*}/../conf/default.conf" +# we only clean if run interactive or if no one is logged in +if ! tty -s && \ + [ -n "$(users)" ]; then + >&2 echo 'Skipping clean up.' + exit +fi + if ! "${base_dir}/bin/sanity-check" -r; then >&2 echo 'Build master is not sane.' exit 1 -- cgit v1.2.3-70-g09d2