ffmap-backend/mkmap.sh

33 lines
494 B
Bash
Raw Normal View History

2012-02-17 02:09:21 +01:00
#!/bin/bash
2012-06-06 02:21:59 +02:00
set -e
2012-02-17 02:09:21 +01:00
DEST=$1
LOCKFILE="/run/lock/ffmap"
2012-02-17 02:09:21 +01:00
2012-06-06 02:21:59 +02:00
[ "$DEST" ] || exit 1
cd "$(dirname "$0")"/
if lockfile-check "$LOCKFILE"; then
exit
fi
lockfile-create "$LOCKFILE"
lockfile-touch "$LOCKFILE" &
LOCKPID="$!"
./bat2nodes.py -A -a aliases.json -d $DEST
kill "$LOCKPID"
lockfile-remove "$LOCKFILE"
if lockfile-check "$LOCKFILE-sync"; then
exit
fi
lockfile-create "$LOCKFILE-sync"
lockfile-touch "$LOCKFILE-sync" &
LOCKPID="$!"
kill "$LOCKPID"
lockfile-remove "$LOCKFILE-sync"