3 [ "$1" = "configure" ] || exit 0
4 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
7 . /usr/share/carnet-tools/functions.sh
9 cp_check_and_sed '#[[:space:]]*security = user' \
10 's/#[[:space:]]*security = user/ security = user/g' \
11 /etc/samba/smb.conf || true
13 cp_check_and_sed ';[[:space:]]*security = user' \
14 's/;[[:space:]]*security = user/ security = user/g' \
15 /etc/samba/smb.conf || true
17 cp_get_netaddr || true
19 if ! grep -q '^[[:space:]]*hosts allow' /etc/samba/smb.conf; then
20 echo " hosts allow = $net 127.0.0.1" >> /etc/samba/smb.conf
22 if ! grep -q '^[[:space:]]*hosts deny' /etc/samba/smb.conf; then
23 echo " hosts deny = ALL" >> /etc/samba/smb.conf
27 if [ -x /usr/sbin/invoke-rc.d ]; then
28 [ -x /etc/init.d/samba ] && invoke-rc.d samba restart
30 [ -x /etc/init.d/samba ] && /etc/init.d/samba restart