lancachenet / lancache-dns

DNS Docker service for a lancache.
https://hub.docker.com/r/lancachenet/lancache-dns/
MIT License
282 stars 74 forks source link

Fix enable check not checking disable #58

Closed VibroAxe closed 5 years ago

VibroAxe commented 5 years ago

Enable check logic purely checks IP not DISABLE_SERVICE

GotenXiao commented 5 years ago

This change does introduce whitespace errors (mix of tabs and spaces), but otherwise LGTM. At some point we should look at refactoring the bootstrap script in terms of how we deal with variables - running grep on the output of env seems incredibly clumsy, and we could probably use indirect variable references if we explicitly use bash, e.g.:

DISABLE_STEAM="${DISABLE_STEAM:-false}"

service_name="STEAM"
service_disabled="DISABLE_${SERVICE_NAME}"

if [ "${!service_disabled}" = "false" ]
then
    echo "Enabling ${service_name}"
fi