1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #5855: replace augtool by grep (#2124)

This commit is contained in:
Alejandro Huertas Herrero 2022-06-02 18:19:46 +02:00 committed by GitHub
parent 338765e4b5
commit 574a5925ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"