#!/bin/sh
# This script is meant to restart key services on a vps or server.
# Written by L.C. Version 2.0
logz=/var/log/maint_sh.log
pstree | grep ssh >/dev/null; if [ $? -eq 1 ]
then
{
/etc/init.d/`ls /etc/init.d/ | grep ss*` restart
echo "MAINT.SH: SSH restarted: `date`" >>$logz
}
fi
pstree | grep mysql >/dev/null; if [ $? -eq 1 ]
then
{
/etc/init.d/`ls /etc/init.d/ | grep mysql` restart
echo "MAINT.SH: MySQL restarted: `date`" >>$logz
}
fi
pstree | grep master >/dev/null; if [ $? -eq 1 ]
then
{
/etc/init.d/`ls /etc/init.d/ | grep postfix` restart
echo "MAINT.SH: POSTFIX restarted: `date`" >>$logz
}
fi
Tuesday, October 13, 2009
[ Linux ] maint2.sh
Kind of a Key service restart if put on a cron or scron
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment