From 888543d2e251bf9da1313b49c571b6b91736428d Mon Sep 17 00:00:00 2001 From: Nathan Robertson Date: Sat, 16 Apr 2022 19:38:14 +1000 Subject: [PATCH] Add machine wide and user cached options for lookup of shpod.yaml --- shpod.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/shpod.sh b/shpod.sh index 752f895..a165307 100755 --- a/shpod.sh +++ b/shpod.sh @@ -1,11 +1,12 @@ #!/bin/sh # For more information about shpod, check it out on GitHub: # https://github.com/bretfisher/shpod -if [ -f shpod.yaml ]; then - YAML=shpod.yaml -else - YAML=https://k8smastery.com/shpod.yaml -fi +YAML=https://k8smastery.com/shpod.yaml +for location in "/etc" "$HOME/.shpod" `pwd` ; do + if [ -f "$location/shpod.yaml" ]; then + YAML="$location/shpod.yaml" + fi +done if [ "$(kubectl get pod --namespace=shpod shpod --ignore-not-found -o jsonpath={.status.phase})" = "Running" ]; then echo "Shpod is already running. Starting a new shell with 'kubectl exec'." echo "(Note: if the main invocation of shpod exits, all others will be terminated.)"