You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
550 B

#!/usr/bin/env bash
set -e
cli=${SIONA_CLI}
DOMAIN=${SIONA_DOMAIN}
ROOT_DIR=${SIONA_ROOT_DIR}
# only ask for data if we don't have it
#if [ -s ~/data/blocks/block-$HEIGHT.json ]; then
# HEIGHT=$($cli getblockcount); $cli getblock $HEIGHT > ~/data/blocks/block-$HEIGHT.json
#fi
NEWFILE=/var/www/$ROOT_DIR/$DOMAIN/blocks/index.new.html
INDEXFILE=/var/www/$ROOT_DIR/$DOMAIN/blocks/index.html
# reads data from /var/www/$domain/api
/var/www/$ROOT_DIR/$DOMAIN/bin/update_blocks_redis.pl > $NEWFILE
if [ -s $NEWFILE ]; then
cp $NEWFILE $INDEXFILE
fi