« September 2006 | Main | January 2007 »

November 30, 2006

Simple Script to check if a process is running and if not restart it

I wrote this simple script to check if a process is running and if not restart it

#!/bin/sh
TEST=`pgrep $1`
if [ ! "$TEST" ]
then
$2
else
echo "$1 Alive "
fi

Usage:
check.sh

Example:
check.sh named /usr/local/sbin/named

November 20, 2006

South Park Me

How I see me:

southparkme.gif

How others see me:

south%20park%20you.jpg

November 9, 2006

ddns for linux / unix in a simple cron job

Here is a script to update your dynamic dns for linux / unix... edit a script:

vi /root/ddns.sh

put in ddns.sh :



chmod 755 ddns.sh

then store your crontab:

crontab -l > /root/crontab.new

edit the /root/crontab.new and add the line:

*/15 * * * * /root/ddns.sh &>/dev/null

then load the new crontab:

crontab /root/crontab.new

Your done! ddns is all ready to go!