Hello Nixcraft!!!
Learning Shell Scripting. Bear with me. And I attempted to search for the answer prior to posting.
I am currently working on a bash shell script that will update a configuration change to a servers swatch logwatch application. The issue that appears to happen is I am successful in the termination piece of the puzzle. However the command that I issue from the command line in the shell does not successfully start the perl Processes again. I tried a sleep command before the init scripts and I was unsuccessful. Please shed some light on this:
Code:
# grep for Process ID and create variable
#
for proc in `ps -ef | grep swatch | awk '{print $2}'`; do
kill -9 $proc ; done
#
#
# Issue start command for perl swatch processes to run
#
swatch -c /var/log/swatch/.swatchrc.apache --script-dir=/var/log/swatch -t /usr/local/apache/logs/radio24_error_log &
swatch -c /var/log/swatch/.swatchrc.messages --script-dir=/var/log/swatch -t /var/log/messages &