diff --git a/install/script/configure.sh b/install/script/configure.sh index 15811df..c290f95 100644 --- a/install/script/configure.sh +++ b/install/script/configure.sh @@ -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 } diff --git a/install/script/install_docker.sh b/install/script/install_docker.sh index 82e0acb..24c0136 100644 --- a/install/script/install_docker.sh +++ b/install/script/install_docker.sh @@ -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 "+------------------------------------------+" } \ No newline at end of file diff --git a/install/script/install_lunanode.sh b/install/script/install_lunanode.sh index b2d708e..09dfec5 100644 --- a/install/script/install_lunanode.sh +++ b/install/script/install_lunanode.sh @@ -1,3 +1,3 @@ install_lunanode() { - trace "Lunanode installation not implemented" + trace "Lunanode installation not implemented" } \ No newline at end of file diff --git a/install/script/setup.sh b/install/script/setup.sh index 4082994..283df16 100755 --- a/install/script/setup.sh +++ b/install/script/setup.sh @@ -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