summaryrefslogtreecommitdiffstats
path: root/adei/scripts/adei-branch.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-02-22 00:51:18 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-02-22 00:51:18 +0100
commit28879b78ddff075daf9d28f6389ecab9909c1de8 (patch)
tree4817e399b31e425248831bf665b478ce75ea63ea /adei/scripts/adei-branch.sh
parentdfe9895825ffbab23d9e8925b28282206d6678f8 (diff)
downloadadei-28879b78ddff075daf9d28f6389ecab9909c1de8.tar.gz
adei-28879b78ddff075daf9d28f6389ecab9909c1de8.tar.bz2
adei-28879b78ddff075daf9d28f6389ecab9909c1de8.tar.xz
adei-28879b78ddff075daf9d28f6389ecab9909c1de8.zip
Move locking protection from run-cron to adei-branch
Diffstat (limited to 'adei/scripts/adei-branch.sh')
-rwxr-xr-xadei/scripts/adei-branch.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/adei/scripts/adei-branch.sh b/adei/scripts/adei-branch.sh
index 6fa8db2..5f14c01 100755
--- a/adei/scripts/adei-branch.sh
+++ b/adei/scripts/adei-branch.sh
@@ -10,8 +10,12 @@ if [ ! -d /adei/src -o ! -d /adei/tmp -o ! -d /adei/sys -o ! -d /adei/cfg ]; th
exit 1
fi
+LOCK_FILE=.lock
+(
+ flock -x 10
+ flock -x 11
-if [ ! -f /adei/src/VERSION ]; then
+ if [ ! -f /adei/src/VERSION ]; then
bzr branch -r $ADEI_REVISION --use-existing-dir http://darksoft.org/bzr/adei/trunk/ /adei/src
(
cd /adei/src
@@ -33,9 +37,9 @@ if [ ! -f /adei/src/VERSION ]; then
ln -s ../cfg/config.actual.php config.actual.php
ln -s ../cfg/config.override.php config.override.php
)
-fi
+ fi
-(
+ (
cd /adei/src
for setup in $ADEI_ENABLED_SETUPS $ADEI_SETUP; do
if [[ ! -a setups/$setup ]]; then
@@ -48,4 +52,5 @@ fi
ln -s ../../cfg/$setup setups/$setup
fi
done
-)
+ )
+) 10> /adei/cfg/$LOCK_FILE 11> /adei/src/$LOCK_FILE