mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
401958c0d6
For #361
42 lines
513 B
Bash
42 lines
513 B
Bash
#!/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 {
|
|
if [[ -v DEBUG ]] && [[ ${DEBUG^^} = TRUE ]]; then
|
|
return 0
|
|
else
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
function debug {
|
|
if isDebugging; then
|
|
echo "DEBUG: $*"
|
|
fi
|
|
} |