clean up if {} statement to keep in sync with HEAD
[Samba.git] / packaging / Debian / debian / samba.config
blobd82e56ccf63052339be28f24220a5c8f0d5719fc
1 #/bin/sh -e
5 # Source debconf library.
6 . /usr/share/debconf/confmodule
8 db_title "Samba Server"
10 # Babysit users who don't read README.Debian
11 db_input medium samba/log_files_moved || true
12 db_go
14 db_input medium samba/run_mode || true
15 db_go
17 # We vary the priority of the next question depending on whether
18 #       /etc/samba/smbpasswd already exists...
19 if [ -f /etc/samba/smbpasswd ]; then
20         PRIORITY="low"
21 else
22         # If 'encrypt passwords' is true in smb.conf, and smbpasswd
23         # does not exist, default to yes here.
24         FILE=/etc/samba/smb.conf
25         if [ -f "$FILE" ]; then
26                 ENCRYPT=`grep -i '^[[:space:]]*encrypt passwords[[:space:]]*=' $FILE \
27                  | sed -e's/^[[:space:]]*encrypt passwords[[:space:]]*=[[:space:]]*//i' \
28                  | tail -1`
29                 if [ "$ENCRYPT" ]; then
30                         ENCRYPT=`echo $ENCRYPT | tr '[A-Z]' '[a-z]'`
31                         if [ "$ENCRYPT" = "yes" ]; then
32                                 ENCRYPT=true
33                         fi
34                         if [ "$ENCRYPT" = "no" ]; then
35                                 ENCRYPT=false
36                         fi
37                 fi
38                 db_set samba/generate_smbpasswd "$ENCRYPT"
39         fi
40         PRIORITY="medium"
43 db_input $PRIORITY samba/generate_smbpasswd || true
44 db_go