Files
webgui/etc/rc.d/rc.runlog
T
bergware 9e6fd22d8a scripts dutchification - batch 1
- includes fix for docker ipv6 used by containers
2023-10-01 14:01:59 +02:00

27 lines
463 B
Bash

#!/bin/bash
#
# script: rc.runlog
#
# General purpose run and log functions
#
# Bergware - created for Unraid OS, October 2023
BASENAME=$(basename "$0")
run(){
# log command to syslog
logger -t $BASENAME "$*"
# run command - dismiss all output
$* 1>/dev/null 2>/dev/null
}
log(){
if [[ ! -t 0 ]]; then
# log message to syslog
logger -t $BASENAME "${1:-$(</dev/stdin)}"
else
# echo message to console
[[ -n $1 ]] && echo "$1"
fi
}