Package autorepo-altnode-config: Scripts

Post install

# rsync-server
if ! grep '^\[pub\]' /etc/rsyncd.conf; then
    cat >> /etc/rsyncd.conf <<EOF
# altnode auto configuration
[pub]
path=/var/ftp/pub
#use chroot
read only
list
EOF
    chkconfig rsync on
fi
if ! grep '^\[altnode\]' /etc/rsyncd.conf; then
    cat >> /etc/rsyncd.conf <<EOF
# altnode auto configuration
[altnode]
path=/var/ftp/altnode
use chroot
read only
list
EOF
    chkconfig rsync on
fi
if grep 'only_from = 127.0.0.1' /etc/xinetd.conf; then
    sed -i -e 's,only_from = .*,only_from = 0.0.0.0,' /etc/xinetd.conf
fi
service xinetd restart
# postfix
if ! grep '^relayhost' /etc/postfix/main.cf; then
    cat >> /etc/postfix/main.cf <<EOF
# altnode auto configuration
relayhost = [relay.mskdc.altlinux.org]
EOF
    chkconfig postfix on ||:
    service postfix restart ||:
fi
if ! grep '^myhostname' /etc/postfix/main.cf; then
    echo "WARNING: myhostname not found in /etc/postfix/main.cf"
else
    mailfqdn=`grep '^myhostname' /etc/postfix/main.cf | awk '{print $3}'`
    if [ x$mailfqdn != x`hostname` ]; then
	echo "WARNING: myhostname in /etc/postfix/main.cf does not match hostname"
    fi
fi
service monit restart ||: