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
This commit is contained in:
Oliver Smith 2023-06-27 12:12:31 +02:00
parent aadee1a645
commit 2ee10b05d5
1 changed files with 9 additions and 0 deletions

View File

@ -8,6 +8,15 @@ if [ "${TERMINAL}" = "tmux" ] && [ "$1" != "inside-tmux" ]; then
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!"