Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
examples/JLogger/JLogger.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3# \author mdejong
4#
5version=1.0
6script=${0##*/}
7
8# ------------------------------------------------------------------------------------------
9#
10# Example script to test message logging.
11#
12# ------------------------------------------------------------------------------------------
13
14
15if [ -z $JPP_DIR ]; then
16 echo "Variable JPP_DIR undefined."
17 exit
18fi
19
20
21source $JPP_DIR/setenv.sh $JPP_DIR
22
23
24set_variable DEBUG 2
25set_variable LOGGER localhost
26set_variable TIMEOUT 10
27
28if do_usage $*; then
29 usage "$script [host name]"
30fi
31
32case $# in
33 1) set_variable LOGGER $1;;
34esac
35
36
37$JPP_BIN/JLogger.sh $LOGGER
38
39until pgrep JGetMessage </dev/null >/dev/null; do
40 sleep 1
41done
42
43JPutMessage -H $LOGGER -t MSG -m "Hello world, I will disappear in $TIMEOUT seconds."
44
45# Stop message logger.
46
47sleep $TIMEOUT
48
49JPutMessage -H $LOGGER -t MSG -m stop