From d6aff5233dc880f15a755f8a5db057ebcdd06656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Tue, 26 Nov 2019 10:45:36 +0100 Subject: [PATCH] Exit when found the new OSD ID --- ceph/new.osd-id.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ceph/new.osd-id.sh b/ceph/new.osd-id.sh index 2bab735..f3ea39f 100755 --- a/ceph/new.osd-id.sh +++ b/ceph/new.osd-id.sh @@ -1,7 +1,7 @@ #!/bin/sh # Vars {{{ -debug="0" +debug="1" ## Colors {{{ c_redb='\033[1;31m' @@ -44,9 +44,12 @@ while [ "${osd_id}" -lt "${osd_id_end}" ]; do if check_osd "${osd_id}" then get_osd_host "${osd_id}" - [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : OSD ${osd_id} exists on ${c_redb}${osd_id_host}." + [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : OSD ${osd_id} exists on ${c_redb}${osd_id_host}${c_reset}." else [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : ! OSD ${osd_id} does exists !" + printf '%b\n' "The next OSD ID should be ${c_redb}${osd_id}${c_reset}. If you plan to use var :" + printf '%b\n' "osd_id=\"${osd_id}\"" + exit 0 fi [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "-----------------------------------------------"