fix: correct logic for rw/ro cases

This commit is contained in:
phoenix 2025-04-17 06:36:42 +01:00
parent 0fe0d427e0
commit e380058907

View File

@ -52,13 +52,16 @@ rw)
fi fi
check_devuser_attached check_devuser_attached
exit 0
;; ;;
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
echo "❌ Container '$CONTAINER' not running." exec podman exec -it --user "$VIEW_USER" "$CONTAINER" tmux attach -r -t "$TMUX_SESSION"
exit 0
else
echo "❌ Container $CONTAINER does not exist."
exit 1 exit 1
fi fi
exec podman exec -it --user "$VIEW_USER" "$CONTAINER" tmux attach -r -t "$TMUX_SESSION"
;; ;;
*) *)
echo "❌ Invalid access mode: $MODE" echo "❌ Invalid access mode: $MODE"