X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=1ea1c59fca447e12e33be7acb350b8d6c0ed7756;hb=40335b6da6ff7daeb3513d8accae4886ca63cecf;hp=ae1797ce8fd6729216bd156ef89fe205d0f80bce;hpb=7dc30c4f7d8eab47068a70feef62f39005d0bb48;p=samba-cn.git diff --git a/debian/postinst b/debian/postinst index ae1797c..1ea1c59 100755 --- a/debian/postinst +++ b/debian/postinst @@ -6,10 +6,23 @@ # Load CARNet Tools . /usr/share/carnet-tools/functions.sh -cp_check_and_sed '; security = user' \ - 's/;.*security = user/security = user/g' \ +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