diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /ceph-menv/mset.sh | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ceph-menv/mset.sh')
-rwxr-xr-x | ceph-menv/mset.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ceph-menv/mset.sh b/ceph-menv/mset.sh new file mode 100755 index 000000000..b9cb5b4df --- /dev/null +++ b/ceph-menv/mset.sh @@ -0,0 +1,21 @@ +get_color() { + s=$1 + sum=1 # just so that 'c1' isn't green that doesn't contrast with the rest of my prompt + for i in `seq 1 ${#s}`; do + c=${s:$((i-1)):1}; + o=`printf '%d' "'$c"` + sum=$((sum+$o)) + done + echo $sum +} + +if [ "$1" == "" ]; then + unset MRUN_CLUSTER + unset MRUN_PROMPT +else + export MRUN_CLUSTER=$1 + export MRUN_PROMPT='['${MRUN_CLUSTER}'] ' + col=$(get_color $1) + MRUN_PROMPT_COLOR=$((col%7+31)) +fi + |