feat: add fallback message before exit
This commit is contained in:
parent
dfca4782bf
commit
f27ca9c212
@ -48,9 +48,17 @@ rw)
|
|||||||
|
|
||||||
# Run tmux session inside the container
|
# Run tmux session inside the container
|
||||||
if ! podman exec -it --user "$USER" "$CONTAINER" tmux has-session -t "$TMUX_SESSION" 2>/dev/null; then
|
if ! podman exec -it --user "$USER" "$CONTAINER" tmux has-session -t "$TMUX_SESSION" 2>/dev/null; then
|
||||||
podman exec -it --user "$USER" "$CONTAINER" tmux new-session -s "$TMUX_SESSION"
|
if ! podman exec -it --user "$USER" "$CONTAINER" tmux new-session -s "$TMUX_SESSION"; then
|
||||||
|
echo "❌ Could not attach to tmux session. Please contact admin or try again later."
|
||||||
|
podman logs "$CONTAINER"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
podman exec -it --user "$USER" "$CONTAINER" tmux attach -t "$TMUX_SESSION"
|
if ! podman exec -it --user "$USER" "$CONTAINER" tmux attach -t "$TMUX_SESSION"; then
|
||||||
|
echo "❌ Could not attach to tmux session. Please contact admin or try again later."
|
||||||
|
podman logs "$CONTAINER"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
check_devuser_attached
|
check_devuser_attached
|
||||||
@ -58,7 +66,11 @@ rw)
|
|||||||
;;
|
;;
|
||||||
ro)
|
ro)
|
||||||
if podman container exists "$CONTAINER" && podman inspect -f '{{.State.Running}}' "$CONTAINER" | grep -q true; then
|
if podman container exists "$CONTAINER" && podman inspect -f '{{.State.Running}}' "$CONTAINER" | grep -q true; then
|
||||||
exec podman exec -it --user "$VIEW_USER" "$CONTAINER" tmux attach -r -t "$TMUX_SESSION"
|
if ! podman exec -it --user "$VIEW_USER" "$CONTAINER" tmux attach -r -t "$TMUX_SESSION"; then
|
||||||
|
echo "❌ Could not attach to tmux session. Please contact admin or try again later."
|
||||||
|
podman logs "$CONTAINER"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "❌ Container $CONTAINER does not exist."
|
echo "❌ Container $CONTAINER does not exist."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user