From 3c9fe4017b65c75b5f0bc891cfb7d6f6a1ed8bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=83rcziem=20=E2=84=A2?= <118485377+spalencsar@users.noreply.github.com> Date: Fri, 3 Oct 2025 13:43:55 +0200 Subject: [PATCH] Fix Samba user reference to use ADMIN_USER instead of NEW_USER - Corrected setup_samba function to use ${ADMIN_USER:-$USER} consistently - Export configuration variables in load_or_create_config for subshell access - Ensure ADMIN_USER variable is properly available in all lib scripts --- lib/network.sh | 2 +- lib/vaultwarden.sh | 2 +- setup.sh | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/network.sh b/lib/network.sh index 3f6c30d..a021b8b 100644 --- a/lib/network.sh +++ b/lib/network.sh @@ -316,7 +316,7 @@ EOF # Add Samba user local samba_password=$(ask_password "Set Samba password for user ${ADMIN_USER:-$USER}") echo -e "$samba_password\n$samba_password" | sudo smbpasswd -a "${ADMIN_USER:-$USER}" - sudo smbpasswd -e "${ADMIN_USER:-$NEW_USER}" + sudo smbpasswd -e "${ADMIN_USER:-$USER}" # Start and enable Samba services sudo systemctl enable smbd nmbd diff --git a/lib/vaultwarden.sh b/lib/vaultwarden.sh index 2a3305c..277d249 100644 --- a/lib/vaultwarden.sh +++ b/lib/vaultwarden.sh @@ -94,4 +94,4 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then # Falls direkt ausgeführt: versuchen wir die Funktion und geben das Ergebnis als Exit-Code zurück. install_vaultwarden "$@" exit $? -fi +fi \ No newline at end of file diff --git a/setup.sh b/setup.sh index dc5c6dc..0a21588 100644 --- a/setup.sh +++ b/setup.sh @@ -300,6 +300,9 @@ load_or_create_config() { create_interactive_config load_config # Load the new configuration fi + + # Export configuration variables for use in subshells + export ADMIN_USER SSH_PORT CONFIGURE_STATIC_IP INSTALL_DOCKER INSTALL_NFS INSTALL_NETDATA INSTALL_VAULTWARDEN INSTALL_JELLYFIN INSTALL_PORTAINER INSTALL_WEBMIN ENABLE_AUTO_UPDATES } create_interactive_config() {