diff --git a/scripts/setup-pi.sh b/scripts/setup-pi.sh index d43395d..826f0e5 100755 --- a/scripts/setup-pi.sh +++ b/scripts/setup-pi.sh @@ -8,7 +8,7 @@ # # Options: # --config PATH Path to config.yaml template to copy to /opt/remoterig/ -# --service-user USER Systemd service user (default: pi) +# --service-user USER Systemd service user (default: invoking sudo user, else pi) # --static-ip IP Static IP for wlan0 (default: 192.168.8.56/24) # --gateway IP Gateway for wlan0 (default: 192.168.8.1) # --help Show this help @@ -19,7 +19,7 @@ set -euo pipefail # Defaults # --------------------------------------------------------------------------- CONFIG_TEMPLATE="" -SERVICE_USER="pi" +SERVICE_USER="${SUDO_USER:-pi}" # default to the invoking user (not every Pi has a 'pi' user) STATIC_IP="192.168.8.56/24" GATEWAY="192.168.8.1" MOSQUITTO_PKG="mosquitto mosquitto-clients"