#!/bin/bash # by: archangel PS_TO_FIND="eggdrop"; PS_BY_USER="irxc"; PS_IN_DIR="/home/irxc/freenode"; PS_TO_START="./eggdrop nibbler.conf"; PS_OUT=`ps aux | grep ${PS_TO_FIND} | grep ${PS_BY_USER}`; if [ -z "${PS_OUT}" ]; then echo "Process '${PS_TO_FIND}' by '${PS_BY_USER}' is dead."; echo "Starting '${PS_TO_START}'."; cd ${PS_IN_DIR}; exec ${PS_TO_START}; fi;