#!/bin/bash

echo "** Enabling sendmail localhost access"
echo "sendmail: 127.0.0.1 : ALLOW" >> /etc/hosts.allow
echo "sendmail: [::1] : ALLOW" >> /etc/hosts.allow

echo "   Disable screen blanking on tty1"
echo '/usr/bin/setterm -blank 0 -powersave off -powerdown 0 > /dev/tty1 2>&1 < /dev/tty1' >> /etc/init.d/boot.local

echo "   Disable blanking of DCUI"
echo '/usr/bin/setterm -blank 0 -powersave off -powerdown 0 > /dev/tty2 2>&1 < /dev/tty2' >> /etc/init.d/boot.local
# For the firstboot, /etc/init.d/boot.local has been already executed at this
# stage. To disable blanking of DCUI  and TTY1 on completion of firstboot execute the
# setterm command.
/usr/bin/setterm -blank 0 -powersave off -powerdown 0 > /dev/tty1 2>&1 < /dev/tty1
/usr/bin/setterm -blank 0 -powersave off -powerdown 0 > /dev/tty2 2>&1 < /dev/tty2

echo "   Add login failure delay to pam configuration"
echo "auth    optional        pam_faildelay.so" >> /etc/pam.d/common-auth

# Workaround for Studio 2.6 bug 842974.
# The mount command on SLES11 takes 15 seconds to timeout when a CD drive is empty.
sed -i -e 's/^\(.*ovfenv\)/#\1/' /etc/profile.d/zzzz-vamilocale.sh

# This forces NTP daemon to set the correct time w.r.t remote server before it starts. Bug 1295956.
sed -i -e 's/^NTPD_FORCE_SYNC_ON_STARTUP="no"/NTPD_FORCE_SYNC_ON_STARTUP="yes"/' /etc/sysconfig/ntp
