summaryrefslogtreecommitdiffstats
path: root/packaging/Debian/debian/samba.config
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/Debian/debian/samba.config')
-rw-r--r--packaging/Debian/debian/samba.config44
1 files changed, 44 insertions, 0 deletions
diff --git a/packaging/Debian/debian/samba.config b/packaging/Debian/debian/samba.config
new file mode 100644
index 00000000000..d82e56ccf63
--- /dev/null
+++ b/packaging/Debian/debian/samba.config
@@ -0,0 +1,44 @@
+#/bin/sh -e
+#
+#
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+db_title "Samba Server"
+
+# Babysit users who don't read README.Debian
+db_input medium samba/log_files_moved || true
+db_go
+
+db_input medium samba/run_mode || true
+db_go
+
+# We vary the priority of the next question depending on whether
+# /etc/samba/smbpasswd already exists...
+if [ -f /etc/samba/smbpasswd ]; then
+ PRIORITY="low"
+else
+ # If 'encrypt passwords' is true in smb.conf, and smbpasswd
+ # does not exist, default to yes here.
+ FILE=/etc/samba/smb.conf
+ if [ -f "$FILE" ]; then
+ ENCRYPT=`grep -i '^[[:space:]]*encrypt passwords[[:space:]]*=' $FILE \
+ | sed -e's/^[[:space:]]*encrypt passwords[[:space:]]*=[[:space:]]*//i' \
+ | tail -1`
+ if [ "$ENCRYPT" ]; then
+ ENCRYPT=`echo $ENCRYPT | tr '[A-Z]' '[a-z]'`
+ if [ "$ENCRYPT" = "yes" ]; then
+ ENCRYPT=true
+ fi
+ if [ "$ENCRYPT" = "no" ]; then
+ ENCRYPT=false
+ fi
+ fi
+ db_set samba/generate_smbpasswd "$ENCRYPT"
+ fi
+ PRIORITY="medium"
+fi
+
+db_input $PRIORITY samba/generate_smbpasswd || true
+db_go