diff options
author | SiemKorteweg <Siem.Korteweg@qnh.nl> | 2015-10-10 14:25:14 +0300 |
---|---|---|
committer | SiemKorteweg <Siem.Korteweg@qnh.nl> | 2015-10-10 14:25:14 +0300 |
commit | 0c48fc3880551d862063e56a029ce43082df376a (patch) | |
tree | d57f59a582b3d457fccd0dad6f32b3513ebf294f /include/data_upload | |
parent | c0378f38f517e916b141a8bc5049eb742e66d48f (diff) |
Optimized use of cat, grep and awk.
Detection of duplicate entries in /etc/hosts is now more robust.
On CentOS7 the SERVICE_MANAGER is detected correctly.
Diffstat (limited to 'include/data_upload')
-rw-r--r-- | include/data_upload | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/data_upload b/include/data_upload index d7bf1401..cd5f0cda 100644 --- a/include/data_upload +++ b/include/data_upload @@ -127,7 +127,7 @@ output "Settings file: ${SETTINGS_FILE}" ExitFatal fi # Extract the hostid from the parse file - HOSTID=`cat ${REPORTFILE} | grep "^hostid=" | awk -F= '{ print $2 }'` + HOSTID=`awk -F= '/^hostid=/ { print $2 }' ${REPORTFILE}` if [ ! "${HOSTID}" = "" ]; then output "${WHITE}Found hostid: ${HOSTID}${NORMAL}" # Try to connect |