[root@10-6-8-200 test]# more lock.sh#!/bin/bashLOCKFILE=$(basename $0)_lockecho $LOCKFILEif [ -f $LOCKFILE ]then MYPID=$(cat $LOCKFILE) ps -p $MYPID &> /dev/null [ $? -eq 0 ] && "already running" && exit 5fiecho $$ > $LOCKFILEreadecho hellorm -rf $LOCKFILE