#!/bin/sh -e [ "$1" = "configure" ] || exit 0 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx # Load CARNet Tools . /usr/share/carnet-tools/functions.sh cp_check_and_sed '#[[:space:]]*security = user' \ 's/#[[:space:]]*security = user/ security = user/g' \ /etc/samba/smb.conf || true cp_check_and_sed ';[[:space:]]*security = user' \ 's/;[[:space:]]*security = user/ security = user/g' \ /etc/samba/smb.conf || true cp_get_netaddr || true net="$RET" if ! grep -q '^[[:space:]]*hosts allow' /etc/samba/smb.conf; then echo " hosts allow = $net 127.0.0.1" >> /etc/samba/smb.conf fi if ! grep -q '^[[:space:]]*hosts deny' /etc/samba/smb.conf; then echo " hosts deny = ALL" >> /etc/samba/smb.conf fi # restart if [ -x /usr/sbin/invoke-rc.d ]; then [ -x /etc/init.d/samba ] && invoke-rc.d samba restart else [ -x /etc/init.d/samba ] && /etc/init.d/samba restart fi