1 parent c2dc80e commit f2b9340Copy full SHA for f2b9340
1 file changed
.debpkg/DEBIAN/postinst
@@ -1,6 +1,13 @@
1
#!/bin/bash
2
echo "disabling samba daemons..."
3
-systemctl disable samba
4
-systemctl disable smbd
5
-systemctl disable nmbd
6
-systemctl disable winbind
+services=("samba" "smbd" "nmbd" "winbind")
+
+for service in "${services[@]}"; do
+ if systemctl is-active --quiet "$service"; then
7
+ echo "$service is active -> stopping and disabling..."
8
+ systemctl stop "$service"
9
+ systemctl disable "$service"
10
+ else
11
+ echo "$service is not active -> skipping."
12
+ fi
13
+done
0 commit comments