nicer output

This commit is contained in:
jash
2018-10-15 19:38:50 +02:00
committed by kexkey
parent 178558973b
commit 464782834a

33
dist/setup.sh vendored
View File

@@ -81,11 +81,12 @@ try() {
}
echo_success() {
echo -n "[ OK ]"
#echo -n "[ OK ]"
echo -n
}
echo_failure() {
echo -n "[ FAILED ]"
echo -n "[ FAILED ]"
}
next() {
@@ -159,7 +160,7 @@ copy_file() {
if [[ $? == 1 ]]; then
# different content
if [[ $createBackup == 1 ]]; then
step "Creating backup of $targetFile"
step " create backup of $targetFile"
try cp $targetFile $targetFile-$(date +"%y-%m-%d-%T")
next
fi
@@ -171,7 +172,7 @@ copy_file() {
if [[ $doCopy == 1 ]]; then
local basename=$(basename "$sourceFile")
step "Copying $basename"
step " copy $basename"
try cp $sourceFile $targetFile
next
fi
@@ -192,7 +193,7 @@ install_docker() {
if [[ $BITCOIN_INTERNAL == true ]]; then
if [ ! -d $BITCOIN_DATAPATH ]; then
step "Creating $BITCOIN_DATAPATH"
step " create $BITCOIN_DATAPATH"
try mkdir -p $BITCOIN_DATAPATH
next
fi
@@ -206,7 +207,7 @@ install_docker() {
dockerfile="Dockerfile-alpine"
fi
if [ ! -d $LIGHTNING_DATAPATH ]; then
step "Creating $LIGHTNING_DATAPATH"
step " create $LIGHTNING_DATAPATH"
try mkdir -p $LIGHTNING_DATAPATH
next
fi
@@ -216,13 +217,13 @@ install_docker() {
# build cyphernode images
if [ ! -d $PROXY_DATAPATH ]; then
step "Creating $PROXY_DATAPATH"
step " create $PROXY_DATAPATH"
try mkdir -p $PROXY_DATAPATH
next
fi
if [[ ! $(docker network ls | grep cyphernodenet) =~ cyphernodenet ]]; then
step "Creating cyphernode network"
step " createcyphernode network"
try docker network create cyphernodenet > /dev/null 2>&1
next
fi
@@ -231,9 +232,17 @@ install_docker() {
copy_file $sourceDataPath/installer/start.sh $topLevel/start.sh 0
copy_file $sourceDataPath/installer/stop.sh $topLevel/stop.sh 0
step "Making scripts executable"
try chmod +x start.sh stop.sh
next
if [[ ! -x start.sh ]]; then
step " make start.sh executable"
try chmod +x start.sh
next
fi
if [[ ! -x stop.sh ]]; then
step " make stop.sh executable"
try chmod +x stop.sh
next
fi
cowsay
}
@@ -280,12 +289,10 @@ if [[ $CONFIGURE == 0 && $INSTALL == 0 && $RECREATE == 0 ]]; then
fi
if [[ $CONFIGURE == 1 ]]; then
logline "Configuration phase"
configure $RECREATE
fi
if [[ $INSTALL == 1 ]]; then
logline "Starting installation phase"
install
fi