fix: correct logic for rw/ro cases
This commit is contained in:
parent
0fe0d427e0
commit
e380058907
@ -52,13 +52,16 @@ rw)
|
||||
fi
|
||||
|
||||
check_devuser_attached
|
||||
exit 0
|
||||
;;
|
||||
ro)
|
||||
if ! podman container exists "$CONTAINER" || ! podman inspect -f '{{.State.Running}}' "$CONTAINER" | grep -q true; then
|
||||
echo "❌ Container '$CONTAINER' not running."
|
||||
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"
|
||||
exit 0
|
||||
else
|
||||
echo "❌ Container $CONTAINER does not exist."
|
||||
exit 1
|
||||
fi
|
||||
exec podman exec -it --user "$VIEW_USER" "$CONTAINER" tmux attach -r -t "$TMUX_SESSION"
|
||||
;;
|
||||
*)
|
||||
echo "❌ Invalid access mode: $MODE"
|
||||
|
Loading…
x
Reference in New Issue
Block a user