diff options
author | Linus Nordberg <linus@nordberg.se> | 2015-04-13 14:19:38 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2015-04-13 17:11:07 +0200 |
commit | cf6e64bf94677092ef94a6f4ed7c1391dcd43f23 (patch) | |
tree | 903d5a399ce3c4a98fe0a61e51a024c9f4616dda /packaging/docker/catlfish-dev/merge.sh | |
parent | 2e7ae73196da22dcf9b4817fc38861774ff61b84 (diff) |
Run all types of nodes from the same docker image.
Diffstat (limited to 'packaging/docker/catlfish-dev/merge.sh')
-rwxr-xr-x | packaging/docker/catlfish-dev/merge.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/packaging/docker/catlfish-dev/merge.sh b/packaging/docker/catlfish-dev/merge.sh new file mode 100755 index 0000000..304d8a4 --- /dev/null +++ b/packaging/docker/catlfish-dev/merge.sh @@ -0,0 +1,29 @@ +#! /bin/sh + +# Default intervals +# - 5m before first merge +# - 20m between subsequent merges +S1=300; [ -n "$1" ] && S1=$1 +S2=1200; [ -n "$2" ] && S2=$2 + +DBDIR="$3" + +[ -d $DBDIR ] || mkdir $DBDIR +[ -d $DBDIR/chains ] || mkdir $DBDIR/chains +[ -e $DBDIR/logorder ] || touch $DBDIR/logorder + +echo "merge: ERL_LIBS: $ERL_LIBS" + +date +echo "merge: waiting $(expr $S1 / 60)m$(expr $S1 % 60)s before merging for the first time" +sleep $S1 + +while true; do + echo "$0: merging" + date + python /usr/local/src/catlfish/tools/merge.py \ + --config /usr/local/etc/catlfish/system.cfg \ + --localconfig /usr/local/etc/catlfish/merge.cfg + echo "merge: waiting $(expr $S2 / 60)m$(expr $S2 % 60)s before merging again" + sleep $S2 +done |