Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
software/JLogger/JLogger.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3# \author mdejong
4#
5script=${0##*/}
6
7# ------------------------------------------------------------------------------------------
8#
9# Example script start message logger on terminal.
10#
11# ------------------------------------------------------------------------------------------
12
13if [ -z $JPP_DIR ]; then
14 echo "Variable JPP_DIR undefined."
15 exit
16fi
17
18source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
19
20set_variable DEBUG 2
21set_variable WORKDIR ${TMPDIR:-/tmp}/
22set_variable HOST $HOSTNAME
23define_variable OUTPUT_FILE
24set_variable TAG MSG
25
26if do_usage $*; then
27 usage "$script [host name [local file]]"
28fi
29
30case $# in
31 2) set_variable OUTPUT_FILE $2;&
32 1) set_variable HOST $1;;
33esac
34
35if [[ -z $OUTPUT_FILE ]]; then
36
37 echo "Launching message logger in new window."
38
39 xterm -geometry 140x30 -e "JGetMessage -H $HOST -T $TAG -d3; exit" &
40
41else
42
43 echo "Direct message logger output to $OUTPUT_FILE."
44
45 JGetMessage -H $HOST -T $TAG -d3 >& $OUTPUT_FILE &
46
47fi