From 515c313e074e77ea6f63b9e4c2b268b47db3984e Mon Sep 17 00:00:00 2001 From: Julian Sommer <115516918+juliansommer@users.noreply.github.com> Date: Tue, 14 Apr 2026 10:07:59 +1000 Subject: [PATCH] fix: setup.sh newgrp --- scripts/setup.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 48a9fa8a8..d48f3e00b 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -527,8 +527,6 @@ print_summary() { echo " If your WAN is a physical NIC:" echo " # Dedicated WAN NIC (not your SSH connection):" echo " sudo /usr/local/share/spinifex/setup-ovn.sh --management --wan-bridge=br-wan --wan-iface=eth1" - echo " # Single-NIC host (SSH-safe macvlan):" - echo " sudo /usr/local/share/spinifex/setup-ovn.sh --management --macvlan --wan-iface=enp0s3" echo "" echo " 2. Initialize:" echo " sudo spx admin init --node node1 --nodes 1" @@ -565,6 +563,17 @@ main() { rm -rf "$SPINIFEX_TMPDIR" restart_if_needed print_summary + + # Activate spinifex group membership in the invoking shell. Under curl|bash + # stdin is the drained pipe, so redirect from /dev/tty and exec so the new + # shell becomes the foreground process. Skip when no tty (CI, cloud-init). + if ! id -Gn 2>/dev/null | grep -qw "$SPINIFEX_GROUP" \ + && [ -r /dev/tty ] && [ -w /dev/tty ]; then + echo "" + echo " Activating '$SPINIFEX_GROUP' group in a subshell — type 'exit' when done." + echo "" + exec newgrp "$SPINIFEX_GROUP" < /dev/tty + fi } main "$@"