Neo-Nevz
Thursday, April 5, 2012
BASH FILE LOCKING
Simple example bash file locking
#!/bin/bash
if [ -f "$HOME/testlocking.lock" ] ; then
echo "Maaf, aplikasi sudah jalan!! Ignore..."
exit 1
fi
touch "$HOME/testlocking.lock"
echo "Aplikasi jalan....lamaaaaaaa"
sleep 6
rm "$HOME/testlocking.lock"
:)
Newer Post
Older Post
Home