From 795f0c9d4e0bd3f70730ad80a1c7fca94184c996 Mon Sep 17 00:00:00 2001 From: Katharina Drexel Date: Thu, 8 Oct 2020 17:12:27 +0200 Subject: Adding awk optimizations in configuration file handling. Signed-off-by: Katharina Drexel --- lib/container/stop | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/container/stop') diff --git a/lib/container/stop b/lib/container/stop index a6bb761..5590747 100755 --- a/lib/container/stop +++ b/lib/container/stop @@ -150,7 +150,7 @@ do fi done -STATE="$(machinectl show ${NAME} 2>&1 | awk -F= '/^State=/ { print $2 }')" +STATE="$(machinectl show ${NAME} 2>&1 | awk -FState= '/^State=/ { print $2 }')" case "${CLEAN}" in true) @@ -175,7 +175,7 @@ case "${CLEAN}" in fi # Removing rw bind mounts - BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.conf)" + BIND="$(awk -Fbind= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.conf)" if [ -n "${BIND}" ] then @@ -190,7 +190,7 @@ case "${CLEAN}" in fi # Removing ro bind mounts - BIND_RO="$(awk -F= '/^bind-ro=/ { print $2 }' ${CONFIG}/${NAME}.conf)" + BIND_RO="$(awk -Fbind-ro= '/^bind-ro=/ { print $2 }' ${CONFIG}/${NAME}.conf)" if [ -n "${BIND_RO}" ] then @@ -205,7 +205,7 @@ case "${CLEAN}" in fi # Removing network configuration - VETHS="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)" + VETHS="$(awk -Fnetwork-veth-extra= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)" case "${VETHS}" in "") @@ -257,7 +257,7 @@ machinectl ${MODE} ${NAME} case "${FORCE}" in true) - VETHS="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf | awk -F: '{ print $1 }')" + VETHS="$(awk -Fnetwork-veth-extra= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf | awk -F: '{ print $1 }')" for VETH in ${VETHS} do -- cgit v1.2.3