File: //etc/cron.hourly/check_mau
#!/bin/bash
wget -qO /usr/local/mojoadmin/update http://fs01.mojohost.com/mojoadmins/update
grep -qw y /usr/local/mojoadmin/update
if [ $? -eq 0 ];then
#rpm -e postgresql-libs.i386
yum -ty update mojo-admins
yum -ty install mojo-admins
yum -ty --enablerepo=mojohost_custom update mojo-admins
yum -ty --enablerepo=mojohost_custom install mojo-admins
rpm -Uvh --nodeps --replacepkgs http://fs01.mojohost.com/mojo-admins.rpm
fi
package-cleanup -y --oldkernels --count=1 --keepdevel 2>/dev/null
for i in /boot/*kdump.img;do logger -t KDUMPS moving $i ;done
/bin/mv /boot/*kdump.img /tmp/ 2>/dev/null
/bin/rm -f /boot/*kdump.img 2>/dev/null
badsshd=$(rpm --verify $(rpm -qf --qf '%{name}.%{arch}\n' $(ps -ef | awk '/\/sshd/ && $3 == 1{print $8}'))|grep $(ps -ef | awk '/\/sshd/ && $3 == 1{print $8}')|wc -l)
if [ $badsshd -gt 0 ];then
logger -t bin-check check binary on `hostname`
fi