X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=1ea1c59fca447e12e33be7acb350b8d6c0ed7756;hb=HEAD;hp=eeb706826aea2fdf4d243b3658a42f58256fe98a;hpb=e6b99b972182db14193dae5c7f0d66f472f981f4;p=samba-cn.git diff --git a/debian/postinst b/debian/postinst index eeb7068..1ea1c59 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,42 +1,31 @@ -#!/bin/sh +#!/bin/sh -e [ "$1" = "configure" ] || exit 0 +[ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx -konfiguriraj() { - if [ -f /etc/ntp.conf ]; then - cp -p /etc/ntp.conf /etc/ntp.conf.dpkg-old - fi +# Load CARNet Tools +. /usr/share/carnet-tools/functions.sh - if [ -f /etc/default/ntp-servers ]; then - cp -p /etc/default/ntp-servers /etc/default/ntp-servers.dpkg-old - fi +cp_check_and_sed '#[[:space:]]*security = user' \ + 's/#[[:space:]]*security = user/ security = user/g' \ + /etc/samba/smb.conf || true - cp /usr/share/doc/ntp-cn/ntp.conf.tmpl /etc +cp_check_and_sed ';[[:space:]]*security = user' \ + 's/;[[:space:]]*security = user/ security = user/g' \ + /etc/samba/smb.conf || true - cat > /etc/default/ntp-servers <> /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 -# restartaj sve -if [ -x /etc/init.d/ntp ]; then - if [ -x /usr/sbin/invoke-rc.d ]; then - invoke-rc.d ntp stop - for i in 1 2 3 4 5 6 7 8 9 0; do - pgrep -u root -f /usr/sbin/ntpd >/dev/null && sleep 1 || break - done - invoke-rc.d ntp start - else - /etc/init.d/ntp stop - for i in 1 2 3 4 5 6 7 8 9 0; do - pgrep -u root -f /usr/sbin/ntpd >/dev/null && sleep 1 || break - done - /etc/init.d/ntp start - 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