5 # Source debconf library.
6 . /usr/share/debconf/confmodule
8 # Function for grabbing a parameter from an smb.conf file
18 if [ -z "$FILE" ]; then
23 s/^[[:space:]]*\[global\]/\[global\]/i
24 /^\[global\]/,/^[[:space:]]*\[/ {
25 s/^[[:space:]]*$1[[:space:]]*=[[:space:]]*//pi
30 FILE=/etc/samba/smb.conf
32 db_title "Samba Server"
34 # Babysit users who don't read README.Debian
35 if [ -n "$2" ] && dpkg --compare-versions "$2" lt "2.2"
37 db_input medium samba/log_files_moved || true
41 db_input medium samba/run_mode || true
45 # Offer to move the password database for existing users
46 if [ "$1" = "configure" -a -n "$2" -a -e /etc/samba/smbpasswd \
47 -a ! -e /var/lib/samba/passdb.tdb ] \
48 && dpkg --compare-versions "$2" lt 2.99.cvs.20020713-2
50 FILE=/etc/samba/smb.conf
52 if [ -f "$FILE" ]; then
53 PASSDB=`smbconf_retr "passdb backend"`
56 if echo "$PASSDB" | grep -q ldapsam; then
59 db_get samba-common/do_debconf || true
60 if [ "${RET}" = "false" ]; then
64 db_input "$TDBPRIORITY" samba/tdbsam || true
67 # We vary the priority of the next question depending on whether
68 # the password database already exists...
69 if [ -e /etc/samba/smbpasswd -o -e /var/lib/samba/passdb.tdb ]; then
72 # If 'encrypt passwords' is true in smb.conf, and smbpasswd
73 # does not exist, default to yes here.
74 FILE=/etc/samba/smb.conf
75 if [ -f "$FILE" ]; then
76 ENCRYPT=`smbconf_retr "encrypt passwords"`
77 if [ "$ENCRYPT" ]; then
78 ENCRYPT=`echo $ENCRYPT | tr '[A-Z]' '[a-z]'`
79 if [ "$ENCRYPT" = "yes" ]; then
82 if [ "$ENCRYPT" = "no" ]; then
86 db_set samba/generate_smbpasswd "$ENCRYPT"
91 db_input $PRIORITY samba/generate_smbpasswd || true