From 12f3ac5e058ecacd3460a32b7fb5f82ed7667071 Mon Sep 17 00:00:00 2001 From: David Kunz Date: Thu, 5 Jan 2017 12:46:32 +0100 Subject: Add check if exist config-new in config-update. --- lib/container/config-update | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/container') diff --git a/lib/container/config-update b/lib/container/config-update index 2679e6e..772da23 100755 --- a/lib/container/config-update +++ b/lib/container/config-update @@ -26,9 +26,9 @@ for FILE in "${CONFIG}"/*.conf do CONTAINER="$(basename ${FILE} .conf)" - NET="$(dig +short ${CONTAINER} | awk -F. '{ print $3 }')" - IP="$(dig +short ${CONTAINER} | awk -F. '{ print $4 }')" - BRIDGE="$(awk -F: '/^cnt.network-brige=/ { print $2 }' ${FILE})" + NET="$(dig @8.8.8.8 +short ${CONTAINER} | awk -F. '{ print $3 }')" + IP="$(dig @8.8.8.8 +short ${CONTAINER} | awk -F. '{ print $4 }')" + BRIDGE="$(awk -F: '/^cnt.network-bridge=/ { print $2 }' ${FILE})" CNT_AUTO="$(awk -F= '/^cnt.auto=/ { print $2 }' ${FILE})" CNT_AUTO="${CNT_AUTO:-FIXME}" @@ -37,7 +37,7 @@ do CNT_OVERLAY="$(awk -F= '/^cnt.overlay=/ { print $2 }' ${FILE})" BIND="$(awk -F= '/^bind=/ { print $2 }' ${FILE})" - BIND="${BIND:-bind=/srv/data/${CONTAINER}:/srv/${CONTAINER};}" + BIND="${BIND:-/srv/data/${CONTAINER}:/srv/${CONTAINER};}" BOOT="$(awk -F= '/^boot=/ { print $2 }' ${FILE})" CAPABILITY="$(awk -F= '/^capability=/ { print $2 }' ${FILE})" @@ -83,6 +83,11 @@ echo " done." for FILE in "${CONFIG}"/*.conf-new do + if [ ! -e "${CONFIG}/$(basename ${FILE} -new)" ] + then + continue + fi + clear echo "diff -Naurp ${CONFIG}/$(basename ${FILE} -new) ${FILE}" -- cgit v1.2.3