#/bin/sh
+BASE_DIR="$HOME/.antifraude"
+LOCK_DIR="$BASE_DIR/lock"
+
# Lee del teclado un valor
#
# parĂ¡metros :
echo "No"
return
fi
- echo "lero lero" > "$INST_DIR/lock/$1.pid"
+ echo "$$" > "$LOCK_DIR/$1.pid"
}
# Desbloquea el script
unlock () {
- rm -rf "$INST_DIR/lock/$1.pid"
+ rm -rf "$LOCK_DIR/$1.pid"
}
# Consulta si un script esta lockeado
is_lock () {
- if [ -e "$INST_DIR/lock/$1.pid" ] ; then
+ if [ -e "$LOCK_DIR/$1.pid" ] ; then
# Lock file encontrado!
return 0
fi