docker-minecraft-server/start-utils

51 lines
592 B
Text
Raw Normal View History

#!/bin/bash
function isURL {
local value=$1
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" ]]; then
return 0
else
return 1
fi
}
function isTrue {
local value=${1,,}
result=
case ${value} in
true|on)
result=0
;;
*)
result=1
;;
esac
return ${result}
}
function isDebugging {
2019-09-15 14:54:13 +00:00
if [[ -v DEBUG ]] && [[ ${DEBUG^^} = TRUE ]]; then
return 0
else
return 1
fi
}
function debug {
if isDebugging; then
2020-03-06 15:52:17 +00:00
log "DEBUG: $*"
fi
}
2020-03-06 15:52:17 +00:00
function logn {
echo -n "[init] $*"
}
function log {
echo "[init] $*"
}