From ca6a69f0e7225ea7cabb9f2065ba5fb73b65f9c7 Mon Sep 17 00:00:00 2001 From: Lijwent Date: Thu, 1 Jun 2023 12:14:29 +0200 Subject: [PATCH 1/2] Change sed cmd to not add the line if already present --- prommanager | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prommanager b/prommanager index 769ceff..e28b876 100755 --- a/prommanager +++ b/prommanager @@ -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 } From a0dfa4d51fcc65638c28d061f537055c7370c97a Mon Sep 17 00:00:00 2001 From: Lijwent Date: Thu, 1 Jun 2023 12:20:20 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db5b2d8..f31c23e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] ... +## [5.1.1] - 2023-06-01 +### Fix +- Fix sed cmd to not duplicate the lines if already there for blackbox_exporter config + ## [5.1.0] - 2022-11-08 ### Add - Add env file path variable to specify custom location @@ -118,7 +122,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ### Removed - [WARNING] Breaking changes for script arguments -[Unreleased]: https://github.com/matbgn/prommanager/compare/v5.1.0...HEAD +[Unreleased]: https://github.com/matbgn/prommanager/compare/v5.1.1...HEAD +[5.1.1]: https://github.com/matbgn/prommanager/compare/v5.1.0...v5.1.1 [5.1.0]: https://github.com/matbgn/prommanager/compare/v5.0.0...v5.1.0 [5.0.0]: https://github.com/matbgn/prommanager/compare/v4.1.0...v5.0.0 [4.1.0]: https://github.com/matbgn/prommanager/compare/v4.0.2...v4.1.0 @@ -129,4 +134,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/). [2.0.0]: https://github.com/matbgn/prommanager/compare/v1.0.0...v2.0.0 [1.0.0]: https://github.com/matbgn/prommanager/releases/tag/v1.0.0 - GH CLI: gh release create vX.0.0 -t "vX.0.0" -n "See [CHANGELOG.md](CHANGELOG.md) for details" prommanager \ No newline at end of file + GH CLI: gh release create vX.0.0 -t "vX.0.0" -n "See [CHANGELOG.md](CHANGELOG.md) for details" prommanager