diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /ceph-menv/mset.sh | |
parent | Initial commit. (diff) | |
download | ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-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 + |