# set -x
releasever=`rpm -q --qf %{version} centos-release`    

if [ $releasever -eq 6 ];then
mv /etc/init/control-alt-delete.conf /etc/init/control-alt-delete.conf.bak 
else if [ $releasever -eq 7 ];then
rm -f /usr/lib/systemd/system/ctrl-alt-del.target
fi
fi



echo `pwd`
if [ `grep ip_default_ttl /etc/sysctl.conf|wc -l` -eq 0 ];then
echo 'net.ipv4.ip_default_ttl = 128'>>/etc/sysctl.conf
fi
sysctl -p
sed -i '/^PASS_MIN_LEN/c PASS_MIN_LEN 8' /etc/login.defs
grep -Pv '^$|^#' /etc/login.defs
echo 'export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S `whoami` "
export HISTSIZE="10000"
export HISTFILE="/var/log/$USER-$UID.log"
export HISTCONTROL=ignoredups
shopt -s histappend'>/etc/profile.d/histtimeformat.sh
source /etc/profile.d/histtimeformat.sh
truncate -s 0 /var/log/$USER-$UID.log
for i in '* soft nofile' '* hard nofile'
do
if [ `grep "$i" /etc/security/limits.conf|wc -l` -eq 0 ];then
echo "$i 65535" >>/etc/security/limits.conf
fi
done
grep -Pv '^$|^#' /etc/security/limits.conf

