From e91ac9668f2936819ca9e0a80eb8dc43bbe55882 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: Mon, 6 Oct 2025 10:40:29 +0200 Subject: [PATCH] Fix Samba service names for openSUSE - Use smb.service and nmb.service instead of smbd.service and nmbd.service - openSUSE uses different service names for Samba --- lib/network.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/network.sh b/lib/network.sh index a021b8b..44ba474 100644 --- a/lib/network.sh +++ b/lib/network.sh @@ -319,11 +319,21 @@ EOF sudo smbpasswd -e "${ADMIN_USER:-$USER}" # Start and enable Samba services - sudo systemctl enable smbd nmbd - if sudo systemctl restart smbd nmbd; then + case $DISTRO in + ubuntu|debian|fedora|arch) + sudo systemctl enable smbd nmbd + sudo systemctl restart smbd nmbd + ;; + opensuse) + sudo systemctl enable smb nmb + sudo systemctl restart smb nmb + ;; + esac + + if sudo systemctl is-active smb >/dev/null 2>&1 && sudo systemctl is-active nmb >/dev/null 2>&1; then log_success "Samba configured and started successfully" log_info "Shared folder created at: $share_dir" - add_rollback_action "sudo systemctl stop smbd nmbd && sudo systemctl disable smbd nmbd" + add_rollback_action "sudo systemctl stop smb nmb && sudo systemctl disable smb nmb" return 0 else log_error "Failed to start Samba services"