aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2026-01-05 09:59:14 +0100
committerPatrick Spek <p.spek@tyil.nl>2026-01-05 09:59:14 +0100
commit166ab0a62a29174df21156751923685eeaa77a45 (patch)
treefe3f1724160b67fae6c702fc68c6cc781da802f1
parentd424b5c4502b895c54d8b6091771b9e304c840bc (diff)
downloaddotfiles-166ab0a62a29174df21156751923685eeaa77a45.tar.gz
dotfiles-166ab0a62a29174df21156751923685eeaa77a45.tar.bz2
Exit if uuidgen does not exist
-rwxr-xr-x.local/bin/kubectl-shell6
1 files changed, 6 insertions, 0 deletions
diff --git a/.local/bin/kubectl-shell b/.local/bin/kubectl-shell
index a170dc6..040a21a 100755
--- a/.local/bin/kubectl-shell
+++ b/.local/bin/kubectl-shell
@@ -33,6 +33,12 @@ main()
[ -z "$DOCKER_IMAGE" ] && DOCKER_IMAGE="alpine"
[ -z "$DOCKER_TAG" ] && DOCKER_TAG="latest"
+ if ! command -v uuidgen >/dev/null 2>&1
+ then
+ printf "No uuidgen in \$PATH\n"
+ return 2
+ fi
+
cmd="kubectl run"
cmd="$cmd \"shell-$(uuidgen)\""
cmd="$cmd --image \"$DOCKER_IMAGE:$DOCKER_TAG\""