From: Banana Date: Fri, 15 Nov 2019 15:07:03 +0000 (+0100) Subject: some exit codes X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=1102ea843b11de1cfabecba9ae5083fdcb8af4f3;p=klimbim.git some exit codes --- diff --git a/kubernetes/kubeconnect b/kubernetes/kubeconnect index b74a1af..8ebe590 100755 --- a/kubernetes/kubeconnect +++ b/kubernetes/kubeconnect @@ -9,6 +9,7 @@ # context = the context to use for kubectl # # uses the default container and /bin/bash as a shell +# needs kubectl to be installed # This program is free software: you can redistribute it and/or modify # it under the terms of the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE @@ -22,7 +23,7 @@ if [ $# -lt 2 ]; then echo "You need to provide pod name and context"; echo "kubeconnect pod-name context"; - exit 126; + exit 2; fi; PODNAME="$1" @@ -39,8 +40,10 @@ then kubectl exec -it $REALPODNAME -- /bin/bash else echo "ERROR: No such pod found. '$PODNAME'"; + exit 1; fi else echo "Could not set context: '$CONTEXT'" + exit 1; fi - +exit 0