diff options
Diffstat (limited to 'common/log.sh')
-rw-r--r-- | common/log.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/log.sh b/common/log.sh new file mode 100644 index 0000000..622a9bb --- /dev/null +++ b/common/log.sh @@ -0,0 +1,15 @@ +# log function for displaying output if loging enabled + +_log() { + # only output something, + # if logging is enabled + if [ $LOGGING -eq 0 ]; then + if [ -n "$1" ]; then + # echo arguments + echo "$@" + else + # echo stdin + cat + fi + fi +} |