Fix dynv6 script

This commit is contained in:
Alexander Schäferdiek 2022-07-10 18:35:26 +02:00
parent 872e725e3c
commit fd2ecb420c

View file

@ -64,35 +64,35 @@ source_config() {
}
apply_defaults() {
if [ -z ${DYNV6_MAIL_ENABLED} ]; then
if [ -z "${DYNV6_MAIL_ENABLED}" ]; then
DYNV6_MAIL_ENABLED=false;
fi
if [ -z ${DYNV6_MAIL_ADDRESS} ]; then
if [ -z "${DYNV6_MAIL_ADDRESS}" ]; then
DYNV6_MAIL_ADDRESS="";
fi
if [ -z ${DYNV6_TOKEN} ]; then
if [ -z "${DYNV6_TOKEN}" ]; then
DYNV6_TOKEN="";
fi
if [ -z ${DYNV6_HOSTNAME} ]; then
if [ -z "${DYNV6_HOSTNAME}" ]; then
DYNV6_HOSTNAME="";
fi
if [ -z ${DYNV6_IPV4_ENABLED} ]; then
if [ -z "${DYNV6_IPV4_ENABLED}" ]; then
DYNV6_IPV4_ENABLED=true;
fi
if [ -z ${DYNV6_IPV6_ENABLED} ]; then
if [ -z "${DYNV6_IPV6_ENABLED}" ]; then
DYNV6_IPV6_ENABLED=true;
fi
if [ -z ${DYNV6_IPV6_INTERFACE} ]; then
if [ -z "${DYNV6_IPV6_INTERFACE}" ]; then
DYNV6_IPV6_INTERFACE="eth0";
fi
}
check_required() {
if [ -z ${DYNV6_TOKEN} ]; then
if [ -z "${DYNV6_TOKEN}" ]; then
echo "DYNV6_TOKEN is required"
exit 1;
fi
if [ -z ${DYNV6_HOSTNAME} ]; then
if [ -z "${DYNV6_HOSTNAME}" ]; then
echo "DYNV6_HOSTNAME is required"
exit 1;
fi