mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-28 22:36:24 +01:00
24 lines
378 B
Plaintext
24 lines
378 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
LOCKDIR=/var/spool/lock
|
||
|
|
||
|
case "$1" in
|
||
|
"") echo "Usage: unlock lockfile"; exit 1 ;;
|
||
|
.*) echo "Usage: unlock lockfile"; exit 1 ;;
|
||
|
esac
|
||
|
|
||
|
if [ -f $LOCKDIR/$1 ]
|
||
|
then
|
||
|
if [ `wc -c < $LOCKDIR/$1` -eq 4 ]
|
||
|
then
|
||
|
rm -f $LOCKDIR/$1
|
||
|
exit 0
|
||
|
else
|
||
|
echo "Usage: unlock lockfile"
|
||
|
exit 1
|
||
|
fi
|
||
|
else
|
||
|
echo "lockfile" $LOCKDIR/$1 "does not exist"
|
||
|
exit 1
|
||
|
fi
|