#!/bin/bash if [ ! `ps auxwww |grep -w "joe /etc/dhcpd.conf" |grep -vw "grep" >/dev/null` -o ! `ps auxwww |grep -w "vi /etc/dhcpd.conf" |grep -vw "grep" >/dev/null` ] then varstat="OK" echo "Nobody is editing the file!" else echo "Somebody is editing dhcpd.conf!" varstat="NOT" fi