Skip to content

Commit

Permalink
Change sed cmd to not add the line if already present
Browse files Browse the repository at this point in the history
  • Loading branch information
Lijwent authored Jun 1, 2023
1 parent 8ebd211 commit ca6a69f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prommanager
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ function download_blackbox_exporter() {
function config_blackbox_exporter() {
if [ $LOG_LEVEL -gt 3 ]; then printf "[DEBUG] Config blackbox_exporter\n"; fi
# Set ipv4 as preferred protocol for blackbox_exporter
sed -i '4i\ http:' /etc/prometheus/blackbox.yml
sed -i '5i\ preferred_ip_protocol: "ip4"' /etc/prometheus/blackbox.yml
sed -i '4s/^.*$/ http:/; 4t; 4i http:' /etc/prometheus/blackbox.yml
sed -i '5s/^.*$/ preferred_ip_protocol: "ip4"/; 5t; 5i preferred_ip_protocol: "ip4"' /etc/prometheus/blackbox.yml
}


Expand Down

0 comments on commit ca6a69f

Please sign in to comment.