ratox-nuggets

useful ratox related scripts
git clone git://git.2f30.org/ratox-nuggets.git
Log | Files | Refs | LICENSE

commit 376b683cd07ad2873f2674293d9161c211386bfc
parent aa016545802ee6d91ad88f5d615ce797ea7b2b32
Author: Myroslav Opyr <myroslav@quintagroup.com>
Date:   Thu Oct  9 20:57:50 +0300

Added shared libary

Diffstat:
functions | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)
diff --git a/functions b/functions @@ -0,0 +1,24 @@ +SCRIPT_NAME=`basename $0` + +if hash inotifywait 2>/dev/null; then + WAIT_FOR_CHANGE="inotifywait -t 60 -e modify" +else + sleep 1 +fi + +function log() { + logger -t $SCRIPT_NAME -s "$*" +} + +function monitor_pending() { + #allowed parameter "call", "file" + WHAT=$1 + while grep -q 0 ${WHAT}_pending; do + $WAIT_FOR_CHANGE ${WHAT}_pending > /dev/null 2>&1 + done +} + +function stdin_trasher () { + { cat > /dev/null <&3 3<&- & } 3<&0 + echo $! +}