From 574a5925ed6d8f3c2e8680a6c53ef79be86eaa41 Mon Sep 17 00:00:00 2001 From: Alejandro Huertas Herrero Date: Thu, 2 Jun 2022 18:19:46 +0200 Subject: [PATCH] B #5855: replace augtool by grep (#2124) --- src/mad/sh/scripts_common.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mad/sh/scripts_common.sh b/src/mad/sh/scripts_common.sh index df163eb999..5928af9d26 100644 --- a/src/mad/sh/scripts_common.sh +++ b/src/mad/sh/scripts_common.sh @@ -1228,11 +1228,11 @@ function send_to_monitor { mon_conf=$ONE_LOCATION/etc/monitord.conf fi - mon_config=$(augtool -L -l $mon_conf ls /files/$mon_conf/NETWORK) - mon_address=$(echo "$mon_config" | grep MONITOR_ADDRESS | awk '{print $3}') - mon_port=$(echo "$mon_config" | grep PORT | awk '{print $3}') - mon_key=$(echo "$mon_config" | grep PUBKEY | awk '{print $3}' | \ - sed 's/^"\(.*\)"$/\1/') + mon_address=$(cat "$mon_conf" | grep MONITOR_ADDRESS | cut -d , -f1 | \ + awk '{print $3}' | sed 's/^"\(.*\)"$/\1/') + mon_port=$(cat "$mon_config" | grep PORT | cut -d , -f1 | awk '{print $3}') + mon_key=$(cat $mon_conf | grep PUBKEY | cut -d , -f1 | awk '{print $3}' | \ + sed 's/^"\(.*\)"$/\1/') if [[ $mon_address == *"auto"* ]]; then mon_address="127.0.0.1"