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
This commit is contained in:
Mărcziem ™
2025-10-03 13:43:55 +02:00
parent c0d6a07cec
commit 3c9fe4017b
3 changed files with 5 additions and 2 deletions

View File

@@ -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

View File

@@ -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() {