osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/33517 )
Change subject: net/templates/run: let user confirm close of tmux ......................................................................
net/templates/run: let user confirm close of tmux
Don't immediately close tmux on exit. Without this patch the error messages printed in error code paths are not visible to the user.
Change-Id: I4a98e7eb7691b7b954ee7edd4ed488ae3c1dd835 --- M net/templates/run.sh 1 file changed, 21 insertions(+), 0 deletions(-)
Approvals: fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, approved; Verified
diff --git a/net/templates/run.sh b/net/templates/run.sh index d4edbaa..e9f10de 100755 --- a/net/templates/run.sh +++ b/net/templates/run.sh @@ -8,6 +8,15 @@ exec tmux new-session -s "$tmux_session" -n "RUN" "$0" "inside-tmux" fi
+exit_confirm() { + trap - EXIT INT TERM 0 + if [ "${TERMINAL}" = "tmux" ]; then + echo "Hit enter to close tmux" + read enter_to_continue + fi +} +trap exit_confirm EXIT INT TERM 0 + if ! ../fill_config.py --check-stale; then echo echo "WARNING: STALE CONFIGS - your net configs are older than the templates they should be based on!"