mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-12 04:39:37 +00:00
Safer and flexible boolean env vars
This commit is contained in:
@ -56,3 +56,13 @@ get_group_id () {
|
||||
getent group "$1" | cut -d: -f3
|
||||
fi
|
||||
}
|
||||
|
||||
# param $1: value
|
||||
is_true () {
|
||||
VAL=$(echo "${1:-}" | tr '[:upper:]' '[:lower:]')
|
||||
if [ "$VAL" == 'true' ] || [ "$VAL" == 'on' ] || [ "$VAL" == '1' ] || [ "$VAL" == 'yes' ]; then
|
||||
echo '1'
|
||||
else
|
||||
echo '0'
|
||||
fi
|
||||
}
|
||||
|
Reference in New Issue
Block a user