From 3bb2f9a6caef07cd2d798fe52e340df524663a82 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 14 Apr 2018 14:17:56 +0200 Subject: monitor-uucp --- monitor-uucp | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 monitor-uucp (limited to 'monitor-uucp') diff --git a/monitor-uucp b/monitor-uucp new file mode 100755 index 0000000..412c707 --- /dev/null +++ b/monitor-uucp @@ -0,0 +1,64 @@ +#!@zsh@/bin/zsh + +lsof() { @lsof@/bin/lsof ${@} 2>/dev/null | tail -n +2} +ignoredFiles() { + cat < len) print substr($0, 1, len-3) "..."; else print; }') + + [[ ${fType} == "REG" ]] || continue + + clear + @pv@/bin/pv -W -D 2 -i 0.5 -d ${pid}:${fd} -s ${size} -F "%r %a %p %e %I" -p -r -I -e -N ${name} + + slept=0 + watched=true + + break + done + + if $watched || [[ $slept -ge $(($sleepTimeout / $sleep)) ]]; then + printf "inotify (%s)\n" $(date +"%T") + @inotify@/bin/inotifywait -r -e access /var/spool/uucp &>/dev/null + slept=0 + else + sleep 0.1 + printf "." + slept=$(($slept + 1)) + fi +done -- cgit v1.2.3