fix: correct logic for rw/ro cases
This commit is contained in:
parent
0fe0d427e0
commit
e380058907
@ -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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user