From cf13427cf35d6535fdaefbda962f2a9d67d38593 Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Sat, 2 Dec 2017 16:14:48 -0700 Subject: [PATCH 01/17] Forward compatibility fix for CentOS 7.x platform. (No functional changes) When nmap-ncat is properly installed, prevent this misleading error message: missing dependency: netcat6 --- lib/dashman_functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index 2687ab3..ba1af18 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -173,7 +173,7 @@ _check_dependencies() { # make sure we have the right netcat version (-4,-6 flags) if [ ! -z "$(which nc)" ]; then - (nc -z -4 8.8.8.8 53 2>&1) >/dev/null + (nc -4 8.8.8.8 53 2>&1) /dev/null if [ $? -gt 0 ]; then MISSING_DEPENDENCIES="${MISSING_DEPENDENCIES}netcat6 " fi @@ -935,7 +935,7 @@ get_dashd_status(){ get_public_ips MASTERNODE_BIND_IP=$PUBLIC_IPV4 - PUBLIC_PORT_CLOSED=$( timeout 2 nc -4 -z $PUBLIC_IPV4 9999 2>&1 >/dev/null; echo $? ) + PUBLIC_PORT_CLOSED=$( timeout 2 nc -4 $PUBLIC_IPV4 9999 2>&1 /dev/null; echo $? ) # if [ $PUBLIC_PORT_CLOSED -ne 0 ] && [ ! -z "$PUBLIC_IPV6" ]; then # PUBLIC_PORT_CLOSED=$( timeout 2 nc -6 -z $PUBLIC_IPV6 9999 2>&1 >/dev/null; echo $? ) # if [ $PUBLIC_PORT_CLOSED -eq 0 ]; then From 979218cfaa5c894b524498538d8dcbcabf95357a Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Tue, 19 Dec 2017 13:08:20 -0700 Subject: [PATCH 02/17] Convert funding txn and address to use "dash-cli masternode status" instead of relying on dashninja.pl website --- lib/dashman_functions.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index ba1af18..b92c9f4 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -1029,8 +1029,6 @@ awk ' \ WEB_NINJA_JSON_TEXT=$(echo $WEB_NINJA_API | python -m json.tool) WEB_NINJA_SEES_OPEN=$(echo "$WEB_NINJA_JSON_TEXT" | grep '"Result"' | grep open | wc -l) WEB_NINJA_MN_ADDY=$(echo "$WEB_NINJA_JSON_TEXT" | grep MasternodePubkey | awk '{print $2}' | sed -e 's/[",]//g') - WEB_NINJA_MN_VIN=$(echo "$WEB_NINJA_JSON_TEXT" | grep MasternodeOutputHash | awk '{print $2}' | sed -e 's/[",]//g') - WEB_NINJA_MN_VIDX=$(echo "$WEB_NINJA_JSON_TEXT" | grep MasternodeOutputIndex | awk '{print $2}' | sed -e 's/[",]//g') WEB_NINJA_MN_BALANCE=$(echo "$WEB_NINJA_JSON_TEXT" | grep Value | awk '{print $2}' | sed -e 's/[",]//g') WEB_NINJA_MN_LAST_PAID_TIME_EPOCH=$(echo "$WEB_NINJA_JSON_TEXT" | grep MNLastPaidTime | awk '{print $2}' | sed -e 's/[",]//g') WEB_NINJA_MN_LAST_PAID_AMOUNT=$(echo "$WEB_NINJA_JSON_TEXT" | grep MNLastPaidAmount | awk '{print $2}' | sed -e 's/[",]//g') @@ -1038,6 +1036,9 @@ awk ' \ WEB_NINJA_LAST_PAYMENT_TIME=$(date -d @${WEB_NINJA_MN_LAST_PAID_TIME_EPOCH} '+%m/%d/%Y %H:%M:%S' 2>/dev/null) + MN_FUNDING=$(echo "$LOCAL_MN_STATUS" | grep '"outpoint"' | awk '{print $2}' | sed -e 's/[",]//g') + MN_PAYEE=$(echo "$LOCAL_MN_STATUS" | grep '"payee"' | awk '{print $2}' | sed -e 's/[",]//g') + if [ ! -z "$WEB_NINJA_LAST_PAYMENT_TIME" ]; then local daysago=$(dateDiff -d now "$WEB_NINJA_LAST_PAYMENT_TIME") local hoursago=$(dateDiff -h now "$WEB_NINJA_LAST_PAYMENT_TIME") @@ -1115,8 +1116,8 @@ print_status() { pending "${messages["status_mnvislo"]}" ; [ $MN_VISIBLE -gt 0 ] && ok "${messages["YES"]}" || err "${messages["NO"]}" if [ $WEB_NINJA_API_OFFLINE -eq 0 ]; then pending "${messages["status_mnvisni"]}" ; [ $WEB_NINJA_SEES_OPEN -gt 0 ] && ok "${messages["YES"]}" || err "${messages["NO"]}" - pending "${messages["status_mnaddre"]}" ; ok "$WEB_NINJA_MN_ADDY" - pending "${messages["status_mnfundt"]}" ; ok "$WEB_NINJA_MN_VIN-$WEB_NINJA_MN_VIDX" + pending "${messages["status_mnaddre"]}" ; ok "$MN_PAYEE" + pending "${messages["status_mnfundt"]}" ; ok "$MN_FUNDING" pending "${messages["status_mnqueue"]}" ; [ $MN_QUEUE_IN_SELECTION -gt 0 ] && highlight "$MN_QUEUE_POSITION/$MN_QUEUE_LENGTH (selection pending)" || ok "$MN_QUEUE_POSITION/$MN_QUEUE_LENGTH" pending " masternode mnsync state : " ; [ ! -z "$MN_SYNC_ASSET" ] && ok "$MN_SYNC_ASSET" || "" pending " masternode network state : " ; [ "$MN_STATUS" == "ENABLED" ] && ok "$MN_STATUS" || highlight "$MN_STATUS" From 8fe8405e6adf706125183466d692fc1e31787a34 Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Wed, 20 Dec 2017 08:12:10 -0700 Subject: [PATCH 03/17] Get rid of WEB_NINJA_MN_ADDY --- lib/dashman_functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index b92c9f4..96b0680 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -1028,7 +1028,6 @@ awk ' \ WEB_NINJA_JSON_TEXT=$(echo $WEB_NINJA_API | python -m json.tool) WEB_NINJA_SEES_OPEN=$(echo "$WEB_NINJA_JSON_TEXT" | grep '"Result"' | grep open | wc -l) - WEB_NINJA_MN_ADDY=$(echo "$WEB_NINJA_JSON_TEXT" | grep MasternodePubkey | awk '{print $2}' | sed -e 's/[",]//g') WEB_NINJA_MN_BALANCE=$(echo "$WEB_NINJA_JSON_TEXT" | grep Value | awk '{print $2}' | sed -e 's/[",]//g') WEB_NINJA_MN_LAST_PAID_TIME_EPOCH=$(echo "$WEB_NINJA_JSON_TEXT" | grep MNLastPaidTime | awk '{print $2}' | sed -e 's/[",]//g') WEB_NINJA_MN_LAST_PAID_AMOUNT=$(echo "$WEB_NINJA_JSON_TEXT" | grep MNLastPaidAmount | awk '{print $2}' | sed -e 's/[",]//g') @@ -1036,8 +1035,9 @@ awk ' \ WEB_NINJA_LAST_PAYMENT_TIME=$(date -d @${WEB_NINJA_MN_LAST_PAID_TIME_EPOCH} '+%m/%d/%Y %H:%M:%S' 2>/dev/null) - MN_FUNDING=$(echo "$LOCAL_MN_STATUS" | grep '"outpoint"' | awk '{print $2}' | sed -e 's/[",]//g') + LOCAL_MN_STATUS=$( $DASH_CLI masternode status | python -mjson.tool ) MN_PAYEE=$(echo "$LOCAL_MN_STATUS" | grep '"payee"' | awk '{print $2}' | sed -e 's/[",]//g') + MN_FUNDING=$([ ! -z "$MN_PAYEE" ] && echo "$LOCAL_MN_STATUS" | grep '"outpoint"' | awk '{print $2}' | sed -e 's/[",]//g') if [ ! -z "$WEB_NINJA_LAST_PAYMENT_TIME" ]; then local daysago=$(dateDiff -d now "$WEB_NINJA_LAST_PAYMENT_TIME") From 8227a26bc1d2af884d7b2f9da91a8ed83e09ad70 Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Fri, 22 Dec 2017 19:41:46 -0700 Subject: [PATCH 04/17] Compatibility fixes to allow dashman to run on CentOS 6.x platform. --- lib/dashman_functions.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index 96b0680..7e5b1ef 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -1227,6 +1227,7 @@ install_sentinel() { ok "${messages["done"]}" pending " --> pip modules... " + venv/bin/pip install argparse 2>&1 > /dev/null venv/bin/pip install -r requirements.txt 2>&1 > /dev/null; if [[ $? -gt 0 ]];then err " --> pip install failed" From f98f9fc17cf44400714e898da5f58eaafa64f9c7 Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Tue, 26 Dec 2017 10:12:58 -0700 Subject: [PATCH 05/17] Stop saying this ugly spewage: masternode mnsync state : /home/master/dashman/lib/dashman_functions.sh: line 1122: : command not found --- lib/dashman_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index 7e5b1ef..0abf003 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -1119,7 +1119,7 @@ print_status() { pending "${messages["status_mnaddre"]}" ; ok "$MN_PAYEE" pending "${messages["status_mnfundt"]}" ; ok "$MN_FUNDING" pending "${messages["status_mnqueue"]}" ; [ $MN_QUEUE_IN_SELECTION -gt 0 ] && highlight "$MN_QUEUE_POSITION/$MN_QUEUE_LENGTH (selection pending)" || ok "$MN_QUEUE_POSITION/$MN_QUEUE_LENGTH" - pending " masternode mnsync state : " ; [ ! -z "$MN_SYNC_ASSET" ] && ok "$MN_SYNC_ASSET" || "" + pending " masternode mnsync state : " ; [ ! -z "$MN_SYNC_ASSET" ] && ok "$MN_SYNC_ASSET" pending " masternode network state : " ; [ "$MN_STATUS" == "ENABLED" ] && ok "$MN_STATUS" || highlight "$MN_STATUS" pending "${messages["status_mnlastp"]}" ; [ ! -z "$WEB_NINJA_MN_LAST_PAID_AMOUNT" ] && \ From 86c492eb2c1aca7d52a33f93b558dd095c5a921e Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Tue, 26 Dec 2017 15:37:13 -0700 Subject: [PATCH 06/17] Fix argparse problems to work on CentOS 6.x --- lib/dashman_functions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index 0abf003..ee7c605 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -1227,7 +1227,6 @@ install_sentinel() { ok "${messages["done"]}" pending " --> pip modules... " - venv/bin/pip install argparse 2>&1 > /dev/null venv/bin/pip install -r requirements.txt 2>&1 > /dev/null; if [[ $? -gt 0 ]];then err " --> pip install failed" @@ -1251,6 +1250,8 @@ install_sentinel() { (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py 2>&1 >> sentinel-cron.log") | crontab - ok "${messages["done"]}" + [ -e venv/bin/python2 ] && [ ! -L venv/bin/python2 ] && [ ! -z "$LD_LIBRARY_PATH" ] && cp -a venv/bin/python2 venv/bin/python2.bin && echo -e "#!/bin/sh\nLD_LIBRARY_PATH=$LD_LIBRARY_PATH exec \`dirname \$0\`/python2.bin \$*" > venv/bin/python2 + cd .. } From 90256341c23066fd5cf0771fe9b0b76174bc3904 Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Tue, 26 Dec 2017 16:05:38 -0700 Subject: [PATCH 07/17] Fix STDERR redirection --- lib/dashman_functions.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index ee7c605..ad96b75 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -358,7 +358,7 @@ restart_dashd(){ if [ $DASHD_RUNNING == 1 ]; then pending " --> ${messages["stopping"]} dashd. ${messages["please_wait"]}" - $DASH_CLI stop 2>&1 >/dev/null + $DASH_CLI stop 2>/dev/null >/dev/null sleep 10 killall -9 dashd dash-shutoff 2>/dev/null ok "${messages["done"]}" @@ -373,7 +373,7 @@ restart_dashd(){ ok "${messages["done"]}" pending " --> ${messages["starting_dashd"]}" - $INSTALL_DIR/dashd 2>&1 >/dev/null + $INSTALL_DIR/dashd 2>/dev/null >/dev/null DASHD_RUNNING=1 ok "${messages["done"]}" @@ -399,7 +399,6 @@ restart_dashd(){ update_dashd(){ if [ $LATEST_VERSION != $CURRENT_VERSION ] || [ ! -z "$REINSTALL" ] ; then - if [ ! -z "$REINSTALL" ];then echo -e "" @@ -470,7 +469,7 @@ update_dashd(){ if [ $DASHD_RUNNING == 1 ]; then pending " --> ${messages["stopping"]} dashd. ${messages["please_wait"]}" - $DASH_CLI stop >/dev/null 2>&1 + $DASH_CLI stop 2>/dev/null >/dev/null sleep 15 killall -9 dashd dash-shutoff >/dev/null 2>&1 ok "${messages["done"]}" @@ -554,7 +553,7 @@ update_dashd(){ pending " --> updating sentinel... " cd sentinel - git remote update >/dev/null 2>&1 + git remote update >/dev/null 2>&1 git reset -q --hard origin/master cd .. ok "${messages["done"]}" @@ -1009,7 +1008,7 @@ awk ' \ cd $INSTALL_DIR/sentinel SENTINEL_INSTALLED=$( ls -l bin/sentinel.py | wc -l ) - SENTINEL_PYTEST=$( venv/bin/py.test test 2>&1 > /dev/null ; echo $? ) + SENTINEL_PYTEST=$( venv/bin/py.test test 2>/dev/null > /dev/null ; echo $? ) SENTINEL_CRONTAB=$( crontab -l | grep sentinel | grep -v '^#' | wc -l ) SENTINEL_LAUNCH_OUTPUT=$( venv/bin/python bin/sentinel.py 2>&1 ) if [ -z "$SENTINEL_LAUNCH_OUTPUT" ] ; then @@ -1217,7 +1216,7 @@ install_sentinel() { cd sentinel pending " --> virtualenv init... " - virtualenv venv 2>&1 > /dev/null; + virtualenv venv 2>/dev/null >/dev/null; if [[ $? -gt 0 ]];then err " --> virtualenv initialization failed" pending " when running: " ; echo @@ -1227,7 +1226,7 @@ install_sentinel() { ok "${messages["done"]}" pending " --> pip modules... " - venv/bin/pip install -r requirements.txt 2>&1 > /dev/null; + venv/bin/pip install -r requirements.txt 2>/dev/null > /dev/null; if [[ $? -gt 0 ]];then err " --> pip install failed" pending " when running: " ; echo @@ -1237,7 +1236,7 @@ install_sentinel() { ok "${messages["done"]}" pending " --> testing installation... " - venv/bin/py.test ./test/ 2>&1>/dev/null; + venv/bin/py.test ./test/ 2>/dev/null >/dev/null; if [[ $? -gt 0 ]];then err " --> sentinel tests failed" pending " when running: " ; echo @@ -1247,7 +1246,7 @@ install_sentinel() { ok "${messages["done"]}" pending " --> installing crontab... " - (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py 2>&1 >> sentinel-cron.log") | crontab - + (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py 2>>sentinel-cron.log >> sentinel-cron.log") | crontab - ok "${messages["done"]}" [ -e venv/bin/python2 ] && [ ! -L venv/bin/python2 ] && [ ! -z "$LD_LIBRARY_PATH" ] && cp -a venv/bin/python2 venv/bin/python2.bin && echo -e "#!/bin/sh\nLD_LIBRARY_PATH=$LD_LIBRARY_PATH exec \`dirname \$0\`/python2.bin \$*" > venv/bin/python2 From 6b655ee23a0b536b864b6077ab8bf2acb971934c Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Thu, 28 Dec 2017 15:18:19 -0700 Subject: [PATCH 08/17] Fix MN_STARTED setting to be compatible with the new DashCore v0.12.2.2 too --- lib/dashman_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index ad96b75..44903fd 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -947,7 +947,7 @@ get_dashd_status(){ # masternode (remote!) specific MN_CONF_ENABLED=$( egrep -s '^[^#]*\s*masternode\s*=\s*1' $HOME/.dash{,core}/dash.conf | wc -l 2>/dev/null) - MN_STARTED=`$DASH_CLI masternode debug 2>&1 | grep 'successfully started' | wc -l` + MN_STARTED=`$DASH_CLI masternode status 2>&1 | grep 'successfully started' | wc -l` MN_QUEUE_IN_SELECTION=0 MN_QUEUE_LENGTH=0 MN_QUEUE_POSITION=0 From 68825d7403b890e4942b84799dc88e6370f53cd1 Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Wed, 31 Jan 2018 06:48:20 -0700 Subject: [PATCH 09/17] Fix sentinel cron to avoid spewing stderr into $MAIL --- lib/dashman_functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index 3159a1d..681811e 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -561,7 +561,7 @@ update_dashd(){ # patch it ----------------------------------------------------------- pending " --> updating crontab... " - (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py 2>&1 >> sentinel-cron.log") | crontab - + (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py 2>>sentinel-cron.log >> sentinel-cron.log") | crontab - ok "${messages["done"]}" fi @@ -1246,7 +1246,7 @@ install_sentinel() { ok "${messages["done"]}" pending " --> installing crontab... " - (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py 2>>sentinel-cron.log >> sentinel-cron.log") | crontab - + (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py 2>>sentinel-cron.log >> sentinel-cron.log") | crontab - ok "${messages["done"]}" [ -e venv/bin/python2 ] && [ ! -L venv/bin/python2 ] && [ ! -z "$LD_LIBRARY_PATH" ] && cp -a venv/bin/python2 venv/bin/python2.bin && echo -e "#!/bin/sh\nLD_LIBRARY_PATH=$LD_LIBRARY_PATH exec \`dirname \$0\`/python2.bin \$*" > venv/bin/python2 From 24a9d12f381ea91a6c0229ad276a72c57e15c42c Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Wed, 31 Jan 2018 09:14:52 -0700 Subject: [PATCH 10/17] Fix sentinel cron to avoid spewing stderr into $MAIL --- lib/dashman_functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index 681811e..cd97e8e 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -561,7 +561,7 @@ update_dashd(){ # patch it ----------------------------------------------------------- pending " --> updating crontab... " - (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py 2>>sentinel-cron.log >> sentinel-cron.log") | crontab - + (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py >> sentinel-cron.log 2>&1") | crontab - ok "${messages["done"]}" fi @@ -1246,7 +1246,7 @@ install_sentinel() { ok "${messages["done"]}" pending " --> installing crontab... " - (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py 2>>sentinel-cron.log >> sentinel-cron.log") | crontab - + (crontab -l 2>/dev/null | grep -v sentinel.py ; echo "* * * * * cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py >> sentinel-cron.log 2>&1") | crontab - ok "${messages["done"]}" [ -e venv/bin/python2 ] && [ ! -L venv/bin/python2 ] && [ ! -z "$LD_LIBRARY_PATH" ] && cp -a venv/bin/python2 venv/bin/python2.bin && echo -e "#!/bin/sh\nLD_LIBRARY_PATH=$LD_LIBRARY_PATH exec \`dirname \$0\`/python2.bin \$*" > venv/bin/python2 From 01a4c4573ca92d7b461b3310d6bc75b10a8018ee Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Wed, 31 Jan 2018 10:28:45 -0700 Subject: [PATCH 11/17] More compatibility fixes: Fix this spewage: pv: invalid option -- 'a' Apparently the pv-1.1.4-3.el6.x86_64 package that comes with CentOS 6.x doesn't support the "-a" option yet. --- lib/dashman_functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index cd97e8e..e389944 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -764,11 +764,11 @@ install_dashd(){ pending " $MAINNET_BOOTSTRAP_FILE_1_SIZE... " tput sc echo -e "$C_CYAN" - $wget_cmd -O - $MAINNET_BOOTSTRAP_FILE_1 | pv -trepa -s${MAINNET_BOOTSTRAP_FILE_1_SIZE_M}m -w80 -N bootstrap > ${MAINNET_BOOTSTRAP_FILE_1##*/} + $wget_cmd -O - $MAINNET_BOOTSTRAP_FILE_1 | pv -trep -s${MAINNET_BOOTSTRAP_FILE_1_SIZE_M}m -w80 -N bootstrap > ${MAINNET_BOOTSTRAP_FILE_1##*/} MAINNET_BOOTSTRAP_FILE=${MAINNET_BOOTSTRAP_FILE_1##*/} if [ ! -s $MAINNET_BOOTSTRAP_FILE ]; then rm $MAINNET_BOOTSTRAP_FILE - $wget_cmd -O - $MAINNET_BOOTSTRAP_FILE_2 | pv -trepa -s${MAINNET_BOOTSTRAP_FILE_1_SIZE_M}m -w80 -N bootstrap > ${MAINNET_BOOTSTRAP_FILE_2##*/} + $wget_cmd -O - $MAINNET_BOOTSTRAP_FILE_2 | pv -trep -s${MAINNET_BOOTSTRAP_FILE_1_SIZE_M}m -w80 -N bootstrap > ${MAINNET_BOOTSTRAP_FILE_2##*/} MAINNET_BOOTSTRAP_FILE=${MAINNET_BOOTSTRAP_FILE_2##*/} fi echo -ne "$C_NORM" From 77d2bc83778fb87a3ac8974d949f98828298c010 Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Mon, 9 Jul 2018 11:15:49 -0600 Subject: [PATCH 12/17] Adjust VERSION sniffer to itself. --- lib/dashman_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index e389944..2d95898 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -261,7 +261,7 @@ _find_dash_directory() { _check_dashman_updates() { - GITHUB_DASHMAN_VERSION=$( $curl_cmd https://raw.githubusercontent.com/moocowmoo/dashman/master/VERSION ) + GITHUB_DASHMAN_VERSION=$( $curl_cmd https://raw.githubusercontent.com/hookbot/dashman/master/VERSION ) if [ ! -z "$GITHUB_DASHMAN_VERSION" ] && [ "$DASHMAN_VERSION" != "$GITHUB_DASHMAN_VERSION" ]; then echo -e "\n" echo -e "${C_RED}${0##*/} ${messages["requires_updating"]} $C_GREEN$GITHUB_DASHMAN_VERSION$C_RED\n${messages["requires_sync"]}$C_NORM\n" From a950c0c483d1dc4cd3a9b93c7ba4b0f137bb5a32 Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Mon, 9 Jul 2018 12:56:37 -0600 Subject: [PATCH 13/17] For bash < 4.2.x, prevent the following crashing spewage: /home/dashman/dashman/lib/dashman_functions.sh: line 324: -2: substring expression < 0 --- lib/dashman_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index de0e9c4..c01dd90 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -321,7 +321,7 @@ _get_versions() { #$(( <-- vim syntax highlighting fix LATEST_VERSION=$(echo "$GITHUB_RELEASE_JSON" | grep tag_name | cut -d'"' -f4 | tr -d 'v') - TARDIR="dashcore-${LATEST_VERSION::-2}" + TARDIR="dashcore-"`echo $LATEST_VERSION | sed -r 's/\.[0-9]+$//;'` if [ -z "$LATEST_VERSION" ]; then die "\n${messages["err_could_not_get_version"]} -- ${messages["exiting"]}" fi From 19890aa466098ceb74ade0fcd0bda0f202d8d785 Mon Sep 17 00:00:00 2001 From: Hook Bot Date: Mon, 17 Sep 2018 12:21:35 -0600 Subject: [PATCH 14/17] When dashd is offline, prevent this warning spewage: lib/dashman_functions.sh: line 1104: [: too many arguments --- lib/dashman_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index c01dd90..29a3b34 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -934,7 +934,7 @@ get_dashd_status(){ get_public_ips MASTERNODE_BIND_IP=$PUBLIC_IPV4 - PUBLIC_PORT_CLOSED=$( timeout 2 nc -4 $PUBLIC_IPV4 9999 2>&1 /dev/null; echo $? ) + PUBLIC_PORT_CLOSED=$( timeout 2 nc -4 $PUBLIC_IPV4 9999 >/dev/null 2>&1 &1 >/dev/null; echo $? ) # if [ $PUBLIC_PORT_CLOSED -eq 0 ]; then From d0be3f725df1e2931798d23d13a93a3107a3f46f Mon Sep 17 00:00:00 2001 From: HookBot Date: Mon, 31 May 2021 20:42:49 -0600 Subject: [PATCH 15/17] Fix this crashing spewage: (dash.org) : lib/dashman_functions.sh: line 1225: [: too many arguments --- lib/dashman_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index 59e8086..8dc58b7 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -968,7 +968,7 @@ get_dashd_status(){ WEB_BLOCK_COUNT_CHAINZ=0 fi - WEB_BLOCK_COUNT_DQA=`$curl_cmd https://explorer.dash.org/chain/Dash/q/getblockcount`; + WEB_BLOCK_COUNT_DQA=`$curl_cmd 'https://insight.dash.org/insight-api/status?q=getInfo' | perl -ne 'print $1 if /"blocks":(\d+)/'` if [ -z "$WEB_BLOCK_COUNT_DQA" ]; then WEB_BLOCK_COUNT_DQA=0 fi From e465a01b8445ab216aefc7c03ada67ec2d76474b Mon Sep 17 00:00:00 2001 From: HookBot Date: Mon, 31 May 2021 21:24:18 -0600 Subject: [PATCH 16/17] Fix this crashing spewage: error code: -32601 error message: getinfo This call was removed in version 0.16.0. --- lib/dashman_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index 8dc58b7..3c2c65e 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -402,7 +402,7 @@ _check_dashd_state() { if [ $DASHD_HASPID -gt 0 ] && [ $DASHD_PID -gt 0 ]; then DASHD_RUNNING=1 fi - $DASH_CLI getinfo >/dev/null 2>&1 + $DASH_CLI getblockchaininfo >/dev/null 2>&1 if [ $? -eq 0 ] || [ $? -eq 28 ]; then DASHD_RESPONDING=1 fi From fe363aadb35c5f402169ec866df89f8bf5f94f15 Mon Sep 17 00:00:00 2001 From: HookBot Date: Mon, 31 May 2021 21:30:39 -0600 Subject: [PATCH 17/17] Fix this crashing spewage: error code: -32601 error message: getinfo This call was removed in version 0.16.0. --- lib/dashman_functions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dashman_functions.sh b/lib/dashman_functions.sh index 3c2c65e..532246e 100755 --- a/lib/dashman_functions.sh +++ b/lib/dashman_functions.sh @@ -455,9 +455,9 @@ restart_dashd(){ die "\n - dashd unexpectedly quit. ${messages["exiting"]}" fi ok "${messages["done"]}" - pending " --> dash-cli getinfo" + pending " --> dash-cli getblockchaininfo" echo - $DASH_CLI getinfo + $DASH_CLI getblockchaininfo echo } @@ -960,7 +960,7 @@ get_dashd_status(){ DASHD_CONNECTIONS=`netstat -nat | grep ESTA | grep 9999 | wc -l`; DASHD_CURRENT_BLOCK=`$DASH_CLI getblockcount 2>/dev/null` if [ -z "$DASHD_CURRENT_BLOCK" ] ; then DASHD_CURRENT_BLOCK=0 ; fi - DASHD_GETINFO=`$DASH_CLI getinfo 2>/dev/null`; + DASHD_GETINFO=`$DASH_CLI getblockchaininfo 2>/dev/null`; DASHD_DIFFICULTY=$(echo "$DASHD_GETINFO" | grep difficulty | awk '{print $2}' | sed -e 's/[",]//g') WEB_BLOCK_COUNT_CHAINZ=`$curl_cmd https://chainz.cryptoid.info/dash/api.dws?q=getblockcount`;