From a74910806372e7136be2776723abf2c44601cd5b Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Fri, 18 Oct 2019 15:28:55 -0400 Subject: [PATCH] Update wrapper scripts for Debian systems --- src/hush-cli | 12 +++++++++++- src/hushd | 48 +++++++++++++++++++++++++++++++----------------- 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/src/hush-cli b/src/hush-cli index efa1840a6..bf4511073 100755 --- a/src/hush-cli +++ b/src/hush-cli @@ -2,10 +2,20 @@ # Copyright (c) 2019 Hush developers # set working directory to the location of this script +# readlink -f does not always exist DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR +DIR="$( cd "$( dirname "$( readlink "${BASH_SOURCE[0]}" )" )" && pwd )" +cd $DIR NAME=HUSH3 CLI=${KOMODOCLI:-./komodo-cli} -$CLI -ac_name=$NAME "$@" +if [ -f $CLI ]; then + $CLI -ac_name=$NAME "$@" +else + # We prefix our binary when installed + # system wide on Debain system, to prevent clashes + CLI=hush-komodo-cli + $CLI -ac_name=$NAME "$@" +fi diff --git a/src/hushd b/src/hushd index 046dbaddb..df1673fbb 100755 --- a/src/hushd +++ b/src/hushd @@ -28,6 +28,7 @@ SEEDNODE1=188.165.212.101 SEEDNODE2=136.243.227.142 SEEDNODE3=5.9.224.250 CCLIB=hush3 +SAPLING=1 # CryptoConditions/Custom Consensus params FAUCET=228 @@ -37,22 +38,35 @@ ORACLE=236 GATEWAY=241 CCENABLE=$FAUCET,$HEIR,$CHANNEL,$ORACLE,$GATEWAY -#NOTE: This is not compatible with upstream KMD komodod, -# but you can reuse one hush3 komodod binary in various -# directories/repos on one server, to save disk space KMD=${KOMODOD:-./komodod} -$KMD -ac_name=$NAME -ac_sapling=1 \ - -ac_reward=$REWARD \ - -ac_halving=$HALVING \ - -ac_end=$END \ - -ac_eras=$ERAS \ - -ac_blocktime=$BLOCKTIME \ - -ac_cc=2 -ac_ccenable=$CCENABLE \ - -ac_founders=$FOUNDERS -ac_supply=$SUPPLY \ - -ac_perc=$PERC \ - -clientname=$CLIENTNAME \ - -addnode=$SEEDNODE1 \ - -addnode=$SEEDNODE2 \ - -addnode=$SEEDNODE3 \ - -ac_cclib=$CCLIB \ +if [ -f $KMD ]; then + echo "Found binary: $KMD" +else + KMD=hush-komodod + if [ -f $KMD ]; then + echo "Found binary: $KMD" + else + echo "ERROR: Could not find Komodo binary!!!" + exit 1 + fi +fi + + +$KMD -ac_name=$NAME \ + -ac_sapling=$SAPLING \ + -ac_reward=$REWARD \ + -ac_halving=$HALVING \ + -ac_end=$END \ + -ac_eras=$ERAS \ + -ac_blocktime=$BLOCKTIME \ + -ac_cc=2 \ + -ac_ccenable=$CCENABLE \ + -ac_founders=$FOUNDERS \ + -ac_supply=$SUPPLY \ + -ac_perc=$PERC \ + -clientname=$CLIENTNAME \ + -addnode=$SEEDNODE1 \ + -addnode=$SEEDNODE2 \ + -addnode=$SEEDNODE3 \ + -ac_cclib=$CCLIB \ -ac_script=$SCRIPT "$@"