fixed indenting

This commit is contained in:
jash
2018-10-08 20:47:33 +02:00
committed by kexkey
parent 80b47e6d17
commit 79f7d9a837
4 changed files with 69 additions and 69 deletions

View File

@@ -1,17 +1,17 @@
configure() {
local current_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
## build setup docker image
local recreate=""
local current_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
## build setup docker image
local recreate=""
if [[ $1 == 1 ]]; then
recreate="recreate"
fi
if [[ $1 == 1 ]]; then
recreate="recreate"
fi
build_docker_image ../ cyphernodeconf && clear && echo "Thinking..."
build_docker_image ../ cyphernodeconf && clear && echo "Thinking..."
# configure features of cyphernode
docker run -v $current_path/../data:/data \
# configure features of cyphernode
docker run -v $current_path/../data:/data \
--log-driver=none\
--rm -it cyphernodeconf:latest $recreate
}

View File

@@ -2,54 +2,54 @@
install_docker() {
local sourceDataPath=../data
local topLevel=../..
local sourceDataPath=../data
local topLevel=../..
if [[ $BITCOIN_INTERAL == true || $FEATURE_LIGHTNING == true ]]; then
trace "Updating SatoshiPortal repos"
git submodule update --recursive --remote
trace "Creating SatoshiPortal images"
if [[ $BITCOIN_INTERAL == true || $FEATURE_LIGHTNING == true ]]; then
trace "Updating SatoshiPortal repos"
git submodule update --recursive --remote
trace "Creating SatoshiPortal images"
fi
fi
local arch=$(uname -m) # TODO: is this correct for every host
if [[ $BITCOIN_INTERNAL == true ]]; then
build_docker_image ../SatoshiPortal/dockers/$arch/bitcoin-core cyphernode/bitcoin
if [ ! -d $BITCOIN_DATAPATH ]; then
trace "Creating $BITCOIN_DATAPATH"
mkdir -p $BITCOIN_DATAPATH
fi
build_docker_image ../SatoshiPortal/dockers/$arch/bitcoin-core cyphernode/bitcoin
if [ ! -d $BITCOIN_DATAPATH ]; then
trace "Creating $BITCOIN_DATAPATH"
mkdir -p $BITCOIN_DATAPATH
fi
if [[ -f $BITCOIN_DATAPATH/bitcoin.conf ]]; then
trace "Creating backup of $BITCOIN_DATAPATH/bitcoin.conf"
cp $BITCOIN_DATAPATH/bitcoin.conf $BITCOIN_DATAPATH/bitcoin.conf-$(date +"%y-%m-%d-%T")
fi
if [[ -f $BITCOIN_DATAPATH/bitcoin.conf ]]; then
trace "Creating backup of $BITCOIN_DATAPATH/bitcoin.conf"
cp $BITCOIN_DATAPATH/bitcoin.conf $BITCOIN_DATAPATH/bitcoin.conf-$(date +"%y-%m-%d-%T")
fi
trace "Copying bitcoin core node config"
cp $sourceDataPath/bitcoin/bitcoin.conf $BITCOIN_DATAPATH
trace "Copying bitcoin core node config"
cp $sourceDataPath/bitcoin/bitcoin.conf $BITCOIN_DATAPATH
fi
if [[ $FEATURE_LIGHTNING == true ]]; then
if [[ $LIGHTNING_IMPLEMENTATION == "c-lightning" ]]; then
build_docker_image ../SatoshiPortal/dockers/$arch/LN/c-lightning cyphernode/clightning
if [ ! -d $LIGHTNING_DATAPATH ]; then
trace "Creating $LIGHTNING_DATAPATH"
mkdir -p $LIGHTNING_DATAPATH
fi
if [[ $LIGHTNING_IMPLEMENTATION == "c-lightning" ]]; then
build_docker_image ../SatoshiPortal/dockers/$arch/LN/c-lightning cyphernode/clightning
if [ ! -d $LIGHTNING_DATAPATH ]; then
trace "Creating $LIGHTNING_DATAPATH"
mkdir -p $LIGHTNING_DATAPATH
fi
if [[ -f $LIGHTNING_DATAPATH/config ]]; then
trace "Creating backup of $LIGHTNING_DATAPATH/config"
cp $LIGHTNING_DATAPATH/config $LIGHTNING_DATAPATH/config-$(date +"%y-%m-%d-%T")
fi
if [[ -f $LIGHTNING_DATAPATH/config ]]; then
trace "Creating backup of $LIGHTNING_DATAPATH/config"
cp $LIGHTNING_DATAPATH/config $LIGHTNING_DATAPATH/config-$(date +"%y-%m-%d-%T")
fi
trace "Copying c-lightning config"
cp $sourceDataPath/lightning/c-lightning/config $LIGHTNING_DATAPATH
fi
trace "Copying c-lightning config"
cp $sourceDataPath/lightning/c-lightning/config $LIGHTNING_DATAPATH
fi
fi
if [[ $FEATURE_OTSCLIENT == true ]]; then
build_docker_image ../SatoshiPortal/dockers/$arch/ots/otsclient cyphernode/otsclient
if [[ $FEATURE_OTSCLIENT == true ]]; then
build_docker_image ../SatoshiPortal/dockers/$arch/ots/otsclient cyphernode/otsclient
fi
@@ -57,9 +57,9 @@ install_docker() {
trace "Creating cyphernode images"
build_docker_image ../../proxy_docker/ cyphernode/proxy
if [ ! -d $PROXY_DATAPATH ]; then
trace "Creating $PROXY_DATAPATH"
mkdir -p $PROXY_DATAPATH
fi
trace "Creating $PROXY_DATAPATH"
mkdir -p $PROXY_DATAPATH
fi
build_docker_image ../../cron_docker/ cyphernode/proxycron
build_docker_image ../../pycoin_docker/ cyphernode/pycoin
@@ -67,16 +67,16 @@ install_docker() {
docker network create cyphernodenet > /dev/null 2>&1
if [[ -f $topLevel/docker-compose.yaml ]]; then
trace "Creating backup of docker-compose.yaml"
cp $topLevel/docker-compose.yaml $topLevel/docker-compose.yaml-$(date +"%y-%m-%d-%T")
fi
trace "Creating backup of docker-compose.yaml"
cp $topLevel/docker-compose.yaml $topLevel/docker-compose.yaml-$(date +"%y-%m-%d-%T")
fi
trace "Copying docker-compose.yaml to top level"
cp $sourceDataPath/installer/docker/docker-compose.yaml $topLevel/docker-compose.yaml
trace "Copying docker-compose.yaml to top level"
cp $sourceDataPath/installer/docker/docker-compose.yaml $topLevel/docker-compose.yaml
echo "+------------------------------------------+"
echo "| to start cyphernode run: |"
echo "| docker-compose -f docker-compose.yaml up |"
echo "+------------------------------------------+"
echo "+------------------------------------------+"
echo "| to start cyphernode run: |"
echo "| docker-compose -f docker-compose.yaml up |"
echo "+------------------------------------------+"
}

View File

@@ -1,3 +1,3 @@
install_lunanode() {
trace "Lunanode installation not implemented"
trace "Lunanode installation not implemented"
}

View File

@@ -10,14 +10,14 @@ RECREATE=0
while getopts ":cir" opt; do
case $opt in
r)
RECREATE=1
;;
r)
RECREATE=1
;;
c)
CONFIGURE=1
CONFIGURE=1
;;
i)
INSTALL=1
INSTALL=1
;;
\?)
echo "Invalid option: -$OPTARG. Use -c to configure and -i to install" >&2
@@ -26,15 +26,15 @@ while getopts ":cir" opt; do
done
if [[ $CONFIGURE == 0 && $INSTALL == 0 && RECREATE == 0 ]]; then
echo "Please use -c to configure, -i to install and -ci to do both. Use -r to recreate config files."
echo "Please use -c to configure, -i to install and -ci to do both. Use -r to recreate config files."
else
if [[ $CONFIGURE == 1 ]]; then
trace "Starting configuration phase"
configure $RECREATE
fi
if [[ $CONFIGURE == 1 ]]; then
trace "Starting configuration phase"
configure $RECREATE
fi
if [[ $INSTALL == 1 ]]; then
trace "Starting installation phase"
install
fi
if [[ $INSTALL == 1 ]]; then
trace "Starting installation phase"
install
fi
fi