From 2300447baa6c3f01662aa400ad3f41cb579fe0b0 Mon Sep 17 00:00:00 2001 From: JesusPerez Date: Sun, 23 Jan 2022 12:13:11 +0000 Subject: [PATCH] chore: add K8s ConfigMap command generator --- generarte-cfgmap.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 generarte-cfgmap.sh diff --git a/generarte-cfgmap.sh b/generarte-cfgmap.sh new file mode 100755 index 0000000..322bac8 --- /dev/null +++ b/generarte-cfgmap.sh @@ -0,0 +1,13 @@ +#!/bin/bash +USAGE="generate-cfgmap.sh target-path" + +[ "$1" == "-h" ] && echo "$USAGE" && exit + +SOURCE="backups-manager.sh" +TARGET=$1 + +[ ! -r "$SOURCE" ] && echo "No $SOURCE path found" && exit 1 +[ -z "$TARGET" ] && echo "No target path found" && exit 1 + +echo " backups-manager: |"> $TARGET +cat "$SOURCE" | sed 's/^/ /g' >> "$TARGET"