mirror of
https://github.com/unraid/webgui.git
synced 2026-05-03 00:09:27 -05:00
9e6fd22d8a
- includes fix for docker ipv6 used by containers
27 lines
463 B
Bash
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
|
|
}
|