#!/bin/sh
LOCKFILE=/tmp/$(basename $0)
if [ -f "$LOCKFILE" ]
then
echo "file had been locked !cant open"
exit 1
else
echo "now,the file locking !"
touch $LOCKFILE
fi
sleep 10
rm -f $LOCKFILE
LOCKFILE=/tmp/$(basename $0)
if [ -f "$LOCKFILE" ]
then
echo "file had been locked !cant open"
exit 1
else
echo "now,the file locking !"
touch $LOCKFILE
fi
sleep 10
rm -f $LOCKFILE