remove all matching selectors and all selctors followed by "-"

This commit is contained in:
2023-02-03 11:09:04 +00:00
parent dac7a093b5
commit f09f06764a

View File

@@ -64,7 +64,8 @@ name_resolver() {
EXISTS=$(grep -w $D $HOST_FILE);
#EXISTS=$(grep -w "$D-" $HOST_FILE); # TODO?
if [ -n "$EXISTS" ]; then # selector exists in hosts file
APP_IP=$(echo $EXISTS | sed s/$D//g); # remove all selectors
# remove all matching selectors and all selctors followed by "-"
APP_IP=$(echo $EXISTS | sed s/$D-//g | sed s/$D//g);
debug "APP_IP: "$APP_IP;
else
debug "no matching APPLICATION NAME found in $HOST_FILE"