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
|
2014-07-06 20:07:49 +02:00
|
|
|
LOCKFILE="/run/lock/ffmap"
|
2012-02-17 02:09:21 +01:00
|
|
|
|
2012-06-06 02:21:59 +02:00
|
|
|
[ "$DEST" ] || exit 1
|
|
|
|
|
2014-02-07 10:53:22 +01:00
|
|
|
cd "$(dirname "$0")"/
|
2013-02-02 01:21:29 +01:00
|
|
|
|
2014-07-06 20:07:49 +02:00
|
|
|
if lockfile-check "$LOCKFILE"; then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
lockfile-create "$LOCKFILE"
|
|
|
|
lockfile-touch "$LOCKFILE" &
|
|
|
|
LOCKPID="$!"
|
|
|
|
|
2014-07-06 20:04:24 +02:00
|
|
|
./bat2nodes.py -A -a aliases.json -d $DEST
|
2014-07-06 20:07:49 +02:00
|
|
|
|
|
|
|
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"
|