Skip to content

Commit fb3c64b

Browse files
committed
Improved Message-Output of join-command
1 parent d994e70 commit fb3c64b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

control.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,10 +988,16 @@ case "${1}" in
988988

989989
START_TIME=`date +%s`
990990
JOIN_TIME=0
991-
992991
if [ "${2}" -eq "${2}" ] &>/dev/null; then
993992
JOIN_TIME=${2}
994993
fi
994+
995+
if [ "${JOIN_TIME}" -gt 0 ]; then
996+
echo -e "${COLOR_GREEN}${COLOR_BOLD}Waiting for ${JOIN_TIME} seconds or ${APPLICATION_NAME} to exit"
997+
else
998+
echo -e "${COLOR_GREEN}${COLOR_BOLD}Waiting for ${APPLICATION_NAME} to exit"
999+
fi
1000+
9951001
while screen_status "${SCREEN_NAME}" && ([ "${JOIN_TIME}" -le 0 ] || [ "$(($(date +%s) - ${START_TIME}))" -lt "${JOIN_TIME}" ]); do
9961002
SLEEP_TIME=10
9971003

@@ -1003,7 +1009,7 @@ case "${1}" in
10031009
done
10041010

10051011
if screen_status "${SCREEN_NAME}"; then
1006-
echo -e "${COLOR_YELLOW}${COLOR_BOLD}Join was cancelled due to insufficient time!${COLOR_RESET}"
1012+
echo -e "${COLOR_YELLOW}${COLOR_BOLD}Join was cancelled because waittime exceeded ${JOIN_TIME} seconds!${COLOR_RESET}"
10071013
else
10081014
echo -e "${COLOR_GREEN}${COLOR_BOLD}${APPLICATION_NAME} stopped!${COLOR_RESET}"
10091015
fi

0 commit comments

Comments
 (0)