summaryrefslogtreecommitdiffstats
path: root/ceph-menv/mset.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /ceph-menv/mset.sh
parentInitial commit. (diff)
downloadceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz
ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ceph-menv/mset.sh')
-rwxr-xr-xceph-menv/mset.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/ceph-menv/mset.sh b/ceph-menv/mset.sh
new file mode 100755
index 00000000..b9cb5b4d
--- /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
+