From 2736f9a03695ac410d0445a878e0ef6794b0c183 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 4 May 2021 17:27:49 +0200 Subject: [PATCH 0001/1176] move to RunOnFlux --- multitoolbox.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4525a58f..29c568c0 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -685,9 +685,9 @@ pm2 save > /dev/null 2>&1 sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Downloading...${NC}" -cd && git clone https://github.com/XK4MiLX/watchdog.git > /dev/null 2>&1 +cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/XK4MiLX/zelnode/master/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" @@ -1125,7 +1125,8 @@ then exit fi -bash -i <(curl -s https://raw.githubusercontent.com/XK4MiLX/zelnode/master/nodeanalizerandfixer.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/nodeanalizerandfixer.sh) + } @@ -1196,7 +1197,8 @@ echo -e "${WORNING}${CYAN}Docker is not working correct or is not installed.${NC exit fi -bash -i <(curl -s https://raw.githubusercontent.com/XK4MiLX/zelnode/master/install_pro.sh) + +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) } From 2d174ff906209b84f1c6b961e306216986ff900a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 4 May 2021 17:53:39 +0200 Subject: [PATCH 0002/1176] update reference for RunOnFlux --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c1f66dca..4ab4eeb5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # MULTITOOLBOX FOR FLUXNODE OPERATORS 1) HOW RUN SCRIPT -```bash -i <(curl -s https://raw.githubusercontent.com/XK4MiLX/zelnode/master/multitoolbox.sh)``` +```bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` 2) MENU: -![screen1](https://raw.githubusercontent.com/XK4MiLX/zelnode/master/image/menu_5v1.png) +![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/menu_5v1.png) 3) HOW USE MULTITOOLBOX TO SETUP FLUXNODE: https://medium.com/zelinsights/zelnode-setup-the-easy-peasy-lemon-squeezy-way-fd89706ea03c
From 6cbd7dda69330fed0d190b6c6ea7ab4b33ec1f33 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 4 May 2021 18:03:26 +0200 Subject: [PATCH 0003/1176] update watchdog reference --- install_pro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index c3dc5523..8a9280f6 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -353,9 +353,9 @@ if pm2 -v > /dev/null 2>&1 then WATCHDOG_INSTALL="1" echo -e "${ARROW} ${YELLOW}Downloading...${NC}" -cd && git clone https://github.com/XK4MiLX/watchdog.git > /dev/null 2>&1 +cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/XK4MiLX/zelnode/master/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" From 7e2dced82dde15ede115550d8905b1add48756d2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 4 May 2021 19:13:15 +0200 Subject: [PATCH 0004/1176] fix typo --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 8a9280f6..9337c805 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -405,7 +405,7 @@ function mongodb_bootstrap(){ BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) - echo -e ${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC} + echo -e ${ARROW} ${CYAN}Node block height after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC} else From 64e0453ad37bd33e9376c3b472d9995871dbb655 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 4 May 2021 19:19:31 +0200 Subject: [PATCH 0005/1176] update tiers --- nodeanalizerandfixer.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index a3800f9d..83a3fa1e 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -414,7 +414,7 @@ if [[ "$bench_benchmark" == "running" ]]; then echo -e "${ARROW} ${CYAN} Benchmarking hasn't completed, please wait until benchmarking has completed.${NC}" fi -if [[ "$bench_benchmark" == "BASIC" || "$bench_benchmark" == "SUPER" || "$bench_benchmark" == "BAMF" ]]; then +if [[ "$bench_benchmark" == "CUMULUS" || "$bench_benchmark" == "NIMBUS" || "$bench_benchmark" == "STRATUS" ]]; then echo -e "${CHECK_MARK} ${CYAN} Flux benchmark working correct, all requirements met.${NC}" fi @@ -630,15 +630,15 @@ fi if [[ $type == ?(-)+([0-9]) ]]; then case $type in - "10000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}BASIC${NC}" ;; - "25000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}SUPER${NC}";; - "100000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}BAMF${NC}";; + "10000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}CUMULUS${NC}" ;; + "25000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}NIMBUS${NC}";; + "100000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}STRATUS${NC}";; esac case $bench_benchmark in - "BASIC") bench_benchmark_value=10000 ;; - "SUPER") bench_benchmark_value=25000 ;; - "BAMF") bench_benchmark_value=100000 ;; + "CUMULUS") bench_benchmark_value=10000 ;; + "NIMBUS") bench_benchmark_value=25000 ;; + "STRATUS") bench_benchmark_value=100000 ;; esac #echo -e "$zelbench_benchmark_value" -> 10000 BASIC @@ -651,18 +651,18 @@ fi if [[ "$bench_benchmark_value" -ge "$type" ]]; then case $type in - "10000") bench_benchmark_value_name="BASIC" ;; - "25000") bench_benchmark_value_name="SUPER" ;; - "100000") bench_benchmark_value_name="BAMF" ;; + "10000") bench_benchmark_value_name="CUMULUS" ;; + "25000") bench_benchmark_value_name="NIMBUS" ;; + "100000") bench_benchmark_value_name="STRATUS" ;; esac #echo -e "${CHECK_MARK} ${CYAN} Benchmark passed for ${GREEN}$bench_benchmark${CYAN} required ${GREEN}$bench_benchmark_value_name${NC}" else case $type in - "10000") bench_benchmark_value_name="BASIC" ;; - "25000") bench_benchmark_value_name="SUPER" ;; - "100000") bench_benchmark_value_name="BAMF" ;; + "10000") bench_benchmark_value_name="CUMULUS" ;; + "25000") bench_benchmark_value_name="NIMBUS" ;; + "100000") bench_benchmark_value_name="STRATUS" ;; esac if [[ "$bench_benchmark" == "running" ]]; then From 9c0fe4b40f5ce0f1ed108323232f34fbda479c91 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 4 May 2021 19:25:46 +0200 Subject: [PATCH 0006/1176] Delete helper.sh --- helper.sh | 1354 ----------------------------------------------------- 1 file changed, 1354 deletions(-) delete mode 100644 helper.sh diff --git a/helper.sh b/helper.sh deleted file mode 100644 index d9fc90d0..00000000 --- a/helper.sh +++ /dev/null @@ -1,1354 +0,0 @@ -#!/bin/bash - -#information -FLUX_APPS_DIR='ZelApps' -FLUX_DIR='zelflux' -COIN_NAME='zelcash' -COIN_DAEMON='zelcashd' -COIN_CLI='zelcash-cli' -COIN_PATH='/usr/local/bin' -CONFIG_DIR='.flux' -CONFIG_FILE='zelcash.conf' -BENCH_NAME='zelbench' -BENCH_DAEMON='zelbenchd' -BENCH_CLI='zelbench-cli' -#end of required details - -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -ORANGE='\e[38;5;202m' -NC='\033[0m' -FLUX_UPDATE="0" - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' -BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' -BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' -BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' -KDA_BOOTSTRAP_ZIPFILE='kda_bootstrap.tar.gz' -KDA_BOOTSTRAP_ZIP='https://fluxnodeservice.com/kda_bootstrap.tar.gz' - -#dialog color -export NEWT_COLORS=' -title=black, -' -# add to path -PATH=$PATH:"$COIN_PATH" -export PATH - -call_type="$1" -type="$2" - -echo -e "${BOOK}${YELLOW}Helper action: ${GREEN}$1${NC}" - - -function max(){ - - local m="0" - for n in "$@" - do - if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then - [ "$n" -gt "$m" ] && m="$n" - fi - done - echo "$m" - -} - -function spinning_timer() -{ - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - - done - done - echo -ne "${MSG2}" -} - -function string_limit_check_mark_port() -{ - - if [[ -z "$2" ]]; then - string="$1" - string=${string::65} - else - string=$1 - string_color=$2 - string_leght=${#string} - string_leght_color=${#string_color} - string_diff=$((string_leght_color-string_leght)) - string=${string_color::65+string_diff} - fi - echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - -function string_limit_check_mark() -{ - - if [[ -z "$2" ]]; then - string="$1" - string=${string::50} - else - string=$1 - string_color=$2 - string_leght=${#string} - string_leght_color=${#string_color} - string_diff=$((string_leght_color-string_leght)) - string=${string_color::50+string_diff} - fi - - echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - -function string_limit_x_mark() -{ - - if [[ -z "$2" ]]; then - string="$1" - string=${string::50} - else - string=$1 - string_color=$2 - string_leght=${#string} - string_leght_color=${#string_color} - string_diff=$((string_leght_color-string_leght)) - string=${string_color::50+string_diff} - fi - - echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" -} - -function local_version_check() -{ - - local_version=$(dpkg -l $1 | grep -w $1 | awk '{print $3}') -} - -function remote_version_check(){ - - #variable null - remote_version="" - package_name="" - - remote_version=$(curl -s -m 3 https://apt.zel.network/pool/main/z/"$1"/ | grep -o '[0-9].[0-9].[0-9]' | head -n1) - - if [[ "$remote_version" != "" ]]; then - package_name=$(echo "$1_"$remote_version"_all.deb") - fi -} - -function install_package() -{ - - echo -e "${ARROW} ${CYAN}Install package for: ${GREEN}$1 $2${NC}" - sudo apt-get purge "$1" "$2" -y >/dev/null 2>&1 && sleep 1 - sudo rm /etc/apt/sources.list.d/zelcash.list >/dev/null 2>&1 && sleep 1 - sudo rm /etc/apt/sources.list.d/flux.list >/dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Adding apt source...${NC}" - - echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - - sudo apt-get update >/dev/null 2>&1 - sudo apt-get install "$1" "$2" -y > /dev/null 2>&1 - sudo chmod 755 "$COIN_PATH/"* && sleep 2 - -} - -start_fluxdaemon() -{ - - serive_check=$(sudo systemctl list-units --full -all | grep -o "$COIN_NAME.service" | head -n1) - - if [[ "$serive_check" != "" ]]; then - echo -e "${ARROW} ${CYAN}Starting Flux daemon service...${NC}" - sudo systemctl start $COIN_NAME >/dev/null 2>&1 - else - echo -e "${ARROW} ${CYAN}Starting Flux daemon process...${NC}" - "$COIN_DAEMON" >/dev/null 2>&1 - fi - -} - -stop_fluxdaemon() { - - echo -e "${ARROW} ${CYAN}Stopping Flux daemon...${NC}" - sudo systemctl stop $COIN_NAME >/dev/null 2>&1 && sleep 5 - "$COIN_CLI" stop >/dev/null 2>&1 && sleep 5 - sudo killall "$COIN_DAEMON" fluxd >/dev/null 2>&1 - sudo killall -s SIGKILL $BENCH_NAME fluxbench >/dev/null 2>&1 && sleep 1 - sleep 4 - -} - -function reindex() -{ - echo -e "${ARROW} ${CYAN}Reindexing...${NC}" - stop_fluxdaemon - "$COIN_DAEMON" -reindex - serive_check=$(sudo systemctl list-units --full -all | grep -o "$COIN_NAM.service" | head -n1) - if [[ "$serive_check" != "" ]]; then - sleep 60 - stop_fluxdaemon - start_fluxdaemon - fi -} - -function restart_fluxdaemon() -{ - - echo -e "${ARROW} ${CYAN}Restarting Flux daemon...${NC}" - serive_check=$(sudo systemctl list-units --full -all | grep -o "$COIN_NAME.service" | head -n1) - if [[ "$serive_check" != "" ]]; then - sudo systemctl restart $COIN_NAME >/dev/null 2>&1 && sleep 3 - else - stop_fluxdaemon - start_fluxdaemon - fi - -} - -function fluxbench_update() -{ - - local_version=$(dpkg -l $BENCH_NAME | grep -w "$BENCH_NAME" | awk '{print $3}') - - if [[ "$type" == "force" ]]; then - echo -e "${ARROW} ${CYAN}Force Flux benchmark updating...${NC}" - stop_fluxdaemon - install_package "$BENCH_NAME" "fluxbench" - dpkg_version_after_install=$(dpkg -l $BENCH_NAME | grep -w "$BENCH_NAME" | awk '{print $3}') - echo -e "${ARROW} ${CYAN}Flux benchmark version before update: ${GREEN}$local_version${NC}" - echo -e "${ARROW} ${CYAN}Flux benchmark version after update: ${GREEN}$dpkg_version_after_install${NC}" - start_fluxdaemon - return - fi - - remote_version_check "$BENCH_NAME" - #remote_version=$(curl -s -m 3 https://zelcore.io/zelflux/zelbenchinfo.php | jq -r .version) - - if [[ "$call_type" != "update_all" ]]; then - - if [[ "$remote_version" == "" ]]; then - echo -e "${ARROW} ${CYAN}Problem with version veryfication...Flux benchmark installation skipped...${NC}" - return - fi - - if [[ "$remote_version" == "$local_version" ]]; then - echo -e "${ARROW} ${CYAN}You have the current version of Flux benchamrk ${GREEN}($remote_version)${NC}" - return - fi - - fi - - echo -e "${ARROW} ${CYAN}Updating Flux benchmark...${NC}" - #stop_zelcash - echo -e "${ARROW} ${CYAN}Flux benchmark stopping...${NC}" - $BENCH_CLI stop >/dev/null 2>&1 && sleep 2 - sudo killall -s SIGKILL $BENCH_DAEMON >/dev/null 2>&1 && sleep 1 - sudo apt-get update >/dev/null 2>&1 - sudo apt-get install --only-upgrade $BENCH_NAME fluxbench -y >/dev/null 2>&1 - sudo chmod 755 "$COIN_PATH/"* - sleep 2 - - dpkg_version_after_install=$(dpkg -l $BENCH_NAME | grep -w "$BENCH_NAME" | awk '{print $3}') - echo -e "${ARROW} ${CYAN}Flux benchmark version before update: ${GREEN}$local_version${NC}" - #echo -e "${ARROW} ${CYAN}Zelbench version after update: ${GREEN}$dpkg_version_after_install${NC}" - - if [[ "$dpkg_version_after_install" == "" ]]; then - - install_package "$BENCH_NAME" "fluxbench" - dpkg_version_after_install=$(dpkg -l $BENCH_NAME | grep -w "$BENCH_NAME" | awk '{print $3}') - - if [[ "$dpkg_version_after_install" != "" ]]; then - echo -e "${ARROW} ${CYAN}Flux benchmark update successful ${CYAN}(${GREEN}$dpkg_version_after_install${CYAN})${NC}" - fi - - start_fluxdaemon - echo -e "${ARROW} ${CYAN}Flux benchmark starting...${NC}" - #zelbenchd -daemon >/dev/null 2>&1 - else - - if [[ "$remote_version" == "$dpkg_version_after_install" ]]; then - - echo -e "${ARROW} ${CYAN}Flux benchmark update successful ${CYAN}(${GREEN}$dpkg_version_after_install${CYAN})${NC}" - start_fluxdaemon - echo -e "${ARROW} ${CYAN}Flux benchmark starting...${NC}" - #zelbenchd -daemon >/dev/null 2>&1 - else - - if [[ "$local_version" == "$dpkg_version_after_install" ]]; then - - install_package "$BENCH_NAME" "fluxbench" - dpkg_version_after_install=$(dpkg -l $BENCH_NAME | grep -w "$BENCH_NAME" | awk '{print $3}') - - if [[ "dpkg_version_after_install" == "$remote_version" ]]; then - - echo -e "${ARROW} ${CYAN}Flux benchmark update successful ${CYAN}(${GREEN}$dpkg_version_after_install${CYAN})${NC}" - - fi - - start_fluxdaemon - echo -e "${ARROW} ${CYAN}Flux benchmark starting...${NC}" - #zelbenchd -daemon >/dev/null 2>&1 - fi - fi - fi - -} - -function flux_update() -{ - - current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - required_ver=$(curl -s -m 3 https://raw.githubusercontent.com/zelcash/zelflux/master/package.json | jq -r '.version') - - if [[ "$required_ver" != "" && "$call_type" != "update_all" ]]; then - - if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then - - echo -e "${ARROW} ${CYAN}You have the current version of Flux ${GREEN}($required_ver)${NC}" - return - - else - #echo -e "${HOT} ${CYAN}New version of Flux available ${SEA}$required_ver${NC}" - FLUX_UPDATE="1" - fi - - fi - - if [[ "$FLUX_UPDATE" == "1" ]]; then - cd /home/$USER/$FLUX_DIR && git pull > /dev/null 2>&1 && cd - current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - required_ver=$(curl -s -m 3 https://raw.githubusercontent.com/zelcash/zelflux/master/package.json | jq -r '.version') - if [[ "$required_ver" == "$current_ver" ]]; then - echo -e "${ARROW} ${CYAN}Flux updated successfully ${GREEN}($required_ver)${NC}" - else - echo -e "${ARROW} ${CYAN}Flux was not updated.${NC}" - echo -e "${ARROW} ${CYAN}Flux force update....${NC}" - rm /home/$USER/$FLUX_DIR/.git/HEAD.lock >/dev/null 2>&1 - #cd /home/$USER/$FLUX_DIR && npm run hardupdatezelflux - cd /home/$USER/$FLUX_DIR && git reset --hard HEAD && git clean -f -d && git pull - - current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - required_ver=$(curl -s -m 3 https://raw.githubusercontent.com/zelcash/zelflux/master/package.json | jq -r '.version') - - if [[ "$required_ver" == "$current_ver" ]]; then - echo -e "${ARROW} ${CYAN}Flux updated successfully ${GREEN}($required_ver)${NC}" - fi - fi - - else - - echo -e "${ARROW} ${CYAN}Problem with version veryfication...Flux installation skipped...${NC}" - fi - -} - -function fluxdaemon_update() -{ - - local_version=$(dpkg -l $COIN_NAME | grep -w "$COIN_NAME" | awk '{print $3}') - - if [[ "$type" == "force" ]]; then - echo -e "${ARROW} ${CYAN}Force Flux daemon updating...${NC}" - stop_fluxdaemon - install_package "$COIN_NAME" "flux" - dpkg_version_after_install=$(dpkg -l $COIN_NAME | grep -w "$COIN_NAME" | awk '{print $3}') - echo -e "${ARROW} ${CYAN}Flux daemon version before update: ${GREEN}$local_version${NC}" - echo -e "${ARROW} ${CYAN}Flux daemon version after update: ${GREEN}$dpkg_version_after_install${NC}" - start_fluxdaemon - return - fi - - - remote_version_check "$COIN_NAME" - #local_version=$($COIN_CLI getinfo | jq -r .version) - #remote_version=$(curl -s -m3 https://zelcore.io/zelflux/zelcashinfo.php | jq -r .version) - - if [[ "$call_type" != "update_all" ]]; then - - if [[ "$local_version" == "" || "$remote_version" == "" ]]; then - - echo -e "${ARROW} ${CYAN}Problem with version veryfication...Flux daemon installation skipped...${NC}" - return - - fi - - if [[ "$local_version" == "$remote_version" ]]; then - - echo -e "${ARROW} ${CYAN}You have the current version of Flux daemon ${GREEN}($remote_version)${NC}" - return - - fi - - fi - - dpkg_version_before_install=$(dpkg -l $COIN_NAME | grep -w "$COIN_NAME" | awk '{print $3}') - stop_fluxdaemon - - sudo apt-get update >/dev/null 2>&1 - sudo apt-get install --only-upgrade $COIN_NAME flux -y >/dev/null 2>&1 - sudo chmod 755 "$COIN_PATH/"* - sleep 2 - - dpkg_version_after_install=$(dpkg -l $COIN_NAME | grep -w "$COIN_NAME" | awk '{print $3}') - echo -e "${ARROW} ${CYAN}Flux daemon version before update: ${GREEN}$local_version${NC}" - #echo -e "${ARROW} ${CYAN}Flux daemon version after update: ${GREEN}$dpkg_version_after_install${NC}" - - if [[ "$dpkg_version_after_install" == "" ]]; then - - install_package "$COIN_NAME" "flux" - dpkg_version_after_install=$(dpkg -l $COIN_NAME | grep -w "$COIN_NAME" | awk '{print $3}') - - if [[ "$dpkg_version_after_install" != "" ]]; then - - echo -e "${ARROW} ${CYAN}Flux daemon update successful ${CYAN}(${GREEN}$dpkg_version_after_install${CYAN})${NC}" - fi - - start_fluxdaemon - - else - - if [[ "$local_version" != "$dpkg_version_after_install" ]]; then - - echo -e "${ARROW} ${CYAN}Flux daemon update successful ${CYAN}(${GREEN}$dpkg_version_after_install${CYAN})${NC}" - start_fluxdaemon - - fi - - if [[ "local_version" == "$dpkg_version_after_install" ]]; then - - install_package "$COIN_NAME" "flux" - dpkg_version_after_install=$(dpkg -l $COIN_NAME | grep -w "$COIN_NAME" | awk '{print $3}') - - if [[ "$dpkg_version_after_install" == "$remote_version" ]]; then - - echo -e "${ARROW} ${CYAN}Flux daemon update successful ${CYAN}(${GREEN}$dpkg_version_after_install${CYAN})${NC}" - fi - - start_fluxdaemon - fi - - fi - -} - -function check_update() -{ - - update_fluxbench="0" - update_fluxdaemon="0" - update_flux="0" - - local_version_check "$COIN_NAME" - remote_version_check "$COIN_NAME" - - if [[ "$local_version" == "" || "$remote_version" == "" ]]; then - echo -e "${RED}${ARROW} ${CYAN}Problem with version veryfication...Flux daemon installation skipped...${NC}" - else - - if [[ "$local_version" != "$remote_version" ]]; then - - echo -e "${RED}${HOT}${CYAN}New version of Flux daemon available ${SEA}$remote_version${NC}" - update_fluxdaemon="1" - - else - - echo -e "${ARROW} ${CYAN}You have the current version of Flux daemon ${GREEN}($remote_version)${NC}" - - fi - - fi - - local_version_check "$BENCH_NAME" - remote_version_check "$BENCH_NAME" - - if [[ "$local_version" == "" || "$remote_version" == "" ]]; then - echo -e "${RED}${ARROW} ${CYAN}Problem with version veryfication...Flux benchmark installation skipped...${NC}" - else - - if [[ "$local_version" != "$remote_version" ]]; then - - echo -e "${RED}${HOT}${CYAN}New version of Flux benchmark available ${SEA}$remote_version${NC}" - update_fluxbench="1" - - else - - echo -e "${ARROW} ${CYAN}You have the current version of Flux benchmark ${GREEN}($remote_version)${NC}" - - fi - - fi - - local_version=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - remote_version=$(curl -s -m 3 https://raw.githubusercontent.com/zelcash/zelflux/master/package.json | jq -r '.version') - - if [[ "$local_version" == "" || "$remote_version" == "" ]]; then - echo -e "${RED}${ARROW} ${CYAN}Problem with version veryfication...Flux installation skipped...${NC}" - else - - if [[ "$local_version" != "$remote_version" ]]; then - - echo -e "${RED}${HOT}${CYAN}New version of Flux available ${SEA}$remote_version${NC}" - update_flux="1" - FLUX_UPDATE="1" - - else - - echo -e "${ARROW} ${CYAN}You have the current version of Flux ${GREEN}($remote_version)${NC}" - - fi - - fi - - if [[ "$update_fluxbench" == "1" || "$update_fluxdaemon" == "1" || "$update_flux" == "1" ]]; then - echo -e "" - fi - -} - -#tar_file_unpack file/file_path dir_to_compress -function tar_file_unpack() -{ - echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" - pv $1 | tar -zx -C $2 -} - - -#tar_file_pack path_to_pack path_to_archive_file_to_save -function tar_file_pack() -{ - echo -e "${ARROW} ${YELLOW}Creating bootstrap archive file...${NC}" - tar -c --use-compress-program=pigz -f $2 $1 - #tar -czf --use-compress-program=pigz - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 -} - - - - -#check_tar file_name -function check_tar() -{ - echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" - - if gzip -t "$1" &>/dev/null; then - - echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" - - else - - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $1 - - fi - -} - - -function create_daemon_bootstrap() -{ - - sudo apt install zip >/dev/null 2>&1 - - if "$COIN_CLI" getinfo > /dev/null 2>&1; then - - - local_network_hight=$("$COIN_CLI" getinfo | jq -r .blocks) - echo -e "${ARROW} ${CYAN}Local Network Block Hight: ${GREEN}$local_network_hight${NC}" - - network_height_01=$(curl -sk -m 5 https://explorer.zel.network/api/status?q=getInfo | jq '.info.blocks') - network_height_02=$(curl -sk -m 5 https://explorer2.zel.network/api/status?q=getInfo | jq '.info.blocks') - network_height_03=$(curl -sk -m 5 https://explorer.zel.zelcore.io/api/status?q=getInfo | jq '.info.blocks') - - explorer_network_hight=$(max "$network_height_01" "$network_height_02" "$network_height_03") - - echo -e "${ARROW} ${CYAN}Global Network Block Hight: ${GREEN}$explorer_network_hight${NC}" - - if [[ "$explorer_network_hight" == "" || "$local_network_hight" == "" ]]; then - - echo -e "${ARROW} ${CYAN}Flux network veryfication failed...${NC}" - return - - fi - - - check_height=$((explorer_network_hight-local_network_hight)) - - if [[ "$check_height" -lt 0 ]]; then - - check_height=$((check_height*(-1))) - - fi - - if [[ "$check_height" -lt 15 ]]; then - - echo -e "${ARROW} ${CYAN}Local and Global network are synced, diff: ${GREEN}$check_height${NC}" - else - - echo -e "${ARROW} ${CYAN}Local and Global network are not synced, try again later (diff: ${RED}$check_height${CYAN})${NC}" - return - fi - - data=$(date -u) - unix=$(date +%s) - stop_fluxdaemon - check_zip=$(zip -L | head -n1) - - if [[ "$check_zip" != "" ]]; then - - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - rm -rf /home/$USER/$BOOTSTRAP_ZIPFILE >/dev/null 2>&1 && sleep 5 - #echo -e "${ARROW} ${CYAN}Flux daemon bootstrap creating...${NC}" - cd /home/$USER/$CONFIG_DIR - tar_file_pack "blocks chainstate determ_zelnodes" "/home/$USER/$BOOTSTRAP_ZIPFILE" - #zip /home/$USER/$BOOTSTRAP_ZIPFILE -r blocks chainstate determ_zelnodes - cd - - if [[ -f /home/$USER/$BOOTSTRAP_ZIPFILE ]]; then - - echo -e "${ARROW} ${CYAN}Flux daemon bootstrap created successful ${GREEN}($local_network_hight)${NC}" - rm -rf /home/$USER/daemon_bootstrap.json >/dev/null 2>&1 - - sudo touch /home/$USER/daemon_bootstrap.json - sudo chown $USER:$USER /home/$USER/daemon_bootstrap.json - cat << EOF > /home/$USER/daemon_bootstrap.json - { - "block_height": "${explorer_network_hight}", - "time": "${data}", - "unix_timestamp": "${unix}" - } -EOF - else - - echo -e "${ARROW} ${CYAN}Flux daemon bootstrap creating failed${NC}" - - fi - - fi - - start_fluxdaemon - - else - - echo -e "${ARROW} ${CYAN}Flux network veryfication failed...Flux daemon not working...${NC}" - echo - - fi - -} - -function create_mongod_bootstrap() -{ - - WANIP=$(wget --timeout=3 --tries=2 http://ipecho.net/plain -O - -q) - - if [[ "$WANIP" == "" ]]; then - - WANIP=$(curl -s -m 3 ifconfig.me) - - if [[ "$WANIP" == "" ]]; then - - echo -e "${ARROW} ${CYAN}Public IP address could not be found, action stopped .........[${X_MARK}${CYAN}]${NC}" - echo - exit - - fi - fi - - local_network_hight=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') - echo -e "${ARROW} ${CYAN}Mongod Network Block Hight: ${GREEN}$local_network_hight${NC}" - - #explorer_network_hight=$(curl -s -m 3 https://explorer.zel.network/api/status?q=getInfo | jq '.info.blocks') - - network_height_01=$(curl -sk -m 5 https://explorer.zel.network/api/status?q=getInfo | jq '.info.blocks') - network_height_02=$(curl -sk -m 5 https://explorer2.zel.network/api/status?q=getInfo | jq '.info.blocks') - network_height_03=$(curl -sk -m 5 https://explorer.zel.zelcore.io/api/status?q=getInfo | jq '.info.blocks') - - explorer_network_hight=$(max "$network_height_01" "$network_height_02" "$network_height_03") - - echo -e "${ARROW} ${CYAN}Global Network Block Hight: ${GREEN}$explorer_network_hight${NC}" - - if [[ "$explorer_network_hight" == "" || "$local_network_hight" == "" ]]; then - - echo -e "${ARROW} ${CYAN}Flux network veryfication failed...${NC}" - return - - fi - - check_height=$((explorer_network_hight-local_network_hight)) - - if [[ "$check_height" -lt 0 ]]; then - - check_height=$((check_height*(-1))) - - fi - - if [[ "$check_height" -lt 15 ]]; then - - echo -e "${ARROW} ${CYAN}Local and Global network are synced, diff: ${GREEN}$check_height${NC}" - - else - - echo -e "${ARROW} ${CYAN}Local and Global network are not synced, try again later (diff: ${RED}$check_height${CYAN})${NC}" - return - - fi - - data=$(date -u) - unix=$(date +%s) - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /home/$USER/dump >/dev/null 2>&1 && sleep 2 - sudo rm -rf /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD >/dev/null 2>&1 && sleep 2 - - echo -e "${ARROW} ${CYAN}Exporting Mongod datetable...${NC}" - mongodump --port 27017 --db zelcashdata --out /home/$USER/dump/ >/dev/null 2>&1 - - tar_file_pack "dump" "/home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD" - #tar -cvzf /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD dump - sudo rm -rf /home/$USER/dump >/dev/null 2>&1 && sleep 2 - - if [[ -f /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD ]]; then - echo -e "${ARROW} ${CYAN}Mongod bootstrap created successful ${GREEN}($local_network_hight)${NC}" - rm -rf /home/$USER/mongodb_bootstrap.json >/dev/null 2>&1 - - sudo touch /home/$USER/mongodb_bootstrap.json - sudo chown $USER:$USER /home/$USER/mongodb_bootstrap.json - cat << EOF > /home/$USER/mongodb_bootstrap.json - { - "block_height": "${explorer_network_hight}", - "time": "${data}", - "unix_timestamp": "${unix}" - } -EOF - - else - - echo -e "${ARROW} ${CYAN}Mongod bootstrap creating failed${NC}" - - fi - -} - -function clean_mongod() { - - echo -e "${ARROW} ${CYAN}Stopping Flux...${NC}" - pm2 stop flux >/dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${CYAN}Stopping MongoDB...${NC}" - sudo systemctl stop mongod >/dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${CYAN}Removing MongoDB datatable...${NC}" - # sudo rm -r /var/lib/mongodb >/dev/null 2>&1 && sleep 2 - install_mongod - - pm2 start flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - - NUM='60' - MSG1='Flux starting...' - MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo - - #mongodb_bootstrap - -} - -function mongodb_bootstrap(){ - - WANIP=$(wget --timeout=3 --tries=2 http://ipecho.net/plain -O - -q) - - if [[ "$WANIP" == "" ]]; then - - WANIP=$(curl -s -m 3 ifconfig.me) - - if [[ "$WANIP" == "" ]]; then - - echo -e "${ARROW} ${CYAN}Public IP address could not be found, action stopped .........[${X_MARK}${CYAN}]${NC}" - echo - exit - - fi - fi - - BLOCKHIGHT=100 - #DB_HIGHT=$(curl -s -m 3 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') - DB_HIGHT=$(curl -s -m 3 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') - echo -e "${ARROW} ${CYAN}Bootstrap block hight: ${GREEN}$DB_HIGHT${NC}" - - if [[ "$BLOCKHIGHT" -gt "0" && "$BLOCKHIGHT" -lt "$DB_HIGHT" ]]; then - - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" - wget $BOOTSTRAP_URL_MONGOD -q --show-progress - echo -e "${ARROW} ${CYAN}Unpacking...${NC}" - #tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD" "/home/$USER" - - echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" - mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 - sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 - pm2 start flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - - NUM='120' - MSG1='Flux starting...' - MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo - BLOCKHIGHT_AFTER_BOOTSTRAP=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') - echo -e ${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC} - - if [[ "$BLOCKHIGHT" != "" ]]; then - - if [[ "$BLOCKHIGHT" -gt "0" && "$BLOCKHIGHT" -lt "$DB_HIGHT" ]]; then - - #echo -e "${ARROW} ${CYAN}Mongo bootstrap installed successful.${NC}" - string_limit_check_mark "Mongo bootstrap installed successful.................................." - echo -e "" - else - #echo -e "${ARROW} ${CYAN}Mongo bootstrap installation failed.${NC}" - string_limit_x_mark "Mongo bootstrap installation failed.................................." - echo -e "" - fi - - else - echo -e "${ARROW} ${CYAN}Current Node block hight ${RED}$BLOCKHIGHT${CYAN} > Bootstrap block hight ${RED}$DB_HIGHT${CYAN}. Datatable is out of date.${NC}" - echo -e "" - fi - fi - -} - -function install_mongod() { - - sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 - if [[ $(lsb_release -r) = *16.* ]]; then - wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc 2> /dev/null | sudo apt-key add - > /dev/null 2>&1 - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - elif [[ $(lsb_release -r) = *18.* || $(lsb_release -r) = *19.* ]]; then - wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc 2> /dev/null | sudo apt-key add - > /dev/null 2>&1 - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - elif [[ $(lsb_release -r) = *20.* ]]; then - wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc 2> /dev/null | sudo apt-key add - > /dev/null 2>&1 - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - elif [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then - wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc 2> /dev/null | sudo apt-key add - > /dev/null 2>&1 - echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - elif [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *10* ]]; then - wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc 2> /dev/null | sudo apt-key add - > /dev/null 2>&1 - echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - - else - echo -e "${WORNING}${CYAN}ERROR: OS version not supported" - echo -e "${WORNING}${CYAN}Installation stopped..." - echo - exit - fi - - sleep 2 - echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" - sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 - sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 - sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 - sudo systemctl enable mongod > /dev/null 2>&1 - sudo systemctl start mongod > /dev/null 2>&1 - - if mongod --version > /dev/null 2>&1 - then - #echo -e "${ARROW} ${CYAN}MongoDB version: ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed${NC}" - string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}MongoDB was not installed${NC}" - string_limit_x_mark "MongoDB was not installed................................." - echo - fi -} - -function swapon_create() -{ - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - #echo -e "${YELLOW}Swap set at $swap...${NC}" - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - # echo -e "${YELLOW}Swap set at $swap...${NC}" - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - #echo -e "${YELLOW}Swap set at $swap...${NC}" - fi - - if ! grep -q "swapfile" /etc/fstab; then - - if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi - - fi -} - - - -function unlock_flux_resouce() -{ - - docker_check=$(docker ps | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) - resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) - mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) - - if [[ "$mongod_check" != "" && "$mongod_check" != "null" && "$1" == "clean_db" ]]; then - - echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 - echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 - echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 - - fi - - if [[ $docker_check != 0 ]]; then - echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 - echo -e "${ARROW} ${CYAN}Stopping containers...${NC}" - docker ps | grep -Eo "^[0-9a-z]{8,}\b" | - - while read line; do - sudo docker stop $line && sleep 2 - sudo docker rm $line && sleep 2 - done - fi - - if [[ $resource_check != 0 ]]; then - echo -e "${ARROW} ${YELLOW}Detected locked resource${NC}" && sleep 1 - echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" && sleep 1 - df | egrep 'flux' | awk '{ print $1}' | - - while read line; do - sudo umount $line && sleep 1 - done - fi - - echo -} - - -function create_kda_bootstrap { - - kda_bootstrap_daemon="0" - - WANIP=$(wget --timeout=3 --tries=2 http://ipecho.net/plain -O - -q) - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl -s -m 3 ifconfig.me) - if [[ "$WANIP" == "" ]]; then - echo -e "${ARROW} ${CYAN}Local IP address could not be found, action stopped .........[${X_MARK}${CYAN}]${NC}" - echo - exit - fi - fi - - if [ ! -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db ]; then - echo -e "${ARROW} ${CYAN}Kadena Node chain directory does not exist, operation stopped...${NC}" - echo - exit - fi - - network_height_node_01=$(curl -sk -m 3 https://us-e1.chainweb.com/chainweb/0.0/mainnet01/cut | jq '.height') - network_height_node_02=$(curl -sk -m 3 https://us-e2.chainweb.com/chainweb/0.0/mainnet01/cut | jq '.height') - network_height_node_03=$(curl -sk -m 3 https://fr1.chainweb.com/chainweb/0.0/mainnet01/cut | jq '.height') - - network_height=$(max "$network_height_node_01" "$network_height_node_02" "$network_height_node_03") - echo -e "${ARROW} ${CYAN}Kadena Global Network Height: ${GREEN}$network_height${NC}" - kda_height=$(curl -sk https://$WANIP:30004/chainweb/0.0/mainnet01/cut | jq '.height') - echo -e "${ARROW} ${CYAN}Kadena Local Node Height: ${GREEN}$kda_height${NC}" - - check_height=$((network_height-kda_height)) - - if [[ "$check_height" -lt 0 ]]; then - check_height=$((check_height*(-1))) - fi - - if [[ "$check_height" -lt 2000 ]]; then - echo -e "${ARROW} ${CYAN}Local and Global network are synced, diff: ${GREEN}$check_height${NC}" - echo - else - echo -e "${ARROW} ${CYAN}Local and Global network are not synced, try again later (diff: ${RED}$check_height${CYAN})${NC}" - echo - exit - fi - - if [[ "$kda_height" != "" && "$kda_height" != "null" ]]; then - - sudo rm -rf /home/$USER/$KDA_BOOTSTRAP_ZIPFILE >/dev/null 2>&1 && sleep 2 - - data=$(date -u) - unix=$(date +%s) - docker_check=$(docker ps | grep 'zelKadenaChainWebNode' | wc -l) - - if [[ "$docker_check" != "" && "$docker_check" != "0" ]]; then - - echo -e "${ARROW} ${CYAN}Stopping Kadena Node...${NC}" - docker stop zelKadenaChainWebNode > /dev/null 2>&1 - - #echo -e "${ARROW} ${CYAN}Bootstrap file creating...${NC}" - cd /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 - #zip /home/$USER/$KDA_BOOTSTRAP_ZIPFILE -r chainweb-db - tar_file_pack "rocksDb sqlite" "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" - cd - - if [[ -f /home/$USER/$KDA_BOOTSTRAP_ZIPFILE ]]; then - kda_bootstrap_daemon="1" - rm -rf /home/$USER/kda_bootstrap.json >/dev/null 2>&1 - - sudo touch /home/$USER/kda_bootstrap.json - sudo chown $USER:$USER /home/$USER/kda_bootstrap.json - cat << EOF > /home/$USER/kda_bootstrap.json - { - "block_height": "${kda_height}", - "time": "${data}", - "unix_timestamp": "${unix}" - } -EOF - fi - - echo -e "${ARROW} ${CYAN}Starting Kadena Node...${NC}" - docker start zelKadenaChainWebNode > /dev/null 2>&1 - - fi - - fi - - - if [[ "$kda_bootstrap_daemon" == "0" ]]; then - echo -e "${ARROW} ${CYAN}Kadena Node bootstrap creating failed...${NC}" - else - echo -e "${ARROW} ${CYAN}Kadena Node bootstrap created successful ${GREEN}($kda_height)${NC}" - fi - -} - -function daemon_bootstrap() { - - - echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" - sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 - sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 - - if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes - fi - - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" - check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" - - fi - - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - #unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode > /dev/null 2>&1 - - else - - echo -e "${ARROW} ${CYAN}Bootstrap file downloading...${NC}" && sleep 2 - - CHOICE=$( - whiptail --title "Bootstrap installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) - - - case $CHOICE in - "1)") - DB_HIGHT=$(curl -s -m 3 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') - echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - wget -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - - ;; - "2)") - BOOTSTRAP_ZIP="$(whiptail --title "Flux daemon bootstrap source" --inputbox "Enter your URL" 8 72 3>&1 1>&2 2>&3)" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - wget -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - #unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode > /dev/null 2>&1 - ;; - esac - - fi - - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - rm -rf $BOOTSTRAP_ZIPFILE - fi - - sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 - NUM='35' - MSG1='Starting Flux daemon service...' - MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo -e "" && echo -e "" - -} - -function kda_bootstrap() { - - sudo chown -R $USER:$USER /home/$USER/$FLUX_DIR - echo -e "${ARROW} ${CYAN}Stopping Kadena Node...${NC}" - docker stop zelKadenaChainWebNode > /dev/null 2>&1 && sleep 2 - - if [[ -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - rm -rf /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db - fi - - mkdir -p /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 > /dev/null 2>&1 - - - if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then - - echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" - check_tar "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" - - fi - - - if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then - - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - sleep 2 - #unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode > /dev/null 2>&1 - - else - - echo -e "${ARROW} ${CYAN}Bootstrap file downloading...${NC}" && sleep 2 - - CHOICE=$( - whiptail --title "Bootstrap installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) - - - case $CHOICE in - "1)") - DB_HIGHT=$(curl -s -m 3 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') - echo -e "${ARROW} ${CYAN}KDA Bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" - wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - sleep 2 - - ;; - "2)") - KDA_BOOTSTRAP_ZIP="$(whiptail --title "Kadena node bootstrap source (*.tar.gz, *.zip file supported)" --inputbox "Enter your URL" 8 72 3>&1 1>&2 2>&3)" - KDA_BOOTSTRAP_ZIPFILE="${KDA_BOOTSTRAP_ZIP##*/}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" - wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - - fi - sleep 2 - ;; - esac - - fi - - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - rm -rf $KDA_BOOTSTRAP_ZIPFILE - fi - - docker start zelKadenaChainWebNode > /dev/null 2>&1 - NUM='15' - MSG1='Starting Kadena Node...' - MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo -e "" - echo -e "${ARROW} ${CYAN}Kadena Node initial process can take about ~15min. ${NC}" - echo -e "" - -} - -if ! pv -V > /dev/null 2>&1 -then -sudo apt-get install -y pv > /dev/null 2>&1 -fi - -if ! gzip -V > /dev/null 2>&1 -then -sudo apt-get install -y gzip > /dev/null 2>&1 -fi - -if ! zip -v > /dev/null 2>&1 -then -sudo apt-get install -y zip > /dev/null 2>&1 -fi - -if ! pigz -V > /dev/null 2>&1 -then -sudo apt-get install -y pigz > /dev/null 2>&1 -fi - - - - - - case $call_type in - - "update_all") - - check_update - if [[ "$update_flux" == "1" ]]; then - flux_update - fi - - if [[ "$update_fluxbench" == "1" ]]; then - fluxbench_update - fi - - if [[ "$update_fluxdaemon" == "1" ]]; then - fluxdaemon_update - fi - echo - ;; - - "fluxdaemon_update") - echo - fluxdaemon_update - echo - ;; - - "fluxbench_update") - echo - fluxbench_update - echo - ;; - - "flux_update") - echo - flux_update - echo - ;; - - "flux_restart") - echo - restart_fluxdaemon - echo - ;; - - "flux_reindex") - echo - reindex - echo - ;; - - "create_daemon_bootstrap") - echo - create_daemon_bootstrap - echo - ;; - - "daemon_bootstrap") - echo - daemon_bootstrap - echo - ;; - - "mongod_bootstrap") - echo - echo -e "${ARROW} ${CYAN}Stopping Flux...${NC}" - pm2 stop flux >/dev/null 2>&1 && sleep 2 - mongodb_bootstrap - echo - ;; - - "create_mongod_bootstrap") - echo - create_mongod_bootstrap - echo - ;; - - "create_kda_bootstrap") - echo - create_kda_bootstrap - echo - ;; - - "clean_mongod") - echo - clean_mongod - echo - ;; - - "swapon_create") - echo - swapon_create - echo - ;; - - "unlock_flux_resouce") - echo - unlock_flux_resouce "$type" - echo - ;; - - "kda_bootstrap") - echo - kda_bootstrap - echo - ;; - - esac From 01208d96167b42d2c441d807267abf80c7224a64 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 4 May 2021 19:28:38 +0200 Subject: [PATCH 0007/1176] clean --- multitoolbox.sh | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 29c568c0..8f90e552 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1130,41 +1130,6 @@ bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool } - function insertAfter -{ - local file="$1" line="$2" newText="$3" - sudo sed -i -e "/$line/a"$'\\\n'"$newText"$'\n' "$file" -} - -function fix_lxc_config(){ - -echo -e "${GREEN}Module: Fix your lxc.conf file on host${NC}" -echo -e "${YELLOW}================================================================${NC}" -echo -e "" - -continer_name="$(whiptail --title "ZELNODE MULTITOOLBOX $dversion" --inputbox "Enter your LXC continer name" 8 72 3>&1 1>&2 2>&3)" -echo -e "${YELLOW}================================================================${NC}" -if [[ $(grep -w "features: mount=fuse,nesting=1" /etc/pve/lxc/$continer_name.conf) && $(grep -w "lxc.mount.entry: /dev/fuse dev/fuse none bind,create=file 0 0" /etc/pve/lxc/$continer_name.conf) ]] -then -echo -e "${CHECK_MARK} ${CYAN}LXC configurate file $continer_name.conf [OK]${NC}" -fi - -insertAfter "/etc/pve/lxc/$continer_name.conf" "cores" "features: mount=fuse,nesting=1" -sudo bash -c "echo 'lxc.mount.entry: /dev/fuse dev/fuse none bind,create=file 0 0' >>/etc/pve/lxc/$continer_name.conf" -sudo bash -c "echo 'lxc.cap.drop:' >>/etc/pve/lxc/$continer_name.conf" -sudo bash -c "echo 'lxc.cap.drop: mac_override sys_time sys_module sys_rawio' >>/etc/pve/lxc/$continer_name.conf" -sudo bash -c "echo 'lxc.apparmor.profile: unconfined' >>/etc/pve/lxc/$continer_name.conf" -sudo bash -c "echo 'lxc.cgroup.devices.allow: a' >>/etc/pve/lxc/$continer_name.conf" -sudo bash -c "echo 'lxc.cap.drop:' >>/etc/pve/lxc/$continer_name.conf" - -if [[ $(grep -w "features: mount=fuse,nesting=1" /etc/pve/lxc/$continer_name.conf) && $(grep -w "lxc.mount.entry: /dev/fuse dev/fuse none bind,create=file 0 0" /etc/pve/lxc/$continer_name.conf) ]] -then -echo -e "${CHECK_MARK} ${CYAN}LXC configurate file $continer_name.conf [FiXED]${NC}" -else -echo -e "${X_MARK} ${CYAN}LXC configurate file $continer_name.conf fix [Failed]${NC}" -fi - -} function install_node(){ @@ -1481,7 +1446,6 @@ echo -e "${CYAN}7 - Create FluxNode installation config file${NC}" echo -e "${CYAN}8 - Re-install Flux${NC}" echo -e "${CYAN}9 - Flux Daemon Reconfiguration${NC}" echo -e "${CYAN}10 - Restore Kadena node blockchain from bootstrap${NC}" -#echo -e "${CYAN}8 - Install Linux Kernel 5.X for Ubuntu 18.04${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " From c96da09039419ddc935ccb92bab88ce7bb490c51 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 12:42:49 +0200 Subject: [PATCH 0008/1176] added watchdog config whiptail ask --- multitoolbox.sh | 90 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8f90e552..9f07a98f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -692,6 +692,96 @@ mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" cd watchdog && npm install > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Creating config file....${NC}" + + +if whiptail --yesno "Would you like enable FluxOS auto update?" 8 65; then +flux_update='1' +sleep 3 +else +flux_update='0' +sleep 3 +fi + +if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 65; then +daemon_update='1' +sleep 3 +else +daemon_update='0' +sleep 3 +fi + +if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 65; then +bench_update='1' +sleep 3 +else +bench_update='0' +sleep 3 +fi + +if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 65; then +fix_action='1' +sleep 3 +else +fix_action='0' +sleep 3 +fi + +if whiptail --yesno "Would you like enable discord alert?" 8 65; then + +discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) +sleep 2 + + if whiptail --yesno "Would you like enable nick ping on discord?" 8 65; then + ping=$(whiptail --inputbox "Enter your discord user id" 8 65 3>&1 1>&2 2>&3) + sleep 3 + else + ping='0' + sleep 3 + fi + +else +discord='0' +ping='0' +sleep 3 +fi + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + + if [[ "$stak_info" != "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.flux.zelcore.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + fi +fi + +if [[ $stak_info === ?(-)+([0-9]) ]]; then + + case $stak_info in + "10000") eps_limit=90 ;; + "25000") eps_limit=180 ;; + "100000") eps_limit=300 ;; + esac + +else +eps_limit=0; +fi + + +sudo touch /home/$USER/watchdog/config.js +sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js +module.exports = { + tier_eps_min: '${eps_limit}', + zelflux_update: '${flux_update}', + zelcash_update: '${daemon_update}', + zelbench_update: '${bench_update}', + action: '${fix_action}', + ping: '${ping}', + web_hook_url: '${discord}' +} +EOF + echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 10 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 From 379c1fd04d9b7166676b5f4ba02dc44a01a3af1c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 12:49:21 +0200 Subject: [PATCH 0009/1176] fix conditional --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9f07a98f..6a384787 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -755,7 +755,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then fi fi -if [[ $stak_info === ?(-)+([0-9]) ]]; then +if [[ $stak_info == ?(-)+([0-9]) ]]; then case $stak_info in "10000") eps_limit=90 ;; From 4308bfbbff160386d713a99c4e7fe1a3117fe7a3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 12:59:07 +0200 Subject: [PATCH 0010/1176] fix eps_limit and change sleep value --- multitoolbox.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6a384787..ad1bd97c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -697,61 +697,62 @@ echo -e "${ARROW} ${CYAN}Creating config file....${NC}" if whiptail --yesno "Would you like enable FluxOS auto update?" 8 65; then flux_update='1' -sleep 3 +sleep 1 else flux_update='0' -sleep 3 +sleep 1 fi if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 65; then daemon_update='1' -sleep 3 +sleep 1 else daemon_update='0' -sleep 3 +sleep 1 fi if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 65; then bench_update='1' -sleep 3 +sleep 1 else bench_update='0' -sleep 3 +sleep 1 fi if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 65; then fix_action='1' -sleep 3 +sleep 1 else fix_action='0' -sleep 3 +sleep 1 fi if whiptail --yesno "Would you like enable discord alert?" 8 65; then discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) -sleep 2 +sleep 1 if whiptail --yesno "Would you like enable nick ping on discord?" 8 65; then ping=$(whiptail --inputbox "Enter your discord user id" 8 65 3>&1 1>&2 2>&3) - sleep 3 + sleep 1 else ping='0' - sleep 3 + sleep 1 fi else discord='0' ping='0' -sleep 3 +sleep 1 fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') if [[ "$stak_info" != "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.flux.zelcore.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.flux.zelcore.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') fi fi From 08146cc8bd99ed0e056c21be3dec6a440401557d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 13:00:43 +0200 Subject: [PATCH 0011/1176] fix variable --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index ad1bd97c..9aec2bc1 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -749,7 +749,7 @@ fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') if [[ "$stak_info" != "" ]]; then stak_info=$(curl -s -m 5 https://explorer.flux.zelcore.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') From 9be64dfa2fd24851d0cbf9f4dba176a37602d51b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 13:09:53 +0200 Subject: [PATCH 0012/1176] add debug log --- multitoolbox.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9aec2bc1..2c9eae86 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -756,6 +756,12 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then fi fi +echo +echo -e "$index_from_file" +echo -e "$tx_from_file" +echo -e "$stak_info" +echo + if [[ $stak_info == ?(-)+([0-9]) ]]; then case $stak_info in From e28c2ac63ee3ebb4fe832b96e273b91fb46ef2c7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 13:13:25 +0200 Subject: [PATCH 0013/1176] fix stak_info --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 2c9eae86..9e65e08e 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -749,10 +749,10 @@ fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') if [[ "$stak_info" != "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.flux.zelcore.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.flux.zelcore.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') fi fi From ca1b5cac7f535d8a57096caf44b239f3218b7f7c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 13:20:56 +0200 Subject: [PATCH 0014/1176] remove debug log, resize whiptail --- multitoolbox.sh | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9e65e08e..6bfb9250 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -695,7 +695,7 @@ cd watchdog && npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating config file....${NC}" -if whiptail --yesno "Would you like enable FluxOS auto update?" 8 65; then +if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then flux_update='1' sleep 1 else @@ -703,7 +703,7 @@ flux_update='0' sleep 1 fi -if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 65; then +if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then daemon_update='1' sleep 1 else @@ -711,7 +711,7 @@ daemon_update='0' sleep 1 fi -if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 65; then +if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then bench_update='1' sleep 1 else @@ -719,7 +719,7 @@ bench_update='0' sleep 1 fi -if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 65; then +if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then fix_action='1' sleep 1 else @@ -727,13 +727,13 @@ fix_action='0' sleep 1 fi -if whiptail --yesno "Would you like enable discord alert?" 8 65; then +if whiptail --yesno "Would you like enable discord alert?" 8 60; then discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) sleep 1 - if whiptail --yesno "Would you like enable nick ping on discord?" 8 65; then - ping=$(whiptail --inputbox "Enter your discord user id" 8 65 3>&1 1>&2 2>&3) + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) sleep 1 else ping='0' @@ -756,12 +756,6 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then fi fi -echo -echo -e "$index_from_file" -echo -e "$tx_from_file" -echo -e "$stak_info" -echo - if [[ $stak_info == ?(-)+([0-9]) ]]; then case $stak_info in From e3238cd6107bc412409cbc4a1aec807fef0f273f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 14:08:40 +0200 Subject: [PATCH 0015/1176] added watchdog configuration via whiptail --- install_pro.sh | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 9337c805..65e3d4aa 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -360,6 +360,96 @@ mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" cd watchdog && npm install > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Creating config file....${NC}" + +if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then +flux_update='1' +sleep 1 +else +flux_update='0' +sleep 1 +fi + +if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then +daemon_update='1' +sleep 1 +else +daemon_update='0' +sleep 1 +fi + +if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then +bench_update='1' +sleep 1 +else +bench_update='0' +sleep 1 +fi + +if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then +fix_action='1' +sleep 1 +else +fix_action='0' +sleep 1 +fi + +if whiptail --yesno "Would you like enable discord alert?" 8 60; then + +discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) +sleep 1 + + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + sleep 1 + else + ping='0' + sleep 1 + fi + +else +discord='0' +ping='0' +sleep 1 +fi + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + + if [[ "$stak_info" != "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.flux.zelcore.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + fi +fi + +if [[ $stak_info == ?(-)+([0-9]) ]]; then + + case $stak_info in + "10000") eps_limit=90 ;; + "25000") eps_limit=180 ;; + "100000") eps_limit=300 ;; + esac + +else +eps_limit=0; +fi + + +sudo touch /home/$USER/watchdog/config.js +sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js +module.exports = { + tier_eps_min: '${eps_limit}', + zelflux_update: '${flux_update}', + zelcash_update: '${daemon_update}', + zelbench_update: '${bench_update}', + action: '${fix_action}', + ping: '${ping}', + web_hook_url: '${discord}' +} +EOF + echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 10 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 From a5134a15874cf0a336227ef0fd24ebd19a1aa2e2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 20:43:07 +0200 Subject: [PATCH 0016/1176] Add files via upload --- image/discord.png | Bin 0 -> 36666 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 image/discord.png diff --git a/image/discord.png b/image/discord.png new file mode 100644 index 0000000000000000000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6cxFH1Am!Dkt45JQyd=hc(&tLyM8-EUlKktP< zr-DCc!arxiKWD-}XTtx;nUIgt4>SkYrb+!Ralx|L_b%uFD|8TOvOalo%~^2G{`}?7 hbMXJkIN*8hUCGT?>b`J(OK?P{#+GNwzq@wte*=iFsptRz literal 0 HcmV?d00001 From f7edf73ec58b2bbe05b79f70e7940142899a24bf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 20:47:38 +0200 Subject: [PATCH 0017/1176] Add files via upload --- image/discord1.png | Bin 0 -> 32967 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 image/discord1.png diff --git a/image/discord1.png b/image/discord1.png new file mode 100644 index 0000000000000000000000000000000000000000..a24149b85964190a11a05e553af2a50ec7274ade GIT binary patch literal 32967 zcmb@tV|XM_^!Gj4*tRxyvPm|!ZF^%*Y;Ur$HrB>YHnwfswr$`8upFy2K{* zRnYIiUp(9VWH8hL5}3SK*_!16nt!Fs)ywLw%IdM&EZVh^>%uX4Pt?jA)T`C!Jn4|_ z614@b)kMLN1tGW~e~HGSxSP8{BM4)#;b47knhUV7wl0s|@Wu$3ySZu%wrcqOGZ!E? z-7f$JYNtXc{C#~KQ2!l6?6yDyHHz>?|DR37{@zh&g!Ufu!RVv}GSSwepTEH+qk4Gc zX|tM1t<%*Q^G;kuBe61m{Wqady+&qlEu#WeA&x2=Gp=S&8n{ojxfw)^I<4eb-DQKB zLFe`LA?uc?C?B&f`S?$~hg=Ux(J}B9+fX3OwP(1+;|JI$NQXP2A1(y!ACO+lV>;70LKWB}{t}+` zlUl(ePCFd7jyc|G?XTDYUo#DKmY;dKe21GQ*huj!X?O`sN01zj_J$L66TeH+64PA@ zVPPQ!t3FaAi6hfCRs-3!GV3YdqK;j(AuGez=r_JXZaJ9w(?n&aaCti&t)xEf$5XX2 zvfuhz`Lfh4%S6zIw62Eca`#3NBX$^cOhsSviATff9QOX7pG8?EJC5qwXzkGhPR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PDvj)cJIeKoOpD&;FTu@*h)fIP9x$$-4F1qz?p&#G4;8`q1G3YVg<%Q#m z1AWohQY<$q5V*b&^Qhl|^L=uG&4a*k-`v?-vmB!=jtlAv9hlx6S`L`jmMRKC z75AFXGhpDD7^}h3}LHi4Qiq{y%(x#MartvCP-i2ZMPl z@x4?-I57rSeCk}!nlLdY9LX|jz0pVJ6aSF9xvPSBRa|i%g{fSIkLri%Ox!Z(ubc#z zFK3STfD_Ov*pMTx_?!q+JLInnZ(4L8^ywoRYYgMN3pdZl;=h@NTdWTdyiOD%ZTO$3 zQSZm@9%@Ekjb9w>FH{6dZMFn;Vk$@PAerm^nKJPS&^`DFM5BO6tv}%X2Zlj^RA2uc zmeNjR!dP$pe0>`hy~jvJ<5Rx?#l`Lnqv3JbyD-GY8-<6X`1O>S_arjKU-q7bQpR3< z?x-sJO1piM54NWyMtTxWBVbLKRT#Ppw5wdb`R#q`#vJHi07CoUQp)-3kWw+$d(Ycz c0`VKM71nwgg29vv;D01pDJ9ABHy;E37puA*%K!iX literal 0 HcmV?d00001 From 1d44e14085034c9f442972914f508ecd794ba1a9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 May 2021 20:47:51 +0200 Subject: [PATCH 0018/1176] Delete discord.png --- image/discord.png | Bin 36666 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 image/discord.png diff --git a/image/discord.png b/image/discord.png deleted file mode 100644 index 0ad38d2bb93f9fb41c1eb384dcf3942d9458c28f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36666 zcmd43XIN9|zVPiF_s9$=i~^z}Fb+*bng~eEwg4hc4Mn64B1I4)EtHUC_9!AEFj6B` zDWQYZNJ%nMrADL#LW%SmLJLVqdlxdZ56+x(zP!(QuIGc7m%>`>F8_Z2{&&<(3*#gF zr}z&XIB>+|`nB5!4tz^IaNr>7yZ-?G=UtiO6X36J0&W{$IZ)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May 2021 20:06:16 +0200 Subject: [PATCH 0019/1176] added discord userid check --- multitoolbox.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6bfb9250..a4e6889c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -733,8 +733,22 @@ discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 sleep 1 if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + + + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + else ping='0' sleep 1 From 78feb9f73c0ec49845cf90eaa686e555f689448e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 9 May 2021 20:07:22 +0200 Subject: [PATCH 0020/1176] added discord userid check --- install_pro.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 65e3d4aa..31458e6f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -400,8 +400,21 @@ discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 sleep 1 if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + else ping='0' sleep 1 From 01b6f629dfd7f9fe9733685b79ba404423fde1d6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 11 May 2021 23:28:12 +0200 Subject: [PATCH 0021/1176] increased daemon loading time --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 31458e6f..9c551180 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1342,7 +1342,7 @@ function start_daemon() { sudo systemctl enable zelcash.service > /dev/null 2>&1 sudo systemctl start zelcash > /dev/null 2>&1 - NUM='180' + NUM='210' MSG1='Starting daemon & syncing with chain please be patient this will take about 3 min...' MSG2='' spinning_timer From fc6b7a553bf368f93106df8566a6efb181661b2c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 13 May 2021 08:57:07 +0200 Subject: [PATCH 0022/1176] add optional zelcash-cli --- install_pro.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 9c551180..b916e515 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1241,7 +1241,11 @@ sudo touch /home/$USER/stop_daemon_service.sh sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh cat <<'EOF' > /home/$USER/stop_daemon_service.sh #!/bin/bash +if [[ -f /usr/local/bin/flux-cli ]]; then bash -c "flux-cli stop" +else +bash -c "zelcash-cli stop" +fi exit EOF From a9280ba521fe8e29be1d735be2cfdd153a2812ab Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 13 May 2021 09:18:44 +0200 Subject: [PATCH 0023/1176] added create Flux daemon service for old nodes --- multitoolbox.sh | 136 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index a4e6889c..5690aa2d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1500,7 +1500,135 @@ echo -e "" && echo -e "" } +function create_service_scripts() { +echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 +sudo touch /home/$USER/start_daemon_service.sh +sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + cat <<'EOF' > /home/$USER/start_daemon_service.sh +#!/bin/bash +#color codes +RED='\033[1;31m' +CYAN='\033[1;36m' +NC='\033[0m' +#emoji codes +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" +sleep 2 +echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" +echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" +bench_status_pind=$(pgrep fluxbenchd) +daemon_status_pind=$(pgrep fluxd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi +bench_status_pind=$(pgrep zelbenchd) +daemon_status_pind=$(pgrep zelcashd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi +if [[ -f /usr/local/bin/fluxd ]]; then +bash -c "fluxd" +exit +else +bash -c "zelcashd" +exit +fi +EOF + + +sudo touch /home/$USER/stop_daemon_service.sh +sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh + cat <<'EOF' > /home/$USER/stop_daemon_service.sh +#!/bin/bash +if [[ -f /usr/local/bin/flux-cli ]]; then +bash -c "flux-cli stop" +else +bash -c "zelcash-cli stop" +fi +exit +EOF + +echo -e "${ARROW} ${CYAN}Setting scripts permissions...${NC}" && sleep 1 +sudo chmod +x /home/$USER/stop_daemon_service.sh +sudo chmod +x /home/$USER/start_daemon_service.sh +echo -e "${ARROW} ${CYAN}Reloading service config...${NC}" && sleep 1 +sudo systemctl daemon-reload > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Starting Flux daemon....${NC}" && sleep 1 +sudo systemctl start zelcash > /dev/null 2>&1 +echo -e "" +} + +function create_service() { + + echo -e "${GREEN}Module: Flux Daemon service creator${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" ]] + then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + +echo -e "" +echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 +sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 +sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 +sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 +sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 + +echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 +sudo touch /etc/systemd/system/zelcash.service +sudo chown $USER:$USER /etc/systemd/system/zelcash.service +cat << EOF > /etc/systemd/system/zelcash.service +[Unit] +Description=Flux daemon service +After=network.target +[Service] +Type=forking +User=$USER +Group=$USER +ExecStart=/home/$USER/start_daemon_service.sh +ExecStop=-/home/$USER/stop_daemon_service.sh +Restart=always +RestartSec=10 +PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=15s +StartLimitInterval=120s +StartLimitBurst=5 +[Install] +WantedBy=multi-user.target +EOF + sudo chown root:root /etc/systemd/system/zelcash.service +} if ! figlet -v > /dev/null 2>&1 @@ -1551,6 +1679,7 @@ echo -e "${CYAN}7 - Create FluxNode installation config file${NC}" echo -e "${CYAN}8 - Re-install Flux${NC}" echo -e "${CYAN}9 - Flux Daemon Reconfiguration${NC}" echo -e "${CYAN}10 - Restore Kadena node blockchain from bootstrap${NC}" +echo -e "${CYAN}11 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -1612,6 +1741,13 @@ read -rp "Pick an option and hit ENTER: " ;; + 11) + clear + sleep 1 + create_service + create_service_scripts + ;; + # 8) #clear # sleep 1 From 80df4fb19fe0eece12fc5b2bb40b83c712594248 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 13 May 2021 09:30:40 +0200 Subject: [PATCH 0024/1176] removing old scripts --- multitoolbox.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5690aa2d..a3c1ce17 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1602,6 +1602,8 @@ echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 +sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 +sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 From 15fd0629a02ac223b6aad6a8ab64d1ea3cde2bca Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 23 May 2021 21:19:27 +0200 Subject: [PATCH 0025/1176] removed MDBPORT --- install_pro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index b916e515..ac878953 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -32,7 +32,7 @@ WATCHDOG_INSTALL="0" ZELFRONTPORT=16126 LOCPORT=16127 ZELNODEPORT=16128 -MDBPORT=27017 +#MDBPORT=27017 RPCPORT=16124 PORT=16125 @@ -1418,7 +1418,7 @@ function install_process() { sudo ufw allow $ZELFRONTPORT/tcp > /dev/null 2>&1 sudo ufw allow $LOCPORT/tcp > /dev/null 2>&1 sudo ufw allow $ZELNODEPORT/tcp > /dev/null 2>&1 - sudo ufw allow $MDBPORT/tcp > /dev/null 2>&1 + #sudo ufw allow $MDBPORT/tcp > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" From 162f93ffbae1009c96062651f910c292db4dabe9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 23 May 2021 22:15:49 +0200 Subject: [PATCH 0026/1176] change watchdog repository --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 83a3fa1e..9e017b50 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -948,7 +948,7 @@ echo echo -e "${BOOK} ${YELLOW}Checking Watchdog:${NC}" current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) -required_ver=$(curl -sS https://raw.githubusercontent.com/XK4MiLX/watchdog/master/package.json | jq -r '.version') +required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/fluxnode-watchdog/master/package.json | jq -r '.version') if [[ "$required_ver" != "" ]]; then if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then From 294fe6039dd60f2d90b44734d84f4c0e9a289ffb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 26 May 2021 09:55:03 +0200 Subject: [PATCH 0027/1176] Added telegram config --- multitoolbox.sh | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a3c1ce17..d6927f71 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -760,6 +760,44 @@ ping='0' sleep 1 fi +if whiptail --yesno "Would you like enable telegram alert?" 8 60; then + + telegram_alert=1; + + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + +else + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; +fi + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') @@ -793,7 +831,10 @@ module.exports = { zelbench_update: '${bench_update}', action: '${fix_action}', ping: '${ping}', - web_hook_url: '${discord}' + web_hook_url: '${discord}', + telegram_alert: '${telegram_alert}', + telegram_bot_token: '${telegram_bot_token}', + telegram_chat_id: '${telegram_chat_id}', } EOF From 82a7f03eb4f11a2a9322df65b4a7afacffa14ffe Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 26 May 2021 09:57:36 +0200 Subject: [PATCH 0028/1176] removed comma --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d6927f71..36b3a42a 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -834,7 +834,7 @@ module.exports = { web_hook_url: '${discord}', telegram_alert: '${telegram_alert}', telegram_bot_token: '${telegram_bot_token}', - telegram_chat_id: '${telegram_chat_id}', + telegram_chat_id: '${telegram_chat_id}' } EOF From 02cc3a2fb137e576366255f1a0fa4e5027522813 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 26 May 2021 10:01:35 +0200 Subject: [PATCH 0029/1176] added telegram notification settings --- install_pro.sh | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index ac878953..1433f902 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -426,6 +426,46 @@ ping='0' sleep 1 fi + +if whiptail --yesno "Would you like enable telegram alert?" 8 60; then + + telegram_alert=1; + + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + +else + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; +fi + + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') @@ -459,7 +499,10 @@ module.exports = { zelbench_update: '${bench_update}', action: '${fix_action}', ping: '${ping}', - web_hook_url: '${discord}' + web_hook_url: '${discord}', + telegram_alert: '${telegram_alert}', + telegram_bot_token: '${telegram_bot_token}', + telegram_chat_id: '${telegram_chat_id}' } EOF From c691ef59426c973eb11f430dcf0178f02f49842f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 11:05:06 +0200 Subject: [PATCH 0030/1176] added menu for watchdog notification --- multitoolbox.sh | 88 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 19 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 36b3a42a..61d82dcf 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -727,28 +727,52 @@ fix_action='0' sleep 1 fi -if whiptail --yesno "Would you like enable discord alert?" 8 60; then +telegram_alert=0; +discord=0; + +if whiptail --yesno "Would you like enable alert notification?" 8 60; then -discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) sleep 1 - if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then +CHOICES=$(whiptail --separate-output --checklist "Choose options" 10 35 5 \ + "1" "Discord notification" ON \ + "2" "Telegram notification" OFF 3>&1 1>&2 2>&3) +if [ -z "$CHOICE" ]; then - while true - do - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) - if [[ $ping == ?(-)+([0-9]) ]]; then - string_limit_check_mark "UserID is valid..........................................." - break - else - string_limit_x_mark "UserID is not valid try again............................." - sleep 1 - fi - done + echo "No option was selected (user hit Cancel or unselected all options)" + sleep 1 + discord='0' + ping='0' + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + +else + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") - sleep 1 + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + + + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + else ping='0' sleep 1 @@ -759,10 +783,9 @@ discord='0' ping='0' sleep 1 fi - -if whiptail --yesno "Would you like enable telegram alert?" 8 60; then - - telegram_alert=1; + ;; + "2") + telegram_alert=1; while true do @@ -798,6 +821,33 @@ else telegram_chat_id=0; fi + ;; + esac + done +fi + +else + + discord='0' + ping='0' + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + sleep 1 +fi + + +if [[ discord == 0 ]]; then + ping='0' +fi + + +if [[ telegram == 0 ]]; then + telegram_bot_token=0; + telegram_chat_id=0; +fi + + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') From cc5fca423ec111c4f0ca947282d5dfd78b89404d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 11:12:58 +0200 Subject: [PATCH 0031/1176] fix loop --- multitoolbox.sh | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 61d82dcf..ce9b0a7b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -758,7 +758,6 @@ else if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - while true do ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) @@ -771,20 +770,16 @@ else fi done - sleep 1 + sleep 1 - else - ping='0' - sleep 1 - fi + else + ping=0; + sleep 1 + fi -else -discord='0' -ping='0' -sleep 1 -fi ;; "2") + telegram_alert=1; while true @@ -814,13 +809,7 @@ fi done sleep 1 - -else - telegram_alert=0; - telegram_bot_token=0; - telegram_chat_id=0; -fi - + ;; esac done @@ -838,11 +827,11 @@ fi if [[ discord == 0 ]]; then - ping='0' + ping=0; fi -if [[ telegram == 0 ]]; then +if [[ telegram_alert == 0 ]]; then telegram_bot_token=0; telegram_chat_id=0; fi From 8fdde1274d597b500f042af76ed6f996ddd1c879 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 11:25:04 +0200 Subject: [PATCH 0032/1176] Update multitoolbox.sh --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index ce9b0a7b..7d05d763 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -734,9 +734,9 @@ if whiptail --yesno "Would you like enable alert notification?" 8 60; then sleep 1 -CHOICES=$(whiptail --separate-output --checklist "Choose options" 10 35 5 \ +CHOICES=$(whiptail --separate-output --checklist "Choose options: " 10 35 5 \ "1" "Discord notification" ON \ - "2" "Telegram notification" OFF 3>&1 1>&2 2>&3) + "2" "Telegram notification" OFF 3>&1 1>&2 2>&3 ) if [ -z "$CHOICE" ]; then From c083e36a2e21d856f1b0da203efc0a4dbca17fec Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 11:28:05 +0200 Subject: [PATCH 0033/1176] added --title --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7d05d763..e46980c6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -734,7 +734,7 @@ if whiptail --yesno "Would you like enable alert notification?" 8 60; then sleep 1 -CHOICES=$(whiptail --separate-output --checklist "Choose options: " 10 35 5 \ +CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 35 5 \ "1" "Discord notification" ON \ "2" "Telegram notification" OFF 3>&1 1>&2 2>&3 ) From 7d2f3cb8d36fca7153f6f07ddcd9b54d5b014eb1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 11:30:11 +0200 Subject: [PATCH 0034/1176] Update multitoolbox.sh --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e46980c6..794816a5 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -738,7 +738,7 @@ CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Cho "1" "Discord notification" ON \ "2" "Telegram notification" OFF 3>&1 1>&2 2>&3 ) -if [ -z "$CHOICE" ]; then +if [ -z "$CHOICES" ]; then echo "No option was selected (user hit Cancel or unselected all options)" sleep 1 From 1a59ac394a51bb77aa94f3c7b76f837ea175d036 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 11:40:28 +0200 Subject: [PATCH 0035/1176] added --infobox --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 794816a5..3105e229 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -734,13 +734,13 @@ if whiptail --yesno "Would you like enable alert notification?" 8 60; then sleep 1 -CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 35 5 \ +CHOICES=$(whiptail --infobox "Use space for select option / use tab for switch" --title "Choose options: " --separate-output --checklist 10 45 5 \ "1" "Discord notification" ON \ "2" "Telegram notification" OFF 3>&1 1>&2 2>&3 ) if [ -z "$CHOICES" ]; then - echo "No option was selected (user hit Cancel or unselected all options)" + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" sleep 1 discord='0' ping='0' From a03fb23ffdf86c8cd5078ce20bd552b2401e9252 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 11:44:59 +0200 Subject: [PATCH 0036/1176] added instruction --- multitoolbox.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3105e229..a9423002 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -734,7 +734,11 @@ if whiptail --yesno "Would you like enable alert notification?" 8 60; then sleep 1 -CHOICES=$(whiptail --infobox "Use space for select option / use tab for switch" --title "Choose options: " --separate-output --checklist 10 45 5 \ +whiptail --title "Info: " --infobox "To select item use space / to switch to OK use tab..." 10 50 + +sleep 1 + +CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist 10 45 5 \ "1" "Discord notification" ON \ "2" "Telegram notification" OFF 3>&1 1>&2 2>&3 ) From 9f9d239cea72f7e4fe1f739bd290d9ddcf9110c8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 12:20:11 +0200 Subject: [PATCH 0037/1176] finalize watchdog notification menu --- multitoolbox.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a9423002..3725863d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -734,24 +734,24 @@ if whiptail --yesno "Would you like enable alert notification?" 8 60; then sleep 1 -whiptail --title "Info: " --infobox "To select item use space / to switch to OK use tab..." 10 50 +whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 sleep 1 -CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist 10 45 5 \ - "1" "Discord notification" ON \ - "2" "Telegram notification" OFF 3>&1 1>&2 2>&3 ) +CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) if [ -z "$CHOICES" ]; then echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" sleep 1 - discord='0' - ping='0' + discord=0; + ping=0; telegram_alert=0; telegram_bot_token=0; telegram_chat_id=0; - + else for CHOICE in $CHOICES; do case "$CHOICE" in @@ -775,17 +775,17 @@ else done sleep 1 - + else ping=0; sleep 1 fi - + ;; "2") - + telegram_alert=1; - + while true do telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) @@ -797,11 +797,11 @@ else sleep 1 fi done - + sleep 1 - + while true - do + do telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then string_limit_check_mark "Chat ID is valid..........................................." @@ -811,9 +811,9 @@ else sleep 1 fi done - + sleep 1 - + ;; esac done @@ -821,8 +821,8 @@ fi else - discord='0' - ping='0' + discord=0; + ping=0; telegram_alert=0; telegram_bot_token=0; telegram_chat_id=0; @@ -830,12 +830,12 @@ else fi -if [[ discord == 0 ]]; then +if [[ $discord == 0 ]]; then ping=0; fi -if [[ telegram_alert == 0 ]]; then +if [[ $telegram_alert == 0 ]]; then telegram_bot_token=0; telegram_chat_id=0; fi From 27ecec8527c02d04530cc0c1dc7c4790e5bf8f02 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 12:24:37 +0200 Subject: [PATCH 0038/1176] added watchdog notification menu --- install_pro.sh | 105 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 73 insertions(+), 32 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 1433f902..92a38f92 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -394,43 +394,65 @@ fix_action='0' sleep 1 fi -if whiptail --yesno "Would you like enable discord alert?" 8 60; then +telegram_alert=0; +discord=0; + +if whiptail --yesno "Would you like enable alert notification?" 8 60; then -discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) sleep 1 - if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then +whiptail --msgbox "Info: to select item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 - while true - do - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) - if [[ $ping == ?(-)+([0-9]) ]]; then - string_limit_check_mark "UserID is valid..........................................." - break - else - string_limit_x_mark "UserID is not valid try again............................." - sleep 1 - fi - done +sleep 1 + +CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + +if [ -z "$CHOICES" ]; then + + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" + sleep 1 + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; - sleep 1 - - else - ping='0' - sleep 1 - fi - else -discord='0' -ping='0' -sleep 1 -fi + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") + + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + sleep 1 -if whiptail --yesno "Would you like enable telegram alert?" 8 60; then + else + ping=0; + sleep 1 + fi + + ;; + "2") + + telegram_alert=1; - telegram_alert=1; - while true do telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) @@ -442,11 +464,11 @@ if whiptail --yesno "Would you like enable telegram alert?" 8 60; then sleep 1 fi done - + sleep 1 - + while true - do + do telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then string_limit_check_mark "Chat ID is valid..........................................." @@ -456,16 +478,35 @@ if whiptail --yesno "Would you like enable telegram alert?" 8 60; then sleep 1 fi done - + sleep 1 + ;; + esac + done +fi + else + + discord=0; + ping=0; telegram_alert=0; telegram_bot_token=0; telegram_chat_id=0; + sleep 1 fi +if [[ "$discord" == 0 ]]; then + ping=0; +fi + + +if [[ "$telegram_alert" == 0 ]]; then + telegram_bot_token=0; + telegram_chat_id=0; +fi + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') From 8ab011561e0376c2eedee073cf2f765c1d95a11d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 12:29:11 +0200 Subject: [PATCH 0039/1176] added flux mark --- install_pro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 92a38f92..57115b16 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1632,7 +1632,7 @@ fi function install_flux() { - docker_check=$(docker container ls -a | grep 'zelcash' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) + docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) @@ -1650,7 +1650,7 @@ echo -e "${ARROW} ${CYAN}Removing containers...${NC}" sudo service docker restart > /dev/null 2>&1 && sleep 5 -docker container ls -a | grep 'zelcash' | grep -Eo "^[0-9a-z]{8,}\b" | +docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | while read line; do sudo docker stop $line > /dev/null 2>&1 && sleep 2 sudo docker rm $line > /dev/null 2>&1 && sleep 2 From 89b9f8026e54f9acaa07551364de7b8f96f1eaf5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 12:30:10 +0200 Subject: [PATCH 0040/1176] added flux mark --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3725863d..ff6823dc 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -288,7 +288,7 @@ fi pm2 save > /dev/null 2>&1 fi -docker_check=$(docker container ls -a | grep 'zelcash' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) +docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) @@ -304,7 +304,7 @@ echo -e "${ARROW} ${CYAN}Removing containers...${NC}" sudo aa-remove-unknown && sudo service docker restart > /dev/null 2>&1 && sleep 2 sleep 5 #docker ps | grep -Eo "^[0-9a-z]{8,}\b" | -docker container ls -a | grep 'zelcash' | grep -Eo "^[0-9a-z]{8,}\b" | +docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | while read line; do sudo docker stop $line > /dev/null 2>&1 && sleep 2 sudo docker rm $line > /dev/null 2>&1 && sleep 2 From 1291c3d0e610f23b6b1d79a7ebfa312729d30b89 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 12:32:48 +0200 Subject: [PATCH 0041/1176] corrected info --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 57115b16..5c314246 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -401,7 +401,7 @@ if whiptail --yesno "Would you like enable alert notification?" 8 60; then sleep 1 -whiptail --msgbox "Info: to select item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 +whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 sleep 1 From b75b955de98aa6380f7a811f0465ddb5ef0970f1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 30 May 2021 23:46:04 +0200 Subject: [PATCH 0042/1176] added user low case transformation --- multitoolbox.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index ff6823dc..6354f764 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1381,12 +1381,12 @@ if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then fi usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" - -echo -e "${ARROW} ${YELLOW}Creating new user...${NC}" +usernew=$(awk '{print tolower($0)}' <<< "$usernew") +echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" adduser --gecos "" "$usernew" usermod -aG sudo "$usernew" > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Update and upgrade system...${NC}" -apt update -y && apt upgrade -y +apt update -y && apt upgrade -y echo -e "${ARROW} ${YELLOW}Installing docker...${NC}" echo -e "${ARROW} ${CYAN}Architecture: ${GREEN}$(dpkg --print-architecture)${NC}" From f093fbaeb0b820488dec653f574274b6c56a868f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Jun 2021 22:30:50 +0200 Subject: [PATCH 0043/1176] added new flux repo --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6354f764..c3740526 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -355,7 +355,7 @@ if [ -d /home/$USER/$FLUX_DIR ]; then fi echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" -git clone https://github.com/zelcash/zelflux.git > /dev/null 2>&1 && sleep 2 +git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 if [ -d /home/$USER/$FLUX_DIR ] then From 1ad896b8613cd9e6ceb28ce53bcd1be2574b304e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Jun 2021 22:34:57 +0200 Subject: [PATCH 0044/1176] added flux new repo --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 9e017b50..66ccc914 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -861,7 +861,7 @@ if [ -f "$FILE" ] then current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - required_ver=$(curl -sS --max-time 10 https://raw.githubusercontent.com/zelcash/zelflux/master/package.json | jq -r '.version') + required_ver=$(curl -sS --max-time 10 https://raw.githubusercontent.com/RunOnFlux/flux/master/package.json | jq -r '.version') if [[ "$required_ver" != "" ]]; then if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then @@ -984,7 +984,7 @@ echo -e "" if [[ $REPLY =~ ^[Yy]$ ]]; then cd /home/$USER/$FLUX_DIR && git pull > /dev/null 2>&1 && cd current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) -required_ver=$(curl -sS https://raw.githubusercontent.com/zelcash/zelflux/master/package.json | jq -r '.version') +required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/flux/master/package.json | jq -r '.version') if [[ "$required_ver" == "$current_ver" ]]; then echo -e "${CHECK_MARK} ${CYAN}Flux updated successfully.${NC}" echo -e "" From 5c456b88d0bac6bea1a7e0812cf3ae899e56ac4f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Jun 2021 22:41:20 +0200 Subject: [PATCH 0045/1176] added new flux repo --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 5c314246..517fb637 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1673,7 +1673,7 @@ fi echo -e "${ARROW} ${YELLOW}Flux installing...${NC}" - git clone https://github.com/zelcash/zelflux.git > /dev/null 2>&1 + git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" From 6ffe028aab4d1bc0692b9cb50415026f94bdbfd7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Jun 2021 14:00:46 +0200 Subject: [PATCH 0046/1176] removed old package names --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 517fb637..38f1d37e 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -974,7 +974,7 @@ EOF function flux_package() { sudo apt-get update -y > /dev/null 2>&1 && sleep 2 echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" - sudo apt install $COIN_NAME $BENCH_NAME zelbench zelcash -y > /dev/null 2>&1 && sleep 2 + sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 integration_check } From 22d3fb75338c5040d89a659de1724d412d36a8d5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Jun 2021 14:12:32 +0200 Subject: [PATCH 0047/1176] increase daemon loading phase --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 38f1d37e..b399623e 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1430,7 +1430,7 @@ function start_daemon() { sudo systemctl enable zelcash.service > /dev/null 2>&1 sudo systemctl start zelcash > /dev/null 2>&1 - NUM='210' + NUM='250' MSG1='Starting daemon & syncing with chain please be patient this will take about 3 min...' MSG2='' spinning_timer From d1fcf82f02151facb23accbd4e7ea655a01a6e67 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:54:04 +0200 Subject: [PATCH 0048/1176] increase watch-delay --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index c3740526..3d18f572 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -882,7 +882,7 @@ module.exports = { EOF echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" -pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 10 > /dev/null 2>&1 +pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 if [[ -f /home/$USER/watchdog/watchdog.js ]] then From 7a03532fa5258c4e5e744624c5a53e27ebffd5a1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:55:02 +0200 Subject: [PATCH 0049/1176] increase watch-delay --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index b399623e..d0f73b2f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -548,7 +548,7 @@ module.exports = { EOF echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" -pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 10 > /dev/null 2>&1 +pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 if [[ -f /home/$USER/watchdog/watchdog.js ]] then From 160a9a7818c3eb69ac4fb96f2fb5259c6310337d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 14 Jun 2021 08:03:33 +0200 Subject: [PATCH 0050/1176] added user decision --- install_pro.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index d0f73b2f..ec63b625 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1456,7 +1456,7 @@ function start_daemon() { #zelbench-cli stop > /dev/null 2>&1 && sleep 2 else echo - echo -e "${WORNING} ${RED}Something is not right the daemon did not start. Will exit out so try and run the script again.${NC}" + echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') @@ -1468,9 +1468,21 @@ function start_daemon() { fi fi - echo -e "${WORNING} ${RED}Veryfity date in ~/.flux/flux.conf .${NC}" - echo - exit + + if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make shour that flux daemon working) Y/N?" 8 90; then + + echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" + echo -n "" + + else + + echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" + echo -n "" + exit + + fi + + fi } From 1270f748f0698725f4e103726b18d57c6341760d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 14 Jun 2021 08:08:07 +0200 Subject: [PATCH 0051/1176] fix typo --- multitoolbox.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3d18f572..9c21506e 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -276,7 +276,7 @@ echo -e "${YELLOW}============================================================== if [[ "$USER" == "root" ]] then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -476,7 +476,7 @@ function create_config() { if [[ "$USER" == "root" ]] then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -661,7 +661,7 @@ function install_watchdog() { if [[ "$USER" == "root" ]] then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -905,7 +905,7 @@ function kda_bootstrap() { if [[ "$USER" == "root" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -1010,7 +1010,7 @@ function flux_daemon_bootstrap() { if [[ "$USER" == "root" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -1128,7 +1128,7 @@ echo -e "${YELLOW}============================================================== if [[ "$USER" == "root" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -1282,7 +1282,7 @@ echo -e "${YELLOW}============================================================== if [[ "$USER" == "root" ]] then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -1308,7 +1308,7 @@ echo -e "${YELLOW}============================================================== if [[ "$USER" == "root" ]] then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -1328,7 +1328,7 @@ echo -e "${YELLOW}============================================================== if [[ "$USER" == "root" ]] then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -1365,7 +1365,7 @@ echo -e "${YELLOW}============================================================== if [[ "$USER" != "root" ]] then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the root accont use command 'su -'.${NC}" + echo -e "${CYAN}Please switch to the root account use command 'su -'.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -1471,7 +1471,7 @@ echo -e "${YELLOW}============================================================== if [[ "$USER" == "root" ]] then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit @@ -1577,7 +1577,7 @@ fi sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 NUM='35' -MSG1='Restarting daemon serivce...' +MSG1='Restarting daemon service...' MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" spinning_timer echo -e "" && echo -e "" @@ -1675,7 +1675,7 @@ function create_service() { if [[ "$USER" == "root" ]] then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit From 85c6c422480caf73673e80d6d22eaaf8e1489a39 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Jun 2021 10:48:53 +0200 Subject: [PATCH 0052/1176] update COMMANDS --- install_pro.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index ec63b625..096767c8 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2007,10 +2007,10 @@ function display_banner() { echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" echo echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" - echo -e "${PIN} ${CYAN}Get info: ${SEA}zelbench-cli getinfo${NC}" - echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}zelbench-cli getbenchmarks${NC}" - echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}zelbench-cli restartnodebenchmarks${NC}" - echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}zelbench-cli stop${NC}" + echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} getinfo${NC}" + echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} getbenchmarks${NC}" + echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} restartnodebenchmarks${NC}" + echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} stop${NC}" echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" echo echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" From dd45ba12b74228b48e27f55ce0539dcfb34ad415 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 20 Jun 2021 17:53:27 +0200 Subject: [PATCH 0053/1176] added option 12 selfhosting --- multitoolbox.sh | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9c21506e..8156e82d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1680,6 +1680,79 @@ function create_service() { echo -e "${NC}" exit fi + + function selfhosting() { + + echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" ]] + then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + +echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 +sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 +sudo touch /home/$USER/ip_check.sh +sudo chown $USER:$USER /home/$USER/ip_check.sh + cat <<'EOF' > /home/$USER/ip_check.sh +#!/bin/bash + +function get_ip(){ + + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi + +} + + +if [[ $1 == "restart" ]]; then + + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + +fi + +if [[ $1 == "ip_check" ]]; then + + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + confirmed_ip=$(curl -SsL -m 10 http://localhost:16127/flux/info | jq -r .data.node.status.ip) + + if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then + + if [[ "$WANIP" != "$confirmed_ip" ]]; then + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + + fi + +fi +EOF + +sudo chmod +x /home/$USER/ip_check.sh +echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 +(crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - +(crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - +echo -e "${ARROW} ${CYAN}Script installed! ${NC}" +echo -e "" + + } echo -e "" echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 @@ -1766,6 +1839,7 @@ echo -e "${CYAN}8 - Re-install Flux${NC}" echo -e "${CYAN}9 - Flux Daemon Reconfiguration${NC}" echo -e "${CYAN}10 - Restore Kadena node blockchain from bootstrap${NC}" echo -e "${CYAN}11 - Create Flux daemon service ( for old nodes )${NC}" +echo -e "${CYAN}12 - Create Self-hosting cron ip service ${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -1834,6 +1908,13 @@ read -rp "Pick an option and hit ENTER: " create_service_scripts ;; + 12) + clear + sleep 1 + selfhosting + ;; + + # 8) #clear # sleep 1 From d5cc621c950c77eacd6a38bea572559d5a4b67ce Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 20 Jun 2021 17:58:56 +0200 Subject: [PATCH 0054/1176] fix function --- multitoolbox.sh | 70 ++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8156e82d..382f8097 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1681,6 +1681,41 @@ function create_service() { exit fi +echo -e "" +echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 +sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 +sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 +sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 +sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 +sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 +sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 + +echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 +sudo touch /etc/systemd/system/zelcash.service +sudo chown $USER:$USER /etc/systemd/system/zelcash.service +cat << EOF > /etc/systemd/system/zelcash.service +[Unit] +Description=Flux daemon service +After=network.target +[Service] +Type=forking +User=$USER +Group=$USER +ExecStart=/home/$USER/start_daemon_service.sh +ExecStop=-/home/$USER/stop_daemon_service.sh +Restart=always +RestartSec=10 +PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=15s +StartLimitInterval=120s +StartLimitBurst=5 +[Install] +WantedBy=multi-user.target +EOF + sudo chown root:root /etc/systemd/system/zelcash.service +} + function selfhosting() { echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" @@ -1754,41 +1789,6 @@ echo -e "" } -echo -e "" -echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 -sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 -sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 -sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 - -echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 -sudo touch /etc/systemd/system/zelcash.service -sudo chown $USER:$USER /etc/systemd/system/zelcash.service -cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service -} - if ! figlet -v > /dev/null 2>&1 then From 3fa4599ded5a2a95f11881519c0c6d5d77b9a8bf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 20 Jun 2021 18:02:58 +0200 Subject: [PATCH 0055/1176] disabled netplan --- nodeanalizerandfixer.sh | 58 ++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 66ccc914..6fb3e50d 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -490,10 +490,10 @@ if [[ "$WANIP" != "" ]]; then echo -e "${CHECK_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) matches local device(${GREEN}$device_name${CYAN}) IP(${GREEN}$local_device_ip${CYAN})${NC}" else echo -e "${X_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) not matches local device(${GREEN}$device_name${CYAN}) IP${NC}" - echo -e "${ARROW} ${CYAN} If you under NAT try add your public IP to netplan, netplan.io or /etc/network/interfaces${NC}" + echo -e "${ARROW} ${CYAN} If you under NAT use option 12 from multitoolbox (self-hosting)${NC}" ## dev_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2"0"}') ## sudo ip addr add "$WANPI" dev "$dev_name" - IP_FIX="1" + # IP_FIX="1" fi else @@ -1038,40 +1038,40 @@ echo -e "" fi fi -if [ "$IP_FIX" == "1" ]; then +#if [ "$IP_FIX" == "1" ]; then -netplan_io=$(dpkg -l netplan.io | grep -w 'netplan.io' | awk '{print $3}') +#netplan_io=$(dpkg -l netplan.io | grep -w 'netplan.io' | awk '{print $3}') -if [[ "$netplan_io" != "" ]]; then +#if [[ "$netplan_io" != "" ]]; then -if [[ ! -f /etc/netplan/666-static.yaml ]]; then -read -p "Would you like to add your public ip to netplan.io? (recommended for NAT users) Y/N?" -n 1 -r -echo -e "" -if [[ $REPLY =~ ^[Yy]$ ]]; then +#if [[ ! -f /etc/netplan/666-static.yaml ]]; then +#read -p "Would you like to add your public ip to netplan.io? (recommended for NAT users) Y/N?" -n 1 -r +#echo -e "" +#if [[ $REPLY =~ ^[Yy]$ ]]; then -sudo ip addr add $WANIP dev $device_name:0 && sleep 2 -ip_address=$(ip a list $device_name | grep -o $WANIP.* | awk '{printf $1}') - - -sudo touch /etc/netplan/666-static.yaml -sudo chown $USER:$USER /etc/netplan/666-static.yaml -sudo cat << EOF > /etc/netplan/666-static.yaml -network: - version: 2 - renderer: networkd - ethernets: - $device_name: - addresses: - - $ip_address -EOF -sudo chown root:root /etc/netplan/666-static.yaml -fi +#sudo ip addr add $WANIP dev $device_name:0 && sleep 2 +#ip_address=$(ip a list $device_name | grep -o $WANIP.* | awk '{printf $1}') -fi -fi +#sudo touch /etc/netplan/666-static.yaml +#sudo chown $USER:$USER /etc/netplan/666-static.yaml +#sudo cat << EOF > /etc/netplan/666-static.yaml +#network: + #version: 2 + # renderer: networkd + #ethernets: + # $device_name: + #addresses: + #- $ip_address +#EOF +#sudo chown root:root /etc/netplan/666-static.yaml +#fi -fi +#fi + +#fi + +#fi echo #if [ "$LC_CHECK" == "1" ]; then #read -p "Would you like to change LC_NUMERIC to en_US.UTF-8 Y/N?" -n 1 -r From 806b738040023e874d2711dbdbf060885332019a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 20 Jun 2021 18:17:32 +0200 Subject: [PATCH 0056/1176] added ip add --- multitoolbox.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 382f8097..f0498731 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -49,6 +49,20 @@ export NEWT_COLORS=' title=black, ' +function get_ip(){ + + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi + +} + function spinning_timer() { animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) end=$((SECONDS+NUM)) @@ -1730,6 +1744,19 @@ EOF exit fi + echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + else + echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 + echo -e "" + exit + fi + + echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 sudo touch /home/$USER/ip_check.sh From b38b5bc8d90f3cbc842d36b7b025fab585ac23ce Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 21 Jun 2021 08:30:16 +0200 Subject: [PATCH 0057/1176] added ip history --- multitoolbox.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index f0498731..5de443a4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1781,10 +1781,13 @@ function get_ip(){ if [[ $1 == "restart" ]]; then + get_ip device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log sudo ip addr add $WANIP dev $device_name:0 && sleep 2 fi @@ -1799,6 +1802,8 @@ if [[ $1 == "ip_check" ]]; then if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log sudo ip addr add $WANIP dev $device_name:0 && sleep 2 fi From c6caa2df4f51d5c45fe337fe8fe241e01f2a7618 Mon Sep 17 00:00:00 2001 From: Greg P Date: Thu, 1 Jul 2021 21:34:37 -0500 Subject: [PATCH 0058/1176] Typo per GregDroid --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5de443a4..08c2a8d8 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1531,7 +1531,7 @@ echo exit fi -echo -e "${ARROW} ${CYAN}Stopping Flux daemon serivce...${NC}" +echo -e "${ARROW} ${CYAN}Stopping Flux daemon service...${NC}" sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 sudo fuser -k 16125/tcp > /dev/null 2>&1 From 2626ad17d941c20ff42ac1957ba08ce5348a56dc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 2 Jul 2021 08:38:49 +0200 Subject: [PATCH 0059/1176] Add files via upload --- image/Menu12.jpg | Bin 0 -> 85432 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 image/Menu12.jpg diff --git a/image/Menu12.jpg b/image/Menu12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..575b4db4aefebffe6775527222cb2e876647c9bd GIT binary patch literal 85432 zcmeFZ2Ut_v)-D`GMNq0BNZryq(yL&h7!Z&aIw&0?iS$lvpmga-78S6o5uk9jFc< zAt3=gA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_$M%OyMn{2XH zzO{?lyA<|i%(!bBC9e-XTT8DO2UOg`hGRQ>7%xrUehMI?briJSVhs(01VCI8P8>~d zs)S73p^rqpNowD2;ZS_r*8{xvz~7|v{N@Lz!&eJwN-y2zTrhiz^1V`9>Q(k~EJVl`(A zG29B-zFoVCRy3Kv%}6_!$kPdlA|B;D7{z` z3t_OQ{l%uI7a}@GsitC4w7=L2(m{90nRA)6G`eVymLrdCe}z_&L_lh#O^b8_U3W4# zLi*uZT#5vbWriml1&^yhD|v`2*8#;Xz8aNt(hUA$caz(iRPWrvf=tnz(hD4~GpToZ zb6>wYtzE{(CL0vbs}6ypFue+_pW`~y$OehD&()5;u_&;JN0`+FS%tw3cz%q%?qhm_ z9dXNsKr<+TaFA=_a36`bvkVw$kr)%3b}78ZjhG!IMnXiE8L0UjHb;h47czN`7@yW) gjCjW=Gh-XGlI1#^7A;V1G^gH~c Date: Fri, 2 Jul 2021 08:39:16 +0200 Subject: [PATCH 0060/1176] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ab4eeb5..f6c7a600 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ```bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` 2) MENU: -![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/menu_5v1.png) +![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/Menu12.jpg) 3) HOW USE MULTITOOLBOX TO SETUP FLUXNODE: https://medium.com/zelinsights/zelnode-setup-the-easy-peasy-lemon-squeezy-way-fd89706ea03c
From 52aed0afc2da3c67d7b0ff7dd68050d7cfbecd7d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 12 Jul 2021 13:25:24 +0200 Subject: [PATCH 0061/1176] added sleep after restart --- multitoolbox.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 08c2a8d8..28ff69e2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1781,7 +1781,8 @@ function get_ip(){ if [[ $1 == "restart" ]]; then - + # give 3min to connext with internet + sleep 180 get_ip device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') From 909d4c7df1761ebb5b759bc6481ffe3cb9c99194 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 12 Jul 2021 13:28:17 +0200 Subject: [PATCH 0062/1176] fix typo --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 28ff69e2..d3dc987d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1781,7 +1781,7 @@ function get_ip(){ if [[ $1 == "restart" ]]; then - # give 3min to connext with internet + # give 3min to connect with internet sleep 180 get_ip device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') From 9cbebdd6457b872d5f96cb2523df08feacd97f1e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 12 Jul 2021 14:03:50 +0200 Subject: [PATCH 0063/1176] added crontab entry check --- multitoolbox.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d3dc987d..1b0e5549 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1815,9 +1815,16 @@ EOF sudo chmod +x /home/$USER/ip_check.sh echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 -(crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - -(crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - -echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + +crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) + +if [[ "$crontab_check" == "0" ]]; then + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" +else + echo -e "${ARROW} ${CYAN}Info: Script already installed! ${NC}" +fi echo -e "" } From 346fe99990f0eb064eaa704e3f3bbc8179db1590 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 12 Jul 2021 14:11:10 +0200 Subject: [PATCH 0064/1176] Minor edits --- multitoolbox.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 1b0e5549..0cdca84d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1823,7 +1823,8 @@ if [[ "$crontab_check" == "0" ]]; then (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" else - echo -e "${ARROW} ${CYAN}Info: Script already installed! ${NC}" + echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" fi echo -e "" From bf657f8bbfa486fcb4c2c206ee44364b995907b8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 29 Jul 2021 09:12:46 +0200 Subject: [PATCH 0065/1176] added node name (label) --- multitoolbox.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 0cdca84d..97533276 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -833,8 +833,24 @@ else done fi + while true + do + node_label=$(whiptail --inputbox "Enter name of yor node" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + else + node_label=0; discord=0; ping=0; telegram_alert=0; @@ -852,6 +868,7 @@ fi if [[ $telegram_alert == 0 ]]; then telegram_bot_token=0; telegram_chat_id=0; + node_label=0; fi @@ -882,6 +899,7 @@ sudo touch /home/$USER/watchdog/config.js sudo chown $USER:$USER /home/$USER/watchdog/config.js cat << EOF > /home/$USER/watchdog/config.js module.exports = { + label: '${node_label}', tier_eps_min: '${eps_limit}', zelflux_update: '${flux_update}', zelcash_update: '${daemon_update}', From 0988732b6c73f88d37d96eda83712b1321e736e7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 29 Jul 2021 09:14:12 +0200 Subject: [PATCH 0066/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 97533276..3482dced 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -835,7 +835,7 @@ fi while true do - node_label=$(whiptail --inputbox "Enter name of yor node" 8 65 3>&1 1>&2 2>&3) + node_label=$(whiptail --inputbox "Enter name of your node (label)" 8 65 3>&1 1>&2 2>&3) if [[ "$node_label" != "" && "$node_label" != "0" ]]; then string_limit_check_mark "Node name is valid..........................................." break From 8e32cbea02d8eebb352094078064d019a50d440c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:39:19 +0200 Subject: [PATCH 0067/1176] added node alias --- install_pro.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 096767c8..ada04ae6 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -418,6 +418,7 @@ if [ -z "$CHOICES" ]; then telegram_alert=0; telegram_bot_token=0; telegram_chat_id=0; + node_label=0; else for CHOICE in $CHOICES; do @@ -486,6 +487,18 @@ else done fi + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + else discord=0; @@ -493,6 +506,7 @@ else telegram_alert=0; telegram_bot_token=0; telegram_chat_id=0; + node_label=0; sleep 1 fi @@ -534,6 +548,7 @@ sudo touch /home/$USER/watchdog/config.js sudo chown $USER:$USER /home/$USER/watchdog/config.js cat << EOF > /home/$USER/watchdog/config.js module.exports = { + label: '${node_label}', tier_eps_min: '${eps_limit}', zelflux_update: '${flux_update}', zelcash_update: '${daemon_update}', From 4f1d0cc18f099c2d36a612aa556343083c7d5e64 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:41:00 +0200 Subject: [PATCH 0068/1176] Minor fix --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3482dced..040e0f6b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -765,6 +765,7 @@ if [ -z "$CHOICES" ]; then telegram_alert=0; telegram_bot_token=0; telegram_chat_id=0; + node_label=0; else for CHOICE in $CHOICES; do @@ -835,7 +836,7 @@ fi while true do - node_label=$(whiptail --inputbox "Enter name of your node (label)" 8 65 3>&1 1>&2 2>&3) + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) if [[ "$node_label" != "" && "$node_label" != "0" ]]; then string_limit_check_mark "Node name is valid..........................................." break @@ -868,7 +869,6 @@ fi if [[ $telegram_alert == 0 ]]; then telegram_bot_token=0; telegram_chat_id=0; - node_label=0; fi From 0ef7c77983fae9681a2b10d5c3942864c45ae16d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 2 Aug 2021 18:26:34 +0200 Subject: [PATCH 0069/1176] disabled mongod bootstrap --- install_pro.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index ada04ae6..18cf8567 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -141,7 +141,7 @@ firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable' bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') -mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') +#mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') @@ -196,9 +196,9 @@ if [[ "$swapon" == "1" ]]; then echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi -if [[ "$mongo_bootstrap" == "1" ]]; then -echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi +#if [[ "$mongo_bootstrap" == "1" ]]; then +#echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +#fi if [[ "$watchdog" == "1" ]]; then echo -e "${PIN}${CYAN} Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -1899,23 +1899,23 @@ else #pm2 start ~/$FLUX_DIR/start.sh --name flux --time > /dev/null 2>&1 - if [[ -z "$mongo_bootstrap" ]]; then - - if whiptail --yesno "Would you like to restore Mongodb datatable from bootstrap?" 8 60; then - mongodb_bootstrap - else - echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" - fi + # if [[ -z "$mongo_bootstrap" ]]; then - else + # if whiptail --yesno "Would you like to restore Mongodb datatable from bootstrap?" 8 60; then + # mongodb_bootstrap + # else + # echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" + # fi + # + # else - if [[ "$mongo_bootstrap" == "1" ]]; then - mongodb_bootstrap - else - echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" - fi + # if [[ "$mongo_bootstrap" == "1" ]]; then + # mongodb_bootstrap + # else + # echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" + # fi - fi + # fi if [[ -z "$watchdog" ]]; then From ec411bfc704c6f052210187bdd6d8526751cfa0b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 2 Aug 2021 18:34:11 +0200 Subject: [PATCH 0070/1176] disabled mongod bootstrap --- multitoolbox.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 040e0f6b..99e8111c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -250,9 +250,9 @@ if [[ "$swapon" == "1" ]]; then echo -e "${PIN}${CYAN}Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi -if [[ "$mongo_bootstrap" == "1" ]]; then -echo -e "${PIN}${CYAN}Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi +#if [[ "$mongo_bootstrap" == "1" ]]; then +#echo -e "${PIN}${CYAN}Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +#fi if [[ "$watchdog" == "1" ]]; then echo -e "${PIN}${CYAN}Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -1157,6 +1157,9 @@ function mongodb_bootstrap(){ echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" echo -e "${YELLOW}================================================================${NC}" +echo -e "${ARROW} ${CYAN}Module disabled...${NC}" +echo -e "" +exit if [[ "$USER" == "root" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" From 9066c8e6724cb68a8632eeb8a08f6f8248f2ed6f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Sep 2021 19:17:30 +0200 Subject: [PATCH 0071/1176] install watchdog by default - only notification as optional --- install_pro.sh | 74 +++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 18cf8567..ccfef159 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -362,37 +362,37 @@ echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" cd watchdog && npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating config file....${NC}" -if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then +#if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then flux_update='1' -sleep 1 -else -flux_update='0' -sleep 1 -fi +#sleep 1 +#else +#lux_update='0' +#sleep 1 +#fi -if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then +#if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then daemon_update='1' -sleep 1 -else -daemon_update='0' -sleep 1 -fi +#sleep 1 +#else +#daemon_update='0' +#sleep 1 +#fi -if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then +#if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then bench_update='1' -sleep 1 -else -bench_update='0' -sleep 1 -fi +#sleep 1 +#else +#bench_update='0' +#sleep 1 +#fi -if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then +#if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then fix_action='1' -sleep 1 -else -fix_action='0' -sleep 1 -fi +#sleep 1 +#else +#fix_action='0' +#sleep 1 +#fi telegram_alert=0; discord=0; @@ -1918,21 +1918,21 @@ else # fi - if [[ -z "$watchdog" ]]; then - if whiptail --yesno "Would you like to install watchdog for FluxNode?" 8 60; then - install_watchdog - else - echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" - fi - else + #if [[ -z "$watchdog" ]]; then + #if whiptail --yesno "Would you like to install watchdog for FluxNode?" 8 60; then + install_watchdog + # else + # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" + # fi + # else - if [[ "$watchdog" == "1" ]]; then - install_watchdog - else - echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" - fi + # if [[ "$watchdog" == "1" ]]; then + # install_watchdog + # else + # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" + # fi - fi + # fi check display_banner From 9ba9876665f83d8917e466b1cb10ddd89b4f76e1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 9 Sep 2021 21:38:30 +0200 Subject: [PATCH 0072/1176] removed index.html check --- nodeanalizerandfixer.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 6fb3e50d..71d5125d 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -899,10 +899,10 @@ tdiff=$((now_date-event_time_uxtime)) show_time "$tdiff" fi -if [ ! -f ~/$FLUX_DIR/ZelFront/dist/index.html ] -then -echo -e "${WORNING} ${CYAN}Flux problem detected, missing ~/$FLUX_DIR/ZelFront/dist/index.html" -fi +#if [ ! -f ~/$FLUX_DIR/ZelFront/dist/index.html ] +#then +#echo -e "${WORNING} ${CYAN}Flux problem detected, missing ~/$FLUX_DIR/ZelFront/dist/index.html" +#fi else FLUXCONF="1" From 5f56533aa25e5f2897dfd0bd0114a40b40033611 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 10 Sep 2021 14:41:56 +0200 Subject: [PATCH 0073/1176] only notification as optional --- multitoolbox.sh | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 99e8111c..396a117a 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -709,37 +709,37 @@ cd watchdog && npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating config file....${NC}" -if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then +#if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then flux_update='1' -sleep 1 -else -flux_update='0' -sleep 1 -fi +#sleep 1 +#else +##flux_update='0' +#sleep 1 +#fi -if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then +#if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then daemon_update='1' -sleep 1 -else +##sleep 1 +#else daemon_update='0' -sleep 1 -fi +##sleep 1 +#fi -if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then +#if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then bench_update='1' -sleep 1 -else -bench_update='0' -sleep 1 -fi +#sleep 1 +#else +##bench_update='0' +##sleep 1 +#fi -if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then +#if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then fix_action='1' -sleep 1 -else -fix_action='0' -sleep 1 -fi +#sleep 1 +#else +#fix_action='0' +##sleep 1 +#fi telegram_alert=0; discord=0; From b58b51f2a85a220c0d25107e09bae97d846e7b13 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 10 Sep 2021 14:43:30 +0200 Subject: [PATCH 0074/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 396a117a..9ecb3289 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -721,7 +721,7 @@ flux_update='1' daemon_update='1' ##sleep 1 #else -daemon_update='0' +#daemon_update='0' ##sleep 1 #fi From 77b520a28d39bce2916b8f060e2e1c62f0b1e326 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 5 Oct 2021 18:22:51 +0200 Subject: [PATCH 0075/1176] added restart flux before restarting daemon --- multitoolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9ecb3289..f2a54405 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1610,6 +1610,7 @@ echo -e "${ARROW} ${CYAN}Replace FluxNode IP skipped.........................[${ fi fi +pm2 restart flux > /dev/null 2>&1 sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 NUM='35' MSG1='Restarting daemon service...' From 3dd1ed22b3ee10f049671fc11ff4c038340a6cf0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 17 Oct 2021 21:46:41 +0200 Subject: [PATCH 0076/1176] skipped empty string --- nodeanalizerandfixer.sh | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 71d5125d..9d851499 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1005,28 +1005,45 @@ sudo fuser -k 16125/tcp > /dev/null 2>&1 echo -e "" if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -echo -e "\c" - else - sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e " ${CYAN}FluxNode privkey replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" - fi + echo -e "\c" +else + + if [[ "$zelnodeprivkey" == "" ]]; then + echo -e " ${CYAN}FluxNode privkey skipped...............${NC}" + else + sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e " ${CYAN}FluxNode privkey replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + fi + fi fi + + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then echo -e "\c" else + + if [[ "$zelnodeoutpoint" == "" ]]; then + echo -e " ${CYAN}FluxNode zelnodeoutpoint skipped...............${NC}" + else sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then echo -e " ${CYAN}FluxNode outpoint replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" fi + fi fi if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then echo -e "\c" else - sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE + + if [[ "$zelnodeindex" == "" ]]; then + echo -e " ${CYAN}FluxNode zelnodeindex skipped...............${NC}" + else + sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then echo -e " ${CYAN}FluxNode index replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" fi + fi fi echo -e "" sudo systemctl start "$COIN_NAME" From 69b6166ffcd7b6e2ebb430252c80f5c42746e4e1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 22 Oct 2021 13:17:29 +0200 Subject: [PATCH 0077/1176] fix typo --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index ccfef159..a964bd70 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1484,7 +1484,7 @@ function start_daemon() { fi - if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make shour that flux daemon working) Y/N?" 8 90; then + if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" echo -n "" From 5b0f3e8fd72db5ca3535797da021c43a6090aedc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 22 Oct 2021 13:40:43 +0200 Subject: [PATCH 0078/1176] added rotate ip service for self-hosting --- install_pro.sh | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index a964bd70..7611d48c 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -74,6 +74,79 @@ fi echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" } + function selfhosting() { + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" + echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + else + echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 + echo -e "" + exit + fi + +echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 +sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 +sudo touch /home/$USER/ip_check.sh +sudo chown $USER:$USER /home/$USER/ip_check.sh + cat <<'EOF' > /home/$USER/ip_check.sh +#!/bin/bash +function get_ip(){ + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi +} +if [[ $1 == "restart" ]]; then + # give 3min to connect with internet + sleep 180 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi +fi +if [[ $1 == "ip_check" ]]; then + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + confirmed_ip=$(curl -SsL -m 10 http://localhost:16127/flux/info | jq -r .data.node.status.ip) + if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then + if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + fi +fi +EOF + +sudo chmod +x /home/$USER/ip_check.sh +echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 + +crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) + +if [[ "$crontab_check" == "0" ]]; then + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" +else + echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" +fi +echo -e "" + } + + function max(){ m="0" @@ -2141,6 +2214,9 @@ fi fi create_service_scripts create_service + if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then + selfhosting + fi install_process start_daemon log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" From 15913bd74a359e583b31b045ddcb269564d09edb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:14:55 +0200 Subject: [PATCH 0079/1176] temp fix solution --- install_pro.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 7611d48c..a45aa5a6 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2016,6 +2016,12 @@ function check() { cd pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 pm2 save > /dev/null 2>&1 +sleed 120000 +cd /home/$USER/zelflux +pm2 stop flux +npm install --legacy-peer-deps +pm2 start flux +cd NUM='400' MSG1='Finalizing Flux installation please be patient this will take about ~5min...' From 336939f2afc58f340b5ea7a33252ebbdfef5f09a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:16:52 +0200 Subject: [PATCH 0080/1176] fix typo --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index a45aa5a6..fdaa6e20 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2016,7 +2016,7 @@ function check() { cd pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 pm2 save > /dev/null 2>&1 -sleed 120000 +sleep 120000 cd /home/$USER/zelflux pm2 stop flux npm install --legacy-peer-deps From 28b0e0215bd5cdd8a49c86628830dc8b110eae0f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:55:29 +0200 Subject: [PATCH 0081/1176] improved rotate ip choice --- install_pro.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index fdaa6e20..99175bd7 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2220,9 +2220,17 @@ fi fi create_service_scripts create_service - if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then - selfhosting + + if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then + echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + else + if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then + selfhosting + else + echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + fi fi + install_process start_daemon log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" From 7be52cb19530951d73f6f977a996135c0d0b3426 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Oct 2021 20:12:27 +0200 Subject: [PATCH 0082/1176] fix sleep time --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 99175bd7..6d482d84 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2016,7 +2016,7 @@ function check() { cd pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 pm2 save > /dev/null 2>&1 -sleep 120000 +sleep 120 cd /home/$USER/zelflux pm2 stop flux npm install --legacy-peer-deps From 795b5c7d344436f8fb022da8db46e1afdf5adf6b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Oct 2021 20:22:00 +0200 Subject: [PATCH 0083/1176] Minor edits --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f2a54405..028f0f3e 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -284,7 +284,7 @@ function ip_confirm() { function install_flux() { -echo -e "${GREEN}Module: Re-install Flux${NC}" +echo -e "${GREEN}Module: Re-install FluxOS${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" ]] @@ -1898,7 +1898,7 @@ echo -e "${CYAN}4 - Install watchdog for FluxNode${NC}" echo -e "${CYAN}5 - Restore Flux MongoDB datatable from bootstrap${NC}" echo -e "${CYAN}6 - Restore Flux blockchain from bootstrap${NC}" echo -e "${CYAN}7 - Create FluxNode installation config file${NC}" -echo -e "${CYAN}8 - Re-install Flux${NC}" +echo -e "${CYAN}8 - Re-install FluxOS${NC}" echo -e "${CYAN}9 - Flux Daemon Reconfiguration${NC}" echo -e "${CYAN}10 - Restore Kadena node blockchain from bootstrap${NC}" echo -e "${CYAN}11 - Create Flux daemon service ( for old nodes )${NC}" From d56cffe1e89bd5a2e666f9ec177cd89259379a0f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Nov 2021 08:30:28 +0100 Subject: [PATCH 0084/1176] added replace zel id --- multitoolbox.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 028f0f3e..9897f364 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1786,6 +1786,42 @@ sudo chown $USER:$USER /home/$USER/ip_check.sh cat <<'EOF' > /home/$USER/ip_check.sh #!/bin/bash +function replace_zelid(){ + + echo -e "${GREEN}Module: Replace Zel ID${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" ]] + then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + +new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + + if [[ "zelid:'$new_zelid'," == $(grep -w zelid /home/$USER/zelflux/config/userconfig.js) ]]; then + echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped..................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js )/zelid='$new_zelid',/" /home/$USER/zelflux/config/userconfig.js + + if [[ $(grep -w $new_zelid home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}ZEL ID replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + fi + + fi + +} + function get_ip(){ WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') @@ -1903,6 +1939,7 @@ echo -e "${CYAN}9 - Flux Daemon Reconfiguration${NC}" echo -e "${CYAN}10 - Restore Kadena node blockchain from bootstrap${NC}" echo -e "${CYAN}11 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}12 - Create Self-hosting cron ip service ${NC}" +echo -e "${CYAN}13 - Replace Zel ID ${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -1977,6 +2014,13 @@ read -rp "Pick an option and hit ENTER: " selfhosting ;; + 13) + clear + sleep 1 + replace_zelid + ;; + + # 8) #clear From 276de149c5939ef8f4453a1ddd909f4014a273f7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Nov 2021 08:39:38 +0100 Subject: [PATCH 0085/1176] Minor edits --- multitoolbox.sh | 69 +++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9897f364..4653a32d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1752,41 +1752,8 @@ EOF sudo chown root:root /etc/systemd/system/zelcash.service } - function selfhosting() { - - echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" ]] - then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 - else - echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 - echo -e "" - exit - fi - - -echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 -sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 -sudo touch /home/$USER/ip_check.sh -sudo chown $USER:$USER /home/$USER/ip_check.sh - cat <<'EOF' > /home/$USER/ip_check.sh -#!/bin/bash -function replace_zelid(){ +function replace_zelid() { echo -e "${GREEN}Module: Replace Zel ID${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1822,6 +1789,40 @@ new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from } + function selfhosting() { + + echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" ]] + then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + else + echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 + echo -e "" + exit + fi + + +echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 +sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 +sudo touch /home/$USER/ip_check.sh +sudo chown $USER:$USER /home/$USER/ip_check.sh + cat <<'EOF' > /home/$USER/ip_check.sh +#!/bin/bash + function get_ip(){ WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') From 1879ed5cbee6d55b3d0f3f34d991fad2e2e35ee6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Nov 2021 09:01:18 +0100 Subject: [PATCH 0086/1176] fix zel id check --- multitoolbox.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4653a32d..0ca00e5c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1767,8 +1767,12 @@ function replace_zelid() { exit fi -new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then +while true + do + + new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + + if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then string_limit_check_mark "Zel ID is valid..........................................." break else @@ -1776,10 +1780,12 @@ new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from sleep 2 fi + done + if [[ "zelid:'$new_zelid'," == $(grep -w zelid /home/$USER/zelflux/config/userconfig.js) ]]; then echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped..................[${CHECK_MARK}${CYAN}]${NC}" else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js )/zelid='$new_zelid',/" /home/$USER/zelflux/config/userconfig.js + sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid='$new_zelid',/" /home/$USER/zelflux/config/userconfig.js if [[ $(grep -w $new_zelid home/$USER/zelflux/config/userconfig.js) != "" ]]; then echo -e "${ARROW} ${CYAN}ZEL ID replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" From 3e8a00eddc7b309fe250b38f6fa4b68e1def1a5d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Nov 2021 09:06:14 +0100 Subject: [PATCH 0087/1176] fix path --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 0ca00e5c..cef6e46e 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1787,7 +1787,7 @@ while true else sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid='$new_zelid',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $new_zelid home/$USER/zelflux/config/userconfig.js) != "" ]]; then + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then echo -e "${ARROW} ${CYAN}ZEL ID replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" fi From bfe96a358ec81089be88f9b77a7e9694bc2581a5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Nov 2021 09:24:57 +0100 Subject: [PATCH 0088/1176] fix conditional --- multitoolbox.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index cef6e46e..7f4da7d3 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1782,7 +1782,7 @@ while true done - if [[ "zelid:'$new_zelid'," == $(grep -w zelid /home/$USER/zelflux/config/userconfig.js) ]]; then + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped..................[${CHECK_MARK}${CYAN}]${NC}" else sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid='$new_zelid',/" /home/$USER/zelflux/config/userconfig.js @@ -2025,6 +2025,7 @@ read -rp "Pick an option and hit ENTER: " clear sleep 1 replace_zelid + echo -e "" ;; From 64018202a8c1d5c453083fd28eb237ba9cfc7474 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Nov 2021 09:28:24 +0100 Subject: [PATCH 0089/1176] Minor edits --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7f4da7d3..f2a272ba 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1783,12 +1783,12 @@ while true done if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped..................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped........................[${CHECK_MARK}${CYAN}]${NC}" else sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid='$new_zelid',/" /home/$USER/zelflux/config/userconfig.js if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}ZEL ID replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" fi fi From c55afb58ef1ce7cd56157fad881661aa0c640df9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Nov 2021 09:34:42 +0100 Subject: [PATCH 0090/1176] fix bad char --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f2a272ba..dd6aaa07 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1785,7 +1785,7 @@ while true if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped........................[${CHECK_MARK}${CYAN}]${NC}" else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid='$new_zelid',/" /home/$USER/zelflux/config/userconfig.js + sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then echo -e "${ARROW} ${CYAN}ZEL ID replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" From eaefb0a6826dd28d3e6c7c0eb701e0072096c426 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 9 Nov 2021 16:36:14 +0100 Subject: [PATCH 0091/1176] Minor edit --- install_pro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 6d482d84..5f133a60 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -697,7 +697,7 @@ function mongodb_bootstrap(){ # echo -e "" # fi -} +#} function wipe_clean() { echo -e "${ARROW} ${YELLOW}Removing any instances of FluxNode${NC}" @@ -1786,7 +1786,7 @@ if [[ "$IMPORT_ZELID" == "0" ]]; then echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" break else - echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}}" + echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" sleep 4 fi done From 8c1f42b0cf633781b275ccf4acca370534d3f9d5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 9 Nov 2021 19:01:32 +0100 Subject: [PATCH 0092/1176] Minor edit --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 5f133a60..af363dcb 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -697,7 +697,7 @@ function mongodb_bootstrap(){ # echo -e "" # fi -#} +} function wipe_clean() { echo -e "${ARROW} ${YELLOW}Removing any instances of FluxNode${NC}" From 0c4d46c8988e92f42aebf1ac94d218c3ba02a507 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 13 Nov 2021 00:13:45 +0100 Subject: [PATCH 0093/1176] removed dummy function --- install_pro.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index af363dcb..d3d2db89 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -77,7 +77,6 @@ echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" function selfhosting() { echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 - get_ip device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') if [[ "$device_name" != "" && "$WANIP" != "" ]]; then From 91e4968a4d694fd73517fe2781dfabd32fb6207d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 13 Nov 2021 00:24:34 +0100 Subject: [PATCH 0094/1176] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index f6c7a600..a1248b38 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,7 @@ https://fluxnodeservice.com

https://x4milx.coinrequest.io

``` -CruxID: k4mil@zel.crux -ZEL: t1f66kBo9xzpgPJV6wvzT7MY6unpm42kvST +FLUX: t1f66kBo9xzpgPJV6wvzT7MY6unpm42kvST BTC: 1NDVjrP1zg35nfSD1WBKyYSBf8dgJ8AKay ETH: 0xf515e0e2ba9347c208418c88a7d75bee3288a010 LTC: LgST14gr5LH93U8NBeAdFZVwsLzxTBRTq8 From 76b025aca7ff12fa25be02909f5957e6de807571 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 13 Nov 2021 00:26:38 +0100 Subject: [PATCH 0095/1176] Add files via upload --- image/new_menu_v3.jpg | Bin 0 -> 97346 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 image/new_menu_v3.jpg diff --git a/image/new_menu_v3.jpg b/image/new_menu_v3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..33ec4485f5bbb4dd9fca72b221a9975338ec50c1 GIT binary patch literal 97346 zcmeFZ2Ut|wvM$8n zb50F?+kMYD_pE*Pa&O<;=e>KsyC;kfKIrZ_s_L)5YSgGPQRAq2z(Yk@1zEtYTekqO z(O&@66yP}ki7X0hm?%`5d|X?GYcylzkr~Su!!jM7c#PP@(PL? znp)aAx_bI%<`$M#)<7F4XBSsDcMng$kNyFHLBS!>F|l#+37-=o8JSto?3~=Z{L(Ub zc|~Pabxm_iYg>EA_s%ZF(D2CU*!aZc!s62M%Iezs#^%A{(ecUY+4;rg54mmuF#o4m z{~_65$wh#c3j=L~+gLy3x`p9}9+(8T?>ynTODL^|^~QmSj`#gN;%8CmCEu{=`PBDG zOdSVtNE!GS7!Q7k_7}+a$ei6maSQCGft2A)tlpuI`qvTex)WQ4H%?=Uc@!Sgw^htZ%(qMI(0 zAQa$u!^xQ1cnJl#Ba8yX#`q4TovI_{P=FjI$o?jPB_jmD0<)9)mf#r&QKgzx&+>b$ zlyC52DcKSB_{~sNp4{);=npZ;0MD=X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L(W4iURfm5=6!_k=C!f6XFl+PtYlk3x zvBc_nS$IQW0Bg;`HUfzNDUP9wdkCyAwirG&M%yofB6;w54Ht`y=!@?SiZ4Nueq0ST zd&R_bZm&NaQIi_4%@4m(L4+pxt3D!*r3ZNwSWm1o&JOy_gEa}tpB94FjWSdto^@I> zZCvtjc&x9SRWWXA_47bWzD1`Rz|feUviCQD3bu+G!H%ut93%!#r63{4!RP}CPNj%q zzDKc(cQo@(UoNh?{OJ3#5!H~=2NI$Tx8_^-p-C6cPr@$R(G%Gy9}NR8C(ir6oDe=> zTE3Bs2tQsMC{=-$H&)&OOEd`>X|Ia$LSUdYX#NfqYdQOP6eGmIJ7`jzh(CIoYfR>* zjazJ>o9$nnolz7?eOzeHZp4^#>~^Vy_so^(D^E^*^Jw$ZzCzh2pg1WShD3T_u7Jyo z$S6v=No8!T`~02qhK3uT7UR41W!NU>e>gvTDah^V)iG%LY1eCi`v8$hO(;pMm;|*0 zcC@`l&CCD@+T%%l@CPJZj1?$Khn;3Tj8Z~zOn2l?d>Pr?BGYs41H6+^i2>vGqQkD~ zM5A2+sX`-J@j=_AvdlDWQ?egrc4Zc)e;|^L_y(hKZ_lGP8mLkftMB!U$c5-$kRBC; zR6#mJ#48WcNqr60TkLT>7R)kg%mvFBJ$fTX=htthYTiwI0!qk*2cMDozAQMYGyGw! zXq~A{-x)#A?E09h`v!bOL%p_uQ`{v*Mjgo!z-a8x|0=@y|LXf}9zdx6jOaGPx|mX> cLja=W;oM$-pFb01`4iEW|GVE|{yp*E0Lae~pa1{> literal 0 HcmV?d00001 From 998f3552030eb2bff96ac77c25611aea7a426ab5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 13 Nov 2021 00:27:24 +0100 Subject: [PATCH 0096/1176] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1248b38..62a8abf2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ```bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` 2) MENU: -![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/Menu12.jpg) +![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/new_menu_v3.jpg) 3) HOW USE MULTITOOLBOX TO SETUP FLUXNODE: https://medium.com/zelinsights/zelnode-setup-the-easy-peasy-lemon-squeezy-way-fd89706ea03c
From d606dc714e49199537872dd225ee22639dc05176 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 13 Nov 2021 22:17:35 +0100 Subject: [PATCH 0097/1176] disabled output --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index d3d2db89..a7830f59 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2018,7 +2018,7 @@ pm2 save > /dev/null 2>&1 sleep 120 cd /home/$USER/zelflux pm2 stop flux -npm install --legacy-peer-deps +npm install --legacy-peer-deps > /dev/null 2>&1 pm2 start flux cd From 4f91b9a0a6c7a2f847f2fade8adb1837f6bb6dec Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 14 Nov 2021 19:36:11 +0100 Subject: [PATCH 0098/1176] improved fluxos error check --- nodeanalizerandfixer.sh | 43 +++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 9d851499..bf432ed1 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -451,35 +451,28 @@ fi if [[ "$WANIP" != "" ]]; then -back_error_check=$(curl -s -m 5 http://$WANIP:16127/zelid/loginphrase | jq -r .data[]? | wc -l) +back_error_check=$(curl -s -m 5 http://$WANIP:16127/zelid/loginphrase | jq -r .status ) - if [[ "$back_error_check" == "" ]]; then + if [[ "$back_error_check" != "success" && "$back_error_check" != "" ]]; then - sudo ufw allow from any to any port 16127 > /dev/null 2>&1 - sudo ufw allow out to any port 16127 > /dev/null 2>&1 - sudo ufw reload > /dev/null 2>&1 + back_error=$(curl -s -m 8 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message.message) + + if [[ "$back_error" != "" ]; then + + echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" + + else + + back_error=$(curl -s -m 8 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message) + + if [[ "$back_error" != "" ]; then + + echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" - else - - if [[ "$back_error_check" == "7" ]]; then - back_error=$(curl -s -m 3 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message.message) - echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" - sudo ufw allow from any to any port 16127 > /dev/null 2>&1 - sudo ufw allow out to any port 16127 > /dev/null 2>&1 - sudo ufw reload > /dev/null 2>&1 - - fi - - if [[ "$back_error_check" == "3" ]]; then - back_error=$(curl -s -m 3 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message) - echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" - sudo ufw allow from any to any port 16127 > /dev/null 2>&1 - sudo ufw allow out to any port 16127 > /dev/null 2>&1 - sudo ufw reload > /dev/null 2>&1 - + fi + fi fi - fi -fi + fi device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') local_device_ip=$(ip a list $device_name | grep -o $WANIP ) From 2cbf80986206331964ee1736a61e4e04197ea327 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 14 Nov 2021 19:40:15 +0100 Subject: [PATCH 0099/1176] fix missing bracket --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index bf432ed1..8aa65865 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -457,7 +457,7 @@ back_error_check=$(curl -s -m 5 http://$WANIP:16127/zelid/loginphrase | jq -r .s back_error=$(curl -s -m 8 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message.message) - if [[ "$back_error" != "" ]; then + if [[ "$back_error" != "" ]]; then echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" @@ -465,7 +465,7 @@ back_error_check=$(curl -s -m 5 http://$WANIP:16127/zelid/loginphrase | jq -r .s back_error=$(curl -s -m 8 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message) - if [[ "$back_error" != "" ]; then + if [[ "$back_error" != "" ]]; then echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" From 64923a0a69cfb887227dc63cbef0cfaeb933b191 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 14 Nov 2021 19:59:44 +0100 Subject: [PATCH 0100/1176] Minor edit --- nodeanalizerandfixer.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 8aa65865..6239a384 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -866,8 +866,9 @@ if [[ "$required_ver" != "" ]]; then fi echo -e "${CHECK_MARK} ${CYAN} Flux config ~/$FLUX_DIR/config/userconfig.js exists${NC}" -ZELIDLG=`echo -n $(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//') | wc -m` -if [ "$ZELIDLG" -eq "36" ] || [ "$ZELIDLG" -eq "35" ]; then + +ZELIDLG=`echo -n $(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e "s/'//g" | sed -e "s/,//g" | sed -e "s/.*zelid://g") | wc -m` +if [ "$ZELIDLG" -eq "35" ] || [ "$ZELIDLG" -eq "34" ]; then echo -e "${CHECK_MARK} ${CYAN} Zel ID is valid${NC}" elif [[ "$ZELIDLG" == "0" || "$ZELIDLG" == "2" ]]; then echo -e "${X_MARK} ${CYAN} Zel ID is missing...${NC}" From 91a6c8ab00f47eef4b0c5bc7714ca2dfdd020b9c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 14 Nov 2021 21:31:44 +0100 Subject: [PATCH 0101/1176] disabled error output --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 6239a384..40a1b3a9 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -455,7 +455,7 @@ back_error_check=$(curl -s -m 5 http://$WANIP:16127/zelid/loginphrase | jq -r .s if [[ "$back_error_check" != "success" && "$back_error_check" != "" ]]; then - back_error=$(curl -s -m 8 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message.message) + back_error=$(curl -s -m 8 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message.message 2>/dev/null ) if [[ "$back_error" != "" ]]; then @@ -463,7 +463,7 @@ back_error_check=$(curl -s -m 5 http://$WANIP:16127/zelid/loginphrase | jq -r .s else - back_error=$(curl -s -m 8 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message) + back_error=$(curl -s -m 8 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message 2>/dev/null ) if [[ "$back_error" != "" ]]; then From 21b2b4ac24cf67153bcef7d1f45f8bfbf5d593b3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 23 Nov 2021 17:22:05 +0100 Subject: [PATCH 0102/1176] set last stable v14 version --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index a7830f59..03eb5941 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1715,7 +1715,7 @@ curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.s . ~/.bashrc sleep 1 #nvm install v12.16.1 -nvm install --lts > /dev/null 2>&1 +nvm install v14.18.1 > /dev/null 2>&1 if node -v > /dev/null 2>&1 then #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" From 9be22d335b5efa25308eaea35186a27c4ba25965 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 25 Nov 2021 20:08:33 +0100 Subject: [PATCH 0103/1176] disabled --legacy-peer-deps --- install_pro.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 03eb5941..40360921 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2015,12 +2015,12 @@ function check() { cd pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 pm2 save > /dev/null 2>&1 -sleep 120 -cd /home/$USER/zelflux -pm2 stop flux -npm install --legacy-peer-deps > /dev/null 2>&1 -pm2 start flux -cd +#sleep 120 +#cd /home/$USER/zelflux +#pm2 stop flux +#npm install --legacy-peer-deps > /dev/null 2>&1 +#pm2 start flux +#cd NUM='400' MSG1='Finalizing Flux installation please be patient this will take about ~5min...' From 96652f26ec4da108db5a3374a9d3ef88fa60bf7b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 25 Nov 2021 20:38:34 +0100 Subject: [PATCH 0104/1176] added new peers --- install_pro.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 40360921..e5a9ecb2 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1053,6 +1053,9 @@ bind=0.0.0.0 addnode=explorer.flux.zelcore.io addnode=explorer.runonflux.io addnode=explorer.zelcash.online +addnode=blockbook.runonflux.io +addnode=185.225.232.141:16125 +addnode=95.216.124.220:16125 maxconnections=256 EOF sleep 2 From 5813fea8b7f988c2234aa0d68323108adfda094d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 25 Nov 2021 20:46:21 +0100 Subject: [PATCH 0105/1176] added new peers --- install_pro.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index e5a9ecb2..c328f97c 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1056,6 +1056,9 @@ addnode=explorer.zelcash.online addnode=blockbook.runonflux.io addnode=185.225.232.141:16125 addnode=95.216.124.220:16125 +addnode=209.145.55.52:16125 +addnode=78.113.97.147:16125 +addnode=209.145.49.181:16125 maxconnections=256 EOF sleep 2 From 1de82fe73935f59846a4703abd8d98b7d886205f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 6 Dec 2021 21:37:05 +0100 Subject: [PATCH 0106/1176] added install dirmngr when missing --- install_pro.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index c328f97c..aff61bc9 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -994,9 +994,15 @@ function create_swap() { function install_packages() { echo echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" + if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 fi + + if ! dirmngr --v > /dev/null 2>&1; then + sudo apt install dirmngr -y > /dev/null 2>&1 + fi + sudo apt-get install software-properties-common -y > /dev/null 2>&1 sudo apt-get update -y > /dev/null 2>&1 sudo apt-get upgrade -y > /dev/null 2>&1 From c816e64a5d2efde200a84d19652650574adcf09f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:13:05 +0100 Subject: [PATCH 0107/1176] added communication check --- nodeanalizerandfixer.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 40a1b3a9..6c847ea2 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -571,6 +571,12 @@ fi fi +flux_communication=$(curl -SsL http://"$WANIP":16127/flux/checkcommunication | jq -r .data.message) +if [[ "$flux_communication" != "null" || "$flux_communication" != "" ]]; then +echo -e "${BOOK} ${YELLOW}Checking FluxOS communication: ${NC}" +echo -e "${ARROW} ${CYAN}$flux_communication${NC}" +fi + echo -e "${BOOK} ${YELLOW}Checking collateral:${NC}" txhash=$(grep -o "\w*" <<< "$collateral") txhash=$(sed -n "2p" <<< "$txhash") From 1af6471da04d34cc148eb1d8a6ab219511192fca Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:15:25 +0100 Subject: [PATCH 0108/1176] Minor edit --- nodeanalizerandfixer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 6c847ea2..18ecaa64 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -575,6 +575,7 @@ flux_communication=$(curl -SsL http://"$WANIP":16127/flux/checkcommunication | j if [[ "$flux_communication" != "null" || "$flux_communication" != "" ]]; then echo -e "${BOOK} ${YELLOW}Checking FluxOS communication: ${NC}" echo -e "${ARROW} ${CYAN}$flux_communication${NC}" +echo -e "" fi echo -e "${BOOK} ${YELLOW}Checking collateral:${NC}" From a796202a449eea8c5bff11ae73f166c9162d1292 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 21 Dec 2021 10:33:07 +0100 Subject: [PATCH 0109/1176] added ufw install when not installed --- multitoolbox.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index dd6aaa07..988886c0 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1406,6 +1406,8 @@ then exit fi + + if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" @@ -1422,6 +1424,11 @@ adduser --gecos "" "$usernew" usermod -aG sudo "$usernew" > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Update and upgrade system...${NC}" apt update -y && apt upgrade -y +if ! ufw version > /dev/null 2>&1 +then +echo -e "${ARROW} ${YELLOW}Installing ufw firewall..${NC}" +sudo apt-get install -y ufw > /dev/null 2>&1 +fi echo -e "${ARROW} ${YELLOW}Installing docker...${NC}" echo -e "${ARROW} ${CYAN}Architecture: ${GREEN}$(dpkg --print-architecture)${NC}" From 6574843619650b21be89940a1aa0f0dcee451c6a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 27 Dec 2021 14:44:07 +0100 Subject: [PATCH 0110/1176] Added Install Watchtower --- multitoolbox.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 988886c0..690d0eb4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1802,6 +1802,34 @@ while true } + function install_watchtower(){ + + echo -e "${GREEN}Module: Install containrrr/watchtower${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" ]] + then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + +echo -e "" +echo -e "${ARROW} ${CYAN}Installing containrrr/watchtower...${NC}" +random=$(shuf -i 300-700 -n 1) +echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" +docker run -d \ +--name watchtower \ +-v /var/run/docker.sock:/var/run/docker.sock \ +containrrr/watchtower \ +--label-enable --cleanup --interval $random + + + } + + function selfhosting() { echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" @@ -1954,6 +1982,7 @@ echo -e "${CYAN}10 - Restore Kadena node blockchain from bootstrap${NC}" echo -e "${CYAN}11 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}12 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}13 - Replace Zel ID ${NC}" +echo -e "${CYAN}13 - Install containrrr/watchtower for docker container autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -2035,6 +2064,13 @@ read -rp "Pick an option and hit ENTER: " echo -e "" ;; + 14) + clear + sleep 1 + install_watchtower + echo -e "" + ;; + # 8) From 4eb7a334e78c4616f079f7b9a767848e9c0d0e16 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 27 Dec 2021 14:45:07 +0100 Subject: [PATCH 0111/1176] Update multitoolbox.sh --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 690d0eb4..09ba5c02 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1982,7 +1982,7 @@ echo -e "${CYAN}10 - Restore Kadena node blockchain from bootstrap${NC}" echo -e "${CYAN}11 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}12 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}13 - Replace Zel ID ${NC}" -echo -e "${CYAN}13 - Install containrrr/watchtower for docker container autoupdate${NC}" +echo -e "${CYAN}14 - Install containrrr/watchtower for docker container autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " From 3f0d283f2de22f54e8bdbfa888cd877f793e74d1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:03:57 +0100 Subject: [PATCH 0112/1176] Minor update --- multitoolbox.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 09ba5c02..3c7dbc4c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1817,14 +1817,17 @@ while true fi echo -e "" -echo -e "${ARROW} ${CYAN}Installing containrrr/watchtower...${NC}" +echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" +docker pull v2tec/watchtower:latest > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" random=$(shuf -i 300-700 -n 1) echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" -docker run -d \ +apps_id=$(docker run -d \ --name watchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ ---label-enable --cleanup --interval $random +--label-enable --cleanup --interval $random) +echo -e "${ARROW} ${CYAN}Watchtower installed ID: ${GREEN}$apps_id${NC}" } From e69e939886b25c2a53920e447b93b0d75bd38ef9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:06:02 +0100 Subject: [PATCH 0113/1176] Added install check --- multitoolbox.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3c7dbc4c..a2073672 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1827,8 +1827,11 @@ apps_id=$(docker run -d \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ --label-enable --cleanup --interval $random) -echo -e "${ARROW} ${CYAN}Watchtower installed ID: ${GREEN}$apps_id${NC}" - +if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then +echo -e "${ARROW} ${CYAN}Watchtower installed successful, id: ${GREEN}$apps_id${NC}" +else +echo -e "${ARROW} ${CYAN}Watchtower installed failed!${NC}" +fi } From fdfbaf0b1020f85e3bcb34797d8d2677238d867f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:07:43 +0100 Subject: [PATCH 0114/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a2073672..475bc3fd 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1830,7 +1830,7 @@ containrrr/watchtower \ if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then echo -e "${ARROW} ${CYAN}Watchtower installed successful, id: ${GREEN}$apps_id${NC}" else -echo -e "${ARROW} ${CYAN}Watchtower installed failed!${NC}" +echo -e "${ARROW} ${CYAN}Watchtower installion failed!${NC}" fi } From 78d85d0d23b34dd56643db63198ba36f2cf2c62e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:12:37 +0100 Subject: [PATCH 0115/1176] fix bad char --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 475bc3fd..d77d3c46 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1830,7 +1830,7 @@ containrrr/watchtower \ if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then echo -e "${ARROW} ${CYAN}Watchtower installed successful, id: ${GREEN}$apps_id${NC}" else -echo -e "${ARROW} ${CYAN}Watchtower installion failed!${NC}" +echo -e "${ARROW} ${CYAN}Watchtower installion failed!.. ${NC}" fi } From 3320f0a8ac2bf0b3a11f55e64ccacf87696cf636 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:15:36 +0100 Subject: [PATCH 0116/1176] fix error --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d77d3c46..594f7590 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1830,7 +1830,7 @@ containrrr/watchtower \ if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then echo -e "${ARROW} ${CYAN}Watchtower installed successful, id: ${GREEN}$apps_id${NC}" else -echo -e "${ARROW} ${CYAN}Watchtower installion failed!.. ${NC}" +echo -e "${ARROW} ${CYAN}Watchtower installion failed..${NC}" fi } From fd0f18453aa5d408e1fe0a411cd360a2a818b133 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:18:41 +0100 Subject: [PATCH 0117/1176] clean --- multitoolbox.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 594f7590..687b69d2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -2077,8 +2077,7 @@ read -rp "Pick an option and hit ENTER: " echo -e "" ;; - - + # 8) #clear # sleep 1 From 28b1aa0457311f977d5d17741e1f2b490b4b2824 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:19:49 +0100 Subject: [PATCH 0118/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 687b69d2..eda18a28 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1988,7 +1988,7 @@ echo -e "${CYAN}10 - Restore Kadena node blockchain from bootstrap${NC}" echo -e "${CYAN}11 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}12 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}13 - Replace Zel ID ${NC}" -echo -e "${CYAN}14 - Install containrrr/watchtower for docker container autoupdate${NC}" +echo -e "${CYAN}14 - Install containrrr/watchtower for docker image autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " From 510e66add9797525373d9128a1d71b85f5eebb0e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:24:00 +0100 Subject: [PATCH 0119/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index eda18a28..5517131c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1804,7 +1804,7 @@ while true function install_watchtower(){ - echo -e "${GREEN}Module: Install containrrr/watchtower${NC}" + echo -e "${GREEN}Module: Install containrrr/watchtower for docker image autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" ]] From 03bdbe878fe0bda746f2de59a348dc74247c1cc0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 06:40:28 +0100 Subject: [PATCH 0120/1176] removed zelcore explorer --- nodeanalizerandfixer.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 18ecaa64..ebe9faee 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -517,10 +517,10 @@ echo -e "${PIN} ${CYAN}Connections: ${SEA}$connections${NC}" echo -e "${PIN} ${CYAN}Blocks: ${SEA}$blocks_hight${NC}" network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') -network_height_02=$(curl -sk -m 5 https://explorer.flux.zelcore.io/api/status?q=getInfo | jq '.info.blocks') +#network_height_02=$(curl -sk -m 5 https://explorer.flux.zelcore.io/api/status?q=getInfo | jq '.info.blocks') network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') -explorer_network_hight=$(max "$network_height_01" "$network_height_02" "$network_height_03") +explorer_network_hight=$(max "$network_height_01" "$network_height_03") block_diff=$((explorer_network_hight-blocks_hight)) @@ -593,7 +593,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') if [[ "$stak_info" != "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.flux.zelcore.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') fi fi From 0ab7b9614b650f25b011ec5dc419b7350d1249c7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 06:49:42 +0100 Subject: [PATCH 0121/1176] removed zelcore explorer --- install_pro.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index aff61bc9..3a7828cc 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1882,10 +1882,9 @@ fi function status_loop() { network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') -network_height_02=$(curl -sk -m 5 https://explorer.flux.zelcore.io/api/status?q=getInfo | jq '.info.blocks') network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') -EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02" "$network_height_03") +EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks') ]]; then @@ -1916,10 +1915,9 @@ else do network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') - network_height_02=$(curl -sk -m 5 https://explorer.flux.zelcore.io/api/status?q=getInfo | jq '.info.blocks') network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02" "$network_height_03") + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') @@ -1955,10 +1953,9 @@ else spinning_timer network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') - network_height_02=$(curl -sk -m 5 https://explorer.flux.zelcore.io/api/status?q=getInfo | jq '.info.blocks') network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02" "$network_height_03") + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') From 7df885621bf96476cc0e19088f7eb4bfa719ebfd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 06:53:59 +0100 Subject: [PATCH 0122/1176] replace explorer --- install_pro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 3a7828cc..6382ae8b 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -598,8 +598,8 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') - if [[ "$stak_info" != "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.flux.zelcore.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') fi fi From a54bbd32a0725d2c66fbb6ed57d07a69359099e0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 09:42:14 +0100 Subject: [PATCH 0123/1176] disable error output --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5517131c..3a1e77be 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1826,7 +1826,7 @@ apps_id=$(docker run -d \ --name watchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ ---label-enable --cleanup --interval $random) +--label-enable --cleanup --interval $random) 2> /dev/null if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then echo -e "${ARROW} ${CYAN}Watchtower installed successful, id: ${GREEN}$apps_id${NC}" else From 76dc3c72c27dfdde29613d1aad72ff5c0870adc0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 09:49:56 +0100 Subject: [PATCH 0124/1176] cleanup --- multitoolbox.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3a1e77be..4355f631 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -7,7 +7,6 @@ BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' KDA_BOOTSTRAP_ZIPFILE='kda_bootstrap.tar.gz' KDA_BOOTSTRAP_ZIP='https://fluxnodeservice.com/kda_bootstrap.tar.gz' - if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' CONFIG_FILE='zelcash.conf' From 89254f3a91bb0e026322db1695181739d520502e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 09:50:36 +0100 Subject: [PATCH 0125/1176] Update multitoolbox.sh --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4355f631..6eab3a7f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1829,7 +1829,7 @@ containrrr/watchtower \ if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then echo -e "${ARROW} ${CYAN}Watchtower installed successful, id: ${GREEN}$apps_id${NC}" else -echo -e "${ARROW} ${CYAN}Watchtower installion failed..${NC}" +echo -e "${ARROW} ${CYAN}Watchtower installion failed...${NC}" fi } From 5d58de731464b1d518dd1b31dec5658167128dbf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 16:43:45 +0100 Subject: [PATCH 0126/1176] added apps check --- multitoolbox.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6eab3a7f..69858a1a 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1816,6 +1816,17 @@ while true fi echo -e "" +echo -e "${ARROW} ${CYAN}Checking if watchtower is installed....${NC}" +apps_check=$(docker ps | grep "watchtower") + +if [[ "$apps_check" != "" ]]; then +echo -e "${ARROW} ${CYAN}Stopping watchtower...${NC}" +docker stop watchtower > /dev/null 2>&1 +sleep 2 +echo -e "${ARROW} ${CYAN}Removing watchtower...${NC}" +docker rm watchtower > /dev/null 2>&1 +fi + echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" docker pull v2tec/watchtower:latest > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" @@ -1825,7 +1836,7 @@ apps_id=$(docker run -d \ --name watchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ ---label-enable --cleanup --interval $random) 2> /dev/null +--label-enable --cleanup --interval $random 2> /dev/null) if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then echo -e "${ARROW} ${CYAN}Watchtower installed successful, id: ${GREEN}$apps_id${NC}" else From 4a7a4ca23ab45d5a4a910c6e0f56f6a4351d91d6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 16:59:19 +0100 Subject: [PATCH 0127/1176] changed interval 2-4h --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 69858a1a..45f1a556 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1830,7 +1830,7 @@ fi echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" docker pull v2tec/watchtower:latest > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" -random=$(shuf -i 300-700 -n 1) +random=$(shuf -i 7200-14400 -n 1) echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" apps_id=$(docker run -d \ --name watchtower \ From db3aa9390bfc85ec800bea91c04085735eefff7e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 18:32:13 +0100 Subject: [PATCH 0128/1176] changed interval range --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 45f1a556..39569713 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1830,13 +1830,13 @@ fi echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" docker pull v2tec/watchtower:latest > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" -random=$(shuf -i 7200-14400 -n 1) +random=$(shuf -i 7500-35000 -n 1) echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" apps_id=$(docker run -d \ --name watchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ ---label-enable --cleanup --interval $random 2> /dev/null) +--label-enable --cleanup --c $random 2> /dev/null) if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then echo -e "${ARROW} ${CYAN}Watchtower installed successful, id: ${GREEN}$apps_id${NC}" else From 1673a5bf2f067582f80bea6998c94b4fb1591ba3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 18:33:31 +0100 Subject: [PATCH 0129/1176] fix typo --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 39569713..1dfa7818 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1836,7 +1836,7 @@ apps_id=$(docker run -d \ --name watchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ ---label-enable --cleanup --c $random 2> /dev/null) +--label-enable --cleanup --interval $random 2> /dev/null) if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then echo -e "${ARROW} ${CYAN}Watchtower installed successful, id: ${GREEN}$apps_id${NC}" else From 94b8a51d075a0983598da17fa8ff7235ce707b12 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 19:22:30 +0100 Subject: [PATCH 0130/1176] rename apps name --- multitoolbox.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 1dfa7818..69772a11 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1816,15 +1816,15 @@ while true fi echo -e "" -echo -e "${ARROW} ${CYAN}Checking if watchtower is installed....${NC}" -apps_check=$(docker ps | grep "watchtower") +echo -e "${ARROW} ${CYAN}Checking if fluxwatchtower is installed....${NC}" +apps_check=$(docker ps | grep "fluxwatchtowerr") if [[ "$apps_check" != "" ]]; then echo -e "${ARROW} ${CYAN}Stopping watchtower...${NC}" -docker stop watchtower > /dev/null 2>&1 +docker stop fluxwatchtower > /dev/null 2>&1 sleep 2 echo -e "${ARROW} ${CYAN}Removing watchtower...${NC}" -docker rm watchtower > /dev/null 2>&1 +docker rm fluxwatchtower > /dev/null 2>&1 fi echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" @@ -1833,7 +1833,7 @@ echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" random=$(shuf -i 7500-35000 -n 1) echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" apps_id=$(docker run -d \ ---name watchtower \ +--name fluxwatchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ --label-enable --cleanup --interval $random 2> /dev/null) From 10783a453048d4e032d2473a6ab392acf6fc3e37 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 19:23:15 +0100 Subject: [PATCH 0131/1176] Minor edits --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 69772a11..bf7c06f4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1838,9 +1838,9 @@ apps_id=$(docker run -d \ containrrr/watchtower \ --label-enable --cleanup --interval $random 2> /dev/null) if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then -echo -e "${ARROW} ${CYAN}Watchtower installed successful, id: ${GREEN}$apps_id${NC}" +echo -e "${ARROW} ${CYAN}FluxWatchtower installed successful, id: ${GREEN}$apps_id${NC}" else -echo -e "${ARROW} ${CYAN}Watchtower installion failed...${NC}" +echo -e "${ARROW} ${CYAN}FluxWatchtower installion failed...${NC}" fi } From 12560225cfebe18ca6a75e0f93bfd2450295260f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Dec 2021 19:28:53 +0100 Subject: [PATCH 0132/1176] fix bad image --- multitoolbox.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index bf7c06f4..0141df64 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1817,18 +1817,18 @@ while true echo -e "" echo -e "${ARROW} ${CYAN}Checking if fluxwatchtower is installed....${NC}" -apps_check=$(docker ps | grep "fluxwatchtowerr") +apps_check=$(docker ps | grep "fluxwatchtower") if [[ "$apps_check" != "" ]]; then -echo -e "${ARROW} ${CYAN}Stopping watchtower...${NC}" +echo -e "${ARROW} ${CYAN}Stopping fluxwatchtower...${NC}" docker stop fluxwatchtower > /dev/null 2>&1 sleep 2 -echo -e "${ARROW} ${CYAN}Removing watchtower...${NC}" +echo -e "${ARROW} ${CYAN}Removing fluxwatchtower...${NC}" docker rm fluxwatchtower > /dev/null 2>&1 fi echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" -docker pull v2tec/watchtower:latest > /dev/null 2>&1 +docker pull containrrr/watchtower:latest > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" random=$(shuf -i 7500-35000 -n 1) echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" From f1fd8d382672178fc25ac0d69dbf908566e7f424 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 30 Dec 2021 05:47:08 +0100 Subject: [PATCH 0133/1176] remove zelcore explorer --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 0141df64..5d178a5d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -876,8 +876,8 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') - if [[ "$stak_info" != "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.flux.zelcore.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') fi fi From a476640d5eab6ac921f046c481df5b9ffbeb60d9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 30 Dec 2021 15:56:27 +0100 Subject: [PATCH 0134/1176] enable logs --- install_pro.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 6382ae8b..d067d66c 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1073,7 +1073,7 @@ EOF function flux_package() { sudo apt-get update -y > /dev/null 2>&1 && sleep 2 echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" - sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 + sudo apt install $COIN_NAME $BENCH_NAME -y && sleep 2 sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 integration_check } @@ -1084,7 +1084,7 @@ function install_daemon() { sudo rm /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" - sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 + sudo chown -R $USER:$USER /usr/share/keyrings if [[ "$(lsb_release -cs)" == "xenial" ]]; then @@ -1100,8 +1100,8 @@ if [[ "$(lsb_release -cs)" == "xenial" ]]; then flux_package && sleep 2 else - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D + gpg --export 4B69CA27A986265D | sudo apt-key add - if ! gpg --list-keys Zel > /dev/null; then gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 @@ -1111,10 +1111,10 @@ else # cleaning sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/flux.list # downloading key && save it as keyring - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" From 05e6d193c3ec468587ddbc70a788218289ad50b8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 30 Dec 2021 16:14:46 +0100 Subject: [PATCH 0135/1176] revert --- install_pro.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index d067d66c..8bd19388 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1073,7 +1073,7 @@ EOF function flux_package() { sudo apt-get update -y > /dev/null 2>&1 && sleep 2 echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" - sudo apt install $COIN_NAME $BENCH_NAME -y && sleep 2 + sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 integration_check } @@ -1084,7 +1084,7 @@ function install_daemon() { sudo rm /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" - sudo chown -R $USER:$USER /usr/share/keyrings + sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "xenial" ]]; then @@ -1100,8 +1100,8 @@ if [[ "$(lsb_release -cs)" == "xenial" ]]; then flux_package && sleep 2 else - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D - gpg --export 4B69CA27A986265D | sudo apt-key add - + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 if ! gpg --list-keys Zel > /dev/null; then gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 @@ -1114,7 +1114,7 @@ else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/flux.list # downloading key && save it as keyring - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" From 357e441edcf833674d2d038a5aa1e760b8f8daa8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 30 Dec 2021 16:18:27 +0100 Subject: [PATCH 0136/1176] revert --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 8bd19388..a729c13a 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1111,7 +1111,7 @@ else # cleaning sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/flux.list + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 From 7f5a1caeb6878f82fc91c2881847e7f9fddb9119 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 30 Dec 2021 16:36:36 +0100 Subject: [PATCH 0137/1176] added ca-certificates --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index a729c13a..2a81b767 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1003,7 +1003,7 @@ function install_packages() { sudo apt install dirmngr -y > /dev/null 2>&1 fi - sudo apt-get install software-properties-common -y > /dev/null 2>&1 + sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 sudo apt-get update -y > /dev/null 2>&1 sudo apt-get upgrade -y > /dev/null 2>&1 sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 From fb59cd1677e0391a3bcf43601d33dbda25c9e32a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 2 Jan 2022 14:01:05 +0100 Subject: [PATCH 0138/1176] update conditional --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5d178a5d..759355e8 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1339,7 +1339,7 @@ function analyzer_and_fixer(){ echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" ]] +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]] then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" From 48144f8817423cdec1ec8f6eb8b168eaca6de067 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 3 Jan 2022 09:52:24 +0100 Subject: [PATCH 0139/1176] removed zelcore explorer --- install_pro.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 2a81b767..67203c4f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1056,9 +1056,8 @@ txindex=1 listen=1 externalip=$WANIP bind=0.0.0.0 -addnode=explorer.flux.zelcore.io -addnode=explorer.runonflux.io addnode=explorer.zelcash.online +addnode=explorer.runonflux.io addnode=blockbook.runonflux.io addnode=185.225.232.141:16125 addnode=95.216.124.220:16125 From 6e9313b6a9af36093adaaa39b0fb250f966273a1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 3 Jan 2022 10:13:37 +0100 Subject: [PATCH 0140/1176] added new nodes --- install_pro.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 67203c4f..3883cc49 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1064,6 +1064,22 @@ addnode=95.216.124.220:16125 addnode=209.145.55.52:16125 addnode=78.113.97.147:16125 addnode=209.145.49.181:16125 +addnode=63.250.53.25:16125 +addnode=5.9.78.207:16125 +addnode=194.163.148.252:16125 +addnode=178.18.241.199:16125 +addnode=178.18.241.197:16125 +addnode=178.18.243.34:16125 +addnode=62.171.188.152:16125 +addnode=194.163.166.101:16125 +addnode=23.88.19.178:16125 +addnode=79.143.178.170:16125 +addnode=178.18.249.115:16125 +addnode=161.97.131.154:16125 +addnode=149.255.39.17:16125 + + + maxconnections=256 EOF sleep 2 From 260265dc420e052b08dc6591ad3793ed9a75e429 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 4 Jan 2022 10:08:30 +0100 Subject: [PATCH 0141/1176] added switch to home dir --- multitoolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 759355e8..0e7ae83f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1047,6 +1047,7 @@ function flux_daemon_bootstrap() { exit fi + cd echo -e "${NC}" echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 From 0f53ab94bd8bfb41768c95211ea9c3a58ab8e3db Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 5 Jan 2022 07:36:54 +0100 Subject: [PATCH 0142/1176] added multi users detection --- nodeanalizerandfixer.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index ebe9faee..3a8d7445 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -444,6 +444,15 @@ fi if [[ "$bench_back" == "disconnected" ]]; then echo -e "${X_MARK} ${CYAN} FluxBack does not work properly${NC}" +usercheck=$(getent group docker) +if [[ "$usercheck" =~ "," ]]; then +echo -e "" +echo -e "${WORNING} ${CYAN} Detected multiple users in docker group...${NC}" +echo -e "${WORNING} ${CYAN} More then one instance of flux daemon will cause it to malfunction...${NC}" +echo -e "${WORNING} ${CYAN} If u installed FluxOS on more then one user you need delete one instance of it...${NC}" +echo -e "" +fi + WANIP=$(wget http://ipecho.net/plain -O - -q) if [[ "$WANIP" == "" ]]; then WANIP=$(curl ifconfig.me) From 0b9ecc5abb49657e7f95c892d0b5d333fb08b85b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 Jan 2022 19:14:03 +0100 Subject: [PATCH 0143/1176] added explorer check --- nodeanalizerandfixer.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 3a8d7445..42d27f42 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -525,18 +525,26 @@ echo -e "${PIN} ${CYAN}Protocolversion: ${SEA}$protocolversion${NC}" echo -e "${PIN} ${CYAN}Connections: ${SEA}$connections${NC}" echo -e "${PIN} ${CYAN}Blocks: ${SEA}$blocks_hight${NC}" -network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') +network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo getinfo 2> /dev/null | jq '.info.blocks') #network_height_02=$(curl -sk -m 5 https://explorer.flux.zelcore.io/api/status?q=getInfo | jq '.info.blocks') -network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') +network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo 2> /dev/null | jq '.info.blocks') explorer_network_hight=$(max "$network_height_01" "$network_height_03") block_diff=$((explorer_network_hight-blocks_hight)) -if [[ "$block_diff" < 10 ]]; then -echo -e "${PIN} ${CYAN}Status: ${GREEN}synced${NC}" +if [[ "$explorer_network_hight" != "" ]]; then + + if [[ "$block_diff" < 10 ]]; then + echo -e "${PIN} ${CYAN}Status: ${GREEN}synced${NC}" + else + echo -e "${PIN} ${CYAN}Status: ${RED}not synced${NC}" + fi + else -echo -e "${PIN} ${CYAN}Status: ${RED}not synced${NC}" + + echo -e "${PIN} ${CYAN}Status: ${RED}sync check skipped...${NC}" + fi echo -e "" @@ -587,6 +595,8 @@ echo -e "${ARROW} ${CYAN}$flux_communication${NC}" echo -e "" fi +if [[ "$explorer_network_hight" != "" ]]; then + echo -e "${BOOK} ${YELLOW}Checking collateral:${NC}" txhash=$(grep -o "\w*" <<< "$collateral") txhash=$(sed -n "2p" <<< "$txhash") @@ -698,6 +708,9 @@ fi #type=$(zelcash-cli gettxout $txhash 0 | jq .value) fi fi +fi + + echo -e "${NC}" echo -e "${BOOK} ${YELLOW}Checking listen ports:${NC}" From 7c2a769beb0ae68eaf7ab6a72b57993e589b3ec0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 Jan 2022 19:21:29 +0100 Subject: [PATCH 0144/1176] fix explorer check --- nodeanalizerandfixer.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 42d27f42..a57c1b44 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -525,15 +525,15 @@ echo -e "${PIN} ${CYAN}Protocolversion: ${SEA}$protocolversion${NC}" echo -e "${PIN} ${CYAN}Connections: ${SEA}$connections${NC}" echo -e "${PIN} ${CYAN}Blocks: ${SEA}$blocks_hight${NC}" -network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo getinfo 2> /dev/null | jq '.info.blocks') +network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo getinfo | jq '.info.blocks' 2> /dev/null) #network_height_02=$(curl -sk -m 5 https://explorer.flux.zelcore.io/api/status?q=getInfo | jq '.info.blocks') -network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo 2> /dev/null | jq '.info.blocks') +network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo | jq '.info.blocks' 2> /dev/null) explorer_network_hight=$(max "$network_height_01" "$network_height_03") block_diff=$((explorer_network_hight-blocks_hight)) -if [[ "$explorer_network_hight" != "" ]]; then +if [[ "$explorer_network_hight" != "0" ]]; then if [[ "$block_diff" < 10 ]]; then echo -e "${PIN} ${CYAN}Status: ${GREEN}synced${NC}" @@ -595,7 +595,7 @@ echo -e "${ARROW} ${CYAN}$flux_communication${NC}" echo -e "" fi -if [[ "$explorer_network_hight" != "" ]]; then +if [[ "$explorer_network_hight" != "0" ]]; then echo -e "${BOOK} ${YELLOW}Checking collateral:${NC}" txhash=$(grep -o "\w*" <<< "$collateral") From c9ea14804ac995252c8daa2f4bdedad2857677e7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 Jan 2022 19:24:45 +0100 Subject: [PATCH 0145/1176] replaced status by info --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index a57c1b44..1fdc8acd 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -543,7 +543,7 @@ if [[ "$explorer_network_hight" != "0" ]]; then else - echo -e "${PIN} ${CYAN}Status: ${RED}sync check skipped...${NC}" + echo -e "${PIN} ${CYAN}Info: ${RED}sync check skipped...${NC}" fi From 60b48c6acfb8834dd58aa6b201ad4b8d75b4b2d0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 9 Jan 2022 10:35:19 +0100 Subject: [PATCH 0146/1176] Update multitoolbox.sh --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 0e7ae83f..6c1f46d6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1837,7 +1837,7 @@ apps_id=$(docker run -d \ --name fluxwatchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ ---label-enable --cleanup --interval $random 2> /dev/null) +--cleanup --interval $random 2> /dev/null) if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then echo -e "${ARROW} ${CYAN}FluxWatchtower installed successful, id: ${GREEN}$apps_id${NC}" else From 36448e7b7842f3b4c29284f3a3a2129981228824 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 14 Jan 2022 11:36:31 +0100 Subject: [PATCH 0147/1176] Update nodeanalizerandfixer.sh --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 1fdc8acd..35d8fc7c 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -611,7 +611,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then #collateral_index=$(awk '{print $1}' <<< "$stak_info") stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') - if [[ "$stak_info" != "" ]]; then + if [[ "$stak_info" == "" ]]; then stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') fi From 7b9f716dc9f1b4fa45bf1ea0cd8d47ec692330cf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 14 Jan 2022 12:42:54 +0100 Subject: [PATCH 0148/1176] function update - added Recover corrupted MongoDB database module - added fluxwatchtower restart flage --- multitoolbox.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6c1f46d6..2be75562 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1834,6 +1834,7 @@ echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" random=$(shuf -i 7500-35000 -n 1) echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" apps_id=$(docker run -d \ +--restart unless-stopped \ --name fluxwatchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ @@ -1846,6 +1847,24 @@ fi } + + function mongod_db_fix() { + echo -e "${GREEN}Module: Recover corrupted MongoDB database${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" ]] + then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "" + sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair + + } function selfhosting() { @@ -2000,6 +2019,7 @@ echo -e "${CYAN}11 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}12 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}13 - Replace Zel ID ${NC}" echo -e "${CYAN}14 - Install containrrr/watchtower for docker image autoupdate${NC}" +echo -e "${CYAN}15 - Recover corrupted MongoDB database${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -2088,6 +2108,13 @@ read -rp "Pick an option and hit ENTER: " echo -e "" ;; + 15) + clear + sleep 1 + mongod_db_fix + echo -e "" + ;; + # 8) #clear From 14c31e1178e0ed40fdb944c1e30b3ed5b2ba2dcd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:39:59 +0100 Subject: [PATCH 0149/1176] Minor edits --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 2be75562..4568ae05 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1804,7 +1804,7 @@ while true function install_watchtower(){ - echo -e "${GREEN}Module: Install containrrr/watchtower for docker image autoupdate${NC}" + echo -e "${GREEN}Module: Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" ]] @@ -2018,7 +2018,7 @@ echo -e "${CYAN}10 - Restore Kadena node blockchain from bootstrap${NC}" echo -e "${CYAN}11 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}12 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}13 - Replace Zel ID ${NC}" -echo -e "${CYAN}14 - Install containrrr/watchtower for docker image autoupdate${NC}" +echo -e "${CYAN}14 - Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${CYAN}15 - Recover corrupted MongoDB database${NC}" echo -e "${YELLOW}================================================================${NC}" From 55923260533d27b50fec7b1896e086372f5f8410 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 15 Jan 2022 12:38:18 +0100 Subject: [PATCH 0150/1176] disable explorer error output --- install_pro.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 3883cc49..394a1725 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1929,8 +1929,8 @@ else while true do - network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') - network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') + network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") @@ -1967,8 +1967,8 @@ else MSG2='' spinning_timer - network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') - network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') + network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") From 35305efdd90bbacf8d09fcb7afc4556ff9f62209 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 16 Jan 2022 11:45:14 +0100 Subject: [PATCH 0151/1176] removed externalip from daemon reconfiguration --- multitoolbox.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4568ae05..5148c8d3 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1522,15 +1522,15 @@ fi echo echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" sleep 4 -skip_change='4' +skip_change='3' zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" sleep 1 zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output TX ID" 8 72 3>&1 1>&2 2>&3)" sleep 1 zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" sleep 1 -externalip="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode IP" 8 60 3>&1 1>&2 2>&3)" -sleep 1 +#externalip="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode IP" 8 60 3>&1 1>&2 2>&3)" +#sleep 1 if [[ "$zelnodeprivkey" == "" ]]; then skip_change=$((skip_change-1)) @@ -1547,10 +1547,10 @@ skip_change=$((skip_change-1)) echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" fi -if [[ "$externalip" == "" ]]; then -skip_change=$((skip_change-1)) -echo -e "${ARROW} ${CYAN}Replace FluxNode IP skipped.........................[${CHECK_MARK}${CYAN}]${NC}" -fi +#if [[ "$externalip" == "" ]]; then +#skip_change=$((skip_change-1)) +#echo -e "${ARROW} ${CYAN}Replace FluxNode IP skipped.........................[${CHECK_MARK}${CYAN}]${NC}" +#fi if [[ "$skip_change" == "0" ]]; then @@ -1604,18 +1604,18 @@ fi fi -if [[ "$externalip" != "" ]]; then +#if [[ "$externalip" != "" ]]; then -if [[ "externalip=$externalip" == $(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -echo -e "${ARROW} ${CYAN}Replace FluxNode IP skipped.........................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE)/externalip=$externalip/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "externalip=$externalip" == $(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode IP replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" +#if [[ "externalip=$externalip" == $(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then +#echo -e "${ARROW} ${CYAN}Replace FluxNode IP skipped.........................[${CHECK_MARK}${CYAN}]${NC}" + # else + # sed -i "s/$(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE)/externalip=$externalip/" ~/$CONFIG_DIR/$CONFIG_FILE + #if [[ "externalip=$externalip" == $(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + # echo -e "${ARROW} ${CYAN}FluxNode IP replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" - fi -fi -fi + # fi +#fi +#fi pm2 restart flux > /dev/null 2>&1 sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 From 52eb85de17185b10b8eaec23251b3c790283649a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 16 Jan 2022 17:43:42 +0100 Subject: [PATCH 0152/1176] block ubuntu user on all module --- multitoolbox.sh | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5148c8d3..5b3a051c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -286,8 +286,7 @@ function install_flux() { echo -e "${GREEN}Module: Re-install FluxOS${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" ]] -then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -486,8 +485,7 @@ fi } function create_config() { -if [[ "$USER" == "root" ]] -then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -671,8 +669,7 @@ echo function install_watchdog() { -if [[ "$USER" == "root" ]] -then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -933,7 +930,7 @@ function kda_bootstrap() { echo -e "${GREEN}Module: Restore Kadena node blockchain from bootstrap${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" @@ -1038,7 +1035,7 @@ function flux_daemon_bootstrap() { echo -e "${GREEN}Module: Restore Flux blockchain from bootstrap${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" @@ -1161,7 +1158,7 @@ echo -e "${ARROW} ${CYAN}Module disabled...${NC}" echo -e "" exit -if [[ "$USER" == "root" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1340,8 +1337,7 @@ function analyzer_and_fixer(){ echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]] -then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1360,8 +1356,7 @@ function install_node(){ echo -e "${GREEN}Module: Install FluxNode${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" ]] -then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1397,8 +1392,7 @@ function install_docker(){ echo -e "${GREEN}Module: Install Docker${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" != "root" ]] -then +if [[ "$USER" != "root" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the root account use command 'su -'.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1510,8 +1504,7 @@ function daemon_reconfiguration() echo -e "${GREEN}Module: Flux Daemon Reconfiguration${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" ]] -then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1715,8 +1708,7 @@ function create_service() { echo -e "${GREEN}Module: Flux Daemon service creator${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" ]] - then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1765,8 +1757,7 @@ function replace_zelid() { echo -e "${GREEN}Module: Replace Zel ID${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" ]] - then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1807,8 +1798,7 @@ while true echo -e "${GREEN}Module: Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" ]] - then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1871,8 +1861,7 @@ fi echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" ]] - then +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" From 84ae12acff0cf49430a2205801053a18eb2c5b35 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 16 Jan 2022 17:51:40 +0100 Subject: [PATCH 0153/1176] block admin user on all module --- multitoolbox.sh | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5b3a051c..8d61cab4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -485,7 +485,7 @@ fi } function create_config() { -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -669,7 +669,7 @@ echo function install_watchdog() { -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -930,8 +930,7 @@ function kda_bootstrap() { echo -e "${GREEN}Module: Restore Kadena node blockchain from bootstrap${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then - +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1035,8 +1034,7 @@ function flux_daemon_bootstrap() { echo -e "${GREEN}Module: Restore Flux blockchain from bootstrap${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then - + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1158,7 +1156,7 @@ echo -e "${ARROW} ${CYAN}Module disabled...${NC}" echo -e "" exit -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1337,7 +1335,7 @@ function analyzer_and_fixer(){ echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1356,7 +1354,7 @@ function install_node(){ echo -e "${GREEN}Module: Install FluxNode${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1504,7 +1502,7 @@ function daemon_reconfiguration() echo -e "${GREEN}Module: Flux Daemon Reconfiguration${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1708,7 +1706,7 @@ function create_service() { echo -e "${GREEN}Module: Flux Daemon service creator${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1757,7 +1755,7 @@ function replace_zelid() { echo -e "${GREEN}Module: Replace Zel ID${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1798,7 +1796,7 @@ while true echo -e "${GREEN}Module: Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1842,7 +1840,7 @@ fi echo -e "${GREEN}Module: Recover corrupted MongoDB database${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" ]] + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" @@ -1861,7 +1859,7 @@ fi echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" From 45b1c8fa4e7f4986d9651d2e5b5289a968b0ac29 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 16 Jan 2022 18:43:52 +0100 Subject: [PATCH 0154/1176] fix --- multitoolbox.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8d61cab4..907e7dc3 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1841,7 +1841,6 @@ fi echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" From 817c1bc1152d57b2d726e311c751f3a7f303bb7a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 16 Jan 2022 20:29:17 +0100 Subject: [PATCH 0155/1176] dump version --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 907e7dc3..86a42f4f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -38,7 +38,7 @@ ARROW="${SEA}\xE2\x96\xB6${NC}" BOOK="${RED}\xF0\x9F\x93\x8B${NC}" HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -dversion="v5.0" +dversion="v6.0" PM2_INSTALL="0" zelflux_setting_import="0" @@ -1988,7 +1988,7 @@ figlet -f slant "Multitoolbox" echo -e "${YELLOW}================================================================${NC}" echo -e "${GREEN}Version: $dversion${NC}" echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" -echo -e "${GREEN}Created by: XK4MiLX from Flux's team${NC}" +echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" echo -e "${GREEN}Special thanks to dk808, CryptoWrench && jriggs28${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${CYAN}1 - Install Docker${NC}" From 6ba237748f9c2e08dcfb232f1d754529f3c1cb6c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 16 Jan 2022 20:32:17 +0100 Subject: [PATCH 0156/1176] new menu --- image/v6.png | Bin 0 -> 22065 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 image/v6.png diff --git a/image/v6.png b/image/v6.png new file mode 100644 index 0000000000000000000000000000000000000000..92495a25ffc8870080e088fb0f1c31c0321ded0f GIT binary patch literal 22065 zcmd3OXH?To@NN_p8z4$kn$kNWYUoi>s(^s>rYImFgidIQqEZD!no3iu^eTu1Vxd>* zJpn?9)DS`lq~73r-+wvxf6uue?*~r!{my1*W_Nb?nP+Abd(T*x?c{}%004kZU+=aV z0B~3w05~*s{4n#4+LEIJ^W%`eneHt><$%Bn^WliwO{1FtKuyvq>cgYV=Mz49HvRwr z`>%t)L!IEyj{yLS4*lCV??W6nvRf+Ufqpnaqvh|%j#XdmrW}&c41IRuNWx{j*x@5? zlGD$Q`IO&y&YcJ_y4sY*E^+VAd=BrMyp*ZXNcE}yh%#%jOks{aPyTDJ{Y4~|Okz;VP;?~tS=bGut)$$5><&7ag!otk0La7u zAH2#ip_eflx_iO&?J^jp$_XuW3h>dH1R*SdVf)c2Ml)*iwmNcF!Rej28&5uYJp*Py~qg})bLJeBlhYW4y4!Z!-t-@OhCG#-Ni^rmEycQsC! zq5I|b-PCPnD3ASB7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XY(>|oiyrJJ=`HlYu=+q_6`2Hg22rrgYe?Z-|Orae6AxO}!(f2@si1r#Y z{Gfn%sTx(}-Vw#MAzVjZnkYA8>ey`5w_{)Vxb6x3u23vN%d7y3HS*EefrqG*@y%`X zLvp4HWNV6!%2`|b@IowuCDPIw&-v9rc*!kusnXx|o&&DQ^J=@ekXlG=ksb@FJ!UV( z=`5GeAura|S|~J(=L-GT@IKh{eS~|W@DVPIHQHIIj*7q|GaUZJNkME;*8xHA6`U1> z;QMu=3SP=_aAfSKM*Zc6#w~})qhp?$K2NmNOeNOx*3PJ8NzcAj1q8!?|CuMBYuW6S zeRbx9wH4PDK8u;N#}Gcb=qXAEqspJb_NoQd&~7Oe^>(6HQa0q=7!_h8;lK0zP!p?Q zL97O({6Us>$(~dNLghXDZg&CEWyBEg_vE}Z8U+@Z3GUnTz4!=sj@+zFra`RR1+&D2 z(zWtC50}lME{%b53X8Nb*YK09en#pd#0FO3K2hm1Qu->VZ6du;)){iMsrs>gk6G|dYeMiUS!=63*+j^AO2z=D^=+tY*MwYIJX}!j$ zr3#Ybr%CSjTjL?~NWnW!U(XqhV90_C2HJtqIAyrC4jLko{R)BLv z2EI>>^EHNE5=2c6a^x`)C$j=Zot~o^;{9B5ZqDpYDYM6hy_`3um4aE%+lTsWkEO0Mzx3=woZ}!YuHl8}RS>LTvas0-azhV$@ z*s@jSXd$Kk88!)c+fBQ_p9VN!C}jK-WL>HIDc%3b^ZpNRs5MYNyPB_9vMgD3z}Gqg QxTk=bvDMY8D}TiP8!nm{&Hw-a literal 0 HcmV?d00001 From 84c9e80a794ee45321273385b03ee59f376c0432 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 16 Jan 2022 20:33:08 +0100 Subject: [PATCH 0157/1176] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62a8abf2..bfb111a2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ```bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` 2) MENU: -![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/new_menu_v3.jpg) +![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/v6.png) 3) HOW USE MULTITOOLBOX TO SETUP FLUXNODE: https://medium.com/zelinsights/zelnode-setup-the-easy-peasy-lemon-squeezy-way-fd89706ea03c
From 13dc1acc7d85f7f6fed64c9d58005ef80d95433b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 17 Jan 2022 06:34:24 +0100 Subject: [PATCH 0158/1176] Minor edits --- multitoolbox.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 86a42f4f..dcb59580 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1793,7 +1793,7 @@ while true function install_watchtower(){ - echo -e "${GREEN}Module: Install fluxwatchtower for docker images autoupdate${NC}" + echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then @@ -1805,15 +1805,15 @@ if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then fi echo -e "" -echo -e "${ARROW} ${CYAN}Checking if fluxwatchtower is installed....${NC}" -apps_check=$(docker ps | grep "fluxwatchtower") +echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" +apps_check=$(docker ps | grep "flux_watchtower") if [[ "$apps_check" != "" ]]; then -echo -e "${ARROW} ${CYAN}Stopping fluxwatchtower...${NC}" -docker stop fluxwatchtower > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" +docker stop flux_watchtower > /dev/null 2>&1 sleep 2 -echo -e "${ARROW} ${CYAN}Removing fluxwatchtower...${NC}" -docker rm fluxwatchtower > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" +docker rm flux_watchtower > /dev/null 2>&1 fi echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" @@ -1823,14 +1823,14 @@ random=$(shuf -i 7500-35000 -n 1) echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" apps_id=$(docker run -d \ --restart unless-stopped \ ---name fluxwatchtower \ +--name flux_watchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ --cleanup --interval $random 2> /dev/null) if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then -echo -e "${ARROW} ${CYAN}FluxWatchtower installed successful, id: ${GREEN}$apps_id${NC}" +echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" else -echo -e "${ARROW} ${CYAN}FluxWatchtower installion failed...${NC}" +echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" fi } From a07dced7b5a7be8c9f5ee5525fe2436eacf945bd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 18 Jan 2022 22:16:50 +0100 Subject: [PATCH 0159/1176] fix multi user detection --- nodeanalizerandfixer.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 35d8fc7c..ba7d8225 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -369,6 +369,14 @@ fi #echo fi +usercheck=$(getent group docker) +if [[ "$usercheck" =~ "," ]]; then +echo -e "" +echo -e "${WORNING} ${CYAN} Detected multiple users in docker group...${NC}" +echo -e "${WORNING} ${CYAN} More then one instance of flux daemon will cause it to malfunction...${NC}" +echo -e "${WORNING} ${CYAN} If u installed FluxOS on more then one user you need delete one instance of it...${NC}" +echo -e "" +fi if [[ "$($BENCH_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then @@ -444,14 +452,7 @@ fi if [[ "$bench_back" == "disconnected" ]]; then echo -e "${X_MARK} ${CYAN} FluxBack does not work properly${NC}" -usercheck=$(getent group docker) -if [[ "$usercheck" =~ "," ]]; then -echo -e "" -echo -e "${WORNING} ${CYAN} Detected multiple users in docker group...${NC}" -echo -e "${WORNING} ${CYAN} More then one instance of flux daemon will cause it to malfunction...${NC}" -echo -e "${WORNING} ${CYAN} If u installed FluxOS on more then one user you need delete one instance of it...${NC}" -echo -e "" -fi + WANIP=$(wget http://ipecho.net/plain -O - -q) if [[ "$WANIP" == "" ]]; then From 17ded48d8a673759356a5219d47cfb834da36cb4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 24 Jan 2022 08:56:50 +0100 Subject: [PATCH 0160/1176] Update multitoolbox.sh --- multitoolbox.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index dcb59580..156a5bf8 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1044,6 +1044,7 @@ function flux_daemon_bootstrap() { cd echo -e "${NC}" + pm2 stop watchdog > /dev/null 2>&1 && sleep 2 echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 @@ -1146,6 +1147,7 @@ function flux_daemon_bootstrap() { MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" spinning_timer echo -e "" && echo -e "" + pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 } function mongodb_bootstrap(){ From f3a6fc37ab919a3d3a17c7d2ea9db7bb5baff7a4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 24 Jan 2022 11:24:32 +0100 Subject: [PATCH 0161/1176] fix external source name added full path --- multitoolbox.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 156a5bf8..2994defd 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1049,9 +1049,9 @@ function flux_daemon_bootstrap() { sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 - if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then + if [[ -e /home/$USER/$CONFIG_DIR/blocks ]] && [[ -e /home/$USER/$CONFIG_DIR/chainstate ]]; then echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes + rm -rf /home/$USER/$CONFIG_DIR/blocks /home/$USER/$CONFIG_DIR/chainstate /home/$USER/$CONFIG_DIR/determ_zelnodes fi BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" @@ -1122,6 +1122,11 @@ function flux_daemon_bootstrap() { BOOTSTRAP_ZIP="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" + + if [[ "$BOOTSTRAP_ZIPFILE" != *".zip"* ]]; then + BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' + fi + wget -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then From 8bf60ac5cbf0fed88c844b9a483c46e2deddf469 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 28 Jan 2022 07:57:09 +0100 Subject: [PATCH 0162/1176] added logs file rotate for Docker --- install_pro.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_pro.sh b/install_pro.sh index 394a1725..036a3592 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2259,5 +2259,6 @@ fi log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" log_rotate "Flux daemon" "daemon_debug_log" "/home/$USER/$CONFIG_DIR/debug.log" "daily" "7" log_rotate "MongoDB" "mongod_debug_log" "/var/log/mongodb/*.log" "daily" "14" + log_rotate "Docker" "docker_debug_log" "/var/lib/docker/containers/*/*.log" "daily" "7" basic_security status_loop From 4d6a1c762d9fba6cf383333acec93bf7d5789630 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 2 Feb 2022 17:55:00 +0100 Subject: [PATCH 0163/1176] added support for Ubuntu impish --- install_pro.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 036a3592..927e75e1 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1125,9 +1125,14 @@ else # cleaning sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - + + if [[ "$(lsb_release -cs)" == "impish" ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + fi + + # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 From b50e910dded491730425e23bbdd3bd092978fc3b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 2 Feb 2022 19:26:54 +0100 Subject: [PATCH 0164/1176] replaced kda bootstrap --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 2994defd..da3e44ad 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -5,7 +5,7 @@ BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' KDA_BOOTSTRAP_ZIPFILE='kda_bootstrap.tar.gz' -KDA_BOOTSTRAP_ZIP='https://fluxnodeservice.com/kda_bootstrap.tar.gz' +KDA_BOOTSTRAP_ZIP='http://202.61.207.10:16127/apps/fluxshare/getfile/kda_bootstrap.tar.gz?token=a705701758411b28ea20325ef9654e31e3d8f5f03a24b4e4e662e601a1250859' if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' From 29b262022aa3205d32d7631d9055ee0c2de56b0c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Feb 2022 20:50:17 +0100 Subject: [PATCH 0165/1176] testnet --- install_pro.sh => install_pro_testnet.sh | 35 ++++++++---------------- 1 file changed, 11 insertions(+), 24 deletions(-) rename install_pro.sh => install_pro_testnet.sh (99%) diff --git a/install_pro.sh b/install_pro_testnet.sh similarity index 99% rename from install_pro.sh rename to install_pro_testnet.sh index 927e75e1..adbc7f0f 100644 --- a/install_pro.sh +++ b/install_pro_testnet.sh @@ -1053,33 +1053,11 @@ zelnodeindex=$zelnodeindex server=1 daemon=1 txindex=1 +testnet=1 listen=1 externalip=$WANIP bind=0.0.0.0 -addnode=explorer.zelcash.online -addnode=explorer.runonflux.io -addnode=blockbook.runonflux.io -addnode=185.225.232.141:16125 -addnode=95.216.124.220:16125 -addnode=209.145.55.52:16125 -addnode=78.113.97.147:16125 -addnode=209.145.49.181:16125 -addnode=63.250.53.25:16125 -addnode=5.9.78.207:16125 -addnode=194.163.148.252:16125 -addnode=178.18.241.199:16125 -addnode=178.18.241.197:16125 -addnode=178.18.243.34:16125 -addnode=62.171.188.152:16125 -addnode=194.163.166.101:16125 -addnode=23.88.19.178:16125 -addnode=79.143.178.170:16125 -addnode=178.18.249.115:16125 -addnode=161.97.131.154:16125 -addnode=149.255.39.17:16125 - - - +addnode=testnet.runonflux.io maxconnections=256 EOF sleep 2 @@ -1166,6 +1144,9 @@ else fi + + + } @@ -1371,6 +1352,12 @@ function bootstrap() { fi fi + + +wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp +tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp \ +mv /tmp/fluxd /usr/local/bin +mv /tmp/flux-cli /usr/local/bin } From ef875df3a7cdb8ce7bf1ef475a6392295e6fc963 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Feb 2022 21:04:02 +0100 Subject: [PATCH 0166/1176] disable watchdog --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index adbc7f0f..8fb365cf 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -2008,7 +2008,7 @@ else #if [[ -z "$watchdog" ]]; then #if whiptail --yesno "Would you like to install watchdog for FluxNode?" 8 60; then - install_watchdog + #install_watchdog # else # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" # fi From 6bccdfa05a0dbc6bbde79c1114affa497b6ffeb1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Feb 2022 21:21:32 +0100 Subject: [PATCH 0167/1176] added node_halvening branch --- install_pro_testnet.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 8fb365cf..7ac425ae 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1792,6 +1792,10 @@ fi echo -e "${ARROW} ${YELLOW}Flux installing...${NC}" git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 + cd zelflux + echo -e "${ARROW} ${YELLOW}Changing to test branch...${NC}" + git checkout node_halvening + cd echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" From f6db29e27fbff7b5c8f8d77932262f58644972a3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Feb 2022 23:00:48 +0100 Subject: [PATCH 0168/1176] Create install_pro.sh --- install_pro.sh | 2277 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2277 insertions(+) create mode 100644 install_pro.sh diff --git a/install_pro.sh b/install_pro.sh new file mode 100644 index 00000000..b7cf29e2 --- /dev/null +++ b/install_pro.sh @@ -0,0 +1,2277 @@ +#!/bin/bash +# Bootstrap settings +BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' +BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' +BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' +BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' + +#wallet information +COIN_NAME='flux' +CONFIG_DIR='.flux' +CONFIG_FILE='flux.conf' + +BENCH_NAME='fluxbench' +BENCH_CLI='fluxbench-cli' +BENCH_DIR_LOG='.fluxbenchmark' + +COIN_DAEMON='fluxd' +COIN_CLI='flux-cli' +COIN_PATH='/usr/local/bin' + +USERNAME="$(whoami)" +FLUX_DIR='zelflux' + +#Install variable +IMPORT_ZELCONF="0" +IMPORT_ZELID="0" +CORRUPTED="0" +BOOTSTRAP_SKIP="0" +WATCHDOG_INSTALL="0" + +#Zelflux ports +ZELFRONTPORT=16126 +LOCPORT=16127 +ZELNODEPORT=16128 +#MDBPORT=27017 +RPCPORT=16124 +PORT=16125 + +#color codes +RED='\033[1;31m' +YELLOW='\033[1;33m' +BLUE="\\033[38;5;27m" +SEA="\\033[38;5;49m" +GREEN='\033[1;32m' +CYAN='\033[1;36m' +NC='\033[0m' + +#emoji codes +CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" +X_MARK="${RED}\xE2\x9C\x96${NC}" +PIN="${RED}\xF0\x9F\x93\x8C${NC}" +CLOCK="${GREEN}\xE2\x8C\x9B${NC}" +ARROW="${SEA}\xE2\x96\xB6${NC}" +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + +#dialog color +export NEWT_COLORS=' +title=black, +' +function string_limit_check_mark() { +if [[ -z "$2" ]]; then +string="$1" +string=${string::40} +else +string=$1 +string_color=$2 +string_leght=${#string} +string_leght_color=${#string_color} +string_diff=$((string_leght_color-string_leght)) +string=${string_color::40+string_diff} +fi +echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" +} + + function selfhosting() { + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" + echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + else + echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 + echo -e "" + exit + fi + +echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 +sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 +sudo touch /home/$USER/ip_check.sh +sudo chown $USER:$USER /home/$USER/ip_check.sh + cat <<'EOF' > /home/$USER/ip_check.sh +#!/bin/bash +function get_ip(){ + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi +} +if [[ $1 == "restart" ]]; then + # give 3min to connect with internet + sleep 180 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi +fi +if [[ $1 == "ip_check" ]]; then + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + confirmed_ip=$(curl -SsL -m 10 http://localhost:16127/flux/info | jq -r .data.node.status.ip) + if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then + if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + fi +fi +EOF + +sudo chmod +x /home/$USER/ip_check.sh +echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 + +crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) + +if [[ "$crontab_check" == "0" ]]; then + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" +else + echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" +fi +echo -e "" + } + + +function max(){ + + m="0" + for n in "$@" + do + if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then + [ "$n" -gt "$m" ] && m="$n" + fi + done + + echo "$m" + +} + +function string_limit_x_mark() { +if [[ -z "$2" ]]; then +string="$1" +string=${string::40} +else +string=$1 +string_color=$2 +string_leght=${#string} +string_leght_color=${#string_color} +string_diff=$((string_leght_color-string_leght)) +string=${string_color::40+string_diff} +fi +echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" +} + + +function integration_check() { +FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) +ELEMENTS=${#FILE_ARRAY[@]} + +for (( i=0;i<$ELEMENTS;i++)); do + +string="${FILE_ARRAY[${i}]}................................." +string=${string::40} + +if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then + echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" +else + echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" + CORRUPTED="1" +fi + +done + +if [[ "$CORRUPTED" == "1" ]]; then + echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" + echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" + echo + exit +fi +echo -e "" +} + + +function config_file() { + +if [[ -f /home/$USER/install_conf.json ]]; then +import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') +ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') +firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') +bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') +bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') +swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') +#mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') +watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') +use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') +prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') +outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') +index=$(cat /home/$USER/install_conf.json | jq -r '.index') +ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') +KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + +echo +echo -e "${ARROW} ${YELLOW}Install config:" + +if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then +echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else + +if [[ "$import_settings" == "1" ]]; then +echo -e "${PIN}${CYAN} Import settings from Flux..............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +fi + +if [[ "$ssh_port" != "" ]]; then +echo -e "${PIN}${CYAN} SSH port set.....................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +if [[ "$firewall_disable" == "1" ]]; then +echo -e "${PIN}${CYAN} Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN} Firewall enabled diuring installation............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +if [[ "$use_old_chain" == "1" ]]; then +echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + +else + +if [[ "$bootstrap_url" == "" ]]; then +echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +if [[ "$bootstrap_zip_del" == "1" ]]; then +echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +fi + +if [[ "$swapon" == "1" ]]; then +echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +#if [[ "$mongo_bootstrap" == "1" ]]; then +#echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +#fi + +if [[ "$watchdog" == "1" ]]; then +echo -e "${PIN}${CYAN} Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + + + +fi +} + +function round() { + printf "%.${2}f" "${1}" +} + +function check_benchmarks() { + + var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") + limit=$2 + if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]] + then + var_round=$(round "$var_benchmark" 2) + echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" + fi + +} + +function import_date() { + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then + + if [[ -z "$import_settings" ]]; then + + if whiptail --yesno "Would you like to import data from Flux config files Y/N?" 8 60; then + + OLD_CONFIG=0 + + if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + OLD_CONFIG=1 + fi + + IMPORT_ZELCONF="1" + echo + echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 + + if [[ "$OLD_CONFIG" == "1" ]]; then + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' + fi + + if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + + ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 + IMPORT_ZELID="1" + fi + + KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 + fi + + fi + fi + +else + + if [[ "$import_settings" == "1" ]]; then + + OLD_CONFIG=0 + + if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + OLD_CONFIG=1 + fi + + IMPORT_ZELCONF="1" + echo + echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 + + if [[ "$OLD_CONFIG" == "1" ]]; then + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' + fi + + + if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + + ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 + IMPORT_ZELID="1" + fi + + KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 + fi + fi + fi + + fi +fi +sleep 1 +echo +} + +function tar_file_unpack() +{ + echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" + pv $1 | tar -zx -C $2 +} + + +function check_tar() +{ + echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" + + if gzip -t "$1" &>/dev/null; then + + echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" + + else + + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $1 + + fi +} + + +function install_watchdog() { +echo -e "${ARROW} ${YELLOW}Install watchdog for FluxNode${NC}" +if pm2 -v > /dev/null 2>&1 +then +WATCHDOG_INSTALL="1" +echo -e "${ARROW} ${YELLOW}Downloading...${NC}" +cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 +echo -e "${ARROW} ${YELLOW}Installing git hooks....${NC}" +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 +mv post-merge /home/$USER/watchdog/.git/hooks/post-merge +sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge +echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" +cd watchdog && npm install > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Creating config file....${NC}" + +#if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then +flux_update='1' +#sleep 1 +#else +#lux_update='0' +#sleep 1 +#fi + +#if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then +daemon_update='1' +#sleep 1 +#else +#daemon_update='0' +#sleep 1 +#fi + +#if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then +bench_update='1' +#sleep 1 +#else +#bench_update='0' +#sleep 1 +#fi + +#if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then +fix_action='1' +#sleep 1 +#else +#fix_action='0' +#sleep 1 +#fi + +telegram_alert=0; +discord=0; + +if whiptail --yesno "Would you like enable alert notification?" 8 60; then + +sleep 1 + +whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 + +sleep 1 + +CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + +if [ -z "$CHOICES" ]; then + + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" + sleep 1 + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + node_label=0; + +else + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") + + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + else + ping=0; + sleep 1 + fi + + ;; + "2") + + telegram_alert=1; + + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + ;; + esac + done +fi + + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + +else + + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + node_label=0; + sleep 1 +fi + + +if [[ "$discord" == 0 ]]; then + ping=0; +fi + + +if [[ "$telegram_alert" == 0 ]]; then + telegram_bot_token=0; + telegram_chat_id=0; +fi + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + fi +fi + +if [[ $stak_info == ?(-)+([0-9]) ]]; then + + case $stak_info in + "10000") eps_limit=90 ;; + "25000") eps_limit=180 ;; + "100000") eps_limit=300 ;; + esac + +else +eps_limit=0; +fi + + +sudo touch /home/$USER/watchdog/config.js +sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js +module.exports = { + label: '${node_label}', + tier_eps_min: '${eps_limit}', + zelflux_update: '${flux_update}', + zelcash_update: '${daemon_update}', + zelbench_update: '${bench_update}', + action: '${fix_action}', + ping: '${ping}', + web_hook_url: '${discord}', + telegram_alert: '${telegram_alert}', + telegram_bot_token: '${telegram_bot_token}', + telegram_chat_id: '${telegram_chat_id}' +} +EOF + +echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" +pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 +pm2 save > /dev/null 2>&1 +if [[ -f /home/$USER/watchdog/watchdog.js ]] +then +current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) +#echo -e "${ARROW} ${CYAN}Watchdog ${GREEN}v$current_ver${CYAN} installed successful.${NC}" +string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." +else +#echo -e "${ARROW} ${CYAN}Watchdog installion failed.${NC}" +string_limit_x_mark "Watchdog was not installed................................." +fi +else +#echo -e "${ARROW} ${CYAN}Watchdog installion failed.${NC}" +string_limit_x_mark "Watchdog was not installed................................." +fi +} + +function mongodb_bootstrap(){ + + echo -e "" + echo -e "${ARROW} ${YELLOW}Restore mongodb datatable from bootstrap${NC}" + + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') + fi + + #BLOCKHIGHT=$(curl -s -m 6 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') + echo -e "${ARROW} ${CYAN}Bootstrap block height: ${GREEN}$DB_HIGHT${NC}" + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" + wget --tries=5 $BOOTSTRAP_URL_MONGOD -q --show-progress + + if [[ -f /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD ]]; then + + echo -e "${ARROW} ${CYAN}Unpacking...${NC}" + tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" + mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 + sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 + + + BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) + echo -e ${ARROW} ${CYAN}Node block height after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC} + + else + + echo -e "${ARROW} ${RED}MongoDB bootstrap server offline...try again later use option 5${NC}" + fi + + echo -e "" + + #if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then + #echo -e "${ARROW} ${CYAN}Mongo bootstrap installed successful.${NC}" + #echo -e "" + # else + # echo -e "${ARROW} ${CYAN}Mongo bootstrap installation failed.${NC}" + # echo -e "" + # fi + +} + +function wipe_clean() { + echo -e "${ARROW} ${YELLOW}Removing any instances of FluxNode${NC}" + apt_number=$(ps aux | grep 'apt' | wc -l) + + if [[ "$apt_number" > 1 ]]; then + + sudo killall apt > /dev/null 2>&1 + sudo killall apt-get > /dev/null 2>&1 + sudo dpkg --configure -a > /dev/null 2>&1 + + fi + + echo -e "${ARROW} ${CYAN}Stopping all services and running processes...${NC}" + + # NEW CLEAN_UP + + sudo killall nano > /dev/null 2>&1 + $COIN_CLI stop > /dev/null 2>&1 && sleep 2 + sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 + sudo killall -s SIGKILL $COIN_DAEMON > /dev/null 2>&1 && sleep 2 + $BENCH_CLI stop > /dev/null 2>&1 && sleep 2 + sudo killall -s SIGKILL $BENCH_NAME > /dev/null 2>&1 && sleep 1 + sudo fuser -k 16127/tcp > /dev/null 2>&1 && sleep 1 + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + sudo rm -rf /usr/bin/flux* > /dev/null 2>&1 && sleep 1 + + echo -e "${ARROW} ${CYAN}Removing daemon && benchmark...${NC}" + sudo apt-get remove $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 + sudo apt-get purge $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 + sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 + sudo rm -rf /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 + tmux kill-server > /dev/null 2>&1 && sleep 1 + + echo -e "${ARROW} ${CYAN}Removing PM2...${NC}" + pm2 del zelflux > /dev/null 2>&1 && sleep 1 + pm2 del flux > /dev/null 2>&1 && sleep 1 + pm2 del watchdog > /dev/null 2>&1 && sleep 1 + pm2 save > /dev/null 2>&1 + pm2 unstartup > /dev/null 2>&1 && sleep 1 + pm2 flush > /dev/null 2>&1 && sleep 1 + pm2 save > /dev/null 2>&1 && sleep 1 + pm2 kill > /dev/null 2>&1 && sleep 1 + npm remove pm2 -g > /dev/null 2>&1 && sleep 1 + + echo -e "${ARROW} ${CYAN}Removing others files and scripts...${NC}" + sudo rm -rf watchgod > /dev/null 2>&1 && sleep 1 + sudo rm -rf $BENCH_DIR_LOG && sleep 1 + + #FILE OF OLD ZEL NODE + sudo rm -rf /etc/logrotate.d/mongolog > /dev/null 2>&1 + sudo rm -rf /etc/logrotate.d/zeldebuglog > /dev/null 2>&1 + rm update.sh > /dev/null 2>&1 + rm restart_zelflux.sh > /dev/null 2>&1 + rm zelnodeupdate.sh > /dev/null 2>&1 + rm start.sh > /dev/null 2>&1 + rm update-zelflux.sh > /dev/null 2>&1 + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + zelcash-cli stop > /dev/null 2>&1 && sleep 2 + sudo killall -s SIGKILL zelcashd > /dev/null 2>&1 + zelbench-cli stop > /dev/null 2>&1 + sudo killall -s SIGKILL zelbenchd > /dev/null 2>&1 + sudo rm /usr/local/bin/zel* > /dev/null 2>&1 && sleep 1 + sudo apt-get purge zelcash zelbench -y > /dev/null 2>&1 && sleep 1 + sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 + sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 + sudo rm -rf zelflux > /dev/null 2>&1 && sleep 1 + #sudo rm -rf ~/.zelcash/determ_zelnodes ~/.zelcash/sporks ~/$CONFIG_DIR/database ~/.zelcash/blocks ~/.zelcashchainstate > /dev/null 2>&1 && sleep 1 + #sudo rm -rf ~/.zelcash > /dev/null 2>&1 && sleep 1 + sudo rm -rf .zelbenchmark > /dev/null 2>&1 && sleep 1 + sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 + + if [[ -d /home/$USER/.zelcash ]]; then + + echo -e "${ARROW} ${CYAN}Moving ~/.zelcash to ~/.flux${NC}" + #echo -e "${ARROW} ${CYAN}Renaming zelcash.conf to flux.conf${NC}" + sudo mv /home/$USER/.zelcash /home/$USER/.flux > /dev/null 2>&1 && sleep 1 + sudo mv /home/$USER/.flux/zelcash.conf /home/$USER/.flux/flux.conf > /dev/null 2>&1 && sleep 1 + + fi + + + if [[ -d /home/$USER/$CONFIG_DIR ]]; then + + if [[ -z "$use_old_chain" ]]; then + + if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 + + else + BOOTSTRAP_SKIP="1" + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 + fi + + else + + if [[ "$use_old_chain" == "1" ]]; then + + BOOTSTRAP_SKIP="1" + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 + + else + + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 + + + fi + + fi +fi + + sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 + sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 + echo -e "" + + echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 + if [[ $(sudo ufw status | grep "Status: active") ]] + then + if [[ -z "$firewall_disable" ]]; then + if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?(Recommended)" 8 60; then + sudo ufw disable > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + else + echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" + fi + else + + if [[ "$firewall_disable" == "1" ]]; then + sudo ufw disable > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + else + echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" + fi + fi + + else + echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + fi + +} + +function spinning_timer() { + animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) + end=$((SECONDS+NUM)) + while [ $SECONDS -lt $end ]; + do + for i in "${animation[@]}"; + do + echo -e "" + echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" + sleep 0.1 + + done + done + echo -ne "${MSG2}" +} + + +function ssh_port() { + + if [[ -z "$ssh_port" ]]; then + + SSHPORT=$(grep -w Port /etc/ssh/sshd_config | sed -e 's/.*Port //') + if ! whiptail --yesno "Detected you are using $SSHPORT for SSH is this correct?" 8 56; then + SSHPORT=$(whiptail --inputbox "Please enter port you are using for SSH" 8 43 3>&1 1>&2 2>&3) + echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 + else + echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 + fi + + else + pettern='^[0-9]+$' + if [[ $ssh_port =~ $pettern ]] ; then + SSHPORT="$ssh_port" + echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 + else + echo -e "${ARROW} ${CYAN}SSH port must be integer................[${X_MARK}${CYAN}]${NC}}" + echo + exit + fi + fi +} + +function ip_confirm() { + echo -e "${ARROW} ${YELLOW}Detecting IP address...${NC}" + + WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') + fi + + + if [[ "$WANIP" == "" ]]; then + echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" + echo + exit + fi + + + string_limit_check_mark "Detected IP: $WANIP ................................." "Detected IP: ${GREEN}$WANIP${CYAN} ................................." + +} + +function create_swap() { + + if [[ -z "$swapon" ]]; then + #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + else + echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" + fi + fi + + else + + if [[ "$swapon" == "1" ]]; then + + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + else + echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" + fi + #fi + + fi + + + fi + sleep 2 +} + +function install_packages() { + echo + echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" + + if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then + sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 + fi + + if ! dirmngr --v > /dev/null 2>&1; then + sudo apt install dirmngr -y > /dev/null 2>&1 + fi + + sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get upgrade -y > /dev/null 2>&1 + sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 + sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 + sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 + sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 + sudo apt-get install wget curl bsdmainutils automake fail2ban -y > /dev/null 2>&1 + sudo apt-get remove sysbench -y > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" +} + +function create_conf() { + + echo -e "${ARROW} ${YELLOW}Creating Flux daemon config file...${NC}" + if [ -f ~/$CONFIG_DIR/$CONFIG_FILE ]; then + echo -e "${ARROW} ${CYAN}Existing conf file found backing up to $COIN_NAME.old ...${NC}" + mv ~/$CONFIG_DIR/$CONFIG_FILE ~/$CONFIG_DIR/$COIN_NAME.old; + fi + + RPCUSER=$(pwgen -1 8 -n) + PASSWORD=$(pwgen -1 20 -n) + + if [[ "$IMPORT_ZELCONF" == "0" ]] + then + zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Privkey generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) + zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) + zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) + fi + + + if [ "x$PASSWORD" = "x" ]; then + PASSWORD=${WANIP}-$(date +%s) + fi + mkdir ~/$CONFIG_DIR > /dev/null 2>&1 + touch ~/$CONFIG_DIR/$CONFIG_FILE + cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE +rpcuser=$RPCUSER +rpcpassword=$PASSWORD +rpcallowip=127.0.0.1 +rpcallowip=172.18.0.1 +rpcport=$RPCPORT +port=$PORT +zelnode=1 +zelnodeprivkey=$zelnodeprivkey +zelnodeoutpoint=$zelnodeoutpoint +zelnodeindex=$zelnodeindex +server=1 +daemon=1 +txindex=1 +listen=1 +externalip=$WANIP +bind=0.0.0.0 +addnode=explorer.zelcash.online +addnode=explorer.runonflux.io +addnode=blockbook.runonflux.io +addnode=185.225.232.141:16125 +addnode=95.216.124.220:16125 +addnode=209.145.55.52:16125 +addnode=78.113.97.147:16125 +addnode=209.145.49.181:16125 +addnode=63.250.53.25:16125 +addnode=5.9.78.207:16125 +addnode=194.163.148.252:16125 +addnode=178.18.241.199:16125 +addnode=178.18.241.197:16125 +addnode=178.18.243.34:16125 +addnode=62.171.188.152:16125 +addnode=194.163.166.101:16125 +addnode=23.88.19.178:16125 +addnode=79.143.178.170:16125 +addnode=178.18.249.115:16125 +addnode=161.97.131.154:16125 +addnode=149.255.39.17:16125 +maxconnections=256 +EOF + sleep 2 +} + +function flux_package() { + sudo apt-get update -y > /dev/null 2>&1 && sleep 2 + echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" + sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 + sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 + integration_check +} + +function install_daemon() { + + sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 + sudo rm /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + + echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" + sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 + +if [[ "$(lsb_release -cs)" == "xenial" ]]; then + + echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + + flux_package && sleep 2 +else + + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + + # cleaning + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + + if [[ "$(lsb_release -cs)" == "impish" ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + fi + + + # downloading key && save it as keyring + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" + sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi + + + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi + + + if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + + flux_package && sleep 2 + + else + + echo + echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + + fi + +fi + + +} + + + +function zk_params() { + echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" + bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 + sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 +} + +function bootstrap() { + + BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" + + echo -e "" + echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" + if [[ -z "$bootstrap_url" ]]; then + + if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes + + fi + + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + + echo -e "${ARROW} ${YELLOW}Local bootstrap file detected...${NC}" + echo -e "${ARROW} ${YELLOW}Checking if zip file is corrupted...${NC}" + if unzip -t $BOOTSTRAP_ZIPFILE | grep 'No errors' > /dev/null 2>&1 + then + echo -e "${ARROW} ${CYAN}Bootstrap zip file is valid.............[${CHECK_MARK}${CYAN}]${NC}" + else + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $BOOTSTRAP_ZIPFILE + fi + + else + check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" + fi + + fi + + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + fi + + else + + + CHOICE=$( + whiptail --title "FLUXNODE INSTALLATION" --menu "Choose a method how to get bootstrap file" 10 47 2 \ + "1)" "Download from source build in script" \ + "2)" "Download from own source" 3>&2 2>&1 1>&3 + ) + + + case $CHOICE in + "1)") + + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + fi + + echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" + echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" + wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + #unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + + + ;; + "2)") + BOOTSTRAP_ZIP="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" + echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" + BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" + wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + fi + #echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + #unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + ;; + esac + + fi + + else + + if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes + fi + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + + echo -e "${ARROW} ${YELLOW}Local bootstrap file detected...${NC}" + echo -e "${ARROW} ${YELLOW}Checking if zip file is corrupted...${NC}" + if unzip -t $BOOTSTRAP_ZIPFILE | grep 'No errors' > /dev/null 2>&1 + then + echo -e "${ARROW} ${CYAN}Bootstrap zip file is valid.............[${CHECK_MARK}${CYAN}]${NC}" + else + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $BOOTSTRAP_ZIPFILE + fi + + else + check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" + fi + + fi + + + if [[ "$bootstrap_url" == "" ]]; then + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + fi + + else + + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + fi + + echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" + echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" + wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + + fi + + else + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + else + BOOTSTRAP_ZIP="$bootstrap_url" + echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" + BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" + wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + fi + + fi + fi + fi + + if [[ -z "$bootstrap_zip_del" ]]; then + if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + rm -rf $BOOTSTRAP_ZIPFILE + fi + else + + if [[ "$bootstrap_zip_del" == "1" ]]; then + rm -rf $BOOTSTRAP_ZIPFILE + fi + + fi + + +wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp +tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp \ +mv /tmp/fluxd /usr/local/bin +mv /tmp/flux-cli /usr/local/bin + +} + + +function create_service_scripts() { + +#echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 +sudo touch /home/$USER/start_daemon_service.sh +sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + cat <<'EOF' > /home/$USER/start_daemon_service.sh +#!/bin/bash + +#color codes +RED='\033[1;31m' +CYAN='\033[1;36m' +NC='\033[0m' +#emoji codes +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + +sleep 2 +echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" +echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" +bench_status_pind=$(pgrep fluxbenchd) +daemon_status_pind=$(pgrep fluxd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi + +bench_status_pind=$(pgrep zelbenchd) +daemon_status_pind=$(pgrep zelcashd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi + +if [[ -f /usr/local/bin/fluxd ]]; then +bash -c "fluxd" +exit +else +bash -c "zelcashd" +exit +fi +EOF + + +sudo touch /home/$USER/stop_daemon_service.sh +sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh + cat <<'EOF' > /home/$USER/stop_daemon_service.sh +#!/bin/bash +if [[ -f /usr/local/bin/flux-cli ]]; then +bash -c "flux-cli stop" +else +bash -c "zelcash-cli stop" +fi +exit +EOF + +sudo chmod +x /home/$USER/stop_daemon_service.sh +sudo chmod +x /home/$USER/start_daemon_service.sh + +} + +function create_service() { + echo -e "${ARROW} ${YELLOW}Creating Flux daemon service...${NC}" && sleep 1 + sudo touch /etc/systemd/system/zelcash.service + sudo chown $USER:$USER /etc/systemd/system/zelcash.service + cat << EOF > /etc/systemd/system/zelcash.service +[Unit] +Description=Flux daemon service +After=network.target +[Service] +Type=forking +User=$USER +Group=$USER +ExecStart=/home/$USER/start_daemon_service.sh +ExecStop=-/home/$USER/stop_daemon_service.sh +Restart=always +RestartSec=10 +PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=15s +StartLimitInterval=120s +StartLimitBurst=5 +[Install] +WantedBy=multi-user.target +EOF + sudo chown root:root /etc/systemd/system/zelcash.service + sudo systemctl daemon-reload +} + +function basic_security() { + echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" + sudo ufw allow 16124/tcp > /dev/null 2>&1 + sudo ufw allow "$SSHPORT"/tcp > /dev/null 2>&1 + sudo ufw allow "$PORT"/tcp > /dev/null 2>&1 + sudo ufw logging on > /dev/null 2>&1 + sudo ufw default deny incoming > /dev/null 2>&1 + + sudo ufw allow out from any to any port 123 > /dev/null 2>&1 + sudo ufw allow out to any port 80 > /dev/null 2>&1 + sudo ufw allow out to any port 443 > /dev/null 2>&1 + sudo ufw allow out to any port 53 > /dev/null 2>&1 + sudo ufw allow out to any port 16124 > /dev/null 2>&1 + sudo ufw allow out to any port 16125 > /dev/null 2>&1 + sudo ufw allow out to any port 16127 > /dev/null 2>&1 + sudo ufw allow from any to any port 16127 > /dev/null 2>&1 + + sudo ufw default deny outgoing > /dev/null 2>&1 + sudo ufw limit OpenSSH > /dev/null 2>&1 + echo "y" | sudo ufw enable > /dev/null 2>&1 + sudo ufw reload > /dev/null 2>&1 + sudo systemctl enable fail2ban > /dev/null 2>&1 + sudo systemctl start fail2ban > /dev/null 2>&1 +} + +function pm2_install(){ + + echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" + npm install pm2@latest -g > /dev/null 2>&1 + + if pm2 -v > /dev/null 2>&1 + then + echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" + pm2 startup systemd -u $USER > /dev/null 2>&1 + sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 + + + #pm2 start ~/zelflux/start.sh --name zelflux > /dev/null 2>&1 + #pm2 save > /dev/null 2>&1 + + + pm2 install pm2-logrotate > /dev/null 2>&1 + pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 + pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 + pm2 set pm2-logrotate:compress true > /dev/null 2>&1 + pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 + pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 + + source ~/.bashrc + #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" + string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." + echo + else + string_limit_x_mark "PM2 was not installed................................." + echo + fi + +} + +function start_daemon() { + + sudo systemctl enable zelcash.service > /dev/null 2>&1 + sudo systemctl start zelcash > /dev/null 2>&1 + + NUM='250' + MSG1='Starting daemon & syncing with chain please be patient this will take about 3 min...' + MSG2='' + spinning_timer + + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + # if $COIN_DAEMON > /dev/null 2>&1; then + + NUM='2' + MSG1='Getting info...' + MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo + + + daemon_version=$($COIN_CLI getinfo | jq -r '.version') + string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." + #echo -e "Zelcash version: ${GREEN}v$zelcash_version${CYAN} installed................................." + bench_version=$($BENCH_CLI getinfo | jq -r '.version') + string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." + #echo -e "${ARROW} ${CYAN}Zelbench version: ${GREEN}v$zelbench_version${CYAN} installed${NC}" + echo + pm2_install + #zelbench-cli stop > /dev/null 2>&1 && sleep 2 + else + echo + echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" + + if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then + error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + if [[ "$error_line" != "" ]]; then + echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" + echo -e "${WORNING} ${CYAN}$error_line${NC}" + echo + exit + fi + fi + + + if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then + + echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" + echo -n "" + + else + + echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" + echo -n "" + exit + + fi + + + fi +} + +function log_rotate() { + echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" + sleep 1 + if [ -f /etc/logrotate.d/$2 ]; then + sudo rm -rf /etc/logrotate.d/$2 + sleep 2 + fi + + sudo touch /etc/logrotate.d/$2 + sudo chown $USER:$USER /etc/logrotate.d/$2 + cat << EOF > /etc/logrotate.d/$2 +$3 { + compress + copytruncate + missingok + $4 + rotate $5 +} +EOF + sudo chown root:root /etc/logrotate.d/$2 +} + +function install_process() { + + echo -e "${ARROW} ${YELLOW}Configuring firewall...${NC}" + sudo ufw allow $ZELFRONTPORT/tcp > /dev/null 2>&1 + sudo ufw allow $LOCPORT/tcp > /dev/null 2>&1 + sudo ufw allow $ZELNODEPORT/tcp > /dev/null 2>&1 + #sudo ufw allow $MDBPORT/tcp > /dev/null 2>&1 + + echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" + + sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 + sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + + curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + + if [[ $(lsb_release -d) = *Debian* ]]; then + + + if [[ $(lsb_release -cs) = *stretch* || $(lsb_release -cs) = *buster* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + fi + + + elif [[ $(lsb_release -d) = *Ubuntu* ]]; then + + + if [[ $(lsb_release -cs) = *focal* || $(lsb_release -cs) = *bionic* || $(lsb_release -cs) = *xenial* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + fi + + else + + echo -e "${WORNING} ${RED}OS type not supported..${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + + fi + + + if ! sysbench --version > /dev/null 2>&1; then + + echo + echo -e "${ARROW} ${YELLOW}Sysbench installing...${NC}" + curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh 2> /dev/null | sudo bash > /dev/null 2>&1 + sudo apt -y install sysbench > /dev/null 2>&1 + + if sysbench --version > /dev/null 2>&1; then + + string_limit_check_mark "Sysbench $(sysbench --version | awk '{print $2}') installed................................." "Sysbench ${GREEN}$(sysbench --version | awk '{print $2}')${CYAN} installed................................." + + fi + + fi + + install_mongod + install_nodejs + install_flux + sleep 2 +} + +function install_mongod() { +echo +echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" +sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 +sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 +sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 +sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 +echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" +sudo apt-get update -y > /dev/null 2>&1 +sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 +sudo systemctl enable mongod > /dev/null 2>&1 +sudo systemctl start mongod > /dev/null 2>&1 +if mongod --version > /dev/null 2>&1 +then + #echo -e "${ARROW} ${CYAN}MongoDB version: ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed${NC}" + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo +else + #echo -e "${ARROW} ${CYAN}MongoDB was not installed${NC}" + string_limit_x_mark "MongoDB was not installed................................." + echo +fi +} + +function install_nodejs() { +echo -e "${ARROW} ${YELLOW}Removing any instances of Nodejs...${NC}" +n-uninstall -y > /dev/null 2>&1 && sleep 1 +rm -rf ~/n +sudo apt-get remove nodejs npm nvm -y > /dev/null 2>&1 && sleep 1 +sudo apt-get purge nodejs nvm -y > /dev/null 2>&1 && sleep 1 +sudo rm -rf /usr/local/bin/npm +sudo rm -rf /usr/local/share/man/man1/node* +sudo rm -rf /usr/local/lib/dtrace/node.d +sudo rm -rf ~/.npm +sudo rm -rf ~/.nvm +sudo rm -rf ~/.pm2 +sudo rm -rf ~/.node-gyp +sudo rm -rf /opt/local/bin/node +sudo rm -rf opt/local/include/node +sudo rm -rf /opt/local/lib/node_modules +sudo rm -rf /usr/local/lib/node* +sudo rm -rf /usr/local/include/node* +sudo rm -rf /usr/local/bin/node* +echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" +#export NVM_DIR="$HOME/.nvm" && ( + # git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" > /dev/null 2>&1 + # cd "$NVM_DIR" + # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 +#) && \. "$NVM_DIR/nvm.sh" +#cd +curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 +. ~/.profile +. ~/.bashrc +sleep 1 +#nvm install v12.16.1 +nvm install v14.18.1 > /dev/null 2>&1 +if node -v > /dev/null 2>&1 +then +#echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" +string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." +echo +else +#echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" +string_limit_x_mark "Nodejs was not installed................................." +echo +fi + +} + +function install_flux() { + + docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) + resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) + mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) + +if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then + +echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 +echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 +echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 + +fi + +if [[ $docker_check != 0 ]]; then +echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 +echo -e "${ARROW} ${CYAN}Removing containers...${NC}" + +sudo service docker restart > /dev/null 2>&1 && sleep 5 + +docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | +while read line; do +sudo docker stop $line > /dev/null 2>&1 && sleep 2 +sudo docker rm $line > /dev/null 2>&1 && sleep 2 +done +fi + +if [[ $resource_check != 0 ]]; then +echo -e "${ARROW} ${YELLOW}Detected locked resource${NC}" && sleep 1 +echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" && sleep 1 +df | egrep 'flux' | awk '{ print $1}' | +while read line; do +sudo umount -l $line && sleep 1 +done +fi + + if [ -d "./$FLUX_DIR" ]; then + echo -e "${ARROW} ${YELLOW}Removing any instances of Flux${NC}" + sudo rm -rf $FLUX_DIR + fi + + + echo -e "${ARROW} ${YELLOW}Flux installing...${NC}" + git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 + cd zelflux + echo -e "${ARROW} ${YELLOW}Changing to test branch...${NC}" + git checkout node_halvening + cd + echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" + + +if [[ "$IMPORT_ZELID" == "0" ]]; then + + while true + do + ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) + if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then + echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" + sleep 4 + fi + done + + if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then + + while true + do + + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* ]]; then + + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + + while true + do + KDA_C=$(whiptail --inputbox "Please enter your kadena chainid (0-19)" 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_C" -ge "0" && "$KDA_C" -le "19" ]]; then + echo -e "${ARROW} ${CYAN}Kadena chainid is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=$KDA_C" + break + else + echo -e "${ARROW} ${CYAN}Kadena chainid is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + + fi + + fi + + +if [[ "$KDA_A" != "" ]]; then + touch ~/$FLUX_DIR/config/userconfig.js + cat << EOF > ~/$FLUX_DIR/config/userconfig.js +module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${ZELID}', + kadena: '${KDA_A}', + testnet: false + } + } +EOF +else + touch ~/$FLUX_DIR/config/userconfig.js + cat << EOF > ~/$FLUX_DIR/config/userconfig.js +module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${ZELID}', + testnet: false + } + } +EOF +fi + +if [ -d ~/$FLUX_DIR ] +then +current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) + +string_limit_check_mark "Flux v$current_ver installed................................." "Flux ${GREEN}v$current_ver${CYAN} installed................................." +#echo -e "${ARROW} ${CYAN}Zelflux version: ${GREEN}v$current_ver${CYAN} installed${NC}" + +echo +else +string_limit_x_mark "Flux was not installed................................." +#echo -e "${ARROW} ${CYAN}Zelflux was not installed${NC}" +echo +fi + +} + + +function status_loop() { + +network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') +network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') + +EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + + +if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks') ]]; then +echo +echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" + + +LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') +CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') +LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + +NUM='2' +MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN}" +MSG2="${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" +spinning_timer +echo && echo + +else + + echo + echo -e "${CLOCK}${GREEN}FLUX DAEMON SYNCING...${NC}" + + f=0 + start_sync=`date +%s` + + + while true + do + + network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + + if [[ "$LEFT" == "0" ]]; then + time_break='5' + else + time_break='20' + fi + + #if [[ "$CONNECTIONS" == "0" ]]; then + # c=$((c+1)) + # if [[ "$c" > 3 ]]; then + # c=0; + #LOCAL_BLOCK_HIGHT="" + # fi + + #fi + # + if [[ $LOCAL_BLOCK_HIGHT == "" ]]; then + + f=$((f+1)) + LOCAL_BLOCK_HIGHT="N/A" + LEFT="N/A" + CONNECTIONS="N/A" + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo systemctl start zelcash > /dev/null 2>&1 + + NUM='60' + MSG1="Syncing progress => Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer + + network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + + fi + + NUM="$time_break" + MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer + + if [[ "$EXPLORER_BLOCK_HIGHT" == "$LOCAL_BLOCK_HIGHT" ]]; then + echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + break + fi + done + + fi + + + #pm2 start ~/$FLUX_DIR/start.sh --name flux --time > /dev/null 2>&1 + + + # if [[ -z "$mongo_bootstrap" ]]; then + + # if whiptail --yesno "Would you like to restore Mongodb datatable from bootstrap?" 8 60; then + # mongodb_bootstrap + # else + # echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" + # fi + # + # else + + # if [[ "$mongo_bootstrap" == "1" ]]; then + # mongodb_bootstrap + # else + # echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" + # fi + + # fi + + + #if [[ -z "$watchdog" ]]; then + #if whiptail --yesno "Would you like to install watchdog for FluxNode?" 8 60; then + install_watchdog + # else + # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" + # fi + # else + + # if [[ "$watchdog" == "1" ]]; then + # install_watchdog + # else + # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" + # fi + + # fi + + check + display_banner +} + +function check() { + +cd +pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 +pm2 save > /dev/null 2>&1 +#sleep 120 +#cd /home/$USER/zelflux +#pm2 stop flux +#npm install --legacy-peer-deps > /dev/null 2>&1 +#pm2 start flux +#cd + +NUM='400' +MSG1='Finalizing Flux installation please be patient this will take about ~5min...' +MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" +echo && spinning_timer +echo + +$BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 + +NUM='250' +MSG1='Restarting benchmark...' +MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" +spinning_timer +echo && echo + +echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" +echo -e "${YELLOW}======================${NC}" +bench_benchmarks=$($BENCH_CLI getbenchmarks) + +if [[ "bench_benchmarks" != "" ]]; then +bench_status=$(jq -r '.status' <<< "$bench_benchmarks") +if [[ "$bench_status" == "failed" ]]; then +echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" +check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" +check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" +else +echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" +bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") +echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" +bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") +bench_ram=$(round "$bench_ram" 2) +echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" +bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") +bench_ssd=$(round "$bench_ssd" 2) +echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" +bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") +bench_hdd=$(round "$bench_hdd" 2) +echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" +bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") +bench_ddwrite=$(round "$bench_ddwrite" 2) +echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" +bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") +bench_eps=$(round "$bench_eps" 2) +echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" +fi + +else +echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" +fi +} + +function display_banner() { + echo -e "${BLUE}" + figlet -t -k "FLUXNODE" + figlet -t -k "INSTALLATION COMPLETED" + echo -e "${YELLOW}================================================================================================================================" + #echo -e "FLUXNODE INSTALATION COMPLITED${NC}" + #echo -e "${CYAN}COURTESY OF DK808/XK4MiLX${NC}" + echo + if pm2 -v > /dev/null 2>&1; then + pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) + if [[ "$pm2_flux_status" == "online" ]]; then + pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" + else + if [[ "$pm2_flux_status" != "" ]]; then + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" + fi + fi + echo + fi + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" + echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" + echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" + echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" + echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} getinfo${NC}" + echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} getbenchmarks${NC}" + echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} restartnodebenchmarks${NC}" + echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} stop${NC}" + echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" + echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" + echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" + echo + if [[ "$WATCHDOG_INSTALL" == "1" ]]; then + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" + echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" + echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo + echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" + echo + fi + echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" + echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" + sleep 1 + cd $HOME + exec bash +} + +function start_install() { + +start_install=`date +%s` + +sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo +echo -e "${CYAN}February 2021, created by dk808 improved by XK4MiLX from Flux's team." +echo -e "Special thanks to Goose-Tech, Skyslayer, & Packetflow." +echo -e "FluxNode setup starting, press [CTRL+C] to cancel.${NC}" +sleep 2 + +if jq --version > /dev/null 2>&1; then +echo -e "" +else +echo -e "" +echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" +sudo apt install jq -y > /dev/null 2>&1 + + if jq --version > /dev/null 2>&1 + then + #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" + string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" + string_limit_x_mark "JQ was not installed................................." + echo + exit + fi +fi + +if [ "$USER" = "root" ]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}root${CYAN}, please switch to the username you just created.${NC}" + sleep 4 + exit +fi + +start_dir=$(pwd) +correct_dir="/home/$USER" +echo -e "${ARROW} ${YELLOW}Checking directory....${NC}" +if [[ "$start_dir" == "$correct_dir" ]] +then +echo -e "${ARROW} ${CYAN}Correct directory ${GREEN}$(pwd)${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" +else +echo -e "${ARROW} ${CYAN}Bad directory switching...${NC}" +cd +echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" +fi +sleep 1 + +config_file + +if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then +import_date +else + +if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then +echo +IMPORT_ZELCONF="1" +IMPORT_ZELID="1" +echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" +zelnodeprivkey="$prvkey" +echo -e "${PIN}${CYAN}Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 +zelnodeoutpoint="$outpoint" +echo -e "${PIN}${CYAN}Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 +zelnodeindex="$index" +echo -e "${PIN}${CYAN}Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 +echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 +echo +fi + +fi + +} + +#end of functions + start_install + wipe_clean + ssh_port + ip_confirm + create_swap + install_packages + create_conf + install_daemon + zk_params + if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then + bootstrap + fi + create_service_scripts + create_service + + if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then + echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + else + if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then + selfhosting + else + echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + fi + fi + + install_process + start_daemon + log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" + log_rotate "Flux daemon" "daemon_debug_log" "/home/$USER/$CONFIG_DIR/debug.log" "daily" "7" + log_rotate "MongoDB" "mongod_debug_log" "/var/log/mongodb/*.log" "daily" "14" + log_rotate "Docker" "docker_debug_log" "/var/lib/docker/containers/*/*.log" "daily" "7" + basic_security + status_loop From eddfd107490246b658fe465675f279fd1ae54fda Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Feb 2022 23:03:46 +0100 Subject: [PATCH 0169/1176] Update install_pro.sh --- install_pro.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index b7cf29e2..2448d2a6 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1371,10 +1371,7 @@ function bootstrap() { fi -wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp -tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp \ -mv /tmp/fluxd /usr/local/bin -mv /tmp/flux-cli /usr/local/bin + } @@ -1809,10 +1806,6 @@ fi echo -e "${ARROW} ${YELLOW}Flux installing...${NC}" git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 - cd zelflux - echo -e "${ARROW} ${YELLOW}Changing to test branch...${NC}" - git checkout node_halvening - cd echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" From 72b542efd04e1b0e4fb37dfbe830ca07c51caaac Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Feb 2022 23:05:49 +0100 Subject: [PATCH 0170/1176] Update install_pro_testnet.sh --- install_pro_testnet.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 7ac425ae..1f408e9c 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1145,7 +1145,10 @@ else fi - +wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp +tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp \ +mv /tmp/fluxd /usr/local/bin +mv /tmp/flux-cli /usr/local/bin } @@ -1353,11 +1356,6 @@ function bootstrap() { fi - -wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp -tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp \ -mv /tmp/fluxd /usr/local/bin -mv /tmp/flux-cli /usr/local/bin } From 08175c472e6b6053f1a3f97e7f52ca3065df9668 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Feb 2022 16:54:17 +0100 Subject: [PATCH 0171/1176] added benchmark 3.0.0.0 --- install_pro_testnet.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 1f408e9c..b24c937c 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1150,6 +1150,11 @@ tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp \ mv /tmp/fluxd /usr/local/bin mv /tmp/flux-cli /usr/local/bin +wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp +tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp \ +mv /tmp/fluxbenchd /usr/local/bin +mv /tmp/fluxbench-cli /usr/local/bin + } From 052d905df4787406b2fbee4ff0cd75b71862f43f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Feb 2022 16:59:09 +0100 Subject: [PATCH 0172/1176] disable bootstrap --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index b24c937c..365588a1 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -2238,7 +2238,7 @@ fi install_daemon zk_params if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then - bootstrap + # bootstrap fi create_service_scripts create_service From 5b7ae42c1aa4023e432a178cb8de4adc908a83fc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 07:33:37 +0100 Subject: [PATCH 0173/1176] fix permission and explorer --- install_pro_testnet.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 365588a1..54b08230 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -596,10 +596,10 @@ fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + stak_info=$(curl -s -m 5 https://testnet.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + stak_info=$(curl -s -m 5 https://testnet.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') fi fi @@ -1147,13 +1147,13 @@ fi wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp \ -mv /tmp/fluxd /usr/local/bin -mv /tmp/flux-cli /usr/local/bin +sudo mv /tmp/fluxd /usr/local/bin +sudo mv /tmp/flux-cli /usr/local/bin wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp \ -mv /tmp/fluxbenchd /usr/local/bin -mv /tmp/fluxbench-cli /usr/local/bin +sudo mv /tmp/fluxbenchd /usr/local/bin +sudo mv /tmp/fluxbench-cli /usr/local/bin } @@ -1895,8 +1895,8 @@ fi function status_loop() { -network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') -network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') +network_height_01=$(curl -sk -m 5 https://testnet.runonflux.io/api/status?q=getInfo | jq '.info.blocks') +network_height_03=$(curl -sk -m 5 https://testnet.runonflux.io/api/status?q=getInfo | jq '.info.blocks') EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") @@ -1928,8 +1928,8 @@ else while true do - network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_01=$(curl -sk -m 5 https://testnet.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 5 https://testnet.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") @@ -1966,8 +1966,8 @@ else MSG2='' spinning_timer - network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_01=$(curl -sk -m 5 https://testnet.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 5 https://tetestnet.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") From f72d93206001aadc303e2a5cec3203f2850e47b0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 07:37:33 +0100 Subject: [PATCH 0174/1176] fix typo --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 54b08230..4e905750 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1967,7 +1967,7 @@ else spinning_timer network_height_01=$(curl -sk -m 5 https://testnet.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 5 https://tetestnet.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 5 https://testnet.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") From 6218eb8ea93d069de014688cbdf6090a43cd9aed Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 08:10:13 +0100 Subject: [PATCH 0175/1176] Update install_pro_testnet.sh --- install_pro_testnet.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 4e905750..16da5e40 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1145,16 +1145,18 @@ else fi -wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp -tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp \ +sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp +sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp \ sudo mv /tmp/fluxd /usr/local/bin sudo mv /tmp/flux-cli /usr/local/bin -wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp -tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp \ +sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp +sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp \ sudo mv /tmp/fluxbenchd /usr/local/bin sudo mv /tmp/fluxbench-cli /usr/local/bin +sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 + } From 55aff7a256a758e340d79d63d017feec3e97af0c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 08:31:43 +0100 Subject: [PATCH 0176/1176] fix tar --- install_pro_testnet.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 16da5e40..af154676 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1146,12 +1146,12 @@ fi sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp -sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp \ +sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp sudo mv /tmp/fluxd /usr/local/bin sudo mv /tmp/flux-cli /usr/local/bin sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp -sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp \ +sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp sudo mv /tmp/fluxbenchd /usr/local/bin sudo mv /tmp/fluxbench-cli /usr/local/bin @@ -2239,9 +2239,9 @@ fi create_conf install_daemon zk_params - if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then + #if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then # bootstrap - fi + # fi create_service_scripts create_service From 9f9f8a32cc5b02064f6d92ea8b14115467278321 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:17:02 +0100 Subject: [PATCH 0177/1176] fix daemon data location --- install_pro_testnet.sh | 68 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index af154676..e2c1faa6 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -786,21 +786,21 @@ function wipe_clean() { if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 + sudo rm -rf ~/$CONFIG_DIR/testnet/determ_zelnodes ~/$CONFIG_DIR/testnet/sporks ~/$CONFIG_DIR/testnet/database ~/$CONFIG_DIR/testnet/blocks ~/$CONFIG_DIR/testnet/chainstate && sleep 2 sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 else BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/peers.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnodecache.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/debug.log && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/flux.conf && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/database && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/sporks && sleep 1 fi else @@ -808,21 +808,21 @@ function wipe_clean() { if [[ "$use_old_chain" == "1" ]]; then BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/peers.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnodecache.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/debug.log && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/flux.conf && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/database && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/sporks && sleep 1 else echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 + sudo rm -rf ~/$CONFIG_DIR/testnet/determ_zelnodes ~/$CONFIG_DIR/testnet/sporks ~/$CONFIG_DIR/testnet/database ~/$CONFIG_DIR/testnet/blocks ~/$CONFIG_DIR/testnet/chainstate && sleep 2 sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 @@ -1037,8 +1037,8 @@ function create_conf() { if [ "x$PASSWORD" = "x" ]; then PASSWORD=${WANIP}-$(date +%s) fi - mkdir ~/$CONFIG_DIR > /dev/null 2>&1 - touch ~/$CONFIG_DIR/$CONFIG_FILE + mkdir ~/$CONFIG_DIR/testnet > /dev/null 2>&1 + touch ~/$CONFIG_DIR/testnet/$CONFIG_FILE cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE rpcuser=$RPCUSER rpcpassword=$PASSWORD @@ -1145,15 +1145,15 @@ else fi -sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp -sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp -sudo mv /tmp/fluxd /usr/local/bin -sudo mv /tmp/flux-cli /usr/local/bin +sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 +sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 +sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 +sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 -sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp -sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp -sudo mv /tmp/fluxbenchd /usr/local/bin -sudo mv /tmp/fluxbench-cli /usr/local/bin +sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp > /dev/null 2>&1 +sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 +sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 +sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 @@ -1423,7 +1423,7 @@ sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 fi if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd" +bash -c "fluxd -datadir=/home/$USER/.flux/testnet" exit else bash -c "zelcashd" @@ -1799,7 +1799,7 @@ fi git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 cd zelflux echo -e "${ARROW} ${YELLOW}Changing to test branch...${NC}" - git checkout node_halvening + git checkout node_halvening > /dev/null 2>&1 cd echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" From ce5ec92c5dce1ddc9d568f156395fc5f34c01537 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:20:42 +0100 Subject: [PATCH 0178/1176] added clean old file --- install_pro_testnet.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index e2c1faa6..19e59f58 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1144,6 +1144,8 @@ else fi +sudo rm -rf /tmp/flux* 2>&1 && sleep 2 +sudo rm -rf /tmp/Flux* 2>&1 && sleep 2 sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 @@ -1156,7 +1158,6 @@ sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 - } From 0b6b32f63ccab981e272201ddf15d3208a663f44 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:24:30 +0100 Subject: [PATCH 0179/1176] redirect import old data from testnet --- install_pro_testnet.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 19e59f58..bb18ab59 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -316,11 +316,11 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeindex=//') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$OLD_CONFIG" == "1" ]]; then @@ -360,11 +360,11 @@ else IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeindex=//') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$OLD_CONFIG" == "1" ]]; then From 939d8a7ba7a94f4f12f26a90027414ac2ce365a3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:29:15 +0100 Subject: [PATCH 0180/1176] fix config --- install_pro_testnet.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index bb18ab59..e129bfe5 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1018,9 +1018,9 @@ function install_packages() { function create_conf() { echo -e "${ARROW} ${YELLOW}Creating Flux daemon config file...${NC}" - if [ -f ~/$CONFIG_DIR/$CONFIG_FILE ]; then + if [ -f ~/$CONFIG_DIR/testnet/$CONFIG_FILE ]; then echo -e "${ARROW} ${CYAN}Existing conf file found backing up to $COIN_NAME.old ...${NC}" - mv ~/$CONFIG_DIR/$CONFIG_FILE ~/$CONFIG_DIR/$COIN_NAME.old; + mv ~/$CONFIG_DIR/testnet/$CONFIG_FILE ~/$CONFIG_DIR/testnet/$COIN_NAME.old; fi RPCUSER=$(pwgen -1 8 -n) @@ -1039,7 +1039,7 @@ function create_conf() { fi mkdir ~/$CONFIG_DIR/testnet > /dev/null 2>&1 touch ~/$CONFIG_DIR/testnet/$CONFIG_FILE - cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE + cat << EOF > ~/$CONFIG_DIR/testnet/$CONFIG_FILE rpcuser=$RPCUSER rpcpassword=$PASSWORD rpcallowip=127.0.0.1 From ec3018cbebf27022b136dbd1ca3249766c50be56 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:34:51 +0100 Subject: [PATCH 0181/1176] fix mkdir --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index e129bfe5..251ae198 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1037,7 +1037,7 @@ function create_conf() { if [ "x$PASSWORD" = "x" ]; then PASSWORD=${WANIP}-$(date +%s) fi - mkdir ~/$CONFIG_DIR/testnet > /dev/null 2>&1 + mkdir -p ~/$CONFIG_DIR/testnet > /dev/null 2>&1 touch ~/$CONFIG_DIR/testnet/$CONFIG_FILE cat << EOF > ~/$CONFIG_DIR/testnet/$CONFIG_FILE rpcuser=$RPCUSER From efea445c9cb692a4063a8f89a4f5c24f148179e7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:58:45 +0100 Subject: [PATCH 0182/1176] directory change --- install_pro_testnet.sh | 70 +++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 251ae198..385545db 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -7,7 +7,7 @@ BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' #wallet information COIN_NAME='flux' -CONFIG_DIR='.flux' +CONFIG_DIR='.fluxtestnet' CONFIG_FILE='flux.conf' BENCH_NAME='fluxbench' @@ -316,11 +316,11 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$OLD_CONFIG" == "1" ]]; then @@ -360,11 +360,11 @@ else IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$OLD_CONFIG" == "1" ]]; then @@ -786,21 +786,21 @@ function wipe_clean() { if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf ~/$CONFIG_DIR/testnet/determ_zelnodes ~/$CONFIG_DIR/testnet/sporks ~/$CONFIG_DIR/testnet/database ~/$CONFIG_DIR/testnet/blocks ~/$CONFIG_DIR/testnet/chainstate && sleep 2 + sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 else BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/peers.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnodecache.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/debug.log && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/flux.conf && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/database && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/sporks && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 fi else @@ -808,21 +808,21 @@ function wipe_clean() { if [[ "$use_old_chain" == "1" ]]; then BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/peers.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnodecache.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/debug.log && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/flux.conf && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/database && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/testnet/sporks && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 else echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf ~/$CONFIG_DIR/testnet/determ_zelnodes ~/$CONFIG_DIR/testnet/sporks ~/$CONFIG_DIR/testnet/database ~/$CONFIG_DIR/testnet/blocks ~/$CONFIG_DIR/testnet/chainstate && sleep 2 + sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 @@ -1018,9 +1018,9 @@ function install_packages() { function create_conf() { echo -e "${ARROW} ${YELLOW}Creating Flux daemon config file...${NC}" - if [ -f ~/$CONFIG_DIR/testnet/$CONFIG_FILE ]; then + if [ -f ~/$CONFIG_DIR/$CONFIG_FILE ]; then echo -e "${ARROW} ${CYAN}Existing conf file found backing up to $COIN_NAME.old ...${NC}" - mv ~/$CONFIG_DIR/testnet/$CONFIG_FILE ~/$CONFIG_DIR/testnet/$COIN_NAME.old; + mv ~/$CONFIG_DIR/$CONFIG_FILE ~/$CONFIG_DIR/$COIN_NAME.old; fi RPCUSER=$(pwgen -1 8 -n) @@ -1037,9 +1037,9 @@ function create_conf() { if [ "x$PASSWORD" = "x" ]; then PASSWORD=${WANIP}-$(date +%s) fi - mkdir -p ~/$CONFIG_DIR/testnet > /dev/null 2>&1 - touch ~/$CONFIG_DIR/testnet/$CONFIG_FILE - cat << EOF > ~/$CONFIG_DIR/testnet/$CONFIG_FILE + mkdir -p ~/$CONFIG_DIR > /dev/null 2>&1 + touch ~/$CONFIG_DIR/$CONFIG_FILE + cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE rpcuser=$RPCUSER rpcpassword=$PASSWORD rpcallowip=127.0.0.1 @@ -1424,7 +1424,7 @@ sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 fi if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd -datadir=/home/$USER/.flux/testnet" +bash -c "fluxd -datadir=/home/$USER/.fluxtestnet" exit else bash -c "zelcashd" From c25ea4fda420e437c372ad1dedaa6e7be79c2731 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 10:15:47 +0100 Subject: [PATCH 0183/1176] Update install_pro_testnet.sh --- install_pro_testnet.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 385545db..1c688389 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -7,7 +7,7 @@ BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' #wallet information COIN_NAME='flux' -CONFIG_DIR='.fluxtestnet' +CONFIG_DIR='.flux' CONFIG_FILE='flux.conf' BENCH_NAME='fluxbench' @@ -299,7 +299,7 @@ function check_benchmarks() { function import_date() { -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then +if [[ -f /home/$USER/$CONFIG_DIR/testnet/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then if [[ -z "$import_settings" ]]; then @@ -316,11 +316,11 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeindex=//') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$OLD_CONFIG" == "1" ]]; then @@ -360,11 +360,11 @@ else IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeindex=//') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$OLD_CONFIG" == "1" ]]; then @@ -593,9 +593,9 @@ if [[ "$telegram_alert" == 0 ]]; then telegram_chat_id=0; fi -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') +if [[ -f /home/$USER/$CONFIG_DIR/testnet/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') stak_info=$(curl -s -m 5 https://testnet.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') if [[ "$stak_info" == "" ]]; then @@ -1037,9 +1037,9 @@ function create_conf() { if [ "x$PASSWORD" = "x" ]; then PASSWORD=${WANIP}-$(date +%s) fi - mkdir -p ~/$CONFIG_DIR > /dev/null 2>&1 - touch ~/$CONFIG_DIR/$CONFIG_FILE - cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE + mkdir -p ~/$CONFIG_DIR/testnet > /dev/null 2>&1 + touch ~/$CONFIG_DIR/testnet/$CONFIG_FILE + cat << EOF > ~/$CONFIG_DIR//testnet/$CONFIG_FILE rpcuser=$RPCUSER rpcpassword=$PASSWORD rpcallowip=127.0.0.1 @@ -1424,7 +1424,7 @@ sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 fi if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd -datadir=/home/$USER/.fluxtestnet" +bash -c "fluxd" exit else bash -c "zelcashd" From cf158e5fa909057bf7432e4d4510a48a568cf153 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Feb 2022 10:45:46 +0100 Subject: [PATCH 0184/1176] Update install_pro_testnet.sh --- install_pro_testnet.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 1c688389..a8512247 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1061,6 +1061,7 @@ addnode=testnet.runonflux.io maxconnections=256 EOF sleep 2 + cp /home/$USER/.flux/testnet/flux.conf /home/$USER/.flux } function flux_package() { From 4accebf41ee1d1dd40f2eee646a03e903874064b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Feb 2022 06:07:55 +0100 Subject: [PATCH 0185/1176] open ports for testnet --- install_pro_testnet.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index a8512247..04fbafac 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1493,6 +1493,8 @@ function basic_security() { sudo ufw allow out to any port 53 > /dev/null 2>&1 sudo ufw allow out to any port 16124 > /dev/null 2>&1 sudo ufw allow out to any port 16125 > /dev/null 2>&1 + sudo ufw allow out to any port 26124 > /dev/null 2>&1 + sudo ufw allow out to any port 26125 > /dev/null 2>&1 sudo ufw allow out to any port 16127 > /dev/null 2>&1 sudo ufw allow from any to any port 16127 > /dev/null 2>&1 From f831a4aa3608966806acfa6567236c48e257ed7f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Feb 2022 14:51:16 +0100 Subject: [PATCH 0186/1176] enabled testnet in userconfig --- install_pro_testnet.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 04fbafac..61a9f885 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1865,7 +1865,7 @@ module.exports = { ipaddress: '${WANIP}', zelid: '${ZELID}', kadena: '${KDA_A}', - testnet: false + testnet: true } } EOF @@ -1876,7 +1876,7 @@ module.exports = { initial: { ipaddress: '${WANIP}', zelid: '${ZELID}', - testnet: false + testnet: true } } EOF From 3aeebafbea38ba3c3c988f140aaed595b5e817e6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Feb 2022 20:09:07 +0100 Subject: [PATCH 0187/1176] fix benchmark output --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 61a9f885..53c6843b 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -2067,7 +2067,7 @@ echo && echo echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" echo -e "${YELLOW}======================${NC}" -bench_benchmarks=$($BENCH_CLI getbenchmarks) +bench_benchmarks=$($BENCH_CLI -testnet getbenchmarks) if [[ "bench_benchmarks" != "" ]]; then bench_status=$(jq -r '.status' <<< "$bench_benchmarks") From dbc8a068a7545bb75226ebd91bb960c6f24401b7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Feb 2022 20:28:01 +0100 Subject: [PATCH 0188/1176] fix getinfo from benchmark --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 53c6843b..aaaf8296 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1563,7 +1563,7 @@ function start_daemon() { daemon_version=$($COIN_CLI getinfo | jq -r '.version') string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." #echo -e "Zelcash version: ${GREEN}v$zelcash_version${CYAN} installed................................." - bench_version=$($BENCH_CLI getinfo | jq -r '.version') + bench_version=$($BENCH_CLI -testnet getinfo | jq -r '.version') string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." #echo -e "${ARROW} ${CYAN}Zelbench version: ${GREEN}v$zelbench_version${CYAN} installed${NC}" echo From dda4e540db3fcfb3598e2d9c12d9ec2042d05cad Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Feb 2022 06:50:54 +0100 Subject: [PATCH 0189/1176] added arm binary --- install_pro_testnet.sh | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index aaaf8296..10963633 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1148,15 +1148,32 @@ fi sudo rm -rf /tmp/flux* 2>&1 && sleep 2 sudo rm -rf /tmp/Flux* 2>&1 && sleep 2 -sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 -sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 -sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 -sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - -sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp > /dev/null 2>&1 -sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 -sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 -sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 +if [[ $(dpkg --print-architecture) = *amd* ]]; then + + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 + + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + +else + + https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz + sudo tar xzvf /tmp/Flux-arm64-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 + + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.0.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + + +fi sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 } From f8a8abe96415c7ff49e945cbaccd391b5e049554 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Feb 2022 07:30:02 +0100 Subject: [PATCH 0190/1176] changed nvm install script --- install_pro_testnet.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 10963633..2de3059f 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1755,7 +1755,8 @@ echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 #) && \. "$NVM_DIR/nvm.sh" #cd -curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 +#curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 +curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 . ~/.profile . ~/.bashrc sleep 1 From 20d18278449398bfb705518beb3f7aef7ace521d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Feb 2022 07:48:56 +0100 Subject: [PATCH 0191/1176] Update install_pro_testnet.sh --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 2de3059f..eae181b4 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1756,7 +1756,7 @@ echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" #) && \. "$NVM_DIR/nvm.sh" #cd #curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 -curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 +curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 . ~/.profile . ~/.bashrc sleep 1 From 5d26dcd9ad5a1ea9efbf12cd1d22a5ce16ee5ce4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Feb 2022 09:00:13 +0100 Subject: [PATCH 0192/1176] fix missing wget --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index eae181b4..17c003f1 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1162,7 +1162,7 @@ if [[ $(dpkg --print-architecture) = *amd* ]]; then else - https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz sudo tar xzvf /tmp/Flux-arm64-halving.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 From 96ce39de520ca9164f969ddc1e2e140b85184498 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Feb 2022 09:01:53 +0100 Subject: [PATCH 0193/1176] fix wget destination dir --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 17c003f1..39fdeccd 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1162,7 +1162,7 @@ if [[ $(dpkg --print-architecture) = *amd* ]]; then else - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Flux-arm64-halving.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 From b5a4883ec433ad09046bc90c40914946a2c0382a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:35:58 +0100 Subject: [PATCH 0194/1176] new crontab check --- install_pro_testnet.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 39fdeccd..3517db22 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -132,7 +132,9 @@ EOF sudo chmod +x /home/$USER/ip_check.sh echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 -crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) +#crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) +sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 + if [[ "$crontab_check" == "0" ]]; then (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - From a568ae738e9249f7552343a8f00556b3af4606fd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:36:54 +0100 Subject: [PATCH 0195/1176] new crontab check --- install_pro.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 2448d2a6..1b957563 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -132,7 +132,8 @@ EOF sudo chmod +x /home/$USER/ip_check.sh echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 -crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) +#crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) +sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 if [[ "$crontab_check" == "0" ]]; then (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - From fff83114ec18dd37d7c18cdfef4feda6b1274008 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:37:57 +0100 Subject: [PATCH 0196/1176] new crontab check --- multitoolbox.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index da3e44ad..7a1db965 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1945,7 +1945,8 @@ EOF sudo chmod +x /home/$USER/ip_check.sh echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 -crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) +#crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) +sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 if [[ "$crontab_check" == "0" ]]; then (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - From e85a72346df9f714ce67333bcba42b804bd49120 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 9 Feb 2022 00:23:25 +0100 Subject: [PATCH 0197/1176] change to development --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 3517db22..0c9132cb 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1823,7 +1823,7 @@ fi git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 cd zelflux echo -e "${ARROW} ${YELLOW}Changing to test branch...${NC}" - git checkout node_halvening > /dev/null 2>&1 + git checkout development > /dev/null 2>&1 cd echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" From c6563fa691b73d68a538b1dfa610ecad45da1a73 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 9 Feb 2022 07:22:35 +0100 Subject: [PATCH 0198/1176] added install bc --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 1b957563..ac99bd99 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1011,7 +1011,7 @@ function install_packages() { sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 - sudo apt-get install wget curl bsdmainutils automake fail2ban -y > /dev/null 2>&1 + sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 sudo apt-get remove sysbench -y > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" } From a932323a58d0ae6edea91ce9ad5cc1f7a9c57e14 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 9 Feb 2022 07:23:04 +0100 Subject: [PATCH 0199/1176] added install bc --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 0c9132cb..2aba51f9 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1012,7 +1012,7 @@ function install_packages() { sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 - sudo apt-get install wget curl bsdmainutils automake fail2ban -y > /dev/null 2>&1 + sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 sudo apt-get remove sysbench -y > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" } From c043b2a935374b47e51cc2481cb9edfa8da93c37 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Feb 2022 19:33:23 +0100 Subject: [PATCH 0200/1176] removed config duplication --- install_pro_testnet.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 2aba51f9..97f40e1a 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1039,9 +1039,9 @@ function create_conf() { if [ "x$PASSWORD" = "x" ]; then PASSWORD=${WANIP}-$(date +%s) fi - mkdir -p ~/$CONFIG_DIR/testnet > /dev/null 2>&1 - touch ~/$CONFIG_DIR/testnet/$CONFIG_FILE - cat << EOF > ~/$CONFIG_DIR//testnet/$CONFIG_FILE + mkdir -p ~/$CONFIG_DIR > /dev/null 2>&1 + touch ~/$CONFIG_DIR/$CONFIG_FILE + cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE rpcuser=$RPCUSER rpcpassword=$PASSWORD rpcallowip=127.0.0.1 @@ -1063,7 +1063,7 @@ addnode=testnet.runonflux.io maxconnections=256 EOF sleep 2 - cp /home/$USER/.flux/testnet/flux.conf /home/$USER/.flux + } function flux_package() { From 1459be02720044536f9230b6aede693e1d15b5e6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Feb 2022 19:39:14 +0100 Subject: [PATCH 0201/1176] fix path --- install_pro_testnet.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 97f40e1a..1e0d2163 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -301,7 +301,7 @@ function check_benchmarks() { function import_date() { -if [[ -f /home/$USER/$CONFIG_DIR/testnet/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then if [[ -z "$import_settings" ]]; then @@ -318,11 +318,11 @@ if [[ -f /home/$USER/$CONFIG_DIR/testnet/$CONFIG_FILE || -f /home/$USER/.zelcash IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$OLD_CONFIG" == "1" ]]; then @@ -362,11 +362,11 @@ else IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/testnet/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$OLD_CONFIG" == "1" ]]; then From cb41dd5b97523fb898caafbd8ac349f66a05a2df Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Feb 2022 10:01:39 +0100 Subject: [PATCH 0202/1176] Create multitoolbox_testnet.sh --- multitoolbox_testnet.sh | 2021 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 2021 insertions(+) create mode 100644 multitoolbox_testnet.sh diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh new file mode 100644 index 00000000..76a7fe39 --- /dev/null +++ b/multitoolbox_testnet.sh @@ -0,0 +1,2021 @@ +#!/bin/bash + +BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' +BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' +BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' +BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' +KDA_BOOTSTRAP_ZIPFILE='kda_bootstrap.tar.gz' +KDA_BOOTSTRAP_ZIP='http://202.61.207.10:16127/apps/fluxshare/getfile/kda_bootstrap.tar.gz?token=a705701758411b28ea20325ef9654e31e3d8f5f03a24b4e4e662e601a1250859' + +if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + +else + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' +fi + +FLUX_DIR='zelflux' +FLUX_APPS_DIR='ZelApps' +COIN_NAME='zelcash' + +#color codes +RED='\033[1;31m' +YELLOW='\033[1;33m' +BLUE="\\033[38;5;27m" +SEA="\\033[38;5;49m" +GREEN='\033[1;32m' +CYAN='\033[1;36m' +NC='\033[0m' + +#emoji codes +CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" +X_MARK="${RED}\xE2\x9C\x96${NC}" +PIN="${RED}\xF0\x9F\x93\x8C${NC}" +CLOCK="${GREEN}\xE2\x8C\x9B${NC}" +ARROW="${SEA}\xE2\x96\xB6${NC}" +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" +dversion="v6.0" + +PM2_INSTALL="0" +zelflux_setting_import="0" + +#dialog color +export NEWT_COLORS=' +title=black, +' + +function get_ip(){ + + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi + +} + +function spinning_timer() { + animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) + end=$((SECONDS+NUM)) + while [ $SECONDS -lt $end ]; + do + for i in "${animation[@]}"; + do + echo -e "" + echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" + sleep 0.1 + + done + done + echo -ne "${MSG2}" +} + +function string_limit_check_mark_port() { +if [[ -z "$2" ]]; then +string="$1" +string=${string::65} +else +string=$1 +string_color=$2 +string_leght=${#string} +string_leght_color=${#string_color} +string_diff=$((string_leght_color-string_leght)) +string=${string_color::65+string_diff} +fi +echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" +} + +function string_limit_check_mark() { +if [[ -z "$2" ]]; then +string="$1" +string=${string::50} +else +string=$1 +string_color=$2 +string_leght=${#string} +string_leght_color=${#string_color} +string_diff=$((string_leght_color-string_leght)) +string=${string_color::50+string_diff} +fi +echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" +} + +function string_limit_x_mark() { +if [[ -z "$2" ]]; then +string="$1" +string=${string::50} +else +string=$1 +string_color=$2 +string_leght=${#string} +string_leght_color=${#string_color} +string_diff=$((string_leght_color-string_leght)) +string=${string_color::50+string_diff} +fi +echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" +} + +function tar_file_unpack() +{ + echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" + pv $1 | tar -zx -C $2 +} + +function tar_file_pack() +{ + echo -e "${ARROW} ${YELLOW}Creating bootstrap archive file...${NC}" + tar -czf - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 +} + +function check_tar() +{ + echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" + + if gzip -t "$1" &>/dev/null; then + + echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" + + else + + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $1 + + fi +} + +function pm2_install(){ + + tmux kill-server > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}PM2 installing...${NC}" + npm install pm2@latest -g > /dev/null 2>&1 + + if pm2 -v > /dev/null 2>&1 + then + rm restart_zelflux.sh > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Configuring PM2...${NC}" + pm2 startup systemd -u $USER > /dev/null 2>&1 + sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 + pm2 start ~/$FLUX_DIR/start.sh --name flux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + pm2 install pm2-logrotate > /dev/null 2>&1 + pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 + pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 + pm2 set pm2-logrotate:compress true > /dev/null 2>&1 + pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 + pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 + source ~/.bashrc + #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" + string_limit_check_mark "PM2 v$(pm2 -v) installed....................................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed....................................................." + PM2_INSTALL="1" + + else + + string_limit_x_mark "PM2 was not installed....................................................." + echo + fi + +} + + +function config_file() { + +if [[ -f /home/$USER/install_conf.json ]]; then +import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') +ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') +firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') +bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') +bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') +swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') +mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') +watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') +use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') +prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') +outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') +index=$(cat /home/$USER/install_conf.json | jq -r '.index') +zel_id=$(cat /home/$USER/install_conf.json | jq -r '.zelid') +kda_address=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + +echo -e "${ARROW} ${YELLOW}Install config summary:" + +if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then +echo -e "${PIN}${CYAN}Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else + +if [[ "$import_settings" == "1" ]]; then +echo -e "${PIN}${CYAN}Import settings from exist config files..........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +fi + +if [[ "$ssh_port" != "" ]]; then +string_limit_check_mark_port "SSH port: $ssh_port ...................................................................." "SSH port: ${GREEN}$ssh_port ${CYAN}...................................................................." +sleep 1 +fi + +if [[ "$firewall_disable" == "1" ]]; then +echo -e "${PIN}${CYAN}Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN}Firewall enabled diuring installation............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +if [[ "$use_old_chain" == "1" ]]; then +echo -e "${PIN}${CYAN}Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + +else + +if [[ "$bootstrap_url" == "" ]]; then +echo -e "${PIN}${CYAN}Use Flux Bootstrap from source build in scripts..................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN}Use Flux Bootstrap from own source...............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +if [[ "$bootstrap_zip_del" == "1" ]]; then +echo -e "${PIN}${CYAN}Remove Flux Bootstrap archive file...............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN}Leave Flux Bootstrap archive file................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +fi + +if [[ "$swapon" == "1" ]]; then +echo -e "${PIN}${CYAN}Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +#if [[ "$mongo_bootstrap" == "1" ]]; then +#echo -e "${PIN}${CYAN}Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +#fi + +if [[ "$watchdog" == "1" ]]; then +echo -e "${PIN}${CYAN}Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi +fi +} + +function ip_confirm() { + + WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') + fi + + + if [[ "$WANIP" == "" ]]; then + echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" + echo + exit + fi + + string_limit_check_mark "IP: $WANIP ..........................................." "IP: ${GREEN}$WANIP${CYAN} ..........................................." +} + +function install_flux() { + +echo -e "${GREEN}Module: Re-install FluxOS${NC}" +echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + + if pm2 -v > /dev/null 2>&1; then + pm2 del zelflux > /dev/null 2>&1 + pm2 del flux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + fi + +docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) +resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) +mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) + +if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then +echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 +echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 +echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 +fi + +if [[ $docker_check != 0 ]]; then +echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 +echo -e "${ARROW} ${CYAN}Removing containers...${NC}" +sudo aa-remove-unknown && sudo service docker restart > /dev/null 2>&1 && sleep 2 +sleep 5 +#docker ps | grep -Eo "^[0-9a-z]{8,}\b" | +docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | +while read line; do +sudo docker stop $line > /dev/null 2>&1 && sleep 2 +sudo docker rm $line > /dev/null 2>&1 && sleep 2 +done +fi + +if [[ $resource_check != 0 ]]; then +echo -e "${ARROW} ${YELLOW}Detected locked resource...${NC}" && sleep 1 +echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" && sleep 1 +df | egrep 'flux' | awk '{ print $1}' | +while read line; do +sudo umount -l $line && sleep 1 +done +fi + +if [ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]; then + + echo -e "${ARROW} ${CYAN}Importing setting...${NC}" + zel_id=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + WANIP=$(grep -w ipaddress /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*ipaddress: .//' | sed -e 's/.\{2\}$//') + + echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$zel_id${NC}" && sleep 1 + + KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + + if [[ "$KDA_A" != "" ]]; then + + echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" && sleep 1 + + fi + + + echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" && sleep 1 + echo + echo -e "${ARROW} ${CYAN}Removing any instances of Flux....${NC}" + sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 2 + #sudo rm -rf zelflux > /dev/null 2>&1 && sleep 2 + zelflux_setting_import="1" + +fi + +if [ -d /home/$USER/$FLUX_DIR ]; then + + echo -e "${ARROW} ${CYAN}Removing any instances of Flux....${NC}" + #sudo rm -rf zelflux > /dev/null 2>&1 && sleep 2 + sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 2 + +fi + +echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" +git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 + +if [ -d /home/$USER/$FLUX_DIR ] +then + +if [[ -f /home/$USER/$FLUX_DIR/package.json ]]; then + current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) +else + string_limit_x_mark "Flux was not downloaded, run script again..........................................." + echo + exit +fi + +string_limit_check_mark "Flux v$current_ver downloaded..........................................." "Flux ${GREEN}v$current_ver${CYAN} downloaded..........................................." +else +string_limit_x_mark "Flux was not downloaded, run script again..........................................." +echo +exit +fi + + +if [[ "$zelflux_setting_import" == "0" ]]; then + +ip_confirm + +while true + do + zel_id="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + + done + + + touch ~/$FLUX_DIR/config/userconfig.js + cat << EOF > ~/$FLUX_DIR/config/userconfig.js +module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${zel_id}', + testnet: false + } + } +EOF + +else + +if [[ "$KDA_A" != "" ]]; then + + touch ~/$FLUX_DIR/config/userconfig.js + cat << EOF > ~/$FLUX_DIR/config/userconfig.js +module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${zel_id}', + kadena: '${KDA_A}', + testnet: false + } + } +EOF + +else + + touch ~/$FLUX_DIR/config/userconfig.js + cat << EOF > ~/$FLUX_DIR/config/userconfig.js +module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${zel_id}', + testnet: false + } + } +EOF + +fi + +fi + +if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then +string_limit_check_mark "Flux configuration successfull..........................................." +else +string_limit_x_mark "Flux installation failed, missing config file..........................................." +echo +exit +fi + + if pm2 -v > /dev/null 2>&1; then + + rm restart_zelflux.sh > /dev/null 2>&1 + pm2 del flux > /dev/null 2>&1 + pm2 del zelflux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" + echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" + echo + pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=60000 --max-restarts=40 --name flux --time > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + pm2 list + + else + + pm2_install() + if [[ "$PM2_INSTALL" == "1" ]]; then + echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" + echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" + echo + pm2 list + fi + fi + +} + +function create_config() { +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + +echo -e "${GREEN}Module: Create FluxNode installation config file${NC}" +echo -e "${YELLOW}================================================================${NC}" + + +if jq --version > /dev/null 2>&1; then +sleep 0.2 +else +echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" +sudo apt install jq -y > /dev/null 2>&1 + + if jq --version > /dev/null 2>&1 + then + #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" + string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" + string_limit_x_mark "JQ was not installed................................." + echo + exit + fi +fi + +skip_zelcash_config='0' +skip_bootstrap='0' + +if [[ -d /home/$USER/$CONFIG_DIR ]]; then + + if whiptail --yesno "Would you like import old settings from daemon and Flux?" 8 65; then + import_settings='1' + skip_zelcash_config='1' + sleep 1 + else + import_settings='0' + sleep 1 + fi + + if whiptail --yesno "Would you like use exist Flux chain?" 8 65; then + use_old_chain='1' + skip_bootstrap='1' + sleep 1 + else + use_old_chain='0' + sleep 1 + fi + + +fi + +if [[ "$skip_zelcash_config" == "1" ]]; then +prvkey="" +outpoint="" +index="" +zelid="" +kda_address="" +else + +prvkey=$(whiptail --inputbox "Enter your FluxNode Private Key from Zelcore" 8 65 3>&1 1>&2 2>&3) +sleep 1 +outpoint=$(whiptail --inputbox "Enter your FluxNode Output TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) +sleep 1 +index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) +sleep 1 +zel_id=$(whiptail --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) +sleep 1 +KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) +sleep 1 +KDA_C=$(whiptail --inputbox "Please enter your kadena chainid (0-19)" 8 85 3>&1 1>&2 2>&3) + + if [[ "$KDA_A" == "" ]]; then + kda_address="" + else + kda_address="kadena:$KDA_A?chainid=$KDA_C" + fi + +fi + +ssh_port=$(whiptail --inputbox "Enter port you are using for SSH (default 22)" 8 65 3>&1 1>&2 2>&3) +sleep 1 + + +pettern='^[0-9]+$' +if [[ $ssh_port =~ $pettern ]] ; then +sleep 1 +else +echo -e "${ARROW} ${CYAN}SSH port must be integer.................................[${X_MARK}${CYAN}]${NC}" +echo +exit +fi + + +if whiptail --yesno "Would you like disable firewall diuring installation?" 8 65; then +firewall_disable='1' +sleep 1 +else +firewall_disable='0' +sleep 1 +fi + + +if [[ "$skip_bootstrap" == "0" ]]; then + +if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then +bootstrap_url="$BOOTSTRAP_ZIP" +sleep 1 +else +bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) +sleep 1 +fi + +if whiptail --yesno "Would you like keep bootstrap archive file localy?" 8 65; then +bootstrap_zip_del='0' +sleep 1 +else +bootstrap_zip_del='1' +sleep 1 +fi +fi + +if whiptail --yesno "Would you like create swapfile?" 8 65; then +swapon='1' +sleep 1 +else +swapon='0' +sleep 1 +fi + + +if whiptail --yesno "Would you like use mongod bootstrap file?" 8 65; then +mongo_bootstrap='1' +sleep 1 +else +mongo_bootstrap='0' +sleep 1 +fi + + +if whiptail --yesno "Would you like install FluxNode watchdog?" 8 65; then +watchdog='1' +sleep 1 +else +watchdog='0' +sleep 1 +fi + +rm /home/$USER/install_conf.json > /dev/null 2>&1 +sudo touch /home/$USER/install_conf.json +sudo chown $USER:$USER /home/$USER/install_conf.json + cat << EOF > /home/$USER/install_conf.json +{ + "import_settings": "${import_settings}", + "prvkey": "${prvkey}", + "outpoint": "${outpoint}", + "index": "${index}", + "zelid": "${zel_id}", + "kda_address": "${kda_address}", + "ssh_port": "${ssh_port}", + "firewall_disable": "${firewall_disable}", + "bootstrap_url": "${bootstrap_url}", + "bootstrap_zip_del": "${bootstrap_zip_del}", + "swapon": "${swapon}", + "mongo_bootstrap": "${mongo_bootstrap}", + "use_old_chain": "${use_old_chain}", + "watchdog": "${watchdog}" +} +EOF +config_file +echo + + + +} + + +function install_watchdog() { + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + +echo -e "${GREEN}Module: Install watchdog for FluxNode${NC}" +echo -e "${YELLOW}================================================================${NC}" + +if ! pm2 -v > /dev/null 2>&1 +then +pm2_install + if [[ "$PM2_INSTALL" == "0" ]]; then + exit + fi +echo -e "" +fi + +echo -e "${ARROW} ${CYAN}Cleaning...${NC}" +pm2 del watchdog > /dev/null 2>&1 +pm2 save > /dev/null 2>&1 +sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 + +echo -e "${ARROW} ${CYAN}Downloading...${NC}" +cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 +mv post-merge /home/$USER/watchdog/.git/hooks/post-merge +sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge +echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" +cd watchdog && npm install > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Creating config file....${NC}" + + +#if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then +flux_update='1' +#sleep 1 +#else +##flux_update='0' +#sleep 1 +#fi + +#if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then +daemon_update='1' +##sleep 1 +#else +#daemon_update='0' +##sleep 1 +#fi + +#if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then +bench_update='1' +#sleep 1 +#else +##bench_update='0' +##sleep 1 +#fi + +#if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then +fix_action='1' +#sleep 1 +#else +#fix_action='0' +##sleep 1 +#fi + +telegram_alert=0; +discord=0; + +if whiptail --yesno "Would you like enable alert notification?" 8 60; then + +sleep 1 + +whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 + +sleep 1 + +CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + +if [ -z "$CHOICES" ]; then + + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" + sleep 1 + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + node_label=0; + +else + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") + + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + else + ping=0; + sleep 1 + fi + + ;; + "2") + + telegram_alert=1; + + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + ;; + esac + done +fi + + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + +else + + node_label=0; + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + sleep 1 +fi + + +if [[ $discord == 0 ]]; then + ping=0; +fi + + +if [[ $telegram_alert == 0 ]]; then + telegram_bot_token=0; + telegram_chat_id=0; +fi + + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + fi +fi + +if [[ $stak_info == ?(-)+([0-9]) ]]; then + + case $stak_info in + "10000") eps_limit=90 ;; + "25000") eps_limit=180 ;; + "100000") eps_limit=300 ;; + esac + +else +eps_limit=0; +fi + + +sudo touch /home/$USER/watchdog/config.js +sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js +module.exports = { + label: '${node_label}', + tier_eps_min: '${eps_limit}', + zelflux_update: '${flux_update}', + zelcash_update: '${daemon_update}', + zelbench_update: '${bench_update}', + action: '${fix_action}', + ping: '${ping}', + web_hook_url: '${discord}', + telegram_alert: '${telegram_alert}', + telegram_bot_token: '${telegram_bot_token}', + telegram_chat_id: '${telegram_chat_id}' +} +EOF + +echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" +pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 +pm2 save > /dev/null 2>&1 +if [[ -f /home/$USER/watchdog/watchdog.js ]] +then +current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) +#echo -e "${ARROW} ${CYAN}Watchdog ${GREEN}v$current_ver${CYAN} installed successful.${NC}" +string_limit_check_mark "Watchdog v$current_ver installed..........................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed..........................................." +else +#echo -e "${ARROW} ${CYAN}Watchdog installion failed.${NC}" +string_limit_x_mark "Watchdog was not installed..........................................." +fi +echo +} + + +function kda_bootstrap() { + + echo -e "${GREEN}Module: Restore Kadena node blockchain from bootstrap${NC}" + echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "${NC}" + sudo chown -R $USER:$USER /home/$USER/$FLUX_DIR + echo -e "${ARROW} ${CYAN}Stopping Kadena Node...${NC}" + + docker stop zelKadenaChainWebNode > /dev/null 2>&1 && sleep 10 + + if [[ -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db ]]; then + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + sudo rm -rf /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db + fi + + mkdir -p /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 + + + if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then + + echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" + if whiptail --yesno "Do u want check vailidation of archive file before unpack?" 8 60 3>&1 1>&2 2>&3; then + check_tar "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" + else + echo -e "${ARROW} ${CYAN}Vailidation of archive file skipped..${NC}" + fi + + fi + + + if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then + + tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" + sleep 2 + #unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode > /dev/null 2>&1 + + else + + echo -e "${ARROW} ${CYAN}Bootstrap file downloading...${NC}" && sleep 2 + + CHOICE=$( + whiptail --title "Bootstrap installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ + "1)" "Download from source build in script" \ + "2)" "Download from own source" 3>&2 2>&1 1>&3 + ) + + + case $CHOICE in + "1)") + DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') + fi + echo -e "${ARROW} ${CYAN}KDA Bootstrap height: ${GREEN}$DB_HIGHT${NC}" + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" + wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress + tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" + sleep 2 + + ;; + "2)") + KDA_BOOTSTRAP_ZIP="$(whiptail --title "Kadena node bootstrap source (*.tar.gz, *.zip file supported)" --inputbox "Enter your URL" 8 72 3>&1 1>&2 2>&3)" + KDA_BOOTSTRAP_ZIPFILE="${KDA_BOOTSTRAP_ZIP##*/}" + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" + wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" + + fi + sleep 2 + ;; + esac + + fi + + if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + rm -rf $KDA_BOOTSTRAP_ZIPFILE + fi + + docker start zelKadenaChainWebNode > /dev/null 2>&1 + NUM='15' + MSG1='Starting Kadena Node...' + MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo -e "" + echo -e "${ARROW} ${CYAN}Kadena Node initial process can take about ~15min. ${NC}" + echo -e "" + +} + + +function flux_daemon_bootstrap() { + + echo -e "${GREEN}Module: Restore Flux blockchain from bootstrap${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + cd + echo -e "${NC}" + pm2 stop watchdog > /dev/null 2>&1 && sleep 2 + echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" + sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + + if [[ -e /home/$USER/$CONFIG_DIR/blocks ]] && [[ -e /home/$USER/$CONFIG_DIR/chainstate ]]; then + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + rm -rf /home/$USER/$CONFIG_DIR/blocks /home/$USER/$CONFIG_DIR/chainstate /home/$USER/$CONFIG_DIR/determ_zelnodes + fi + + BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + + echo -e "${ARROW} ${YELLOW}Local bootstrap file detected...${NC}" + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + + echo -e "${ARROW} ${YELLOW}Checking if zip file is corrupted...${NC}" + + if unzip -t $BOOTSTRAP_ZIPFILE | grep 'No errors' > /dev/null 2>&1 + then + echo -e "${ARROW} ${CYAN}Bootstrap zip file is valid.............[${CHECK_MARK}${CYAN}]${NC}" + else + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $BOOTSTRAP_ZIPFILE + fi + + else + check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" + fi + + fi + + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + fi + + else + + CHOICE=$( + whiptail --title "FLUXNODE INSTALLATION" --menu "Choose a method how to get bootstrap file" 10 47 2 \ + "1)" "Download from source build in script" \ + "2)" "Download from own source" 3>&2 2>&1 1>&3 + ) + + + case $CHOICE in + "1)") + + DB_HIGHT=$(curl -s -m 3 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" + echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" + wget -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + + + + ;; + "2)") + BOOTSTRAP_ZIP="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" + echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" + BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" + + if [[ "$BOOTSTRAP_ZIPFILE" != *".zip"* ]]; then + BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' + fi + + wget -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + fi + ;; + esac + + fi + + + if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + rm -rf $BOOTSTRAP_ZIPFILE + fi + + sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 + NUM='35' + MSG1='Starting Flux daemon service...' + MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo -e "" && echo -e "" + pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 +} + +function mongodb_bootstrap(){ + +echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" +echo -e "${YELLOW}================================================================${NC}" +echo -e "${ARROW} ${CYAN}Module disabled...${NC}" +echo -e "" +exit + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + +sudo rm /home/$USER/fluxdb_dump.tar.gz > /dev/null 2>&1 +sudo rm /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 + +if ! pm2 -v > /dev/null 2>&1; then + + pm2_install + + if [[ "$PM2_INSTALL" == "0" ]]; then + exit + fi + +fi + +WANIP=$(wget http://ipecho.net/plain -O - -q) + +DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') +if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') +fi + +BLOCKHIGHT=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') +FORCE_BOOTSTRAP=0 + +if [[ "$DB_HIGHT" == "" ]]; then + echo -e "${ARROW} ${CYAN}MongoDB bootstrap server offline...${NC}" + string_limit_x_mark "Operation aborted....................." + exit +fi + + +if [[ "$BLOCKHIGHT" == "" || "$BLOCKHIGHT" == "null" ]]; then + + if whiptail --yesno "Local Explorer not respondin...Would you like force bootstrap installation?" 8 60; then + FORCE_BOOTSTRAP=1 + else + string_limit_x_mark "Local Explorer not responding........." + string_limit_x_mark "Operation aborted....................." + echo -e "" + exit + fi + +fi + + if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then + + if [[ "$BLOCKHIGHT" == "null" ]]; then + + message=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq -r .data.message) + + if whiptail --yesno "Flux explorer error noticed...Would you like force bootstrap installation?" 8 60; then + FORCE_BOOTSTRAP=1 + else + echo -e "${ARROW} ${CYAN}Flux explorer error: ${RED}$message${NC}" + string_limit_x_mark "Operation aborted....................." + echo -e "" + exit + fi + fi + fi + + +if [[ "$BLOCKHIGHT" != "" && "$BLOCKHIGHT" != "null" ]]; then + + if [[ "$BLOCKHIGHT" -gt "$DB_HIGHT" ]]; then + + if whiptail --yesno "Datatable is out of date....Would you like force bootstrap installation?" 8 60; then + FORCE_BOOTSTRAP=1 + else + echo -e "${ARROW} ${CYAN}Current Node block hight ${RED}$BLOCKHIGHT${CYAN} > Bootstrap block hight ${RED}$DB_HIGHT${CYAN}. Datatable is out of date.${NC}" + string_limit_x_mark "Operation aborted....................." + echo -e "" + exit + fi + + fi +fi + + +echo -e "${ARROW} ${CYAN}IP: ${RED}$WANIP${NC}" + +if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then + echo -e "${ARROW} ${CYAN}Node block hight: ${GREEN}$BLOCKHIGHT${NC}" +fi + +echo -e "${ARROW} ${CYAN}Bootstrap block hight: ${GREEN}$DB_HIGHT${NC}" +echo -e "" + + +echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" +wget $BOOTSTRAP_URL_MONGOD -q --show-progress +echo -e "${ARROW} ${CYAN}Unpacking...${NC}" +tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 +echo -e "${ARROW} ${CYAN}Stoping Flux...${NC}" +pm2 stop flux > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" +mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Cleaning...${NC}" +sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 +sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 +pm2 start flux > /dev/null 2>&1 +pm2 save > /dev/null 2>&1 + +NUM='120' +MSG1='Flux starting...' +MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" +spinning_timer +echo + +#BLOCKHIGHT_AFTER_BOOTSTRAP=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') +BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) + if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "" && "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "null" ]]; then + + echo -e "${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC}" + + if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then + + string_limit_check_mark "MongoDB bootstrap installed successful.................................." + echo -e "" + else + + if [[ "$FORCE_BOOTSTRAP" == "1" ]]; then + string_limit_check_mark "MongoDB bootstrap installed successful.................................." + echo -e "" + else + string_limit_x_mark "MongoDB bootstrap installation failed.................................." + echo -e "" + fi + + fi + else + + string_limit_x_mark "MongoDB bootstrap installation failed.................................." + echo -e "" + + fi + + +} + +function install_kernel(){ + + +echo -e "${GREEN}Module: Install Linux Kernel 5.X for Ubuntu 18.04${NC}" +echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" ]] +then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + +echo -e "${NC}" +echo -e "${YELLOW}Installing Linux Kernel 5.x${NC}" +sudo apt-get install --install-recommends linux-generic-hwe-18.04 -y +read -p "Would you like to reboot pc Y/N?" -n 1 -r +echo -e "${NC}" +if [[ $REPLY =~ ^[Yy]$ ]] +then +sudo reboot -n +fi + +} + +function analyzer_and_fixer(){ + +echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" +echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/nodeanalizerandfixer.sh) + + +} + + +function install_node(){ + +echo -e "${GREEN}Module: Install FluxNode${NC}" +echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + +if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then + + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit +fi + + +if docker run hello-world > /dev/null 2>&1 +then +echo -e "" +else +echo -e "${WORNING}${CYAN}Docker is not working correct or is not installed.${NC}" +exit +fi + + +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro_testnet.sh) + + +} + +function install_docker(){ + +echo -e "${GREEN}Module: Install Docker${NC}" +echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" != "root" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the root account use command 'su -'.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + + + +if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then + + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + +fi + +usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" +usernew=$(awk '{print tolower($0)}' <<< "$usernew") +echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" +adduser --gecos "" "$usernew" +usermod -aG sudo "$usernew" > /dev/null 2>&1 +echo -e "${ARROW} ${YELLOW}Update and upgrade system...${NC}" +apt update -y && apt upgrade -y +if ! ufw version > /dev/null 2>&1 +then +echo -e "${ARROW} ${YELLOW}Installing ufw firewall..${NC}" +sudo apt-get install -y ufw > /dev/null 2>&1 +fi +echo -e "${ARROW} ${YELLOW}Installing docker...${NC}" +echo -e "${ARROW} ${CYAN}Architecture: ${GREEN}$(dpkg --print-architecture)${NC}" + +if [[ -f /usr/share/keyrings/docker-archive-keyring.gpg ]]; then + sudo rm /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 +fi + +if [[ -f /etc/apt/sources.list.d/docker.list ]]; then + sudo rm /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 +fi + + +if [[ $(lsb_release -d) = *Debian* ]] +then + +sudo apt-get remove docker docker-engine docker.io containerd runc -y > /dev/null 2>&1 +sudo apt-get update -y > /dev/null 2>&1 +sudo apt-get -y install apt-transport-https ca-certificates > /dev/null 2>&1 +sudo apt-get -y install curl gnupg-agent software-properties-common > /dev/null 2>&1 +#curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - > /dev/null 2>&1 +#sudo add-apt-repository -y "deb [arch=amd64,arm64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /dev/null 2>&1 +curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 +sudo apt-get update -y > /dev/null 2>&1 +sudo apt-get install docker-ce docker-ce-cli containerd.io -y > /dev/null 2>&1 + +else + +sudo apt-get remove docker docker-engine docker.io containerd runc -y > /dev/null 2>&1 +sudo apt-get -y install apt-transport-https ca-certificates > /dev/null 2>&1 +sudo apt-get -y install curl gnupg-agent software-properties-common > /dev/null 2>&1 + +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 +#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - > /dev/null 2>&1 +#sudo add-apt-repository -y "deb [arch=amd64,arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /dev/null 2>&1 +sudo apt-get update -y > /dev/null 2>&1 +sudo apt-get install docker-ce docker-ce-cli containerd.io -y > /dev/null 2>&1 + +fi + +# echo -e "${YELLOW}Creating docker group..${NC}" +# groupadd docker +echo -e "${ARROW} ${YELLOW}Adding $usernew to docker group...${NC}" +adduser "$usernew" docker +echo -e "${NC}" +echo -e "${YELLOW}=====================================================${NC}" +echo -e "${YELLOW}Running through some checks...${NC}" +echo -e "${YELLOW}=====================================================${NC}" + +if sudo docker run hello-world > /dev/null 2>&1 +then + echo -e "${CHECK_MARK} ${CYAN}Docker is installed${NC}" +else + echo -e "${X_MARK} ${CYAN}Docker did not installed${NC}" +fi + +if [[ $(getent group docker | grep "$usernew") ]] +then + echo -e "${CHECK_MARK} ${CYAN}User $usernew is member of 'docker'${NC}" +else + echo -e "${X_MARK} ${CYAN}User $usernew is not member of 'docker'${NC}" +fi + +echo -e "${YELLOW}=====================================================${NC}" +echo -e "${NC}" +read -p "Would you like switch to user account Y/N?" -n 1 -r +echo -e "${NC}" +if [[ $REPLY =~ ^[Yy]$ ]] +then +su - $usernew +fi + +} + +function daemon_reconfiguration() +{ + +echo -e "${GREEN}Module: Flux Daemon Reconfiguration${NC}" +echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + +echo +echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" +sleep 4 +skip_change='3' +zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" +sleep 1 +zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output TX ID" 8 72 3>&1 1>&2 2>&3)" +sleep 1 +zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" +sleep 1 +#externalip="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode IP" 8 60 3>&1 1>&2 2>&3)" +#sleep 1 + +if [[ "$zelnodeprivkey" == "" ]]; then +skip_change=$((skip_change-1)) +echo -e "${ARROW} ${CYAN}Replace FluxNode privkey skipped....................[${CHECK_MARK}${CYAN}]${NC}" +fi + +if [[ "$zelnodeoutpoint" == "" ]]; then +skip_change=$((skip_change-1)) +echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" +fi + +if [[ "$zelnodeindex" == "" ]]; then +skip_change=$((skip_change-1)) +echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" +fi + +#if [[ "$externalip" == "" ]]; then +#skip_change=$((skip_change-1)) +#echo -e "${ARROW} ${CYAN}Replace FluxNode IP skipped.........................[${CHECK_MARK}${CYAN}]${NC}" +#fi + + +if [[ "$skip_change" == "0" ]]; then +echo -e "${ARROW} ${YELLOW}All fields are empty changes skipped...${NC}" +echo +exit +fi + +echo -e "${ARROW} ${CYAN}Stopping Flux daemon service...${NC}" +sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 +sudo fuser -k 16125/tcp > /dev/null 2>&1 + + +if [[ "$zelnodeprivkey" != "" ]]; then + +if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then +echo -e "${ARROW} ${CYAN}Replace FluxNode privkey skipped....................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode privkey replaced successful................[${CHECK_MARK}${CYAN}]${NC}" + fi +fi + +fi + +if [[ "$zelnodeoutpoint" != "" ]]; then + +if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then +echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode outpoint replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + fi +fi + +fi + +if [[ "$zelnodeindex" != "" ]]; then + +if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then +echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" + + fi +fi + +fi + +#if [[ "$externalip" != "" ]]; then + +#if [[ "externalip=$externalip" == $(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then +#echo -e "${ARROW} ${CYAN}Replace FluxNode IP skipped.........................[${CHECK_MARK}${CYAN}]${NC}" + # else + # sed -i "s/$(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE)/externalip=$externalip/" ~/$CONFIG_DIR/$CONFIG_FILE + #if [[ "externalip=$externalip" == $(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + # echo -e "${ARROW} ${CYAN}FluxNode IP replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" + + # fi +#fi +#fi + +pm2 restart flux > /dev/null 2>&1 +sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 +NUM='35' +MSG1='Restarting daemon service...' +MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" +spinning_timer +echo -e "" && echo -e "" + +} + +function create_service_scripts() { + +echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 +sudo touch /home/$USER/start_daemon_service.sh +sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + cat <<'EOF' > /home/$USER/start_daemon_service.sh +#!/bin/bash +#color codes +RED='\033[1;31m' +CYAN='\033[1;36m' +NC='\033[0m' +#emoji codes +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" +sleep 2 +echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" +echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" +bench_status_pind=$(pgrep fluxbenchd) +daemon_status_pind=$(pgrep fluxd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi +bench_status_pind=$(pgrep zelbenchd) +daemon_status_pind=$(pgrep zelcashd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi +if [[ -f /usr/local/bin/fluxd ]]; then +bash -c "fluxd" +exit +else +bash -c "zelcashd" +exit +fi +EOF + + +sudo touch /home/$USER/stop_daemon_service.sh +sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh + cat <<'EOF' > /home/$USER/stop_daemon_service.sh +#!/bin/bash +if [[ -f /usr/local/bin/flux-cli ]]; then +bash -c "flux-cli stop" +else +bash -c "zelcash-cli stop" +fi +exit +EOF + +echo -e "${ARROW} ${CYAN}Setting scripts permissions...${NC}" && sleep 1 +sudo chmod +x /home/$USER/stop_daemon_service.sh +sudo chmod +x /home/$USER/start_daemon_service.sh +echo -e "${ARROW} ${CYAN}Reloading service config...${NC}" && sleep 1 +sudo systemctl daemon-reload > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Starting Flux daemon....${NC}" && sleep 1 +sudo systemctl start zelcash > /dev/null 2>&1 +echo -e "" +} + +function create_service() { + + echo -e "${GREEN}Module: Flux Daemon service creator${NC}" + echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + +echo -e "" +echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 +sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 +sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 +sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 +sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 +sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 +sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 + +echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 +sudo touch /etc/systemd/system/zelcash.service +sudo chown $USER:$USER /etc/systemd/system/zelcash.service +cat << EOF > /etc/systemd/system/zelcash.service +[Unit] +Description=Flux daemon service +After=network.target +[Service] +Type=forking +User=$USER +Group=$USER +ExecStart=/home/$USER/start_daemon_service.sh +ExecStop=-/home/$USER/stop_daemon_service.sh +Restart=always +RestartSec=10 +PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=15s +StartLimitInterval=120s +StartLimitBurst=5 +[Install] +WantedBy=multi-user.target +EOF + sudo chown root:root /etc/systemd/system/zelcash.service +} + + +function replace_zelid() { + + echo -e "${GREEN}Module: Replace Zel ID${NC}" + echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + +while true + do + + new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + + if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + + done + + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped........................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js + + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}ZEL ID replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" + fi + + fi + +} + + function install_watchtower(){ + + echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" + echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + +echo -e "" +echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" +apps_check=$(docker ps | grep "flux_watchtower") + +if [[ "$apps_check" != "" ]]; then +echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" +docker stop flux_watchtower > /dev/null 2>&1 +sleep 2 +echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" +docker rm flux_watchtower > /dev/null 2>&1 +fi + +echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" +docker pull containrrr/watchtower:latest > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" +random=$(shuf -i 7500-35000 -n 1) +echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" +apps_id=$(docker run -d \ +--restart unless-stopped \ +--name flux_watchtower \ +-v /var/run/docker.sock:/var/run/docker.sock \ +containrrr/watchtower \ +--cleanup --interval $random 2> /dev/null) +if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then +echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" +else +echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" +fi + + } + + + function mongod_db_fix() { + echo -e "${GREEN}Module: Recover corrupted MongoDB database${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "" + sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair + + } + + function selfhosting() { + + echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" + echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + else + echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 + echo -e "" + exit + fi + + +echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 +sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 +sudo touch /home/$USER/ip_check.sh +sudo chown $USER:$USER /home/$USER/ip_check.sh + cat <<'EOF' > /home/$USER/ip_check.sh +#!/bin/bash + +function get_ip(){ + + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi + +} + + +if [[ $1 == "restart" ]]; then + + # give 3min to connect with internet + sleep 180 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + +fi + +if [[ $1 == "ip_check" ]]; then + + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + confirmed_ip=$(curl -SsL -m 10 http://localhost:16127/flux/info | jq -r .data.node.status.ip) + + if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then + + if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + + fi + +fi +EOF + +sudo chmod +x /home/$USER/ip_check.sh +echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 + +#crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) +sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 + +if [[ "$crontab_check" == "0" ]]; then + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" +else + echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" +fi +echo -e "" + + } + + +if ! figlet -v > /dev/null 2>&1 +then +sudo apt-get update -y > /dev/null 2>&1 +sudo apt-get install -y figlet > /dev/null 2>&1 +fi + +if ! pv -V > /dev/null 2>&1 +then +sudo apt-get install -y pv > /dev/null 2>&1 +fi + +if ! gzip -V > /dev/null 2>&1 +then +sudo apt-get install -y gzip > /dev/null 2>&1 +fi + +if ! zip -v > /dev/null 2>&1 +then +sudo apt-get install -y zip > /dev/null 2>&1 +fi + +if ! whiptail -v > /dev/null 2>&1 +then +sudo apt-get install -y whiptail > /dev/null 2>&1 +fi + + + +clear +sleep 1 +echo -e "${BLUE}" +figlet -f slant "Multitoolbox TESTNET" +echo -e "${YELLOW}================================================================${NC}" +echo -e "${GREEN}Version: $dversion${NC}" +echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" +echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" +echo -e "${GREEN}Special thanks to dk808, CryptoWrench && jriggs28${NC}" +echo -e "${YELLOW}================================================================${NC}" +echo -e "${CYAN}1 - Install Docker${NC}" +echo -e "${CYAN}2 - Install FluxNode${NC}" +echo -e "${YELLOW}================================================================${NC}" + +read -rp "Pick an option and hit ENTER: " + + case "$REPLY" in + + 1) + clear + sleep 1 + install_docker + ;; + 2) + clear + sleep 1 + install_node + ;; + esac From ce68658da6feb7f4e30c046a689265f3d9857108 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Feb 2022 17:42:04 +0100 Subject: [PATCH 0203/1176] simplificy - removed kadena - disable firewall diuring install as default --- install_pro_testnet.sh | 93 +++++++++++------------------------------- 1 file changed, 24 insertions(+), 69 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 1e0d2163..68dc42a9 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -339,10 +339,10 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash IMPORT_ZELID="1" fi - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi + # KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + # if [[ "$KDA_A" != "" ]]; then + # echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 + # fi fi fi @@ -384,10 +384,10 @@ else IMPORT_ZELID="1" fi - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi + # KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + # if [[ "$KDA_A" != "" ]]; then + # echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 + # fi fi fi @@ -839,26 +839,25 @@ fi echo -e "" echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 - if [[ $(sudo ufw status | grep "Status: active") ]] - then - if [[ -z "$firewall_disable" ]]; then - if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?(Recommended)" 8 60; then + if [[ $(sudo ufw status | grep "Status: active") ]]; then + # if [[ -z "$firewall_disable" ]]; then + # if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?(Recommended)" 8 60; then sudo ufw disable > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - else - echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" - fi + # else + # echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" + # fi else - if [[ "$firewall_disable" == "1" ]]; then - sudo ufw disable > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - else - echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" - fi - fi + # if [[ "$firewall_disable" == "1" ]]; then + #sudo ufw disable > /dev/null 2>&1 + # echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + # else + # echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" + # fi + # fi - else + # else echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" fi @@ -1841,55 +1840,11 @@ if [[ "$IMPORT_ZELID" == "0" ]]; then sleep 4 fi done - - if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then - - while true - do - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* ]]; then - - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - - while true - do - KDA_C=$(whiptail --inputbox "Please enter your kadena chainid (0-19)" 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_C" -ge "0" && "$KDA_C" -le "19" ]]; then - echo -e "${ARROW} ${CYAN}Kadena chainid is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=$KDA_C" - break - else - echo -e "${ARROW} ${CYAN}Kadena chainid is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - - fi - fi -if [[ "$KDA_A" != "" ]]; then - touch ~/$FLUX_DIR/config/userconfig.js - cat << EOF > ~/$FLUX_DIR/config/userconfig.js -module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - kadena: '${KDA_A}', - testnet: true - } - } -EOF -else + touch ~/$FLUX_DIR/config/userconfig.js cat << EOF > ~/$FLUX_DIR/config/userconfig.js module.exports = { @@ -1900,7 +1855,7 @@ module.exports = { } } EOF -fi + if [ -d ~/$FLUX_DIR ] then From 92db06ef07d3830d0dd6eb6f6233067af2f7b807 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 19 Feb 2022 14:33:57 +0000 Subject: [PATCH 0204/1176] Update FLuxOs to testnet branch --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 68dc42a9..08616cf2 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1822,7 +1822,7 @@ fi git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 cd zelflux echo -e "${ARROW} ${YELLOW}Changing to test branch...${NC}" - git checkout development > /dev/null 2>&1 + git checkout testnet > /dev/null 2>&1 cd echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" From d6d9f068a3f2d4713b3ae75b5594a343db2085f6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Feb 2022 15:44:32 +0100 Subject: [PATCH 0205/1176] enable explorer in daemon --- install_pro_testnet.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 08616cf2..d9175126 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1054,6 +1054,11 @@ zelnodeindex=$zelnodeindex server=1 daemon=1 txindex=1 +addressindex=1 +timestampindex=1 +spentindex=1 +insightexplorer=1 +experimentalfeatures=1 testnet=1 listen=1 externalip=$WANIP From 2a9083d5f71e81850064f953a2c107659f7ba1ff Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Feb 2022 15:52:43 +0100 Subject: [PATCH 0206/1176] changed branch for script --- multitoolbox_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 76a7fe39..b92e791b 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1388,7 +1388,7 @@ fi # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro_testnet.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development_halving/install_pro_testnet.sh) } From bfce0087f7bb31ab779454841f149c56e1e61d89 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 20 Feb 2022 19:07:53 +0100 Subject: [PATCH 0207/1176] improvement - firewall disabled diuring install process by default - create swap by default - kadena node only for nimbus and startus - cron service for rotate ip by default --- install_pro.sh | 96 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 30 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index ac99bd99..eb137615 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -9,6 +9,7 @@ BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' COIN_NAME='flux' CONFIG_DIR='.flux' CONFIG_FILE='flux.conf' +kadena_possible="0" BENCH_NAME='fluxbench' BENCH_CLI='fluxbench-cli' @@ -204,6 +205,34 @@ fi echo -e "" } +function tier(){ + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + fi + + + if [[ $stak_info == ?(-)+([0-9]) ]]; then + + case $stak_info in + "25000") kadena_possible=1 ;; + "100000") kadena_possible=1 ;; + "12500") kadena_possible=1 ;; + "40000") kadena_possible=1 ;; + esac + + else + kadena_possible=0 + fi + +fi + +} function config_file() { @@ -597,10 +626,10 @@ fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') fi fi @@ -610,6 +639,9 @@ if [[ $stak_info == ?(-)+([0-9]) ]]; then "10000") eps_limit=90 ;; "25000") eps_limit=180 ;; "100000") eps_limit=300 ;; + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; esac else @@ -838,26 +870,26 @@ fi echo -e "" echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 - if [[ $(sudo ufw status | grep "Status: active") ]] - then - if [[ -z "$firewall_disable" ]]; then - if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?(Recommended)" 8 60; then +if [[ $(sudo ufw status | grep "Status: active") ]] + # then + # if [[ -z "$firewall_disable" ]]; then + # if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?(Recommended)" 8 60; then sudo ufw disable > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - else - echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" - fi - else + # else + # echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" + # fi + # else - if [[ "$firewall_disable" == "1" ]]; then - sudo ufw disable > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - else - echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" - fi - fi + # if [[ "$firewall_disable" == "1" ]]; then + ### sudo ufw disable > /dev/null 2>&1 + # echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + # else + #echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" + # fi + # fi - else + else echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" fi @@ -946,7 +978,7 @@ function create_swap() { swap=2G fi if ! grep -q "swapfile" /etc/fstab; then - if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then + # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 sudo chmod 600 /swapfile > /dev/null 2>&1 sudo mkswap /swapfile > /dev/null 2>&1 @@ -955,7 +987,7 @@ function create_swap() { echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" else echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi + # fi fi else @@ -1824,8 +1856,11 @@ if [[ "$IMPORT_ZELID" == "0" ]]; then fi done - if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then - + # if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then + + tier + if [[ "$kadena_possible" == "1" ]]; then + while true do @@ -2161,6 +2196,7 @@ function display_banner() { exec bash } + function start_install() { start_install=`date +%s` @@ -2251,15 +2287,15 @@ fi create_service_scripts create_service - if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then - echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" - else - if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then + # if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then + # echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + # else + # if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then selfhosting - else - echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" - fi - fi + ## else + #echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + ### fi + ## fi install_process start_daemon From 5eded933141e047294cdeee42f2c1f1ec75fa9d9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 20 Feb 2022 20:42:34 +0100 Subject: [PATCH 0208/1176] fix missing then --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index eb137615..286df04b 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -870,7 +870,7 @@ fi echo -e "" echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 -if [[ $(sudo ufw status | grep "Status: active") ]] +if [[ $(sudo ufw status | grep "Status: active") ]]; then # then # if [[ -z "$firewall_disable" ]]; then # if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?(Recommended)" 8 60; then From daed413c239fd6360f01de87fba445c991de5728 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 21 Feb 2022 08:02:57 +0100 Subject: [PATCH 0209/1176] enabled explorer features --- install_pro.sh | 101 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 71 insertions(+), 30 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index ac99bd99..6013f863 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -9,6 +9,7 @@ BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' COIN_NAME='flux' CONFIG_DIR='.flux' CONFIG_FILE='flux.conf' +kadena_possible="0" BENCH_NAME='fluxbench' BENCH_CLI='fluxbench-cli' @@ -204,6 +205,34 @@ fi echo -e "" } +function tier(){ + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + fi + + + if [[ $stak_info == ?(-)+([0-9]) ]]; then + + case $stak_info in + "25000") kadena_possible=1 ;; + "100000") kadena_possible=1 ;; + "12500") kadena_possible=1 ;; + "40000") kadena_possible=1 ;; + esac + + else + kadena_possible=0 + fi + +fi + +} function config_file() { @@ -597,10 +626,10 @@ fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') fi fi @@ -610,6 +639,9 @@ if [[ $stak_info == ?(-)+([0-9]) ]]; then "10000") eps_limit=90 ;; "25000") eps_limit=180 ;; "100000") eps_limit=300 ;; + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; esac else @@ -838,26 +870,26 @@ fi echo -e "" echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 - if [[ $(sudo ufw status | grep "Status: active") ]] - then - if [[ -z "$firewall_disable" ]]; then - if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?(Recommended)" 8 60; then +if [[ $(sudo ufw status | grep "Status: active") ]]; then + # then + # if [[ -z "$firewall_disable" ]]; then + # if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?(Recommended)" 8 60; then sudo ufw disable > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - else - echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" - fi - else + # else + # echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" + # fi + # else - if [[ "$firewall_disable" == "1" ]]; then - sudo ufw disable > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - else - echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" - fi - fi + # if [[ "$firewall_disable" == "1" ]]; then + ### sudo ufw disable > /dev/null 2>&1 + # echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + # else + #echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" + # fi + # fi - else + else echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" fi @@ -946,7 +978,7 @@ function create_swap() { swap=2G fi if ! grep -q "swapfile" /etc/fstab; then - if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then + # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 sudo chmod 600 /swapfile > /dev/null 2>&1 sudo mkswap /swapfile > /dev/null 2>&1 @@ -955,7 +987,7 @@ function create_swap() { echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" else echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi + # fi fi else @@ -1054,6 +1086,11 @@ zelnodeindex=$zelnodeindex server=1 daemon=1 txindex=1 +addressindex=1 +timestampindex=1 +spentindex=1 +insightexplorer=1 +experimentalfeatures=1 listen=1 externalip=$WANIP bind=0.0.0.0 @@ -1824,8 +1861,11 @@ if [[ "$IMPORT_ZELID" == "0" ]]; then fi done - if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then - + # if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then + + tier + if [[ "$kadena_possible" == "1" ]]; then + while true do @@ -2161,6 +2201,7 @@ function display_banner() { exec bash } + function start_install() { start_install=`date +%s` @@ -2251,15 +2292,15 @@ fi create_service_scripts create_service - if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then - echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" - else - if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then + # if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then + # echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + # else + # if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then selfhosting - else - echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" - fi - fi + ## else + #echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + ### fi + ## fi install_process start_daemon From 4975d7445294f1697f3c8c67f30faf4139b9da82 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 21 Feb 2022 08:42:39 +0100 Subject: [PATCH 0210/1176] replaced daemon bootstrap --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 6013f863..050b5765 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,6 +1,6 @@ #!/bin/bash # Bootstrap settings -BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' +BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' From e5560e2448cfdab4731e085d8052eee72cc9d26a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 21 Feb 2022 09:00:39 +0100 Subject: [PATCH 0211/1176] update eps limit for watchdog --- multitoolbox.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7a1db965..2a132eb4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,11 +1,11 @@ #!/bin/bash -BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' +BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' KDA_BOOTSTRAP_ZIPFILE='kda_bootstrap.tar.gz' -KDA_BOOTSTRAP_ZIP='http://202.61.207.10:16127/apps/fluxshare/getfile/kda_bootstrap.tar.gz?token=a705701758411b28ea20325ef9654e31e3d8f5f03a24b4e4e662e601a1250859' +KDA_BOOTSTRAP_ZIP='http://38.242.202.86:16127/apps/fluxshare/getfile/kda_bootstrap.tar.gz?token=8ba005f55511d806f9d4ec5f56bf5c14ae02a50bfb80f5bdb08a1ded22f7b159' if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' @@ -871,10 +871,10 @@ fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') fi fi @@ -884,6 +884,9 @@ if [[ $stak_info == ?(-)+([0-9]) ]]; then "10000") eps_limit=90 ;; "25000") eps_limit=180 ;; "100000") eps_limit=300 ;; + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; esac else @@ -891,6 +894,7 @@ eps_limit=0; fi + sudo touch /home/$USER/watchdog/config.js sudo chown $USER:$USER /home/$USER/watchdog/config.js cat << EOF > /home/$USER/watchdog/config.js From 8a98d6bc955c820990b73ef2a92cad4ac3cf0bf9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 21 Feb 2022 14:05:45 +0100 Subject: [PATCH 0212/1176] Added update binary --- multitoolbox_testnet.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index b92e791b..b2e5cd8c 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1843,6 +1843,41 @@ fi } + function update_binary(){ + + echo -e "${GREEN}Module: Update flux daemon and benchmark binary${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + sudo rm -rf /tmp/Flux* > /dev/null 2>&1 + sudo rm -rf /tmp/flux* > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Stopping flux daemon..${NC}" + sudo systemctl stop zelcash > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Downloading file...${NC}" + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 + + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + + echo -e "${ARROW} ${CYAN}Starting flux daemon..${NC}" + echo "" + sudo systemctl start zelcash > /dev/null 2>&1 + + } + function mongod_db_fix() { echo -e "${GREEN}Module: Recover corrupted MongoDB database${NC}" @@ -2002,6 +2037,7 @@ echo -e "${GREEN}Special thanks to dk808, CryptoWrench && jriggs28${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${CYAN}1 - Install Docker${NC}" echo -e "${CYAN}2 - Install FluxNode${NC}" +echo -e "${CYAN}3 - Update flux daemon and benchmark binary${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -2017,5 +2053,10 @@ read -rp "Pick an option and hit ENTER: " clear sleep 1 install_node + ;; + 3) + clear + sleep 1 + update_binary ;; esac From a740f30a447a446c56a44bbe745a96cae01c4ff5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 21 Feb 2022 14:41:16 +0100 Subject: [PATCH 0213/1176] swap by default --- install_pro_testnet.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index d9175126..5db5fa89 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -946,7 +946,7 @@ function create_swap() { swap=2G fi if ! grep -q "swapfile" /etc/fstab; then - if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then + # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 sudo chmod 600 /swapfile > /dev/null 2>&1 sudo mkswap /swapfile > /dev/null 2>&1 @@ -955,7 +955,7 @@ function create_swap() { echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" else echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi + # fi fi else From 85596929b4e59722594c522f156640ca237260b4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 22 Feb 2022 10:32:42 +0100 Subject: [PATCH 0214/1176] fix node install script location --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 2a132eb4..52f3dbc1 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1391,7 +1391,7 @@ exit fi -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development_halving/install_pro.sh) } From 14f1c24701e9ab965d076ec8af1f3155c9e7c97b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 22 Feb 2022 20:41:51 +0100 Subject: [PATCH 0215/1176] new nodejs script --- install_pro.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 286df04b..11b2919f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1776,7 +1776,8 @@ echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 #) && \. "$NVM_DIR/nvm.sh" #cd -curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 +#curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 +curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 . ~/.profile . ~/.bashrc sleep 1 From 4336352c8a0fcfbf0b172d27159eb78b994f8478 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 22 Feb 2022 20:42:42 +0100 Subject: [PATCH 0216/1176] new nodejs script --- install_pro.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 050b5765..c649c082 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1781,7 +1781,8 @@ echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 #) && \. "$NVM_DIR/nvm.sh" #cd -curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 +#curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 +curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 . ~/.profile . ~/.bashrc sleep 1 From 3efa733a145e3db6c2cd186ec5a3e23cd7948522 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Thu, 24 Feb 2022 15:48:40 +0000 Subject: [PATCH 0217/1176] Change to FluxOs development branch --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 52f3dbc1..c99d2eb1 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -367,7 +367,7 @@ if [ -d /home/$USER/$FLUX_DIR ]; then fi echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" -git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 +git clone --single-branch --branch development https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 if [ -d /home/$USER/$FLUX_DIR ] then From b2c0b02a9336e4fe33c54d676b51a4da7e644c74 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 24 Feb 2022 19:03:17 +0100 Subject: [PATCH 0218/1176] revert git clone, --- multitoolbox.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index c99d2eb1..c9a88637 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -367,7 +367,8 @@ if [ -d /home/$USER/$FLUX_DIR ]; then fi echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" -git clone --single-branch --branch development https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 +#git clone --single-branch --branch development https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 +git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 if [ -d /home/$USER/$FLUX_DIR ] then From 778bf41d2da2edab67147360c0827fd55bc2cc51 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 24 Feb 2022 19:12:52 +0100 Subject: [PATCH 0219/1176] added install fluxOS, development branch --- multitoolbox_testnet.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index b2e5cd8c..41e181e9 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -367,7 +367,8 @@ if [ -d /home/$USER/$FLUX_DIR ]; then fi echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" -git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 +#git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 +git clone --single-branch --branch development https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 if [ -d /home/$USER/$FLUX_DIR ] then @@ -412,7 +413,7 @@ module.exports = { initial: { ipaddress: '${WANIP}', zelid: '${zel_id}', - testnet: false + testnet: true } } EOF @@ -428,7 +429,7 @@ module.exports = { ipaddress: '${WANIP}', zelid: '${zel_id}', kadena: '${KDA_A}', - testnet: false + testnet: true, } } EOF @@ -441,7 +442,7 @@ module.exports = { initial: { ipaddress: '${WANIP}', zelid: '${zel_id}', - testnet: false + testnet: true } } EOF @@ -2038,6 +2039,7 @@ echo -e "${YELLOW}============================================================== echo -e "${CYAN}1 - Install Docker${NC}" echo -e "${CYAN}2 - Install FluxNode${NC}" echo -e "${CYAN}3 - Update flux daemon and benchmark binary${NC}" +echo -e "${CYAN}4 - Install/Re-install FluxOS${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -2058,5 +2060,10 @@ read -rp "Pick an option and hit ENTER: " clear sleep 1 update_binary + ;; + 4) + clear + sleep 1 + install_flux ;; esac From 4e71bdd68874e362f5e220e778156665b8c1c670 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 24 Feb 2022 19:25:06 +0100 Subject: [PATCH 0220/1176] development edit --- install_pro_dev.sh | 2314 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2314 insertions(+) create mode 100644 install_pro_dev.sh diff --git a/install_pro_dev.sh b/install_pro_dev.sh new file mode 100644 index 00000000..50f3b45e --- /dev/null +++ b/install_pro_dev.sh @@ -0,0 +1,2314 @@ +#!/bin/bash +# Bootstrap settings +BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' +BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' +BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' +BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' + +#wallet information +COIN_NAME='flux' +CONFIG_DIR='.flux' +CONFIG_FILE='flux.conf' +kadena_possible="0" + +BENCH_NAME='fluxbench' +BENCH_CLI='fluxbench-cli' +BENCH_DIR_LOG='.fluxbenchmark' + +COIN_DAEMON='fluxd' +COIN_CLI='flux-cli' +COIN_PATH='/usr/local/bin' + +USERNAME="$(whoami)" +FLUX_DIR='zelflux' + +#Install variable +IMPORT_ZELCONF="0" +IMPORT_ZELID="0" +CORRUPTED="0" +BOOTSTRAP_SKIP="0" +WATCHDOG_INSTALL="0" + +#Zelflux ports +ZELFRONTPORT=16126 +LOCPORT=16127 +ZELNODEPORT=16128 +#MDBPORT=27017 +RPCPORT=16124 +PORT=16125 + +#color codes +RED='\033[1;31m' +YELLOW='\033[1;33m' +BLUE="\\033[38;5;27m" +SEA="\\033[38;5;49m" +GREEN='\033[1;32m' +CYAN='\033[1;36m' +NC='\033[0m' + +#emoji codes +CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" +X_MARK="${RED}\xE2\x9C\x96${NC}" +PIN="${RED}\xF0\x9F\x93\x8C${NC}" +CLOCK="${GREEN}\xE2\x8C\x9B${NC}" +ARROW="${SEA}\xE2\x96\xB6${NC}" +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + +#dialog color +export NEWT_COLORS=' +title=black, +' +function string_limit_check_mark() { +if [[ -z "$2" ]]; then +string="$1" +string=${string::40} +else +string=$1 +string_color=$2 +string_leght=${#string} +string_leght_color=${#string_color} +string_diff=$((string_leght_color-string_leght)) +string=${string_color::40+string_diff} +fi +echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" +} + + function selfhosting() { + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" + echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + else + echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 + echo -e "" + exit + fi + +echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 +sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 +sudo touch /home/$USER/ip_check.sh +sudo chown $USER:$USER /home/$USER/ip_check.sh + cat <<'EOF' > /home/$USER/ip_check.sh +#!/bin/bash +function get_ip(){ + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi +} +if [[ $1 == "restart" ]]; then + # give 3min to connect with internet + sleep 180 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi +fi +if [[ $1 == "ip_check" ]]; then + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + confirmed_ip=$(curl -SsL -m 10 http://localhost:16127/flux/info | jq -r .data.node.status.ip) + if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then + if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + fi +fi +EOF + +sudo chmod +x /home/$USER/ip_check.sh +echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 + +#crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) +sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 + +if [[ "$crontab_check" == "0" ]]; then + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" +else + echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" +fi +echo -e "" + } + + +function max(){ + + m="0" + for n in "$@" + do + if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then + [ "$n" -gt "$m" ] && m="$n" + fi + done + + echo "$m" + +} + +function string_limit_x_mark() { +if [[ -z "$2" ]]; then +string="$1" +string=${string::40} +else +string=$1 +string_color=$2 +string_leght=${#string} +string_leght_color=${#string_color} +string_diff=$((string_leght_color-string_leght)) +string=${string_color::40+string_diff} +fi +echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" +} + + +function integration_check() { +FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) +ELEMENTS=${#FILE_ARRAY[@]} + +for (( i=0;i<$ELEMENTS;i++)); do + +string="${FILE_ARRAY[${i}]}................................." +string=${string::40} + +if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then + echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" +else + echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" + CORRUPTED="1" +fi + +done + +if [[ "$CORRUPTED" == "1" ]]; then + echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" + echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" + echo + exit +fi +echo -e "" +} + +function tier(){ + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + fi + + + if [[ $stak_info == ?(-)+([0-9]) ]]; then + + case $stak_info in + "25000") kadena_possible=1 ;; + "100000") kadena_possible=1 ;; + "12500") kadena_possible=1 ;; + "40000") kadena_possible=1 ;; + esac + + else + kadena_possible=0 + fi + +fi + +} + +function config_file() { + +if [[ -f /home/$USER/install_conf.json ]]; then +import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') +ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') +firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') +bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') +bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') +swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') +#mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') +watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') +use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') +prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') +outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') +index=$(cat /home/$USER/install_conf.json | jq -r '.index') +ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') +KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + +echo +echo -e "${ARROW} ${YELLOW}Install config:" + +if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then +echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else + +if [[ "$import_settings" == "1" ]]; then +echo -e "${PIN}${CYAN} Import settings from Flux..............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +fi + +if [[ "$ssh_port" != "" ]]; then +echo -e "${PIN}${CYAN} SSH port set.....................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +if [[ "$firewall_disable" == "1" ]]; then +echo -e "${PIN}${CYAN} Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN} Firewall enabled diuring installation............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +if [[ "$use_old_chain" == "1" ]]; then +echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + +else + +if [[ "$bootstrap_url" == "" ]]; then +echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +if [[ "$bootstrap_zip_del" == "1" ]]; then +echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +fi + +if [[ "$swapon" == "1" ]]; then +echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + +#if [[ "$mongo_bootstrap" == "1" ]]; then +#echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +#fi + +if [[ "$watchdog" == "1" ]]; then +echo -e "${PIN}${CYAN} Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi + + + +fi +} + +function round() { + printf "%.${2}f" "${1}" +} + +function check_benchmarks() { + + var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") + limit=$2 + if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]] + then + var_round=$(round "$var_benchmark" 2) + echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" + fi + +} + +function import_date() { + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then + + if [[ -z "$import_settings" ]]; then + + if whiptail --yesno "Would you like to import data from Flux config files Y/N?" 8 60; then + + OLD_CONFIG=0 + + if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + OLD_CONFIG=1 + fi + + IMPORT_ZELCONF="1" + echo + echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 + + if [[ "$OLD_CONFIG" == "1" ]]; then + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' + fi + + if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + + ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 + IMPORT_ZELID="1" + fi + + KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 + fi + + fi + fi + +else + + if [[ "$import_settings" == "1" ]]; then + + OLD_CONFIG=0 + + if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + OLD_CONFIG=1 + fi + + IMPORT_ZELCONF="1" + echo + echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 + + if [[ "$OLD_CONFIG" == "1" ]]; then + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' + fi + + + if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + + ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 + IMPORT_ZELID="1" + fi + + KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 + fi + fi + fi + + fi +fi +sleep 1 +echo +} + +function tar_file_unpack() +{ + echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" + pv $1 | tar -zx -C $2 +} + + +function check_tar() +{ + echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" + + if gzip -t "$1" &>/dev/null; then + + echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" + + else + + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $1 + + fi +} + + +function install_watchdog() { +echo -e "${ARROW} ${YELLOW}Install watchdog for FluxNode${NC}" +if pm2 -v > /dev/null 2>&1 +then +WATCHDOG_INSTALL="1" +echo -e "${ARROW} ${YELLOW}Downloading...${NC}" +cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 +echo -e "${ARROW} ${YELLOW}Installing git hooks....${NC}" +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 +mv post-merge /home/$USER/watchdog/.git/hooks/post-merge +sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge +echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" +cd watchdog && npm install > /dev/null 2>&1 +echo -e "${ARROW} ${CYAN}Creating config file....${NC}" + +#if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then +flux_update='1' +#sleep 1 +#else +#lux_update='0' +#sleep 1 +#fi + +#if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then +daemon_update='1' +#sleep 1 +#else +#daemon_update='0' +#sleep 1 +#fi + +#if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then +bench_update='1' +#sleep 1 +#else +#bench_update='0' +#sleep 1 +#fi + +#if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then +fix_action='1' +#sleep 1 +#else +#fix_action='0' +#sleep 1 +#fi + +telegram_alert=0; +discord=0; + +if whiptail --yesno "Would you like enable alert notification?" 8 60; then + +sleep 1 + +whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 + +sleep 1 + +CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + +if [ -z "$CHOICES" ]; then + + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" + sleep 1 + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + node_label=0; + +else + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") + + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + else + ping=0; + sleep 1 + fi + + ;; + "2") + + telegram_alert=1; + + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + ;; + esac + done +fi + + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + +else + + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + node_label=0; + sleep 1 +fi + + +if [[ "$discord" == 0 ]]; then + ping=0; +fi + + +if [[ "$telegram_alert" == 0 ]]; then + telegram_bot_token=0; + telegram_chat_id=0; +fi + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + fi +fi + +if [[ $stak_info == ?(-)+([0-9]) ]]; then + + case $stak_info in + "10000") eps_limit=90 ;; + "25000") eps_limit=180 ;; + "100000") eps_limit=300 ;; + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; + esac + +else +eps_limit=0; +fi + + +sudo touch /home/$USER/watchdog/config.js +sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js +module.exports = { + label: '${node_label}', + tier_eps_min: '${eps_limit}', + zelflux_update: '${flux_update}', + zelcash_update: '${daemon_update}', + zelbench_update: '${bench_update}', + action: '${fix_action}', + ping: '${ping}', + web_hook_url: '${discord}', + telegram_alert: '${telegram_alert}', + telegram_bot_token: '${telegram_bot_token}', + telegram_chat_id: '${telegram_chat_id}' +} +EOF + +echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" +pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 +pm2 save > /dev/null 2>&1 +if [[ -f /home/$USER/watchdog/watchdog.js ]] +then +current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) +#echo -e "${ARROW} ${CYAN}Watchdog ${GREEN}v$current_ver${CYAN} installed successful.${NC}" +string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." +else +#echo -e "${ARROW} ${CYAN}Watchdog installion failed.${NC}" +string_limit_x_mark "Watchdog was not installed................................." +fi +else +#echo -e "${ARROW} ${CYAN}Watchdog installion failed.${NC}" +string_limit_x_mark "Watchdog was not installed................................." +fi +} + +function mongodb_bootstrap(){ + + echo -e "" + echo -e "${ARROW} ${YELLOW}Restore mongodb datatable from bootstrap${NC}" + + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') + fi + + #BLOCKHIGHT=$(curl -s -m 6 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') + echo -e "${ARROW} ${CYAN}Bootstrap block height: ${GREEN}$DB_HIGHT${NC}" + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" + wget --tries=5 $BOOTSTRAP_URL_MONGOD -q --show-progress + + if [[ -f /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD ]]; then + + echo -e "${ARROW} ${CYAN}Unpacking...${NC}" + tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" + mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 + sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 + + + BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) + echo -e ${ARROW} ${CYAN}Node block height after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC} + + else + + echo -e "${ARROW} ${RED}MongoDB bootstrap server offline...try again later use option 5${NC}" + fi + + echo -e "" + + #if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then + #echo -e "${ARROW} ${CYAN}Mongo bootstrap installed successful.${NC}" + #echo -e "" + # else + # echo -e "${ARROW} ${CYAN}Mongo bootstrap installation failed.${NC}" + # echo -e "" + # fi + +} + +function wipe_clean() { + echo -e "${ARROW} ${YELLOW}Removing any instances of FluxNode${NC}" + apt_number=$(ps aux | grep 'apt' | wc -l) + + if [[ "$apt_number" > 1 ]]; then + + sudo killall apt > /dev/null 2>&1 + sudo killall apt-get > /dev/null 2>&1 + sudo dpkg --configure -a > /dev/null 2>&1 + + fi + + echo -e "${ARROW} ${CYAN}Stopping all services and running processes...${NC}" + + # NEW CLEAN_UP + + sudo killall nano > /dev/null 2>&1 + $COIN_CLI stop > /dev/null 2>&1 && sleep 2 + sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 + sudo killall -s SIGKILL $COIN_DAEMON > /dev/null 2>&1 && sleep 2 + $BENCH_CLI stop > /dev/null 2>&1 && sleep 2 + sudo killall -s SIGKILL $BENCH_NAME > /dev/null 2>&1 && sleep 1 + sudo fuser -k 16127/tcp > /dev/null 2>&1 && sleep 1 + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + sudo rm -rf /usr/bin/flux* > /dev/null 2>&1 && sleep 1 + + echo -e "${ARROW} ${CYAN}Removing daemon && benchmark...${NC}" + sudo apt-get remove $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 + sudo apt-get purge $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 + sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 + sudo rm -rf /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 + tmux kill-server > /dev/null 2>&1 && sleep 1 + + echo -e "${ARROW} ${CYAN}Removing PM2...${NC}" + pm2 del zelflux > /dev/null 2>&1 && sleep 1 + pm2 del flux > /dev/null 2>&1 && sleep 1 + pm2 del watchdog > /dev/null 2>&1 && sleep 1 + pm2 save > /dev/null 2>&1 + pm2 unstartup > /dev/null 2>&1 && sleep 1 + pm2 flush > /dev/null 2>&1 && sleep 1 + pm2 save > /dev/null 2>&1 && sleep 1 + pm2 kill > /dev/null 2>&1 && sleep 1 + npm remove pm2 -g > /dev/null 2>&1 && sleep 1 + + echo -e "${ARROW} ${CYAN}Removing others files and scripts...${NC}" + sudo rm -rf watchgod > /dev/null 2>&1 && sleep 1 + sudo rm -rf $BENCH_DIR_LOG && sleep 1 + + #FILE OF OLD ZEL NODE + sudo rm -rf /etc/logrotate.d/mongolog > /dev/null 2>&1 + sudo rm -rf /etc/logrotate.d/zeldebuglog > /dev/null 2>&1 + rm update.sh > /dev/null 2>&1 + rm restart_zelflux.sh > /dev/null 2>&1 + rm zelnodeupdate.sh > /dev/null 2>&1 + rm start.sh > /dev/null 2>&1 + rm update-zelflux.sh > /dev/null 2>&1 + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + zelcash-cli stop > /dev/null 2>&1 && sleep 2 + sudo killall -s SIGKILL zelcashd > /dev/null 2>&1 + zelbench-cli stop > /dev/null 2>&1 + sudo killall -s SIGKILL zelbenchd > /dev/null 2>&1 + sudo rm /usr/local/bin/zel* > /dev/null 2>&1 && sleep 1 + sudo apt-get purge zelcash zelbench -y > /dev/null 2>&1 && sleep 1 + sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 + sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 + sudo rm -rf zelflux > /dev/null 2>&1 && sleep 1 + #sudo rm -rf ~/.zelcash/determ_zelnodes ~/.zelcash/sporks ~/$CONFIG_DIR/database ~/.zelcash/blocks ~/.zelcashchainstate > /dev/null 2>&1 && sleep 1 + #sudo rm -rf ~/.zelcash > /dev/null 2>&1 && sleep 1 + sudo rm -rf .zelbenchmark > /dev/null 2>&1 && sleep 1 + sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 + + if [[ -d /home/$USER/.zelcash ]]; then + + echo -e "${ARROW} ${CYAN}Moving ~/.zelcash to ~/.flux${NC}" + #echo -e "${ARROW} ${CYAN}Renaming zelcash.conf to flux.conf${NC}" + sudo mv /home/$USER/.zelcash /home/$USER/.flux > /dev/null 2>&1 && sleep 1 + sudo mv /home/$USER/.flux/zelcash.conf /home/$USER/.flux/flux.conf > /dev/null 2>&1 && sleep 1 + + fi + + + if [[ -d /home/$USER/$CONFIG_DIR ]]; then + + if [[ -z "$use_old_chain" ]]; then + + if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 + + else + BOOTSTRAP_SKIP="1" + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 + fi + + else + + if [[ "$use_old_chain" == "1" ]]; then + + BOOTSTRAP_SKIP="1" + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 + + else + + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 + + + fi + + fi +fi + + sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 + sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 + echo -e "" + + echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 +if [[ $(sudo ufw status | grep "Status: active") ]]; then + # then + # if [[ -z "$firewall_disable" ]]; then + # if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?(Recommended)" 8 60; then + sudo ufw disable > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + # else + # echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" + # fi + # else + + # if [[ "$firewall_disable" == "1" ]]; then + ### sudo ufw disable > /dev/null 2>&1 + # echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + # else + #echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" + # fi + # fi + + else + echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + fi + +} + +function spinning_timer() { + animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) + end=$((SECONDS+NUM)) + while [ $SECONDS -lt $end ]; + do + for i in "${animation[@]}"; + do + echo -e "" + echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" + sleep 0.1 + + done + done + echo -ne "${MSG2}" +} + + +function ssh_port() { + + if [[ -z "$ssh_port" ]]; then + + SSHPORT=$(grep -w Port /etc/ssh/sshd_config | sed -e 's/.*Port //') + if ! whiptail --yesno "Detected you are using $SSHPORT for SSH is this correct?" 8 56; then + SSHPORT=$(whiptail --inputbox "Please enter port you are using for SSH" 8 43 3>&1 1>&2 2>&3) + echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 + else + echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 + fi + + else + pettern='^[0-9]+$' + if [[ $ssh_port =~ $pettern ]] ; then + SSHPORT="$ssh_port" + echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 + else + echo -e "${ARROW} ${CYAN}SSH port must be integer................[${X_MARK}${CYAN}]${NC}}" + echo + exit + fi + fi +} + +function ip_confirm() { + echo -e "${ARROW} ${YELLOW}Detecting IP address...${NC}" + + WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') + fi + + + if [[ "$WANIP" == "" ]]; then + echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" + echo + exit + fi + + + string_limit_check_mark "Detected IP: $WANIP ................................." "Detected IP: ${GREEN}$WANIP${CYAN} ................................." + +} + +function create_swap() { + + if [[ -z "$swapon" ]]; then + #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + else + echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" + # fi + fi + + else + + if [[ "$swapon" == "1" ]]; then + + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + else + echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" + fi + #fi + + fi + + + fi + sleep 2 +} + +function install_packages() { + echo + echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" + + if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then + sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 + fi + + if ! dirmngr --v > /dev/null 2>&1; then + sudo apt install dirmngr -y > /dev/null 2>&1 + fi + + sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get upgrade -y > /dev/null 2>&1 + sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 + sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 + sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 + sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 + sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 + sudo apt-get remove sysbench -y > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" +} + +function create_conf() { + + echo -e "${ARROW} ${YELLOW}Creating Flux daemon config file...${NC}" + if [ -f ~/$CONFIG_DIR/$CONFIG_FILE ]; then + echo -e "${ARROW} ${CYAN}Existing conf file found backing up to $COIN_NAME.old ...${NC}" + mv ~/$CONFIG_DIR/$CONFIG_FILE ~/$CONFIG_DIR/$COIN_NAME.old; + fi + + RPCUSER=$(pwgen -1 8 -n) + PASSWORD=$(pwgen -1 20 -n) + + if [[ "$IMPORT_ZELCONF" == "0" ]] + then + zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Privkey generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) + zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) + zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) + fi + + + if [ "x$PASSWORD" = "x" ]; then + PASSWORD=${WANIP}-$(date +%s) + fi + mkdir ~/$CONFIG_DIR > /dev/null 2>&1 + touch ~/$CONFIG_DIR/$CONFIG_FILE + cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE +rpcuser=$RPCUSER +rpcpassword=$PASSWORD +rpcallowip=127.0.0.1 +rpcallowip=172.18.0.1 +rpcport=$RPCPORT +port=$PORT +zelnode=1 +zelnodeprivkey=$zelnodeprivkey +zelnodeoutpoint=$zelnodeoutpoint +zelnodeindex=$zelnodeindex +server=1 +daemon=1 +txindex=1 +addressindex=1 +timestampindex=1 +spentindex=1 +insightexplorer=1 +experimentalfeatures=1 +listen=1 +externalip=$WANIP +bind=0.0.0.0 +addnode=explorer.zelcash.online +addnode=explorer.runonflux.io +addnode=blockbook.runonflux.io +addnode=185.225.232.141:16125 +addnode=95.216.124.220:16125 +addnode=209.145.55.52:16125 +addnode=78.113.97.147:16125 +addnode=209.145.49.181:16125 +addnode=63.250.53.25:16125 +addnode=5.9.78.207:16125 +addnode=194.163.148.252:16125 +addnode=178.18.241.199:16125 +addnode=178.18.241.197:16125 +addnode=178.18.243.34:16125 +addnode=62.171.188.152:16125 +addnode=194.163.166.101:16125 +addnode=23.88.19.178:16125 +addnode=79.143.178.170:16125 +addnode=178.18.249.115:16125 +addnode=161.97.131.154:16125 +addnode=149.255.39.17:16125 +maxconnections=256 +EOF + sleep 2 +} + +function flux_package() { + sudo apt-get update -y > /dev/null 2>&1 && sleep 2 + echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" + sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 + sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 + integration_check +} + +function install_daemon() { + + sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 + sudo rm /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + + echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" + sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 + +if [[ "$(lsb_release -cs)" == "xenial" ]]; then + + echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + + flux_package && sleep 2 +else + + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + + # cleaning + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + + if [[ "$(lsb_release -cs)" == "impish" ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + fi + + + # downloading key && save it as keyring + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" + sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi + + + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi + + + if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + + flux_package && sleep 2 + + else + + echo + echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + + fi + +fi + + +} + + + +function zk_params() { + echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" + bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 + sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 +} + +function bootstrap() { + + BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" + + echo -e "" + echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" + if [[ -z "$bootstrap_url" ]]; then + + if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes + + fi + + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + + echo -e "${ARROW} ${YELLOW}Local bootstrap file detected...${NC}" + echo -e "${ARROW} ${YELLOW}Checking if zip file is corrupted...${NC}" + if unzip -t $BOOTSTRAP_ZIPFILE | grep 'No errors' > /dev/null 2>&1 + then + echo -e "${ARROW} ${CYAN}Bootstrap zip file is valid.............[${CHECK_MARK}${CYAN}]${NC}" + else + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $BOOTSTRAP_ZIPFILE + fi + + else + check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" + fi + + fi + + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + fi + + else + + + CHOICE=$( + whiptail --title "FLUXNODE INSTALLATION" --menu "Choose a method how to get bootstrap file" 10 47 2 \ + "1)" "Download from source build in script" \ + "2)" "Download from own source" 3>&2 2>&1 1>&3 + ) + + + case $CHOICE in + "1)") + + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + fi + + echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" + echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" + wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + #unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + + + ;; + "2)") + BOOTSTRAP_ZIP="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" + echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" + BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" + wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + fi + #echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + #unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + ;; + esac + + fi + + else + + if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes + fi + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + + echo -e "${ARROW} ${YELLOW}Local bootstrap file detected...${NC}" + echo -e "${ARROW} ${YELLOW}Checking if zip file is corrupted...${NC}" + if unzip -t $BOOTSTRAP_ZIPFILE | grep 'No errors' > /dev/null 2>&1 + then + echo -e "${ARROW} ${CYAN}Bootstrap zip file is valid.............[${CHECK_MARK}${CYAN}]${NC}" + else + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + printf '\e[A\e[K' + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $BOOTSTRAP_ZIPFILE + fi + + else + check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" + fi + + fi + + + if [[ "$bootstrap_url" == "" ]]; then + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + fi + + else + + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + fi + + echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" + echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" + wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + + fi + + else + + if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + else + BOOTSTRAP_ZIP="$bootstrap_url" + echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" + BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" + wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" + sleep 2 + fi + + fi + fi + fi + + if [[ -z "$bootstrap_zip_del" ]]; then + if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + rm -rf $BOOTSTRAP_ZIPFILE + fi + else + + if [[ "$bootstrap_zip_del" == "1" ]]; then + rm -rf $BOOTSTRAP_ZIPFILE + fi + + fi + + + + +} + + +function create_service_scripts() { + +#echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 +sudo touch /home/$USER/start_daemon_service.sh +sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + cat <<'EOF' > /home/$USER/start_daemon_service.sh +#!/bin/bash + +#color codes +RED='\033[1;31m' +CYAN='\033[1;36m' +NC='\033[0m' +#emoji codes +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + +sleep 2 +echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" +echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" +bench_status_pind=$(pgrep fluxbenchd) +daemon_status_pind=$(pgrep fluxd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi + +bench_status_pind=$(pgrep zelbenchd) +daemon_status_pind=$(pgrep zelcashd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi + +if [[ -f /usr/local/bin/fluxd ]]; then +bash -c "fluxd" +exit +else +bash -c "zelcashd" +exit +fi +EOF + + +sudo touch /home/$USER/stop_daemon_service.sh +sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh + cat <<'EOF' > /home/$USER/stop_daemon_service.sh +#!/bin/bash +if [[ -f /usr/local/bin/flux-cli ]]; then +bash -c "flux-cli stop" +else +bash -c "zelcash-cli stop" +fi +exit +EOF + +sudo chmod +x /home/$USER/stop_daemon_service.sh +sudo chmod +x /home/$USER/start_daemon_service.sh + +} + +function create_service() { + echo -e "${ARROW} ${YELLOW}Creating Flux daemon service...${NC}" && sleep 1 + sudo touch /etc/systemd/system/zelcash.service + sudo chown $USER:$USER /etc/systemd/system/zelcash.service + cat << EOF > /etc/systemd/system/zelcash.service +[Unit] +Description=Flux daemon service +After=network.target +[Service] +Type=forking +User=$USER +Group=$USER +ExecStart=/home/$USER/start_daemon_service.sh +ExecStop=-/home/$USER/stop_daemon_service.sh +Restart=always +RestartSec=10 +PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=15s +StartLimitInterval=120s +StartLimitBurst=5 +[Install] +WantedBy=multi-user.target +EOF + sudo chown root:root /etc/systemd/system/zelcash.service + sudo systemctl daemon-reload +} + +function basic_security() { + echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" + sudo ufw allow 16124/tcp > /dev/null 2>&1 + sudo ufw allow "$SSHPORT"/tcp > /dev/null 2>&1 + sudo ufw allow "$PORT"/tcp > /dev/null 2>&1 + sudo ufw logging on > /dev/null 2>&1 + sudo ufw default deny incoming > /dev/null 2>&1 + + sudo ufw allow out from any to any port 123 > /dev/null 2>&1 + sudo ufw allow out to any port 80 > /dev/null 2>&1 + sudo ufw allow out to any port 443 > /dev/null 2>&1 + sudo ufw allow out to any port 53 > /dev/null 2>&1 + sudo ufw allow out to any port 16124 > /dev/null 2>&1 + sudo ufw allow out to any port 16125 > /dev/null 2>&1 + sudo ufw allow out to any port 16127 > /dev/null 2>&1 + sudo ufw allow from any to any port 16127 > /dev/null 2>&1 + + sudo ufw default deny outgoing > /dev/null 2>&1 + sudo ufw limit OpenSSH > /dev/null 2>&1 + echo "y" | sudo ufw enable > /dev/null 2>&1 + sudo ufw reload > /dev/null 2>&1 + sudo systemctl enable fail2ban > /dev/null 2>&1 + sudo systemctl start fail2ban > /dev/null 2>&1 +} + +function pm2_install(){ + + echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" + npm install pm2@latest -g > /dev/null 2>&1 + + if pm2 -v > /dev/null 2>&1 + then + echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" + pm2 startup systemd -u $USER > /dev/null 2>&1 + sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 + + + #pm2 start ~/zelflux/start.sh --name zelflux > /dev/null 2>&1 + #pm2 save > /dev/null 2>&1 + + + pm2 install pm2-logrotate > /dev/null 2>&1 + pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 + pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 + pm2 set pm2-logrotate:compress true > /dev/null 2>&1 + pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 + pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 + + source ~/.bashrc + #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" + string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." + echo + else + string_limit_x_mark "PM2 was not installed................................." + echo + fi + +} + +function start_daemon() { + + sudo systemctl enable zelcash.service > /dev/null 2>&1 + sudo systemctl start zelcash > /dev/null 2>&1 + + NUM='250' + MSG1='Starting daemon & syncing with chain please be patient this will take about 3 min...' + MSG2='' + spinning_timer + + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + # if $COIN_DAEMON > /dev/null 2>&1; then + + NUM='2' + MSG1='Getting info...' + MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo + + + daemon_version=$($COIN_CLI getinfo | jq -r '.version') + string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." + #echo -e "Zelcash version: ${GREEN}v$zelcash_version${CYAN} installed................................." + bench_version=$($BENCH_CLI getinfo | jq -r '.version') + string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." + #echo -e "${ARROW} ${CYAN}Zelbench version: ${GREEN}v$zelbench_version${CYAN} installed${NC}" + echo + pm2_install + #zelbench-cli stop > /dev/null 2>&1 && sleep 2 + else + echo + echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" + + if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then + error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + if [[ "$error_line" != "" ]]; then + echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" + echo -e "${WORNING} ${CYAN}$error_line${NC}" + echo + exit + fi + fi + + + if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then + + echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" + echo -n "" + + else + + echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" + echo -n "" + exit + + fi + + + fi +} + +function log_rotate() { + echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" + sleep 1 + if [ -f /etc/logrotate.d/$2 ]; then + sudo rm -rf /etc/logrotate.d/$2 + sleep 2 + fi + + sudo touch /etc/logrotate.d/$2 + sudo chown $USER:$USER /etc/logrotate.d/$2 + cat << EOF > /etc/logrotate.d/$2 +$3 { + compress + copytruncate + missingok + $4 + rotate $5 +} +EOF + sudo chown root:root /etc/logrotate.d/$2 +} + +function install_process() { + + echo -e "${ARROW} ${YELLOW}Configuring firewall...${NC}" + sudo ufw allow $ZELFRONTPORT/tcp > /dev/null 2>&1 + sudo ufw allow $LOCPORT/tcp > /dev/null 2>&1 + sudo ufw allow $ZELNODEPORT/tcp > /dev/null 2>&1 + #sudo ufw allow $MDBPORT/tcp > /dev/null 2>&1 + + echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" + + sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 + sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + + curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + + if [[ $(lsb_release -d) = *Debian* ]]; then + + + if [[ $(lsb_release -cs) = *stretch* || $(lsb_release -cs) = *buster* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + fi + + + elif [[ $(lsb_release -d) = *Ubuntu* ]]; then + + + if [[ $(lsb_release -cs) = *focal* || $(lsb_release -cs) = *bionic* || $(lsb_release -cs) = *xenial* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + fi + + else + + echo -e "${WORNING} ${RED}OS type not supported..${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + + fi + + + if ! sysbench --version > /dev/null 2>&1; then + + echo + echo -e "${ARROW} ${YELLOW}Sysbench installing...${NC}" + curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh 2> /dev/null | sudo bash > /dev/null 2>&1 + sudo apt -y install sysbench > /dev/null 2>&1 + + if sysbench --version > /dev/null 2>&1; then + + string_limit_check_mark "Sysbench $(sysbench --version | awk '{print $2}') installed................................." "Sysbench ${GREEN}$(sysbench --version | awk '{print $2}')${CYAN} installed................................." + + fi + + fi + + install_mongod + install_nodejs + install_flux + sleep 2 +} + +function install_mongod() { +echo +echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" +sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 +sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 +sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 +sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 +echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" +sudo apt-get update -y > /dev/null 2>&1 +sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 +sudo systemctl enable mongod > /dev/null 2>&1 +sudo systemctl start mongod > /dev/null 2>&1 +if mongod --version > /dev/null 2>&1 +then + #echo -e "${ARROW} ${CYAN}MongoDB version: ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed${NC}" + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo +else + #echo -e "${ARROW} ${CYAN}MongoDB was not installed${NC}" + string_limit_x_mark "MongoDB was not installed................................." + echo +fi +} + +function install_nodejs() { +echo -e "${ARROW} ${YELLOW}Removing any instances of Nodejs...${NC}" +n-uninstall -y > /dev/null 2>&1 && sleep 1 +rm -rf ~/n +sudo apt-get remove nodejs npm nvm -y > /dev/null 2>&1 && sleep 1 +sudo apt-get purge nodejs nvm -y > /dev/null 2>&1 && sleep 1 +sudo rm -rf /usr/local/bin/npm +sudo rm -rf /usr/local/share/man/man1/node* +sudo rm -rf /usr/local/lib/dtrace/node.d +sudo rm -rf ~/.npm +sudo rm -rf ~/.nvm +sudo rm -rf ~/.pm2 +sudo rm -rf ~/.node-gyp +sudo rm -rf /opt/local/bin/node +sudo rm -rf opt/local/include/node +sudo rm -rf /opt/local/lib/node_modules +sudo rm -rf /usr/local/lib/node* +sudo rm -rf /usr/local/include/node* +sudo rm -rf /usr/local/bin/node* +echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" +#export NVM_DIR="$HOME/.nvm" && ( + # git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" > /dev/null 2>&1 + # cd "$NVM_DIR" + # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 +#) && \. "$NVM_DIR/nvm.sh" +#cd +#curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 +curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 +. ~/.profile +. ~/.bashrc +sleep 1 +#nvm install v12.16.1 +nvm install v14.18.1 > /dev/null 2>&1 +if node -v > /dev/null 2>&1 +then +#echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" +string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." +echo +else +#echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" +string_limit_x_mark "Nodejs was not installed................................." +echo +fi + +} + +function install_flux() { + + docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) + resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) + mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) + +if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then + +echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 +echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 +echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 + +fi + +if [[ $docker_check != 0 ]]; then +echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 +echo -e "${ARROW} ${CYAN}Removing containers...${NC}" + +sudo service docker restart > /dev/null 2>&1 && sleep 5 + +docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | +while read line; do +sudo docker stop $line > /dev/null 2>&1 && sleep 2 +sudo docker rm $line > /dev/null 2>&1 && sleep 2 +done +fi + +if [[ $resource_check != 0 ]]; then +echo -e "${ARROW} ${YELLOW}Detected locked resource${NC}" && sleep 1 +echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" && sleep 1 +df | egrep 'flux' | awk '{ print $1}' | +while read line; do +sudo umount -l $line && sleep 1 +done +fi + + if [ -d "./$FLUX_DIR" ]; then + echo -e "${ARROW} ${YELLOW}Removing any instances of Flux${NC}" + sudo rm -rf $FLUX_DIR + fi + + + echo -e "${ARROW} ${YELLOW}Flux installing...${NC}" + # git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 + git clone --single-branch --branch development https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 + echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" + + +if [[ "$IMPORT_ZELID" == "0" ]]; then + + while true + do + ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) + if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then + echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" + sleep 4 + fi + done + + # if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then + + tier + if [[ "$kadena_possible" == "1" ]]; then + + while true + do + + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* ]]; then + + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + + while true + do + KDA_C=$(whiptail --inputbox "Please enter your kadena chainid (0-19)" 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_C" -ge "0" && "$KDA_C" -le "19" ]]; then + echo -e "${ARROW} ${CYAN}Kadena chainid is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=$KDA_C" + break + else + echo -e "${ARROW} ${CYAN}Kadena chainid is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + + fi + + fi + + +if [[ "$KDA_A" != "" ]]; then + touch ~/$FLUX_DIR/config/userconfig.js + cat << EOF > ~/$FLUX_DIR/config/userconfig.js +module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${ZELID}', + kadena: '${KDA_A}', + testnet: false + } + } +EOF +else + touch ~/$FLUX_DIR/config/userconfig.js + cat << EOF > ~/$FLUX_DIR/config/userconfig.js +module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${ZELID}', + testnet: false + } + } +EOF +fi + +if [ -d ~/$FLUX_DIR ] +then +current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) + +string_limit_check_mark "Flux v$current_ver installed................................." "Flux ${GREEN}v$current_ver${CYAN} installed................................." +#echo -e "${ARROW} ${CYAN}Zelflux version: ${GREEN}v$current_ver${CYAN} installed${NC}" + +echo +else +string_limit_x_mark "Flux was not installed................................." +#echo -e "${ARROW} ${CYAN}Zelflux was not installed${NC}" +echo +fi + +} + + +function status_loop() { + +network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') +network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') + +EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + + +if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks') ]]; then +echo +echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" + + +LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') +CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') +LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + +NUM='2' +MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN}" +MSG2="${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" +spinning_timer +echo && echo + +else + + echo + echo -e "${CLOCK}${GREEN}FLUX DAEMON SYNCING...${NC}" + + f=0 + start_sync=`date +%s` + + + while true + do + + network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + + if [[ "$LEFT" == "0" ]]; then + time_break='5' + else + time_break='20' + fi + + #if [[ "$CONNECTIONS" == "0" ]]; then + # c=$((c+1)) + # if [[ "$c" > 3 ]]; then + # c=0; + #LOCAL_BLOCK_HIGHT="" + # fi + + #fi + # + if [[ $LOCAL_BLOCK_HIGHT == "" ]]; then + + f=$((f+1)) + LOCAL_BLOCK_HIGHT="N/A" + LEFT="N/A" + CONNECTIONS="N/A" + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo systemctl start zelcash > /dev/null 2>&1 + + NUM='60' + MSG1="Syncing progress => Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer + + network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + + fi + + NUM="$time_break" + MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer + + if [[ "$EXPLORER_BLOCK_HIGHT" == "$LOCAL_BLOCK_HIGHT" ]]; then + echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + break + fi + done + + fi + + + #pm2 start ~/$FLUX_DIR/start.sh --name flux --time > /dev/null 2>&1 + + + # if [[ -z "$mongo_bootstrap" ]]; then + + # if whiptail --yesno "Would you like to restore Mongodb datatable from bootstrap?" 8 60; then + # mongodb_bootstrap + # else + # echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" + # fi + # + # else + + # if [[ "$mongo_bootstrap" == "1" ]]; then + # mongodb_bootstrap + # else + # echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" + # fi + + # fi + + + #if [[ -z "$watchdog" ]]; then + #if whiptail --yesno "Would you like to install watchdog for FluxNode?" 8 60; then + install_watchdog + # else + # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" + # fi + # else + + # if [[ "$watchdog" == "1" ]]; then + # install_watchdog + # else + # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" + # fi + + # fi + + check + display_banner +} + +function check() { + +cd +pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 +pm2 save > /dev/null 2>&1 +#sleep 120 +#cd /home/$USER/zelflux +#pm2 stop flux +#npm install --legacy-peer-deps > /dev/null 2>&1 +#pm2 start flux +#cd + +NUM='400' +MSG1='Finalizing Flux installation please be patient this will take about ~5min...' +MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" +echo && spinning_timer +echo + +$BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 + +NUM='250' +MSG1='Restarting benchmark...' +MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" +spinning_timer +echo && echo + +echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" +echo -e "${YELLOW}======================${NC}" +bench_benchmarks=$($BENCH_CLI getbenchmarks) + +if [[ "bench_benchmarks" != "" ]]; then +bench_status=$(jq -r '.status' <<< "$bench_benchmarks") +if [[ "$bench_status" == "failed" ]]; then +echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" +check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" +check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" +else +echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" +bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") +echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" +bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") +bench_ram=$(round "$bench_ram" 2) +echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" +bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") +bench_ssd=$(round "$bench_ssd" 2) +echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" +bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") +bench_hdd=$(round "$bench_hdd" 2) +echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" +bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") +bench_ddwrite=$(round "$bench_ddwrite" 2) +echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" +bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") +bench_eps=$(round "$bench_eps" 2) +echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" +fi + +else +echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" +fi +} + +function display_banner() { + echo -e "${BLUE}" + figlet -t -k "FLUXNODE" + figlet -t -k "INSTALLATION COMPLETED" + echo -e "${YELLOW}================================================================================================================================" + #echo -e "FLUXNODE INSTALATION COMPLITED${NC}" + #echo -e "${CYAN}COURTESY OF DK808/XK4MiLX${NC}" + echo + if pm2 -v > /dev/null 2>&1; then + pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) + if [[ "$pm2_flux_status" == "online" ]]; then + pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" + else + if [[ "$pm2_flux_status" != "" ]]; then + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" + fi + fi + echo + fi + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" + echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" + echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" + echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" + echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} getinfo${NC}" + echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} getbenchmarks${NC}" + echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} restartnodebenchmarks${NC}" + echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} stop${NC}" + echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" + echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" + echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" + echo + if [[ "$WATCHDOG_INSTALL" == "1" ]]; then + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" + echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" + echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo + echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" + echo + fi + echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" + echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" + sleep 1 + cd $HOME + exec bash +} + + +function start_install() { + +start_install=`date +%s` + +sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo +echo -e "${CYAN}February 2021, created by dk808 improved by XK4MiLX from Flux's team." +echo -e "Special thanks to Goose-Tech, Skyslayer, & Packetflow." +echo -e "FluxNode setup starting, press [CTRL+C] to cancel.${NC}" +sleep 2 + +if jq --version > /dev/null 2>&1; then +echo -e "" +else +echo -e "" +echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" +sudo apt install jq -y > /dev/null 2>&1 + + if jq --version > /dev/null 2>&1 + then + #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" + string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" + string_limit_x_mark "JQ was not installed................................." + echo + exit + fi +fi + +if [ "$USER" = "root" ]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}root${CYAN}, please switch to the username you just created.${NC}" + sleep 4 + exit +fi + +start_dir=$(pwd) +correct_dir="/home/$USER" +echo -e "${ARROW} ${YELLOW}Checking directory....${NC}" +if [[ "$start_dir" == "$correct_dir" ]] +then +echo -e "${ARROW} ${CYAN}Correct directory ${GREEN}$(pwd)${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" +else +echo -e "${ARROW} ${CYAN}Bad directory switching...${NC}" +cd +echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" +fi +sleep 1 + +config_file + +if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then +import_date +else + +if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then +echo +IMPORT_ZELCONF="1" +IMPORT_ZELID="1" +echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" +zelnodeprivkey="$prvkey" +echo -e "${PIN}${CYAN}Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 +zelnodeoutpoint="$outpoint" +echo -e "${PIN}${CYAN}Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 +zelnodeindex="$index" +echo -e "${PIN}${CYAN}Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 +echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 +echo +fi + +fi + +} + +#end of functions + start_install + wipe_clean + ssh_port + ip_confirm + create_swap + install_packages + create_conf + install_daemon + zk_params + if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then + bootstrap + fi + create_service_scripts + create_service + + # if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then + # echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + # else + # if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then + selfhosting + ## else + #echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + ### fi + ## fi + + install_process + start_daemon + log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" + log_rotate "Flux daemon" "daemon_debug_log" "/home/$USER/$CONFIG_DIR/debug.log" "daily" "7" + log_rotate "MongoDB" "mongod_debug_log" "/var/log/mongodb/*.log" "daily" "14" + log_rotate "Docker" "docker_debug_log" "/var/lib/docker/containers/*/*.log" "daily" "7" + basic_security + status_loop From 34e7c40937663b9976f12ef7cb9cf5c4bee7cae7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 24 Feb 2022 19:31:00 +0100 Subject: [PATCH 0221/1176] testnet branch --- multitoolbox_testnet.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 41e181e9..a1e1b154 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -367,8 +367,11 @@ if [ -d /home/$USER/$FLUX_DIR ]; then fi echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" -#git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 -git clone --single-branch --branch development https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 +git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 +cd zelflux +echo -e "${ARROW} ${YELLOW}Changing to test branch...${NC}" +git checkout testnet > /dev/null 2>&1 +#git clone --single-branch --branch development https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 if [ -d /home/$USER/$FLUX_DIR ] then From 659bfdaaf5c9c96c6d36d32e65158eb222291047 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 25 Feb 2022 10:17:54 +0100 Subject: [PATCH 0222/1176] update commands for benchmark --- install_pro_testnet.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 5db5fa89..1a01e810 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -2109,10 +2109,10 @@ function display_banner() { echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" echo echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" - echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} getinfo${NC}" - echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} getbenchmarks${NC}" - echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} restartnodebenchmarks${NC}" - echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} stop${NC}" + echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} -testnet getinfo${NC}" + echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} -testnet getbenchmarks${NC}" + echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} -testnet restartnodebenchmarks${NC}" + echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} -testnet stop${NC}" echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" echo echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" From c28cc191425054310fc0942f9f429c30649578bc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 2 Mar 2022 12:00:04 +0100 Subject: [PATCH 0223/1176] fix arm64 binary update --- multitoolbox_testnet.sh | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index a1e1b154..c7baca7e 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1860,14 +1860,16 @@ fi exit fi - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /tmp/Flux* > /dev/null 2>&1 - sudo rm -rf /tmp/flux* > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Stopping flux daemon..${NC}" sudo systemctl stop zelcash > /dev/null 2>&1 + + +if [[ $(dpkg --print-architecture) = *amd* ]]; then + echo -e "${ARROW} ${CYAN}Downloading file...${NC}" sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 @@ -1875,11 +1877,32 @@ fi sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + sudo rm -rf /tmp/flux* 2>&1 && sleep 2 + sudo rm -rf /tmp/Flux* 2>&1 && sleep 2 + +else + + echo -e "${ARROW} ${CYAN}Downloading file...${NC}" + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-arm64-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 + + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.0.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + sudo rm -rf /tmp/flux* 2>&1 && sleep 2 + sudo rm -rf /tmp/Flux* 2>&1 && sleep 2 + +fi + + sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 echo -e "${ARROW} ${CYAN}Starting flux daemon..${NC}" echo "" sudo systemctl start zelcash > /dev/null 2>&1 - + } From b7c92c66cdb55918467dbc778d25d614670a3be2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 08:34:41 +0100 Subject: [PATCH 0224/1176] halving update - added new bootstrap - added config verification - skip use old chain when config verification failed - remove wallet.dat when config verification failed - rand bootstrap source build in script ( 4 source ) --- install_pro.sh | 96 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 25 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index c649c082..9d6f9f1e 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,7 +1,7 @@ #!/bin/bash # Bootstrap settings -BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' -BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' +#BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' +BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' @@ -28,6 +28,7 @@ IMPORT_ZELID="0" CORRUPTED="0" BOOTSTRAP_SKIP="0" WATCHDOG_INSTALL="0" +SKIP_OLD_CHAIN="0" #Zelflux ports ZELFRONTPORT=16126 @@ -75,6 +76,32 @@ fi echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" } +function config_veryfity(){ + + if [[ -f /home/$USER/.flux/flux.conf ]]; then + + echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" + insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) + + if [[ "$insightexplorer" == "1" ]]; then + + echo -e "${ARROW} ${CYAN}Insightexplorer enabled.............[${CHECK_MARK}${CYAN}]${NC}" + + else + + echo -e "${ARROW} ${CYAN}Insightexplorer enabled.............[${X_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Removing wallet.dat...${NC}" + echo -e "${ARROW} ${CYAN}Use old chain will be skipped...${NC}" + sudo rm -rf /home/$USER/$CONFIG_DIR/wallet.dat && sleep 1 + SKIP_OLD_CHAIN="1" + + fi + + fi + +} + + function selfhosting() { echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 @@ -347,7 +374,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Public Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') @@ -391,7 +418,7 @@ else echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Public Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') @@ -814,27 +841,41 @@ function wipe_clean() { if [[ -d /home/$USER/$CONFIG_DIR ]]; then + + config_veryfity if [[ -z "$use_old_chain" ]]; then - if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then - echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 - sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 + if [[ "SKIP_OLD_CHAIN" == "0" ]]; then + + if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 + + else + + BOOTSTRAP_SKIP="1" + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 + fi + + else + + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 + + fi - else - BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 - fi else @@ -1061,7 +1102,7 @@ function create_conf() { if [[ "$IMPORT_ZELCONF" == "0" ]] then - zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Privkey generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) + zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Public Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) fi @@ -1120,6 +1161,8 @@ EOF sleep 2 } + + function flux_package() { sudo apt-get update -y > /dev/null 2>&1 && sleep 2 echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" @@ -1214,6 +1257,9 @@ function zk_params() { function bootstrap() { + + indexb=$(shuf -i 1-4 -n 1) + BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" echo -e "" @@ -1278,9 +1324,9 @@ function bootstrap() { case $CHOICE in "1)") - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -s -m 10 https://cdn-4.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -s -m 10 https://cdn-4.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') fi echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" @@ -2264,7 +2310,7 @@ IMPORT_ZELCONF="1" IMPORT_ZELID="1" echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" zelnodeprivkey="$prvkey" -echo -e "${PIN}${CYAN}Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 +echo -e "${PIN}${CYAN}Public Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint="$outpoint" echo -e "${PIN}${CYAN}Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex="$index" From fe939d94fe3ba996c9556b5b93560be7ade84493 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 09:03:58 +0100 Subject: [PATCH 0225/1176] halving update - added new bootstrap with rand - mongod fix improvement - menu correction ( removed mongod , kda bootstrap option ) - added config verification for deamon reconfiguration --- multitoolbox.sh | 111 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 35 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index c9a88637..8abeba95 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,7 +1,9 @@ #!/bin/bash -BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' -BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' +#BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' +indexb=$(shuf -i 1-4 -n 1) +BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" +BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' KDA_BOOTSTRAP_ZIPFILE='kda_bootstrap.tar.gz' @@ -38,7 +40,7 @@ ARROW="${SEA}\xE2\x96\xB6${NC}" BOOK="${RED}\xF0\x9F\x93\x8B${NC}" HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -dversion="v6.0" +dversion="v7.0" PM2_INSTALL="0" zelflux_setting_import="0" @@ -48,6 +50,32 @@ export NEWT_COLORS=' title=black, ' +function config_veryfity(){ + + if [[ -f /home/$USER/.flux/flux.conf ]]; then + + echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" + insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) + + if [[ "$insightexplorer" == "1" ]]; then + + echo -e "${ARROW} ${CYAN}Insightexplorer enabled.............[${CHECK_MARK}${CYAN}]${NC}" + echo "" + + else + + echo -e "${WORNING} ${CYAN}Insightexplorer enabled.............[${X_MARK}${CYAN}]${NC}" + echo -e "${WORNING} ${CYAN}Use option 2 for node re-install${NC}" + echo -e "" + exit + + fi + + fi + +} + + function get_ip(){ WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') @@ -1113,7 +1141,10 @@ function flux_daemon_bootstrap() { case $CHOICE in "1)") - DB_HIGHT=$(curl -s -m 3 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -s -m 10 https://cdn-4.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 10 https://cdn-4.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') + fi echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" wget -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress @@ -1522,6 +1553,8 @@ if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then exit fi +config_veryfity + echo echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" sleep 4 @@ -1860,8 +1893,18 @@ fi exit fi - echo -e "" + echo -e "" + echo -e "${WORNING} ${CYAN}Stopping mongod service ${NC}" && sleep 1 + sudo systemctl stop mongod + echo -e "${WORNING} ${CYAN}Fix for corrupted DB ${NC}" && sleep 1 sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair + echo -e "${WORNING} ${CYAN}Fix for bad privilege ${NC}" && sleep 1 + sudo chown -R mongodb:mongodb /var/lib/mongodb + sudo chown mongodb:mongodb /tmp/mongodb-27017.sock + echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" && sleep 1 + sudo systemctl start mongod + echo -e "" + } @@ -2008,17 +2051,15 @@ echo -e "${CYAN}1 - Install Docker${NC}" echo -e "${CYAN}2 - Install FluxNode${NC}" echo -e "${CYAN}3 - FluxNode analyzer and fixer${NC}" echo -e "${CYAN}4 - Install watchdog for FluxNode${NC}" -echo -e "${CYAN}5 - Restore Flux MongoDB datatable from bootstrap${NC}" -echo -e "${CYAN}6 - Restore Flux blockchain from bootstrap${NC}" -echo -e "${CYAN}7 - Create FluxNode installation config file${NC}" -echo -e "${CYAN}8 - Re-install FluxOS${NC}" -echo -e "${CYAN}9 - Flux Daemon Reconfiguration${NC}" -echo -e "${CYAN}10 - Restore Kadena node blockchain from bootstrap${NC}" -echo -e "${CYAN}11 - Create Flux daemon service ( for old nodes )${NC}" -echo -e "${CYAN}12 - Create Self-hosting cron ip service ${NC}" -echo -e "${CYAN}13 - Replace Zel ID ${NC}" -echo -e "${CYAN}14 - Install fluxwatchtower for docker images autoupdate${NC}" -echo -e "${CYAN}15 - Recover corrupted MongoDB database${NC}" +echo -e "${CYAN}5 - Restore Flux blockchain from bootstrap${NC}" +echo -e "${CYAN}6 - Create FluxNode installation config file${NC}" +echo -e "${CYAN}7 - Re-install FluxOS${NC}" +echo -e "${CYAN}8 - Flux Daemon Reconfiguration${NC}" +echo -e "${CYAN}9 - Create Flux daemon service ( for old nodes )${NC}" +echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" +echo -e "${CYAN}11 - Replace Zel ID ${NC}" +echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" +echo -e "${CYAN}13 - Recover corrupted MongoDB database${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -2046,68 +2087,68 @@ read -rp "Pick an option and hit ENTER: " install_watchdog ;; - 5) - clear - sleep 1 - mongodb_bootstrap - ;; - 6) +# 5) + # clear + #sleep 1 + #mongodb_bootstrap +# ;; + 5) clear sleep 1 flux_daemon_bootstrap ;; - 7) + 6) clear sleep 1 create_config ;; - 8) + 7) clear sleep 1 install_flux ;; - 9) + 8) clear sleep 1 daemon_reconfiguration ;; - 10) - clear - sleep 1 - kda_bootstrap +# 10) + # clear + # sleep 1 + # kda_bootstrap - ;; +# ;; - 11) + 9) clear sleep 1 create_service create_service_scripts ;; - 12) + 10) clear sleep 1 selfhosting ;; - 13) + 11) clear sleep 1 replace_zelid echo -e "" ;; - 14) + 12) clear sleep 1 install_watchtower echo -e "" ;; - 15) + 13) clear sleep 1 mongod_db_fix From 3f24ecf1965cd80a6418876e31809038135c53bf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 09:18:40 +0100 Subject: [PATCH 0226/1176] Minor edits --- multitoolbox.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8abeba95..ab9b3fd4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1559,7 +1559,7 @@ echo echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" sleep 4 skip_change='3' -zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" +zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Public Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" sleep 1 zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output TX ID" 8 72 3>&1 1>&2 2>&3)" sleep 1 @@ -1570,7 +1570,7 @@ sleep 1 if [[ "$zelnodeprivkey" == "" ]]; then skip_change=$((skip_change-1)) -echo -e "${ARROW} ${CYAN}Replace FluxNode privkey skipped....................[${CHECK_MARK}${CYAN}]${NC}" +echo -e "${ARROW} ${CYAN}Replace FluxNode public key skipped....................[${CHECK_MARK}${CYAN}]${NC}" fi if [[ "$zelnodeoutpoint" == "" ]]; then @@ -1603,11 +1603,11 @@ sudo fuser -k 16125/tcp > /dev/null 2>&1 if [[ "$zelnodeprivkey" != "" ]]; then if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -echo -e "${ARROW} ${CYAN}Replace FluxNode privkey skipped....................[${CHECK_MARK}${CYAN}]${NC}" +echo -e "${ARROW} ${CYAN}Replace FluxNode public key skipped....................[${CHECK_MARK}${CYAN}]${NC}" else sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode privkey replaced successful................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}FluxNode public key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" fi fi From 96195b1d106335cb15fac83bc10f5681138051f3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 13:19:03 +0100 Subject: [PATCH 0227/1176] added config verification --- multitoolbox.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index ab9b3fd4..4336b550 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1077,6 +1077,9 @@ function flux_daemon_bootstrap() { cd echo -e "${NC}" + + config_veryfity + pm2 stop watchdog > /dev/null 2>&1 && sleep 2 echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 From 32d4bac765e857d47c73ded260787cebc6f5f725 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 13:31:47 +0100 Subject: [PATCH 0228/1176] update node list --- install_pro.sh | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 9d6f9f1e..8ce526c0 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1135,27 +1135,10 @@ experimentalfeatures=1 listen=1 externalip=$WANIP bind=0.0.0.0 -addnode=explorer.zelcash.online +addnode=explorer.flux.zelcore.io addnode=explorer.runonflux.io +addnode=explorer.zelcash.online addnode=blockbook.runonflux.io -addnode=185.225.232.141:16125 -addnode=95.216.124.220:16125 -addnode=209.145.55.52:16125 -addnode=78.113.97.147:16125 -addnode=209.145.49.181:16125 -addnode=63.250.53.25:16125 -addnode=5.9.78.207:16125 -addnode=194.163.148.252:16125 -addnode=178.18.241.199:16125 -addnode=178.18.241.197:16125 -addnode=178.18.243.34:16125 -addnode=62.171.188.152:16125 -addnode=194.163.166.101:16125 -addnode=23.88.19.178:16125 -addnode=79.143.178.170:16125 -addnode=178.18.249.115:16125 -addnode=161.97.131.154:16125 -addnode=149.255.39.17:16125 maxconnections=256 EOF sleep 2 From f13b3aac71ba55cf79af918648aa86febf0d1dee Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 14:49:47 +0100 Subject: [PATCH 0229/1176] improved awaiting for daemon start --- install_pro.sh | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 8ce526c0..5e3e5ab4 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1617,10 +1617,42 @@ function start_daemon() { sudo systemctl enable zelcash.service > /dev/null 2>&1 sudo systemctl start zelcash > /dev/null 2>&1 - NUM='250' - MSG1='Starting daemon & syncing with chain please be patient this will take about 3 min...' - MSG2='' - spinning_timer + #NUM='300' + #MSG1='Starting daemon & syncing with chain please be patient this will take about 5 min...' + #MSG2='' + #spinning_timer + + + + x=1 + while [ $x -le 6 ] + do + + NUM='300' + MSG1='Starting daemon & syncing with chain please be patient this will take about 5 min...' + MSG2='' + spinning_timer + + chain_check=$(flux-cli getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) + if [[ "$chain_check" == "1" ]]; then + echo -e "${ARROW} ${CYAN}Activating best chain detected....Awaiting incresed for next 5min${NC}" + fi + + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + break + fi + + if [[ "$x" -gt 6 ]]; then + echo -e "${ARROW} ${CYAN}Maximum timeout exceeded...${NC}" + break + fi + + x=$(( $x + 1 )) + + done + + + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then # if $COIN_DAEMON > /dev/null 2>&1; then From 91c5b0334189f7d3aa27606a1fbfcd158891f305 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 14:57:09 +0100 Subject: [PATCH 0230/1176] fix missing $ --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 5e3e5ab4..7f580d41 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -846,7 +846,7 @@ function wipe_clean() { if [[ -z "$use_old_chain" ]]; then - if [[ "SKIP_OLD_CHAIN" == "0" ]]; then + if [[ "$SKIP_OLD_CHAIN" == "0" ]]; then if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" From 3c314a5c5ecf678f17b910c0c23228a41ac93514 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 16:59:49 +0100 Subject: [PATCH 0231/1176] Minor edit --- install_pro.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_pro.sh b/install_pro.sh index 7f580d41..29a9ba05 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1635,6 +1635,7 @@ function start_daemon() { chain_check=$(flux-cli getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) if [[ "$chain_check" == "1" ]]; then + echo -e "" echo -e "${ARROW} ${CYAN}Activating best chain detected....Awaiting incresed for next 5min${NC}" fi From 346c9019e632eca6e26f31d35121f8740f6a1cae Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:01:59 +0100 Subject: [PATCH 0232/1176] fix typo --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 29a9ba05..a6ce73f4 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1636,7 +1636,7 @@ function start_daemon() { chain_check=$(flux-cli getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) if [[ "$chain_check" == "1" ]]; then echo -e "" - echo -e "${ARROW} ${CYAN}Activating best chain detected....Awaiting incresed for next 5min${NC}" + echo -e "${ARROW} ${CYAN}Activating best chain detected....Awaiting increased for next 5min${NC}" fi if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then From 18dcf8c9710292ec3f5c84db3374c9bab3d23460 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:47:05 +0100 Subject: [PATCH 0233/1176] added port range for FluxOS communication --- install_pro.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index a6ce73f4..b6cc9f32 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1555,9 +1555,9 @@ EOF function basic_security() { echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" - sudo ufw allow 16124/tcp > /dev/null 2>&1 + #sudo ufw allow 16124/tcp > /dev/null 2>&1 sudo ufw allow "$SSHPORT"/tcp > /dev/null 2>&1 - sudo ufw allow "$PORT"/tcp > /dev/null 2>&1 + #sudo ufw allow "$PORT"/tcp > /dev/null 2>&1 sudo ufw logging on > /dev/null 2>&1 sudo ufw default deny incoming > /dev/null 2>&1 @@ -1565,10 +1565,14 @@ function basic_security() { sudo ufw allow out to any port 80 > /dev/null 2>&1 sudo ufw allow out to any port 443 > /dev/null 2>&1 sudo ufw allow out to any port 53 > /dev/null 2>&1 - sudo ufw allow out to any port 16124 > /dev/null 2>&1 - sudo ufw allow out to any port 16125 > /dev/null 2>&1 - sudo ufw allow out to any port 16127 > /dev/null 2>&1 - sudo ufw allow from any to any port 16127 > /dev/null 2>&1 + #sudo ufw allow out to any port 16124 > /dev/null 2>&1 + #sudo ufw allow out to any port 16125 > /dev/null 2>&1 + #sudo ufw allow out to any port 16127 > /dev/null 2>&1 + #sudo ufw allow from any to any port 16127 > /dev/null 2>&1 + + #FluxOS communication + sudo ufw allow 16100:16199/tcp > /dev/null 2>&1 + ## sudo ufw default deny outgoing > /dev/null 2>&1 sudo ufw limit OpenSSH > /dev/null 2>&1 From 453fedf001cafda117e55a0746bbc20f5743ac8f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 18:33:38 +0100 Subject: [PATCH 0234/1176] disabled error output --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4336b550..30eb435b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1902,8 +1902,8 @@ fi echo -e "${WORNING} ${CYAN}Fix for corrupted DB ${NC}" && sleep 1 sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair echo -e "${WORNING} ${CYAN}Fix for bad privilege ${NC}" && sleep 1 - sudo chown -R mongodb:mongodb /var/lib/mongodb - sudo chown mongodb:mongodb /tmp/mongodb-27017.sock + sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 + sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" && sleep 1 sudo systemctl start mongod echo -e "" From 740fecd931593ee3c185153085f0652bf66c048c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 20:12:18 +0100 Subject: [PATCH 0235/1176] random ip instead of domain --- install_pro.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index b6cc9f32..deaa5257 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -76,6 +76,12 @@ fi echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" } +function bootstrap_rand_ip(){ +rand=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") +r=$(shuf -i 0-3 -n 1) +bootstrap_ip=${rand[$r]} +} + function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then @@ -1239,10 +1245,11 @@ function zk_params() { } function bootstrap() { - - indexb=$(shuf -i 1-4 -n 1) - BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + bootstrap_rand_ip + # indexb=$(shuf -i 1-4 -n 1) + # BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + BOOTSTRAP_ZIP="https://$bootstrap_ip/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" echo -e "" From c75eff4b2e7de9c44d6afea0eda7495486f00501 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 20:19:49 +0100 Subject: [PATCH 0236/1176] fix bootstrap --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index deaa5257..b00b862d 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1249,7 +1249,7 @@ function bootstrap() { bootstrap_rand_ip # indexb=$(shuf -i 1-4 -n 1) # BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" - BOOTSTRAP_ZIP="https://$bootstrap_ip/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + BOOTSTRAP_ZIP="http://$bootstrap_ip:11111/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" echo -e "" From 9e7573867012227b996743871c08f7306ace0c2f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 20:23:52 +0100 Subject: [PATCH 0237/1176] replaced domain by ip --- multitoolbox.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 30eb435b..569c6deb 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,8 +1,14 @@ #!/bin/bash #BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' -indexb=$(shuf -i 1-4 -n 1) -BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" +#indexb=$(shuf -i 1-4 -n 1) +#BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + +rand=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") +r=$(shuf -i 0-3 -n 1) +bootstrap_ip=${rand[$r]} +BOOTSTRAP_ZIP="http://$bootstrap_ip:11111/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' From 0568bb3876585b302dd7fbe1bc978be1799c247b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 3 Mar 2022 21:20:33 +0100 Subject: [PATCH 0238/1176] update install_packages --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index b00b862d..140dccd4 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1085,7 +1085,7 @@ function install_packages() { sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get upgrade -y > /dev/null 2>&1 + sudo apt-get --with-new-pkgs upgrade -y > /dev/null 2>&1 sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 From 8df7a018b05b757f2d704b2637b97d505d0dd475 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Mar 2022 07:46:32 +0100 Subject: [PATCH 0239/1176] update docker install info --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 569c6deb..a670a6ae 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1444,7 +1444,7 @@ echo -e "${YELLOW}============================================================== if [[ "$USER" != "root" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the root account use command 'su -'.${NC}" + echo -e "${CYAN}Please switch to the root account use command 'sudo su -'.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit From fabc0bf2711142ee1e2363aa26eaa347c843479c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Mar 2022 07:56:21 +0100 Subject: [PATCH 0240/1176] halving update part 2 - revert bootstrap domain - revert private key - update kda message - auto delete bootstrap archive after download - bootstrap info form download server --- install_pro.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 140dccd4..06204c44 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -380,7 +380,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Public Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') @@ -424,7 +424,7 @@ else echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Public Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') @@ -1108,7 +1108,7 @@ function create_conf() { if [[ "$IMPORT_ZELCONF" == "0" ]] then - zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Public Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) + zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) fi @@ -1246,10 +1246,10 @@ function zk_params() { function bootstrap() { - bootstrap_rand_ip - # indexb=$(shuf -i 1-4 -n 1) - # BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" - BOOTSTRAP_ZIP="http://$bootstrap_ip:11111/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + # bootstrap_rand_ip + indexb=$(shuf -i 1-4 -n 1) + BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + #BOOTSTRAP_ZIP="http://$bootstrap_ip:11111/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" echo -e "" @@ -1314,9 +1314,9 @@ function bootstrap() { case $CHOICE in "1)") - DB_HIGHT=$(curl -s -m 10 https://cdn-4.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://cdn-4.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') fi echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" @@ -1433,9 +1433,9 @@ function bootstrap() { fi if [[ -z "$bootstrap_zip_del" ]]; then - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + # if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then rm -rf $BOOTSTRAP_ZIPFILE - fi + # fi else if [[ "$bootstrap_zip_del" == "1" ]]; then @@ -1943,7 +1943,7 @@ if [[ "$IMPORT_ZELID" == "0" ]]; then while true do - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* ]]; then echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" @@ -2337,7 +2337,7 @@ IMPORT_ZELCONF="1" IMPORT_ZELID="1" echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" zelnodeprivkey="$prvkey" -echo -e "${PIN}${CYAN}Public Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 +echo -e "${PIN}${CYAN}Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint="$outpoint" echo -e "${PIN}${CYAN}Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex="$index" From 6cd3c35f24293753938bcccde64cba4ec682a4cb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Mar 2022 08:03:35 +0100 Subject: [PATCH 0241/1176] halving update part 2 - revert domain - revert key name - bootstrap info for download server - restart flux after bootstrap apply --- multitoolbox.sh | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a670a6ae..365f155f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,14 +1,12 @@ #!/bin/bash #BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' -#indexb=$(shuf -i 1-4 -n 1) -#BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" - -rand=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") -r=$(shuf -i 0-3 -n 1) -bootstrap_ip=${rand[$r]} -BOOTSTRAP_ZIP="http://$bootstrap_ip:11111/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" - +indexb=$(shuf -i 1-4 -n 1) +BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" +#rand=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") +#r=$(shuf -i 0-3 -n 1) +#bootstrap_ip=${rand[$r]} +#BOOTSTRAP_ZIP="http://$bootstrap_ip:11111/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' @@ -1150,9 +1148,9 @@ function flux_daemon_bootstrap() { case $CHOICE in "1)") - DB_HIGHT=$(curl -s -m 10 https://cdn-4.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://cdn-4.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') fi echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" @@ -1197,6 +1195,7 @@ function flux_daemon_bootstrap() { MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" spinning_timer echo -e "" && echo -e "" + pm2 restart flux pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 } @@ -1568,7 +1567,7 @@ echo echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" sleep 4 skip_change='3' -zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Public Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" +zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" sleep 1 zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output TX ID" 8 72 3>&1 1>&2 2>&3)" sleep 1 @@ -1612,11 +1611,11 @@ sudo fuser -k 16125/tcp > /dev/null 2>&1 if [[ "$zelnodeprivkey" != "" ]]; then if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -echo -e "${ARROW} ${CYAN}Replace FluxNode public key skipped....................[${CHECK_MARK}${CYAN}]${NC}" +echo -e "${ARROW} ${CYAN}Replace FluxNode private key skipped....................[${CHECK_MARK}${CYAN}]${NC}" else sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode public key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}FluxNode private key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" fi fi From d4abd91f94c14742744378c8bd23b3f7fd80fbad Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Mar 2022 08:04:53 +0100 Subject: [PATCH 0242/1176] Minor update --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 365f155f..87ac8f8b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1195,7 +1195,7 @@ function flux_daemon_bootstrap() { MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" spinning_timer echo -e "" && echo -e "" - pm2 restart flux + pm2 restart flux > /dev/null 2>&1 && sleep 2 pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 } From 2f03964c0ce2508de307a376d1f25cb15d9385b2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Mar 2022 08:13:11 +0100 Subject: [PATCH 0243/1176] replaced cli name by variable --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 06204c44..02b4ccd8 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1644,7 +1644,7 @@ function start_daemon() { MSG2='' spinning_timer - chain_check=$(flux-cli getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) + chain_check=$($COIN_CLI getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) if [[ "$chain_check" == "1" ]]; then echo -e "" echo -e "${ARROW} ${CYAN}Activating best chain detected....Awaiting increased for next 5min${NC}" From b0f5d357b30cbe666224c4d01ed171bd66653c1e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 4 Mar 2022 08:20:28 +0100 Subject: [PATCH 0244/1176] selfhosting as default --- install_pro_testnet.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 1a01e810..5beece1f 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -2229,15 +2229,15 @@ fi create_service_scripts create_service - if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then - echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" - else - if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then + # if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then + # echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + # else + # if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then selfhosting - else - echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" - fi - fi + # else + # echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" + # fi + # fi install_process start_daemon From 95cbbddb77558cd45302d29e766a6cf51bde14f1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Mar 2022 11:12:32 +0100 Subject: [PATCH 0245/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 87ac8f8b..9e23dfd6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -2063,7 +2063,7 @@ echo -e "${CYAN}5 - Restore Flux blockchain from bootstrap${NC}" echo -e "${CYAN}6 - Create FluxNode installation config file${NC}" echo -e "${CYAN}7 - Re-install FluxOS${NC}" echo -e "${CYAN}8 - Flux Daemon Reconfiguration${NC}" -echo -e "${CYAN}9 - Create Flux daemon service ( for old nodes )${NC}" +echo -e "${CYAN}9 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}11 - Replace Zel ID ${NC}" echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" From 65a906c6c4485146f428d03bf8e930fbee4c1dcb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Mar 2022 12:47:25 +0100 Subject: [PATCH 0246/1176] added bootstrap server check --- install_pro.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 02b4ccd8..502ada6f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -29,6 +29,7 @@ CORRUPTED="0" BOOTSTRAP_SKIP="0" WATCHDOG_INSTALL="0" SKIP_OLD_CHAIN="0" +Server_offline=0 #Zelflux ports ZELFRONTPORT=16126 @@ -76,6 +77,39 @@ fi echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" } +function bootstrap_server(){ +#rand_by_ip=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") +rand_by_domain=("1" "2" "3" "4") +richable=() + +i=0 +len=${#rand_by_domain[@]} +#echo -e "Bootstrap on list: $len" +while [ $i -lt $len ]; +do + + #echo ${rand_by_domain[$i]} + bootstrap_check=$(curl -s -m 10 https://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + #echo -e "Height: $bootstrap_check" + if [[ "$bootstrap_check" != "" ]]; then + #echo -e "Adding: ${rand_by_domain[$i]}" + richable+=( ${rand_by_domain[$i]} ) + fi + i=$(($i+1)) + + +done + +len=${#richable[@]} +if [[ "$len" == "0" ]]; then +echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 +Server_offline=1 +return 1 +fi +Server_offline=0 + +} + function bootstrap_rand_ip(){ rand=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") r=$(shuf -i 0-3 -n 1) @@ -1245,9 +1279,14 @@ function zk_params() { } function bootstrap() { + + bootstrap_server + if [[ "$Server_offline" == "1" ]]; then + return 1 + fi # bootstrap_rand_ip - indexb=$(shuf -i 1-4 -n 1) + indexb=$(shuf -i 0-${#richable[@]} -n 1) BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" #BOOTSTRAP_ZIP="http://$bootstrap_ip:11111/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" @@ -1314,11 +1353,15 @@ function bootstrap() { case $CHOICE in "1)") - DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) fi + ckec + + + echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress From 121ed6045f2521d53c9af4e42a28730e94976f10 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Mar 2022 17:01:45 +0100 Subject: [PATCH 0247/1176] auto detection ssh port as default --- install_pro.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 502ada6f..e7089f6f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -998,12 +998,12 @@ function ssh_port() { if [[ -z "$ssh_port" ]]; then SSHPORT=$(grep -w Port /etc/ssh/sshd_config | sed -e 's/.*Port //') - if ! whiptail --yesno "Detected you are using $SSHPORT for SSH is this correct?" 8 56; then - SSHPORT=$(whiptail --inputbox "Please enter port you are using for SSH" 8 43 3>&1 1>&2 2>&3) + # if ! whiptail --yesno "Detected you are using $SSHPORT for SSH is this correct?" 8 56; then + # SSHPORT=$(whiptail --inputbox "Please enter port you are using for SSH" 8 43 3>&1 1>&2 2>&3) + # echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 + # else echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 - else - echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 - fi + # fi else pettern='^[0-9]+$' From 5a4abf641643672fd9d97f77c8a296a6da637384 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Mar 2022 17:39:50 +0100 Subject: [PATCH 0248/1176] clean --- install_pro.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index e7089f6f..ff8d7faf 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1358,7 +1358,6 @@ function bootstrap() { DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) fi - ckec From a75b2c99c5451f723f076683ca9d9af260318757 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Mar 2022 19:28:48 +0100 Subject: [PATCH 0249/1176] clean --- install_pro.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index ff8d7faf..775d7051 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2176,7 +2176,6 @@ else # fi - #if [[ -z "$watchdog" ]]; then #if whiptail --yesno "Would you like to install watchdog for FluxNode?" 8 60; then install_watchdog From c4966afdab41a5ff5526003db4067b00e640d11e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Mar 2022 19:32:30 +0100 Subject: [PATCH 0250/1176] redirect script to master --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9e23dfd6..a7b0b434 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1431,7 +1431,7 @@ exit fi -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development_halving/install_pro.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) } From b284016c86f7ec4a4a4fbbe5a914abc9b5487229 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Mar 2022 19:34:09 +0100 Subject: [PATCH 0251/1176] redirect to master --- multitoolbox_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index c7baca7e..28905067 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1392,7 +1392,7 @@ fi # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development_halving/install_pro_testnet.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro_testnet.sh) } From 0cff4b037230050a88cf416d7282d72734c2dfe3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Mar 2022 02:03:04 +0100 Subject: [PATCH 0252/1176] fix for bootstrap array item --- install_pro.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 775d7051..d583fef0 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1286,7 +1286,10 @@ function bootstrap() { fi # bootstrap_rand_ip - indexb=$(shuf -i 0-${#richable[@]} -n 1) + bootstrap_index=$((${#richable[@]}-1)) + r=$(shuf -i 0-$bootstrap_index -n 1) + indexb=${richable[$r]} + BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" #BOOTSTRAP_ZIP="http://$bootstrap_ip:11111/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" From 6c6b6c906efb33b3035901d861bbab54ad42670e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Mar 2022 09:25:16 +0100 Subject: [PATCH 0253/1176] added bootstrap server check --- multitoolbox.sh | 62 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a7b0b434..8f1f94c0 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,12 +1,5 @@ #!/bin/bash -#BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' -indexb=$(shuf -i 1-4 -n 1) -BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" -#rand=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") -#r=$(shuf -i 0-3 -n 1) -#bootstrap_ip=${rand[$r]} -#BOOTSTRAP_ZIP="http://$bootstrap_ip:11111/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' @@ -25,6 +18,7 @@ fi FLUX_DIR='zelflux' FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' +Server_offline=0 #color codes RED='\033[1;31m' @@ -80,6 +74,39 @@ function config_veryfity(){ } +function bootstrap_server(){ +#rand_by_ip=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") +rand_by_domain=("1" "2" "3" "4") +richable=() + +i=0 +len=${#rand_by_domain[@]} +#echo -e "Bootstrap on list: $len" +while [ $i -lt $len ]; +do + + #echo ${rand_by_domain[$i]} + bootstrap_check=$(curl -s -m 10 https://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + #echo -e "Height: $bootstrap_check" + if [[ "$bootstrap_check" != "" ]]; then + #echo -e "Adding: ${rand_by_domain[$i]}" + richable+=( ${rand_by_domain[$i]} ) + fi + i=$(($i+1)) + + +done + +len=${#richable[@]} +if [[ "$len" == "0" ]]; then +echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 +Server_offline=1 +return 1 +fi +Server_offline=0 + +} + function get_ip(){ WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') @@ -629,8 +656,11 @@ fi if [[ "$skip_bootstrap" == "0" ]]; then if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then -bootstrap_url="$BOOTSTRAP_ZIP" + +bootstrap_server_index=$(shuf -i 1-4 -n 1) +bootstrap_url="https://cdn-$bootstrap_server_index.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" sleep 1 + else bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) sleep 1 @@ -1083,6 +1113,18 @@ function flux_daemon_bootstrap() { echo -e "${NC}" config_veryfity + bootstrap_server + + if [[ "$Server_offline" == "1" ]]; then + echo -e "" + exit + fi + + bootstrap_index=$((${#richable[@]}-1)) + r=$(shuf -i 0-$bootstrap_index -n 1) + indexb=${richable[$r]} + BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" pm2 stop watchdog > /dev/null 2>&1 && sleep 2 echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" @@ -1092,9 +1134,7 @@ function flux_daemon_bootstrap() { if [[ -e /home/$USER/$CONFIG_DIR/blocks ]] && [[ -e /home/$USER/$CONFIG_DIR/chainstate ]]; then echo -e "${ARROW} ${CYAN}Cleaning...${NC}" rm -rf /home/$USER/$CONFIG_DIR/blocks /home/$USER/$CONFIG_DIR/chainstate /home/$USER/$CONFIG_DIR/determ_zelnodes - fi - - BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" + fi if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then From 79e82441ddcb5814bed2b0d8b0ba1edb575e3c5b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Mar 2022 10:19:55 +0100 Subject: [PATCH 0254/1176] Minor edits and improvement --- install_pro.sh | 114 ++++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index d583fef0..c25e03fd 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -414,7 +414,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') @@ -458,7 +458,7 @@ else echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') @@ -1142,7 +1142,7 @@ function create_conf() { if [[ "$IMPORT_ZELCONF" == "0" ]] then - zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) + zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) fi @@ -1182,6 +1182,58 @@ addnode=blockbook.runonflux.io maxconnections=256 EOF sleep 2 + + if [[ "$IMPORT_ZELID" == "0" ]]; then + + while true + do + ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) + if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then + echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" + sleep 4 + fi + done + + # if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then + + tier + if [[ "$kadena_possible" == "1" ]]; then + + while true + do + + KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* ]]; then + + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + + while true + do + KDA_C=$(whiptail --inputbox "Please enter your kadena chainid (0-19)" 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_C" -ge "0" && "$KDA_C" -le "19" ]]; then + echo -e "${ARROW} ${CYAN}Kadena chainid is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=$KDA_C" + break + else + echo -e "${ARROW} ${CYAN}Kadena chainid is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + + fi + + fi + } @@ -1964,59 +2016,7 @@ fi echo -e "${ARROW} ${YELLOW}Flux installing...${NC}" git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" - - -if [[ "$IMPORT_ZELID" == "0" ]]; then - - while true - do - ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) - if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then - echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" - sleep 4 - fi - done - - # if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then - - tier - if [[ "$kadena_possible" == "1" ]]; then - - while true - do - - KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* ]]; then - - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - - while true - do - KDA_C=$(whiptail --inputbox "Please enter your kadena chainid (0-19)" 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_C" -ge "0" && "$KDA_C" -le "19" ]]; then - echo -e "${ARROW} ${CYAN}Kadena chainid is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=$KDA_C" - break - else - echo -e "${ARROW} ${CYAN}Kadena chainid is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - - fi - - fi - + if [[ "$KDA_A" != "" ]]; then touch ~/$FLUX_DIR/config/userconfig.js @@ -2381,7 +2381,7 @@ IMPORT_ZELCONF="1" IMPORT_ZELID="1" echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" zelnodeprivkey="$prvkey" -echo -e "${PIN}${CYAN}Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 +echo -e "${PIN}${CYAN}Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint="$outpoint" echo -e "${PIN}${CYAN}Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex="$index" From c6762280fb94f948d8280c04bc8b0dffc091e7e4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Mar 2022 14:17:20 +0100 Subject: [PATCH 0255/1176] added alias multitoolbox --- multitoolbox.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8f1f94c0..4d40dc3b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -2083,6 +2083,12 @@ then sudo apt-get install -y whiptail > /dev/null 2>&1 fi +if [[ -f /home/$USER/.bashrc ]]; then + if [[ $(cat /home/$USER/.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then + echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" >> /home/$USER/.bashrc + source /home/$USER/.bashrc + fi +fi clear From 035b880b9b1127030b43f5da02502d4515c00cae Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 8 Mar 2022 14:42:40 +0100 Subject: [PATCH 0256/1176] fix alias for all users --- multitoolbox.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4d40dc3b..5665fc49 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -2083,11 +2083,16 @@ then sudo apt-get install -y whiptail > /dev/null 2>&1 fi -if [[ -f /home/$USER/.bashrc ]]; then - if [[ $(cat /home/$USER/.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then - echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" >> /home/$USER/.bashrc - source /home/$USER/.bashrc - fi +if [[ ! -f /etc/profile.d/alias.sh ]]; then + +sudo touch /etc/profile.d/alias.sh +sudo chown $USER:$USER /etc/profile.d/alias.sh + cat << EOF > /etc/profile.d/alias.sh +#!/bin/bash +alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)' +EOF +source /etc/profile.d/alias.sh + fi From dfe9c8e6be5da49e30486e178a7f9b0ed5484871 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 9 Mar 2022 08:02:12 +0100 Subject: [PATCH 0257/1176] improvement selfhosting --- install_pro.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index c25e03fd..df017cf2 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -143,16 +143,17 @@ function config_veryfity(){ function selfhosting() { + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" - echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') if [[ "$device_name" != "" && "$WANIP" != "" ]]; then sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 else - echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 + echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 echo -e "" - exit + return 1 fi echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 From 4406ae8c3f20667c88529ac4f60f94cd1394589b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 9 Mar 2022 08:36:54 +0100 Subject: [PATCH 0258/1176] fix alias for all users --- multitoolbox.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5665fc49..dec1580c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -2083,16 +2083,9 @@ then sudo apt-get install -y whiptail > /dev/null 2>&1 fi -if [[ ! -f /etc/profile.d/alias.sh ]]; then - -sudo touch /etc/profile.d/alias.sh -sudo chown $USER:$USER /etc/profile.d/alias.sh - cat << EOF > /etc/profile.d/alias.sh -#!/bin/bash -alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)' -EOF -source /etc/profile.d/alias.sh - +if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then +echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc +source /etc/bash.bashrc fi From e7df9bfcdf400eaf79eb867513972604a4fe749a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 9 Mar 2022 10:53:31 +0100 Subject: [PATCH 0259/1176] Update install_pro.sh --- install_pro.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index df017cf2..ab6fe84d 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1254,7 +1254,8 @@ function install_daemon() { echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 - + sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 + if [[ "$(lsb_release -cs)" == "xenial" ]]; then echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 From 7a2c19a9d6a5981e318504d8f52288657dc05c5c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 10:26:12 +0100 Subject: [PATCH 0260/1176] initial --- geo_test.sh | 224 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 geo_test.sh diff --git a/geo_test.sh b/geo_test.sh new file mode 100644 index 00000000..7f49919d --- /dev/null +++ b/geo_test.sh @@ -0,0 +1,224 @@ +#!/bin/bash + +BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' + +#color codes +RED='\033[1;31m' +YELLOW='\033[1;33m' +BLUE="\\033[38;5;27m" +SEA="\\033[38;5;49m" +GREEN='\033[1;32m' +CYAN='\033[1;36m' +NC='\033[0m' + +#emoji codes +CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" +X_MARK="${RED}\xE2\x9C\x96${NC}" +PIN="${RED}\xF0\x9F\x93\x8C${NC}" +CLOCK="${GREEN}\xE2\x8C\x9B${NC}" +ARROW="${SEA}\xE2\x96\xB6${NC}" +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + +#dialog color +export NEWT_COLORS=' +title=black, +' + +function get_ip(){ + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi +} + +function bootstrap_geolocation(){ + +IP=$WANIP +ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone | jq .) +ip_status=$( jq -r .status <<< "$ip_output") + +if [[ "$ip_status" == "success" ]]; then +country=$(jq -r .country <<< "$ip_output") +org=$(jq -r .org <<< "$ip_output") +continent=$(jq -r .timezone <<< "$ip_output") +else +country="UKNOW" +continent="UKNOW" +fi + +continent=$(cut -f1 -d"/" <<< "$continent" ) + +if [[ "$continent" =~ "Europe" ]]; then + continent="EU" +elif [[ "$continent" =~ "America" ]]; then + continent="US" +elif [[ "$continent" =~ "Asia" ]]; then + continent="AS" +else + continent="ALL" +fi + +echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" +echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" +echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" +bootstrap_server $continent + + +} + +function bootstrap_server(){ +rand_by_domain=("1" "2" "3" "5" "6" "7" "8" "9" "10" "11") +richable=() +richable_eu=() +richable_us=() +richable_as=() + +i=0 +len=${#rand_by_domain[@]} +#echo -e "Bootstrap on list: $len" +while [ $i -lt $len ]; +do + + #echo ${rand_by_domain[$i]} + bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + #echo -e "Height: $bootstrap_check" + if [[ "$bootstrap_check" != "" ]]; then + #echo -e "Adding: ${rand_by_domain[$i]}" + + if [[ "${rand_by_domain[$i]}" -le "3" ]]; then + richable_eu+=( ${rand_by_domain[$i]} ) + fi + + if [[ "${rand_by_domain[$i]}" -gt "3" && "${rand_by_domain[$i]}" -le "10" ]]; then + richable_us+=( ${rand_by_domain[$i]} ) + fi + + if [[ "${rand_by_domain[$i]}" -gt "10" ]]; then + richable_as+=( ${rand_by_domain[$i]} ) + fi + + richable+=( ${rand_by_domain[$i]} ) + fi + + i=$(($i+1)) + +done + +server_found="1" +if [[ "$continent" == "EU" ]]; then + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + #echo -e "Final: ${richable[*]}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi +elif [[ "$continent" == "US" ]]; then + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_as=${#richable_as[@]} + if [[ "$len_as" -gt "0" ]]; then + richable=( ${richable_as[*]} ) + fi + if [[ "$len_as" == "0" ]]; then + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + fi +elif [[ "$continent" == "AS" ]]; then + len_as=${#richable_as[@]} + if [[ "$len_as" -gt "0" ]]; then + richable=( ${richable_as[*]} ) + fi + if [[ "$len_as" == "0" ]]; then + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + fi +else + len=${#richable[@]} + if [[ "$len" == "0" ]]; then + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 + Server_offline=1 + return 1 + fi +fi + + + +if [[ "$server_found" == "0" ]]; then + len=${#richable[@]} + if [[ "$len" == "0" ]]; then + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 + Server_offline=1 + return 1 + fi +fi + +Server_offline=0 + +} + + + +get_ip +bootstrap_geolocation + +if [[ "$Server_offline" == "1" ]]; then + exit 1 +fi + + #bootstrap_rand_ip + bootstrap_index=$((${#richable[@]}-1)) + r=$(shuf -i 0-$bootstrap_index -n 1) + indexb=${richable[$r]} + BOOTSTRAP_ZIP="http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + echo -e "$BOOTSTRAP_ZIP" From 4c925fe605fe0c9baa873da0f5203423c97b649e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 10:30:34 +0100 Subject: [PATCH 0261/1176] Update geo_test.sh --- geo_test.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index 7f49919d..561d4061 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -116,7 +116,7 @@ if [[ "$continent" == "EU" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - #echo -e "Final: ${richable[*]}" + echo -e "Final: ${richable[*]}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" @@ -135,6 +135,7 @@ elif [[ "$continent" == "US" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) + echo -e "Final: ${richable[*]}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -142,6 +143,7 @@ elif [[ "$continent" == "US" ]]; then len_as=${#richable_as[@]} if [[ "$len_as" -gt "0" ]]; then richable=( ${richable_as[*]} ) + echo -e "Final: ${richable[*]}" fi if [[ "$len_as" == "0" ]]; then continent="AS" @@ -149,6 +151,7 @@ elif [[ "$continent" == "US" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) + echo -e "Final: ${richable[*]}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" @@ -161,6 +164,7 @@ elif [[ "$continent" == "AS" ]]; then len_as=${#richable_as[@]} if [[ "$len_as" -gt "0" ]]; then richable=( ${richable_as[*]} ) + echo -e "Final: ${richable[*]}" fi if [[ "$len_as" == "0" ]]; then continent="AS" @@ -168,6 +172,7 @@ elif [[ "$continent" == "AS" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) + echo -e "Final: ${richable[*]}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -175,6 +180,7 @@ elif [[ "$continent" == "AS" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) + echo -e "Final: ${richable[*]}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" From 11c8653d251e92cbc7174df1cce2a02cf902e697 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 10:34:05 +0100 Subject: [PATCH 0262/1176] Update geo_test.sh --- geo_test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index 561d4061..9dcd8387 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -116,7 +116,7 @@ if [[ "$continent" == "EU" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - echo -e "Final: ${richable[*]}" + #echo -e "Final: ${richable[*]}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" @@ -124,6 +124,7 @@ if [[ "$continent" == "EU" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) + echo -e "Final: ${richable[*]}" fi if [[ "$len_us" == "0" ]]; then continent="US" From ee77189a3173e26638b634880ef3bb9b1e20b348 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 10:37:00 +0100 Subject: [PATCH 0263/1176] Added reachable servers list --- geo_test.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index 9dcd8387..0473c4f9 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -116,7 +116,7 @@ if [[ "$continent" == "EU" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - #echo -e "Final: ${richable[*]}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" @@ -124,7 +124,7 @@ if [[ "$continent" == "EU" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) - echo -e "Final: ${richable[*]}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -136,7 +136,7 @@ elif [[ "$continent" == "US" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) - echo -e "Final: ${richable[*]}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -144,7 +144,7 @@ elif [[ "$continent" == "US" ]]; then len_as=${#richable_as[@]} if [[ "$len_as" -gt "0" ]]; then richable=( ${richable_as[*]} ) - echo -e "Final: ${richable[*]}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_as" == "0" ]]; then continent="AS" @@ -152,7 +152,7 @@ elif [[ "$continent" == "US" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - echo -e "Final: ${richable[*]}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" @@ -165,7 +165,7 @@ elif [[ "$continent" == "AS" ]]; then len_as=${#richable_as[@]} if [[ "$len_as" -gt "0" ]]; then richable=( ${richable_as[*]} ) - echo -e "Final: ${richable[*]}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_as" == "0" ]]; then continent="AS" @@ -173,7 +173,7 @@ elif [[ "$continent" == "AS" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) - echo -e "Final: ${richable[*]}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -181,7 +181,7 @@ elif [[ "$continent" == "AS" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - echo -e "Final: ${richable[*]}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" From 43c055d99be94e1b430009c7b3fa64e62bdd7d69 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 11:16:24 +0100 Subject: [PATCH 0264/1176] clean --- geo_test.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index 0473c4f9..46be88eb 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -1,7 +1,5 @@ #!/bin/bash -BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' - #color codes RED='\033[1;31m' YELLOW='\033[1;33m' From ef09e07c5b7cd9d869038a7bb9af13ecdebba3fa Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 11:45:53 +0100 Subject: [PATCH 0265/1176] added smart bootstrap selection --- multitoolbox.sh | 187 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 182 insertions(+), 5 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index dec1580c..9d2430c6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -48,6 +48,182 @@ export NEWT_COLORS=' title=black, ' +function bootstrap_geolocation(){ + +IP=$WANIP +ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone | jq .) +ip_status=$( jq -r .status <<< "$ip_output") + +if [[ "$ip_status" == "success" ]]; then +country=$(jq -r .country <<< "$ip_output") +org=$(jq -r .org <<< "$ip_output") +continent=$(jq -r .timezone <<< "$ip_output") +else +country="UKNOW" +continent="UKNOW" +fi + +continent=$(cut -f1 -d"/" <<< "$continent" ) + +if [[ "$continent" =~ "Europe" ]]; then + continent="EU" +elif [[ "$continent" =~ "America" ]]; then + continent="US" +elif [[ "$continent" =~ "Asia" ]]; then + continent="AS" +else + continent="ALL" +fi + +echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" +echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" +echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" +bootstrap_server $continent + + +} + +function bootstrap_server(){ +rand_by_domain=("1" "2" "3" "5" "6" "7" "8" "9" "10" "11") +richable=() +richable_eu=() +richable_us=() +richable_as=() + +i=0 +len=${#rand_by_domain[@]} +#echo -e "Bootstrap on list: $len" +while [ $i -lt $len ]; +do + + #echo ${rand_by_domain[$i]} + bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + #echo -e "Height: $bootstrap_check" + if [[ "$bootstrap_check" != "" ]]; then + #echo -e "Adding: ${rand_by_domain[$i]}" + + if [[ "${rand_by_domain[$i]}" -le "3" ]]; then + richable_eu+=( ${rand_by_domain[$i]} ) + fi + + if [[ "${rand_by_domain[$i]}" -gt "3" && "${rand_by_domain[$i]}" -le "10" ]]; then + richable_us+=( ${rand_by_domain[$i]} ) + fi + + if [[ "${rand_by_domain[$i]}" -gt "10" ]]; then + richable_as+=( ${rand_by_domain[$i]} ) + fi + + richable+=( ${rand_by_domain[$i]} ) + fi + + i=$(($i+1)) + +done + +server_found="1" +if [[ "$continent" == "EU" ]]; then + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi +elif [[ "$continent" == "US" ]]; then + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_as=${#richable_as[@]} + if [[ "$len_as" -gt "0" ]]; then + richable=( ${richable_as[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_as" == "0" ]]; then + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + fi +elif [[ "$continent" == "AS" ]]; then + len_as=${#richable_as[@]} + if [[ "$len_as" -gt "0" ]]; then + richable=( ${richable_as[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_as" == "0" ]]; then + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + fi +else + len=${#richable[@]} + if [[ "$len" == "0" ]]; then + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 + Server_offline=1 + return 1 + fi +fi + + + +if [[ "$server_found" == "0" ]]; then + len=${#richable[@]} + if [[ "$len" == "0" ]]; then + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 + Server_offline=1 + return 1 + fi +fi + +Server_offline=0 + +} + function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then @@ -1113,7 +1289,8 @@ function flux_daemon_bootstrap() { echo -e "${NC}" config_veryfity - bootstrap_server + get_ip + bootstrap_geolocation if [[ "$Server_offline" == "1" ]]; then echo -e "" @@ -1123,7 +1300,7 @@ function flux_daemon_bootstrap() { bootstrap_index=$((${#richable[@]}-1)) r=$(shuf -i 0-$bootstrap_index -n 1) indexb=${richable[$r]} - BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + BOOTSTRAP_ZIP="http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" pm2 stop watchdog > /dev/null 2>&1 && sleep 2 @@ -1188,9 +1365,9 @@ function flux_daemon_bootstrap() { case $CHOICE in "1)") - DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -SsL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -SsL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') fi echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" @@ -1207,7 +1384,7 @@ function flux_daemon_bootstrap() { BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" if [[ "$BOOTSTRAP_ZIPFILE" != *".zip"* ]]; then - BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' + BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' fi wget -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress From 66f8f0a71a7288f709c67f36ca1ca89c483bf0d3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 11:53:02 +0100 Subject: [PATCH 0266/1176] Update multitoolbox.sh --- multitoolbox.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9d2430c6..48f6a103 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -202,6 +202,12 @@ elif [[ "$continent" == "AS" ]]; then fi else len=${#richable[@]} + + if [[ "$len" -gt "0" ]]; then + richable=( ${richable[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len" == "0" ]]; then echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 Server_offline=1 From 10f1659a58329af106dc94b224663add43a9ace7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 11:55:13 +0100 Subject: [PATCH 0267/1176] Update multitoolbox.sh --- multitoolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 48f6a103..b83aa8e2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -226,6 +226,7 @@ if [[ "$server_found" == "0" ]]; then fi fi +echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" Server_offline=0 } From 2b1233251c3044cec3a86510f0df297389e60475 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 11:58:48 +0100 Subject: [PATCH 0268/1176] moved function --- multitoolbox.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index b83aa8e2..36fd9003 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -78,9 +78,6 @@ fi echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" -bootstrap_server $continent - - } function bootstrap_server(){ @@ -1298,6 +1295,7 @@ function flux_daemon_bootstrap() { config_veryfity get_ip bootstrap_geolocation + bootstrap_server $continent if [[ "$Server_offline" == "1" ]]; then echo -e "" From 6fedc26625082b2b2b14f044998665fc7163bb51 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:01:31 +0100 Subject: [PATCH 0269/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 36fd9003..f40cacdd 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -89,7 +89,7 @@ richable_as=() i=0 len=${#rand_by_domain[@]} -#echo -e "Bootstrap on list: $len" +echo -e "${ARROW} ${CYAN}Checking servers availability... ${richable[*]}${NC}" while [ $i -lt $len ]; do From 370249e0ecf6489db7d530fd8857636b2084b7e8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:06:10 +0100 Subject: [PATCH 0270/1176] Update geo_test.sh --- geo_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/geo_test.sh b/geo_test.sh index 46be88eb..0906c235 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -80,6 +80,7 @@ richable_as=() i=0 len=${#rand_by_domain[@]} +echo -e "${ARROW} ${CYAN}Checking servers availability... ${richable[*]}${NC}" #echo -e "Bootstrap on list: $len" while [ $i -lt $len ]; do From f12bf29c0f406d3cd9c2834f76ada2e990d493cc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:09:39 +0100 Subject: [PATCH 0271/1176] Update multitoolbox.sh --- multitoolbox.sh | 68 +++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f40cacdd..d01c6699 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -48,37 +48,6 @@ export NEWT_COLORS=' title=black, ' -function bootstrap_geolocation(){ - -IP=$WANIP -ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone | jq .) -ip_status=$( jq -r .status <<< "$ip_output") - -if [[ "$ip_status" == "success" ]]; then -country=$(jq -r .country <<< "$ip_output") -org=$(jq -r .org <<< "$ip_output") -continent=$(jq -r .timezone <<< "$ip_output") -else -country="UKNOW" -continent="UKNOW" -fi - -continent=$(cut -f1 -d"/" <<< "$continent" ) - -if [[ "$continent" =~ "Europe" ]]; then - continent="EU" -elif [[ "$continent" =~ "America" ]]; then - continent="US" -elif [[ "$continent" =~ "Asia" ]]; then - continent="AS" -else - continent="ALL" -fi - -echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" -echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" -echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" -} function bootstrap_server(){ rand_by_domain=("1" "2" "3" "5" "6" "7" "8" "9" "10" "11") @@ -89,7 +58,8 @@ richable_as=() i=0 len=${#rand_by_domain[@]} -echo -e "${ARROW} ${CYAN}Checking servers availability... ${richable[*]}${NC}" +echo -e "Checking servers availability..." +echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" while [ $i -lt $len ]; do @@ -223,11 +193,43 @@ if [[ "$server_found" == "0" ]]; then fi fi -echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" +##echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" Server_offline=0 } +function bootstrap_geolocation(){ + +IP=$WANIP +ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone | jq .) +ip_status=$( jq -r .status <<< "$ip_output") + +if [[ "$ip_status" == "success" ]]; then +country=$(jq -r .country <<< "$ip_output") +org=$(jq -r .org <<< "$ip_output") +continent=$(jq -r .timezone <<< "$ip_output") +else +country="UKNOW" +continent="UKNOW" +fi + +continent=$(cut -f1 -d"/" <<< "$continent" ) + +if [[ "$continent" =~ "Europe" ]]; then + continent="EU" +elif [[ "$continent" =~ "America" ]]; then + continent="US" +elif [[ "$continent" =~ "Asia" ]]; then + continent="AS" +else + continent="ALL" +fi + +echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" +echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" +echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" +} + function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then From 30f97e6620561969add8f2daa4d4d533c922ee12 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:10:06 +0100 Subject: [PATCH 0272/1176] Update geo_test.sh --- geo_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index 0906c235..95be76c4 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -80,7 +80,7 @@ richable_as=() i=0 len=${#rand_by_domain[@]} -echo -e "${ARROW} ${CYAN}Checking servers availability... ${richable[*]}${NC}" +echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" #echo -e "Bootstrap on list: $len" while [ $i -lt $len ]; do From 7ab0af4475173935244bd4292b9f1b448f109758 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:13:12 +0100 Subject: [PATCH 0273/1176] added log --- multitoolbox.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d01c6699..98a8bc0b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -58,8 +58,6 @@ richable_as=() i=0 len=${#rand_by_domain[@]} -echo -e "Checking servers availability..." -echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" while [ $i -lt $len ]; do @@ -193,7 +191,6 @@ if [[ "$server_found" == "0" ]]; then fi fi -##echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" Server_offline=0 } @@ -228,6 +225,8 @@ fi echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" +echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" + } function config_veryfity(){ @@ -1299,11 +1298,13 @@ function flux_daemon_bootstrap() { bootstrap_geolocation bootstrap_server $continent + if [[ "$Server_offline" == "1" ]]; then echo -e "" exit fi + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" bootstrap_index=$((${#richable[@]}-1)) r=$(shuf -i 0-$bootstrap_index -n 1) indexb=${richable[$r]} From 176baf6571eba4096d93278c076afab50f0ad1de Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:16:46 +0100 Subject: [PATCH 0274/1176] Minor edit --- multitoolbox.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 98a8bc0b..eb55664c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -91,7 +91,7 @@ if [[ "$continent" == "EU" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" @@ -99,7 +99,7 @@ if [[ "$continent" == "EU" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -111,7 +111,7 @@ elif [[ "$continent" == "US" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -119,7 +119,7 @@ elif [[ "$continent" == "US" ]]; then len_as=${#richable_as[@]} if [[ "$len_as" -gt "0" ]]; then richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_as" == "0" ]]; then continent="AS" @@ -127,7 +127,7 @@ elif [[ "$continent" == "US" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" @@ -140,7 +140,7 @@ elif [[ "$continent" == "AS" ]]; then len_as=${#richable_as[@]} if [[ "$len_as" -gt "0" ]]; then richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_as" == "0" ]]; then continent="AS" @@ -148,7 +148,7 @@ elif [[ "$continent" == "AS" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -156,7 +156,7 @@ elif [[ "$continent" == "AS" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" @@ -170,7 +170,7 @@ else if [[ "$len" -gt "0" ]]; then richable=( ${richable[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len" == "0" ]]; then From aeea891d9f6dd3a8a8ee6e2d4377f8d281cf4751 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:24:46 +0100 Subject: [PATCH 0275/1176] Update multitoolbox.sh --- multitoolbox.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index eb55664c..485d2bd3 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -174,7 +174,6 @@ else fi if [[ "$len" == "0" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 Server_offline=1 return 1 fi @@ -185,7 +184,6 @@ fi if [[ "$server_found" == "0" ]]; then len=${#richable[@]} if [[ "$len" == "0" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 Server_offline=1 return 1 fi @@ -1300,6 +1298,7 @@ function flux_daemon_bootstrap() { if [[ "$Server_offline" == "1" ]]; then + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 echo -e "" exit fi From 7d12a3c8ddb9c3f8997d983ff0a8b19a6c8f2158 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:26:12 +0100 Subject: [PATCH 0276/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 485d2bd3..1ea0b1ab 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1298,7 +1298,7 @@ function flux_daemon_bootstrap() { if [[ "$Server_offline" == "1" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 echo -e "" exit fi From 8f3a525c717c5ed40180dc49ac81e0451cb2e64a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:36:51 +0100 Subject: [PATCH 0277/1176] fix function --- multitoolbox.sh | 63 +++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 1ea0b1ab..fbb954b4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -61,6 +61,7 @@ len=${#rand_by_domain[@]} while [ $i -lt $len ]; do + echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" #echo ${rand_by_domain[$i]} bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) #echo -e "Height: $bootstrap_check" @@ -91,7 +92,7 @@ if [[ "$continent" == "EU" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" @@ -99,7 +100,7 @@ if [[ "$continent" == "EU" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) - #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -111,7 +112,7 @@ elif [[ "$continent" == "US" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) - #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -119,7 +120,7 @@ elif [[ "$continent" == "US" ]]; then len_as=${#richable_as[@]} if [[ "$len_as" -gt "0" ]]; then richable=( ${richable_as[*]} ) - #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_as" == "0" ]]; then continent="AS" @@ -127,7 +128,7 @@ elif [[ "$continent" == "US" ]]; then len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then continent="EU" @@ -140,7 +141,7 @@ elif [[ "$continent" == "AS" ]]; then len_as=${#richable_as[@]} if [[ "$len_as" -gt "0" ]]; then richable=( ${richable_as[*]} ) - #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_as" == "0" ]]; then continent="AS" @@ -148,7 +149,7 @@ elif [[ "$continent" == "AS" ]]; then len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) - #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then continent="US" @@ -223,7 +224,7 @@ fi echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" -echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" + } @@ -253,38 +254,38 @@ function config_veryfity(){ } -function bootstrap_server(){ +##function bootstrap_server(){ #rand_by_ip=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") -rand_by_domain=("1" "2" "3" "4") -richable=() +##rand_by_domain=("1" "2" "3" "4") +##richable=() -i=0 -len=${#rand_by_domain[@]} +##i=0 +##len=${#rand_by_domain[@]} #echo -e "Bootstrap on list: $len" -while [ $i -lt $len ]; -do +##while [ $i -lt $len ]; +##do #echo ${rand_by_domain[$i]} - bootstrap_check=$(curl -s -m 10 https://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + ## bootstrap_check=$(curl -s -m 10 https://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) #echo -e "Height: $bootstrap_check" - if [[ "$bootstrap_check" != "" ]]; then + ##if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" - richable+=( ${rand_by_domain[$i]} ) - fi - i=$(($i+1)) + ## richable+=( ${rand_by_domain[$i]} ) + ## fi + ## i=$(($i+1)) -done - -len=${#richable[@]} -if [[ "$len" == "0" ]]; then -echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 -Server_offline=1 -return 1 -fi -Server_offline=0 +#done -} +#len=${#richable[@]} +#if [[ "$len" == "0" ]]; then +#echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 +#Server_offline=1 +#return 1 +#fi +#Server_offline=0 +# +#} function get_ip(){ @@ -836,7 +837,7 @@ if [[ "$skip_bootstrap" == "0" ]]; then if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then -bootstrap_server_index=$(shuf -i 1-4 -n 1) +bootstrap_server_index=$(shuf -i 1-11 -n 1) bootstrap_url="https://cdn-$bootstrap_server_index.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" sleep 1 From 50eba607e0947370830171578601218d091b695c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:39:37 +0100 Subject: [PATCH 0278/1176] clean --- multitoolbox.sh | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index fbb954b4..bb145241 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -48,7 +48,6 @@ export NEWT_COLORS=' title=black, ' - function bootstrap_server(){ rand_by_domain=("1" "2" "3" "5" "6" "7" "8" "9" "10" "11") richable=() @@ -254,39 +253,6 @@ function config_veryfity(){ } -##function bootstrap_server(){ -#rand_by_ip=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") -##rand_by_domain=("1" "2" "3" "4") -##richable=() - -##i=0 -##len=${#rand_by_domain[@]} -#echo -e "Bootstrap on list: $len" -##while [ $i -lt $len ]; -##do - - #echo ${rand_by_domain[$i]} - ## bootstrap_check=$(curl -s -m 10 https://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) - #echo -e "Height: $bootstrap_check" - ##if [[ "$bootstrap_check" != "" ]]; then - #echo -e "Adding: ${rand_by_domain[$i]}" - ## richable+=( ${rand_by_domain[$i]} ) - ## fi - ## i=$(($i+1)) - - -#done - -#len=${#richable[@]} -#if [[ "$len" == "0" ]]; then -#echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 -#Server_offline=1 -#return 1 -#fi -#Server_offline=0 -# -#} - function get_ip(){ WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') From eecdbe4d009819008923305fe76bdb68e0b1ced0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:46:07 +0100 Subject: [PATCH 0279/1176] Minor edits --- multitoolbox.sh | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index bb145241..46eb9fbf 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -57,10 +57,9 @@ richable_as=() i=0 len=${#rand_by_domain[@]} +echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" while [ $i -lt $len ]; do - - echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" #echo ${rand_by_domain[$i]} bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) #echo -e "Height: $bootstrap_check" @@ -83,7 +82,6 @@ do fi i=$(($i+1)) - done server_found="1" @@ -94,16 +92,16 @@ if [[ "$continent" == "EU" ]]; then echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + continent1="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + continent1="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 server_found="0" fi fi @@ -114,24 +112,24 @@ elif [[ "$continent" == "US" ]]; then echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + continent1="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 len_as=${#richable_as[@]} if [[ "$len_as" -gt "0" ]]; then richable=( ${richable_as[*]} ) echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + continent1="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + continent1="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 server_found="0" fi fi @@ -143,34 +141,33 @@ elif [[ "$continent" == "AS" ]]; then echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + continent1="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + continent1="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) - #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + continent1="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 server_found="0" fi fi fi else len=${#richable[@]} - if [[ "$len" -gt "0" ]]; then richable=( ${richable[*]} ) - #echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len" == "0" ]]; then From d6106d54c9d856ee4f0fad0b4aad874a8e47a5f8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:49:24 +0100 Subject: [PATCH 0280/1176] finalizing --- multitoolbox.sh | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 46eb9fbf..1c7c91b2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -92,16 +92,16 @@ if [[ "$continent" == "EU" ]]; then echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then - continent1="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then - continent1="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 server_found="0" fi fi @@ -112,24 +112,24 @@ elif [[ "$continent" == "US" ]]; then echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then - continent1="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 len_as=${#richable_as[@]} if [[ "$len_as" -gt "0" ]]; then richable=( ${richable_as[*]} ) echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_as" == "0" ]]; then - continent1="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then - continent1="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 server_found="0" fi fi @@ -141,24 +141,24 @@ elif [[ "$continent" == "AS" ]]; then echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_as" == "0" ]]; then - continent1="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 len_us=${#richable_us[@]} if [[ "$len_us" -gt "0" ]]; then richable=( ${richable_us[*]} ) echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_us" == "0" ]]; then - continent1="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 len_eu=${#richable_eu[@]} if [[ "$len_eu" -gt "0" ]]; then richable=( ${richable_eu[*]} ) echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" fi if [[ "$len_eu" == "0" ]]; then - continent1="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent1 are offline, checking other location...${NC}" && sleep 1 + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 server_found="0" fi fi @@ -1267,7 +1267,6 @@ function flux_daemon_bootstrap() { exit fi - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" bootstrap_index=$((${#richable[@]}-1)) r=$(shuf -i 0-$bootstrap_index -n 1) indexb=${richable[$r]} From d003778bfd6f80c61bb29ce7e8204e72445e2bf5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 13:56:12 +0100 Subject: [PATCH 0281/1176] added smart bootstrap server selection - initial function base on geo location - 3 server in eu - 6 server in us - 1 server is as --- install_pro.sh | 183 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 161 insertions(+), 22 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index ab6fe84d..64c6d74b 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -77,45 +77,182 @@ fi echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" } + function bootstrap_server(){ -#rand_by_ip=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") -rand_by_domain=("1" "2" "3" "4") +rand_by_domain=("1" "2" "3" "5" "6" "7" "8" "9" "10" "11") richable=() +richable_eu=() +richable_us=() +richable_as=() i=0 len=${#rand_by_domain[@]} -#echo -e "Bootstrap on list: $len" +echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" while [ $i -lt $len ]; do - #echo ${rand_by_domain[$i]} - bootstrap_check=$(curl -s -m 10 https://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) #echo -e "Height: $bootstrap_check" if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" - richable+=( ${rand_by_domain[$i]} ) + + if [[ "${rand_by_domain[$i]}" -le "3" ]]; then + richable_eu+=( ${rand_by_domain[$i]} ) + fi + + if [[ "${rand_by_domain[$i]}" -gt "3" && "${rand_by_domain[$i]}" -le "10" ]]; then + richable_us+=( ${rand_by_domain[$i]} ) + fi + + if [[ "${rand_by_domain[$i]}" -gt "10" ]]; then + richable_as+=( ${rand_by_domain[$i]} ) + fi + + richable+=( ${rand_by_domain[$i]} ) fi + i=$(($i+1)) +done +server_found="1" +if [[ "$continent" == "EU" ]]; then + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi +elif [[ "$continent" == "US" ]]; then + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_as=${#richable_as[@]} + if [[ "$len_as" -gt "0" ]]; then + richable=( ${richable_as[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_as" == "0" ]]; then + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + fi +elif [[ "$continent" == "AS" ]]; then + len_as=${#richable_as[@]} + if [[ "$len_as" -gt "0" ]]; then + richable=( ${richable_as[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_as" == "0" ]]; then + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + fi +else + len=${#richable[@]} + if [[ "$len" -gt "0" ]]; then + richable=( ${richable[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + + if [[ "$len" == "0" ]]; then + Server_offline=1 + return 1 + fi +fi -done -len=${#richable[@]} -if [[ "$len" == "0" ]]; then -echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 -Server_offline=1 -return 1 + +if [[ "$server_found" == "0" ]]; then + len=${#richable[@]} + if [[ "$len" == "0" ]]; then + Server_offline=1 + return 1 + fi fi + Server_offline=0 } -function bootstrap_rand_ip(){ -rand=("91.229.245.161" "91.229.245.159" "89.58.33.204" "89.58.31.71") -r=$(shuf -i 0-3 -n 1) -bootstrap_ip=${rand[$r]} +function bootstrap_geolocation(){ + +IP=$WANIP +ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone | jq .) +ip_status=$( jq -r .status <<< "$ip_output") + +if [[ "$ip_status" == "success" ]]; then +country=$(jq -r .country <<< "$ip_output") +org=$(jq -r .org <<< "$ip_output") +continent=$(jq -r .timezone <<< "$ip_output") +else +country="UKNOW" +continent="UKNOW" +fi + +continent=$(cut -f1 -d"/" <<< "$continent" ) + +if [[ "$continent" =~ "Europe" ]]; then + continent="EU" +elif [[ "$continent" =~ "America" ]]; then + continent="US" +elif [[ "$continent" =~ "Asia" ]]; then + continent="AS" +else + continent="ALL" +fi + +echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" +echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" +echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" } + function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then @@ -1334,18 +1471,20 @@ function zk_params() { function bootstrap() { - bootstrap_server + bootstrap_geolocation + bootstrap_server $continent + if [[ "$Server_offline" == "1" ]]; then + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 + echo -e "" return 1 fi - # bootstrap_rand_ip bootstrap_index=$((${#richable[@]}-1)) r=$(shuf -i 0-$bootstrap_index -n 1) indexb=${richable[$r]} - BOOTSTRAP_ZIP="https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" - #BOOTSTRAP_ZIP="http://$bootstrap_ip:11111/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" + BOOTSTRAP_ZIP="http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" echo -e "" @@ -1410,9 +1549,9 @@ function bootstrap() { case $CHOICE in "1)") - DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + DB_HIGHT=$(curl -sSL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + DB_HIGHT=$(curl -sSL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) fi From daa9a6eb9494477bea6d1a82c116be84a6673de5 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Thu, 10 Mar 2022 15:48:56 +0000 Subject: [PATCH 0282/1176] Change FluxNode properties name asked --- multitoolbox.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 1c7c91b2..2c8406af 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -753,9 +753,9 @@ zelid="" kda_address="" else -prvkey=$(whiptail --inputbox "Enter your FluxNode Private Key from Zelcore" 8 65 3>&1 1>&2 2>&3) +prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) sleep 1 -outpoint=$(whiptail --inputbox "Enter your FluxNode Output TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) +outpoint=$(whiptail --inputbox "Enter your FluxNode Collateral TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) sleep 1 index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) sleep 1 @@ -1754,9 +1754,9 @@ echo echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" sleep 4 skip_change='3' -zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" +zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" sleep 1 -zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output TX ID" 8 72 3>&1 1>&2 2>&3)" +zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3)" sleep 1 zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" sleep 1 From b6219e6ea05437be2afcd30d234c308b1b32519d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 21:09:56 +0100 Subject: [PATCH 0283/1176] added extra check for wget --- install_pro.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 64c6d74b..fedff8b5 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1471,6 +1471,17 @@ function zk_params() { function bootstrap() { + + if ! wget --version ; then + sudo apt install -y wget > /dev/null 2>&1 && sleep 2 + fi + + if ! wget --version ; then + echo -e "${WORNING} ${CYAN}Wget not installed, operation aborted.. ${NC}" && sleep 1 + echo -e "" + return 1 + fi + bootstrap_geolocation bootstrap_server $continent From 2e7f5a1dafe5ba6a918273267f5324a876d9db0d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 21:13:11 +0100 Subject: [PATCH 0284/1176] disable output --- install_pro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index fedff8b5..026960ab 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1472,11 +1472,11 @@ function zk_params() { function bootstrap() { - if ! wget --version ; then + if ! wget --version > /dev/null 2>&1 ; then sudo apt install -y wget > /dev/null 2>&1 && sleep 2 fi - if ! wget --version ; then + if ! wget --version > /dev/null 2>&1 ; then echo -e "${WORNING} ${CYAN}Wget not installed, operation aborted.. ${NC}" && sleep 1 echo -e "" return 1 From 882e4c590c1e4037c29a1c62c527216019798ffc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Mar 2022 21:15:01 +0100 Subject: [PATCH 0285/1176] added wget check --- multitoolbox.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 2c8406af..5c9a2053 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -2235,6 +2235,11 @@ echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/Ru source /etc/bash.bashrc fi +if ! wget --version > /dev/null 2>&1 ; then + sudo apt install -y wget > /dev/null 2>&1 && sleep 2 +fi + + clear sleep 1 From 78a9fe035db6e59db6128caf8050d53714428e2e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Mar 2022 10:55:15 +0100 Subject: [PATCH 0286/1176] added install jq --- geo_test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index 95be76c4..d4a94733 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -213,7 +213,9 @@ Server_offline=0 } - +if ! jq --version > /dev/null 2>&1; then + sudo apt install jq -y > /dev/null 2>&1 +fi get_ip bootstrap_geolocation From c221745fe78bb4b2848fa1edd1a6eedb3f40a49d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Mar 2022 11:14:08 +0100 Subject: [PATCH 0287/1176] disabled curl error output --- geo_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index d4a94733..fec1624a 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -86,7 +86,7 @@ while [ $i -lt $len ]; do #echo ${rand_by_domain[$i]} - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) #echo -e "Height: $bootstrap_check" if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" From e127cfdf4b3def9a44106f2e4ad0e718930f0b74 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Mar 2022 11:14:38 +0100 Subject: [PATCH 0288/1176] disabled curl error output --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5c9a2053..b94443a1 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -61,7 +61,7 @@ echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" while [ $i -lt $len ]; do #echo ${rand_by_domain[$i]} - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) #echo -e "Height: $bootstrap_check" if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" From ad60430febff2a213178d2f3dc8347cba02ce1a0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Mar 2022 11:15:14 +0100 Subject: [PATCH 0289/1176] disabled curl error output --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 026960ab..22ff72ac 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -91,7 +91,7 @@ echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" while [ $i -lt $len ]; do #echo ${rand_by_domain[$i]} - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) + bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) #echo -e "Height: $bootstrap_check" if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" From bd8b98ed5372005fde89f8d2396f12b13c1e1c04 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Mar 2022 13:20:10 +0100 Subject: [PATCH 0290/1176] Minor edit --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index ba7d8225..b21cc2a8 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -493,7 +493,7 @@ if [[ "$WANIP" != "" ]]; then echo -e "${CHECK_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) matches local device(${GREEN}$device_name${CYAN}) IP(${GREEN}$local_device_ip${CYAN})${NC}" else echo -e "${X_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) not matches local device(${GREEN}$device_name${CYAN}) IP${NC}" - echo -e "${ARROW} ${CYAN} If you under NAT use option 12 from multitoolbox (self-hosting)${NC}" + echo -e "${ARROW} ${CYAN} If you under NAT use option 10 from multitoolbox (self-hosting)${NC}" ## dev_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2"0"}') ## sudo ip addr add "$WANPI" dev "$dev_name" # IP_FIX="1" From 7382160c2603a689c911f6c49ce6910e13a1c4f1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Mar 2022 13:31:23 +0100 Subject: [PATCH 0291/1176] fix logical operator --- nodeanalizerandfixer.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index b21cc2a8..b8bd81b0 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -526,9 +526,9 @@ echo -e "${PIN} ${CYAN}Protocolversion: ${SEA}$protocolversion${NC}" echo -e "${PIN} ${CYAN}Connections: ${SEA}$connections${NC}" echo -e "${PIN} ${CYAN}Blocks: ${SEA}$blocks_hight${NC}" -network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo getinfo | jq '.info.blocks' 2> /dev/null) +network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) #network_height_02=$(curl -sk -m 5 https://explorer.flux.zelcore.io/api/status?q=getInfo | jq '.info.blocks') -network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo | jq '.info.blocks' 2> /dev/null) +network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) explorer_network_hight=$(max "$network_height_01" "$network_height_03") @@ -589,8 +589,8 @@ fi fi -flux_communication=$(curl -SsL http://"$WANIP":16127/flux/checkcommunication | jq -r .data.message) -if [[ "$flux_communication" != "null" || "$flux_communication" != "" ]]; then +flux_communication=$(curl -SsL -m 10 http://"$WANIP":16127/flux/checkcommunication 2>/dev/null | jq -r .data.message 2>/dev/null) +if [[ "$flux_communication" != "null" && "$flux_communication" != "" ]]; then echo -e "${BOOK} ${YELLOW}Checking FluxOS communication: ${NC}" echo -e "${ARROW} ${CYAN}$flux_communication${NC}" echo -e "" @@ -610,10 +610,10 @@ stak_info="" if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') #collateral_index=$(awk '{print $1}' <<< "$stak_info") - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + stak_info=$(curl -s -m 10 https://explorer.runonflux.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') fi fi @@ -702,7 +702,7 @@ fi fi else - echo -e "${X_MARK} ${CYAN} Fluxnodeoutpoint is not valid${NC}" + echo -e "${X_MARK} ${CYAN} Flux collateral check skipped...${NC}" fi #url_to_check="https://explorer.zel.cash/api/tx/$txhash" #type=$(wget -nv -qO - $url_to_check | jq '.vout' | grep '"value"' | egrep -o '10000|25000|100000') From 860c28ecd3b50720e22a215e3f16f4fe5b16f0f5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Mar 2022 14:01:03 +0100 Subject: [PATCH 0292/1176] disabled error output --- install_pro.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 22ff72ac..9e28d229 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2214,19 +2214,19 @@ fi function status_loop() { -network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') -network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') +network_height_01=$(curl -sk -m 10 https://explorer.runonflux.io/api/status?q=getInfo 2> /dev/null | jq '.info.blocks') +network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks') EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") -if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks') ]]; then +if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks' 2> /dev/null) ]]; then echo echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" -LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') -CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') +LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) +CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) NUM='2' @@ -2247,13 +2247,13 @@ else while true do - network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_01=$(curl -sk -m 10 https://explorer.runonflux.io/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) if [[ "$LEFT" == "0" ]]; then @@ -2285,8 +2285,8 @@ else MSG2='' spinning_timer - network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) + network_height_01=$(curl -sk -m 10 https://explorer.runonflux.io/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") From bed46802fcf48addb3db649613c22ec96de1fb87 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Mar 2022 16:26:49 +0100 Subject: [PATCH 0293/1176] disabled error output --- geo_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index fec1624a..5b046f8e 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -25,22 +25,22 @@ title=black, ' function get_ip(){ - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') fi if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + WANIP=$(curl --silent -m 10 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') fi } function bootstrap_geolocation(){ IP=$WANIP -ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone | jq .) -ip_status=$( jq -r .status <<< "$ip_output") +ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) +ip_status=$( jq -r .status 2>/dev/null <<< "$ip_output") if [[ "$ip_status" == "success" ]]; then country=$(jq -r .country <<< "$ip_output") From 5f46a9fbf4d6c82055ad902fe0f9888aac2e5a40 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Mar 2022 17:46:51 +0100 Subject: [PATCH 0294/1176] added new collateral --- nodeanalizerandfixer.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index b8bd81b0..7245c205 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -610,10 +610,10 @@ stak_info="" if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') #collateral_index=$(awk '{print $1}' <<< "$stak_info") - stak_info=$(curl -s -m 10 https://explorer.runonflux.io/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + stak_info=$(curl -s -m 10 https://explorer.runonflux.io/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000|1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000') + stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000|1000|12500|40000') fi fi @@ -653,6 +653,9 @@ fi "10000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}CUMULUS${NC}" ;; "25000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}NIMBUS${NC}";; "100000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}STRATUS${NC}";; + "1000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}CUMULUS${NC}" ;; + "12500") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}NIMBUS${NC}";; + "40000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}STRATUS${NC}";; esac case $bench_benchmark in @@ -674,6 +677,9 @@ fi "10000") bench_benchmark_value_name="CUMULUS" ;; "25000") bench_benchmark_value_name="NIMBUS" ;; "100000") bench_benchmark_value_name="STRATUS" ;; + "1000") bench_benchmark_value_name="CUMULUS" ;; + "12500") bench_benchmark_value_name="NIMBUS" ;; + "40000") bench_benchmark_value_name="STRATUS" ;; esac #echo -e "${CHECK_MARK} ${CYAN} Benchmark passed for ${GREEN}$bench_benchmark${CYAN} required ${GREEN}$bench_benchmark_value_name${NC}" @@ -683,6 +689,9 @@ fi "10000") bench_benchmark_value_name="CUMULUS" ;; "25000") bench_benchmark_value_name="NIMBUS" ;; "100000") bench_benchmark_value_name="STRATUS" ;; + "1000") bench_benchmark_value_name="CUMULUS" ;; + "12500") bench_benchmark_value_name="NIMBUS" ;; + "40000") bench_benchmark_value_name="STRATUS" ;; esac if [[ "$bench_benchmark" == "running" ]]; then From a7a25e4ef3b817be03e28ef69fac9a2a8d56849a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 12 Mar 2022 08:24:49 +0100 Subject: [PATCH 0295/1176] ip check improvment --- install_pro.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 9e28d229..6192fcce 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,4 +1,4 @@ -#!/bin/bash +5#!/bin/bash # Bootstrap settings #BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' @@ -299,7 +299,7 @@ sudo touch /home/$USER/ip_check.sh sudo chown $USER:$USER /home/$USER/ip_check.sh cat <<'EOF' > /home/$USER/ip_check.sh #!/bin/bash -function get_ip(){ +function get8(){ WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') if [[ "$WANIP" == "" ]]; then @@ -316,7 +316,7 @@ if [[ $1 == "restart" ]]; then get_ip device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S')1 echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log sudo ip addr add $WANIP dev $device_name:0 && sleep 2 fi @@ -1161,16 +1161,16 @@ function ip_confirm() { WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - if [[ "$WANIP" == "" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') fi - if [[ "$WANIP" == "" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') fi - if [[ "$WANIP" == "" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" echo exit From c84cccf166a029e36d2b8c9702d8d4b54653c95b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 12 Mar 2022 08:27:30 +0100 Subject: [PATCH 0296/1176] Minor edit --- install_pro.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 6192fcce..1d359d3c 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,4 +1,4 @@ -5#!/bin/bash +#!/bin/bash # Bootstrap settings #BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' @@ -299,14 +299,14 @@ sudo touch /home/$USER/ip_check.sh sudo chown $USER:$USER /home/$USER/ip_check.sh cat <<'EOF' > /home/$USER/ip_check.sh #!/bin/bash -function get8(){ +function get_ip(){ WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - if [[ "$WANIP" == "" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') fi - if [[ "$WANIP" == "" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') fi } @@ -316,7 +316,7 @@ if [[ $1 == "restart" ]]; then get_ip device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S')1 + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log sudo ip addr add $WANIP dev $device_name:0 && sleep 2 fi From 2be9d5dd3a87d364b99febe1cc9e3d4daf546b7f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 12 Mar 2022 10:03:09 +0100 Subject: [PATCH 0297/1176] Minor edit and cleanup --- install_pro.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 1d359d3c..e8bfb1dc 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -90,11 +90,8 @@ len=${#rand_by_domain[@]} echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" while [ $i -lt $len ]; do - #echo ${rand_by_domain[$i]} bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) - #echo -e "Height: $bootstrap_check" if [[ "$bootstrap_check" != "" ]]; then - #echo -e "Adding: ${rand_by_domain[$i]}" if [[ "${rand_by_domain[$i]}" -le "3" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) @@ -206,8 +203,6 @@ else fi fi - - if [[ "$server_found" == "0" ]]; then len=${#richable[@]} if [[ "$len" == "0" ]]; then @@ -248,7 +243,7 @@ else fi echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" -echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" +echo -e "${ARROW} ${CYAN}Node Location: $country, Continent: $continent ${NC}" echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" } From 3b5c0795b471986b9b39a9a817fc8ffee15fbf84 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 12 Mar 2022 12:05:49 +0000 Subject: [PATCH 0298/1176] Addnode to flux.conf file --- install_pro.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index e8bfb1dc..1b2ab49b 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1312,6 +1312,25 @@ addnode=explorer.flux.zelcore.io addnode=explorer.runonflux.io addnode=explorer.zelcash.online addnode=blockbook.runonflux.io +addnode=202.61.202.21 +addnode=89.58.40.172 +addnode=109.90.125.189 +addnode=185.30.117.2 +addnode=185.30.117.4 +addnode=185.30.117.3 +addnode=185.30.117.5 +addnode=31.7.195.203 +addnode=65.108.192.59 +addnode=188.25.224.51 +addnode=89.58.26.142 +addnode=135.181.165.186 +addnode=89.58.3.209 +addnode=89.58.37.73 +addnode=213.231.3.224 +addnode=89.58.10.47 +addnode=65.108.40.221 +addnode=89.58.28.201 +addnode=136.243.77.25 maxconnections=256 EOF sleep 2 From eee2144fd967de16f857c281ac8a3ac21b1f4edb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 12 Mar 2022 16:23:02 +0100 Subject: [PATCH 0299/1176] removed cdn-2 from list --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 1b2ab49b..fc9f1bb8 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -79,7 +79,7 @@ echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" function bootstrap_server(){ -rand_by_domain=("1" "2" "3" "5" "6" "7" "8" "9" "10" "11") +rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11") richable=() richable_eu=() richable_us=() From fd66a89ed3558cd03a6b00a5da58881681fe6838 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 12 Mar 2022 16:24:34 +0100 Subject: [PATCH 0300/1176] removed cdn-2 from list --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index b94443a1..fcb7080b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -49,7 +49,7 @@ title=black, ' function bootstrap_server(){ -rand_by_domain=("1" "2" "3" "5" "6" "7" "8" "9" "10" "11") +rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11") richable=() richable_eu=() richable_us=() From 3d99d608b68e175b86a780e03b889687c5857669 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 12 Mar 2022 15:33:03 +0000 Subject: [PATCH 0301/1176] Add more addnodes --- install_pro.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index fc9f1bb8..9ff0ef1f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1331,6 +1331,30 @@ addnode=89.58.10.47 addnode=65.108.40.221 addnode=89.58.28.201 addnode=136.243.77.25 +addnode=185.216.178.243 +addnode=178.63.64.107 +addnode=72.194.134.229 +addnode=65.108.98.168 +addnode=135.181.211.41 +addnode=65.108.100.234 +addnode=89.58.42.201 +addnode=37.221.197.179 +addnode=108.204.4.49 +addnode=108.196.85.217 +addnode=88.99.6.216 +addnode=202.61.200.66 +addnode=100.4.72.94 +addnode=176.126.47.133 +addnode=66.119.15.227 +addnode=148.72.144.148 +addnode=74.142.7.118 +addnode=71.126.67.85 +addnode=65.108.192.60 +addnode=76.27.137.166 +addnode=75.152.95.135 +addnode=135.181.22.96 +addnode=23.227.173.75 +addnode=65.108.73.180 maxconnections=256 EOF sleep 2 From f4ceb7e8a2dd0c5e7f1b1671046cf3f34e1dc56e Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 12 Mar 2022 22:45:24 +0000 Subject: [PATCH 0302/1176] Add 3 more EU bootstrap Servers --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index fcb7080b..24230202 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -49,7 +49,7 @@ title=black, ' function bootstrap_server(){ -rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11") +rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14") richable=() richable_eu=() richable_us=() From 4d15df673010acade523a0a8ed1f190f2181cdaa Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 12 Mar 2022 22:46:46 +0000 Subject: [PATCH 0303/1176] Add 3 more EU bootstrap servers --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 9ff0ef1f..351e2a9b 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -79,7 +79,7 @@ echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" function bootstrap_server(){ -rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11") +rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14") richable=() richable_eu=() richable_us=() From ddba0e84c2f89c5ac2437b3260688efad505475e Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 12 Mar 2022 22:48:27 +0000 Subject: [PATCH 0304/1176] Add 3 more EU bootstrap Servers --- geo_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index 5b046f8e..794566ed 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -72,7 +72,7 @@ bootstrap_server $continent } function bootstrap_server(){ -rand_by_domain=("1" "2" "3" "5" "6" "7" "8" "9" "10" "11") +rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14") richable=() richable_eu=() richable_us=() From 894a2e6e53e4cb0aa0aa4c6301a5840bc7026913 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 12 Mar 2022 23:02:50 +0000 Subject: [PATCH 0305/1176] Fix EU locations --- geo_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index 794566ed..a148aac1 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -91,7 +91,7 @@ do if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" - if [[ "${rand_by_domain[$i]}" -le "3" ]]; then + if [[ "${rand_by_domain[$i]}" -le "3" -o "${rand_by_domain[$i]}" -gt "3" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) fi From 9619af4c21c2c6dd3b06fed2871d6eec54a4d58a Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 12 Mar 2022 23:05:34 +0000 Subject: [PATCH 0306/1176] Fix eu reacheable --- geo_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index a148aac1..40858d44 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -91,7 +91,7 @@ do if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" - if [[ "${rand_by_domain[$i]}" -le "3" -o "${rand_by_domain[$i]}" -gt "3" ]]; then + if [[ "${rand_by_domain[$i]}" -le "3" || "${rand_by_domain[$i]}" -gt "11" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) fi From c3a62c6bdd94d9a0e55d642eb9cca218a44a2192 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 12 Mar 2022 23:06:40 +0000 Subject: [PATCH 0307/1176] Fix EU reachable bootstraps --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 351e2a9b..11522271 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -93,7 +93,7 @@ do bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) if [[ "$bootstrap_check" != "" ]]; then - if [[ "${rand_by_domain[$i]}" -le "3" ]]; then + if [[ "${rand_by_domain[$i]}" -le "3" || "${rand_by_domain[$i]}" -gt "11" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) fi From 47f6ae6e46c04cdcd811e5d7784acfa0698fbf36 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 12 Mar 2022 23:07:19 +0000 Subject: [PATCH 0308/1176] Fix EU reachable bootstraps --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 24230202..52d552e8 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -66,7 +66,7 @@ do if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" - if [[ "${rand_by_domain[$i]}" -le "3" ]]; then + if [[ "${rand_by_domain[$i]}" -le "3" || "${rand_by_domain[$i]}" -gt "11" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) fi From 5072c23a36992b98c9db75e78ebed45b2a69c353 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Mar 2022 09:16:20 +0100 Subject: [PATCH 0309/1176] bootstrap server segregation --- geo_test.sh | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index 40858d44..f3e27222 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -71,6 +71,36 @@ bootstrap_server $continent } +function server_geolocation(){ + +ip_output=$(curl -s -m 10 http://ip-api.com/json/cdn-${rand_by_domain[$i]}.runonflux.io?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) +ip_status=$( jq -r .status 2>/dev/null <<< "$ip_output") + +if [[ "$ip_status" == "success" ]]; then +country=$(jq -r .country <<< "$ip_output") +org=$(jq -r .org <<< "$ip_output") +continent=$(jq -r .timezone <<< "$ip_output") +else +country="UKNOW" +continent="UKNOW" +fi + +continent=$(cut -f1 -d"/" <<< "$continent" ) +if [[ "$continent" =~ "Europe" ]]; then + server_continent="EU" +elif [[ "$continent" =~ "America" ]]; then + server_continent="US" +else [[ "$continent" =~ "Asia" ]]; + server_continent="AS" +fi + +echo -e "${ARROW} ${CYAN}Checking bootstrap server location....${NC}" +echo -e "${ARROW} ${CYAN}Server Location: $country, Continent: $continent ${NC}" +sleep 1 + +} + + function bootstrap_server(){ rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14") richable=() @@ -85,21 +115,22 @@ echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" while [ $i -lt $len ]; do + server_geolocation ${rand_by_domain[$i]} #echo ${rand_by_domain[$i]} bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) #echo -e "Height: $bootstrap_check" if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" - if [[ "${rand_by_domain[$i]}" -le "3" || "${rand_by_domain[$i]}" -gt "11" ]]; then + if [[ "$server_continent" == "EU" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) fi - if [[ "${rand_by_domain[$i]}" -gt "3" && "${rand_by_domain[$i]}" -le "10" ]]; then + if [[ "$server_continent" == "US" ]]; then richable_us+=( ${rand_by_domain[$i]} ) fi - if [[ "${rand_by_domain[$i]}" -gt "10" ]]; then + if [[ "$server_continent" == "AS" ]]; then richable_as+=( ${rand_by_domain[$i]} ) fi From bc622af064e21ba0bc73574b8325dfdf47d658ca Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Mar 2022 09:18:49 +0100 Subject: [PATCH 0310/1176] Minor edit --- geo_test.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index f3e27222..e49020f1 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -86,11 +86,16 @@ continent="UKNOW" fi continent=$(cut -f1 -d"/" <<< "$continent" ) + if [[ "$continent" =~ "Europe" ]]; then server_continent="EU" -elif [[ "$continent" =~ "America" ]]; then +fi + +if [[ "$continent" =~ "America" ]]; then server_continent="US" -else [[ "$continent" =~ "Asia" ]]; +fi + +if [[ "$continent" =~ "Asia" ]]; server_continent="AS" fi @@ -116,12 +121,9 @@ while [ $i -lt $len ]; do server_geolocation ${rand_by_domain[$i]} - #echo ${rand_by_domain[$i]} bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) - #echo -e "Height: $bootstrap_check" if [[ "$bootstrap_check" != "" ]]; then - #echo -e "Adding: ${rand_by_domain[$i]}" - + if [[ "$server_continent" == "EU" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) fi From 80ac7919c569f752f24a0897ae2d3181f72aa25e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Mar 2022 09:21:55 +0100 Subject: [PATCH 0311/1176] fix missing then --- geo_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index e49020f1..af98e6e1 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -95,7 +95,7 @@ if [[ "$continent" =~ "America" ]]; then server_continent="US" fi -if [[ "$continent" =~ "Asia" ]]; +if [[ "$continent" =~ "Asia" ]]; then server_continent="AS" fi From e7929228257cbda1473d6e13ed1a6328de924d26 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Mar 2022 09:25:33 +0100 Subject: [PATCH 0312/1176] fix get_ip --- geo_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index af98e6e1..d3b906eb 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -27,11 +27,11 @@ title=black, function get_ip(){ WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') - if [[ "$WANIP" == "" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *hmtl* ]]; then WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') fi - if [[ "$WANIP" == "" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *hmtl* ]]; then WANIP=$(curl --silent -m 10 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') fi } From fc481f878fe7b223b711af1c76ed36f8e734910f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Mar 2022 09:33:44 +0100 Subject: [PATCH 0313/1176] fix typo --- geo_test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index d3b906eb..21949d61 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -25,13 +25,14 @@ title=black, ' function get_ip(){ + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') - if [[ "$WANIP" == "" || "$WANIP" = *hmtl* ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') fi - if [[ "$WANIP" == "" || "$WANIP" = *hmtl* ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then WANIP=$(curl --silent -m 10 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') fi } @@ -101,7 +102,6 @@ fi echo -e "${ARROW} ${CYAN}Checking bootstrap server location....${NC}" echo -e "${ARROW} ${CYAN}Server Location: $country, Continent: $continent ${NC}" -sleep 1 } From 76c061b93267bca10d811270626f4a6f8f9d718f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Mar 2022 09:35:01 +0100 Subject: [PATCH 0314/1176] get ip improvement --- geo_test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index 21949d61..6cd37080 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -26,14 +26,14 @@ title=black, function get_ip(){ - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') + WANIP=$(curl -SsL -m 5 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') + WANIP=$(curl -SsL -m 5 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') fi if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') + WANIP=$(curl -SsL -m 5 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') fi } From c1c49dccafd88790e6d6140d6025b63e352c7995 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Mar 2022 09:39:37 +0100 Subject: [PATCH 0315/1176] Update geo_test.sh --- geo_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index 6cd37080..f14fc607 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -100,8 +100,8 @@ if [[ "$continent" =~ "Asia" ]]; then server_continent="AS" fi -echo -e "${ARROW} ${CYAN}Checking bootstrap server location....${NC}" -echo -e "${ARROW} ${CYAN}Server Location: $country, Continent: $continent ${NC}" +#echo -e "${ARROW} ${CYAN}Checking bootstrap server location....${NC}" +#echo -e "${ARROW} ${CYAN}Server Location: $country, Continent: $continent ${NC}" } From ec1cdb61cd90974b67350b61b8eb89822738a5e0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Mar 2022 09:45:14 +0100 Subject: [PATCH 0316/1176] variable correction --- geo_test.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index f14fc607..db7e57bf 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -74,29 +74,29 @@ bootstrap_server $continent function server_geolocation(){ -ip_output=$(curl -s -m 10 http://ip-api.com/json/cdn-${rand_by_domain[$i]}.runonflux.io?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) -ip_status=$( jq -r .status 2>/dev/null <<< "$ip_output") +ip_output1=$(curl -s -m 10 http://ip-api.com/json/cdn-${rand_by_domain[$i]}.runonflux.io?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) +ip_status1=$( jq -r .status 2>/dev/null <<< "$ip_output") -if [[ "$ip_status" == "success" ]]; then -country=$(jq -r .country <<< "$ip_output") -org=$(jq -r .org <<< "$ip_output") -continent=$(jq -r .timezone <<< "$ip_output") +if [[ "$ip_status1" == "success" ]]; then +country1=$(jq -r .country <<< "$ip_output1") +org1=$(jq -r .org <<< "$ip_output1") +continent1=$(jq -r .timezone <<< "$ip_output1") else -country="UKNOW" -continent="UKNOW" +country1="UKNOW" +continent1="UKNOW" fi -continent=$(cut -f1 -d"/" <<< "$continent" ) +continent1=$(cut -f1 -d"/" <<< "$continent1" ) -if [[ "$continent" =~ "Europe" ]]; then +if [[ "$continent1" =~ "Europe" ]]; then server_continent="EU" fi -if [[ "$continent" =~ "America" ]]; then +if [[ "$continent1" =~ "America" ]]; then server_continent="US" fi -if [[ "$continent" =~ "Asia" ]]; then +if [[ "$continent1" =~ "Asia" ]]; then server_continent="AS" fi From e7a648419b1ced3394e4e9bd43d900391db49983 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sun, 13 Mar 2022 15:14:00 +0000 Subject: [PATCH 0317/1176] Addnodes --- install_pro.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 11522271..d648bd62 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1308,6 +1308,11 @@ experimentalfeatures=1 listen=1 externalip=$WANIP bind=0.0.0.0 +addnode=80.211.207.17 +addnode=95.217.12.176 +addnode=89.58.3.209 +addnode=161.97.85.103 +addnode=194.163.176.185 addnode=explorer.flux.zelcore.io addnode=explorer.runonflux.io addnode=explorer.zelcash.online @@ -1355,6 +1360,26 @@ addnode=75.152.95.135 addnode=135.181.22.96 addnode=23.227.173.75 addnode=65.108.73.180 +addnode=95.216.80.122 +addnode=95.216.124.207 +addnode=65.21.81.152 +addnode=75.119.145.183 +addnode=207.180.233.97 +addnode=194.163.168.93 +addnode=89.58.13.117 +addnode=46.173.134.109 +addnode=46.173.134.156 +addnode=23.227.173.61 +addnode=23.227.173.61 +addnode=23.227.173.135 +addnode=23.227.173.15 +addnode=95.216.124.197 +addnode=65.21.165.2 +addnode=45.129.180.23 +addnode=89.58.27.53 +addnode=89.58.25.225 +addnode=195.201.170.210 +addnode=45.9.61.125 maxconnections=256 EOF sleep 2 From 565f1eb5e6f9fe6a42f1c257a635059668952fca Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:35:28 +0100 Subject: [PATCH 0318/1176] initial for test --- multinode.sh | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 multinode.sh diff --git a/multinode.sh b/multinode.sh new file mode 100644 index 00000000..21b63c7c --- /dev/null +++ b/multinode.sh @@ -0,0 +1,155 @@ +#!/bin/bash + +#color codes +RED='\033[1;31m' +YELLOW='\033[1;33m' +BLUE="\\033[38;5;27m" +SEA="\\033[38;5;49m" +GREEN='\033[1;32m' +CYAN='\033[1;36m' +NC='\033[0m' + +#emoji codes +CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" +X_MARK="${RED}\xE2\x9C\x96${NC}" +PIN="${RED}\xF0\x9F\x93\x8C${NC}" +CLOCK="${GREEN}\xE2\x8C\x9B${NC}" +ARROW="${SEA}\xE2\x96\xB6${NC}" +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + + +#dialog color +export NEWT_COLORS=' +title=black, +' + +function get_ip(){ + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi +} + +function string_limit_check_mark_port() { +if [[ -z "$2" ]]; then +string="$1" +string=${string::65} +else +string=$1 +string_color=$2 +string_leght=${#string} +string_leght_color=${#string_color} +string_diff=$((string_leght_color-string_leght)) +string=${string_color::65+string_diff} +fi +echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" +} + +function string_limit_check_mark() { +if [[ -z "$2" ]]; then +string="$1" +string=${string::50} +else +string=$1 +string_color=$2 +string_leght=${#string} +string_leght_color=${#string_color} +string_diff=$((string_leght_color-string_leght)) +string=${string_color::50+string_diff} +fi +echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" +} + +function string_limit_x_mark() { +if [[ -z "$2" ]]; then +string="$1" +string=${string::50} +else +string=$1 +string_color=$2 +string_leght=${#string} +string_leght_color=${#string_color} +string_diff=$((string_leght_color-string_leght)) +string=${string_color::50+string_diff} +fi +echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" +} + + + function insertAfter +{ + local file="$1" line="$2" newText="$3" + sudo sed -i -e "/$line/a"$'\\\n'"$newText"$'\n' "$file" +} + + +echo -e "" +get_ip + + while true + do + + echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 120 3>&1 1>&2 2>&3) + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16187" ]]; then + + string_limit_check_mark "Port is valid..........................................." + + echo -e "${ARROW}${YELLOW} Checking port availability.....${NC}" + port_check=$(curl -s -m 5 http://$WANIP:$FLUX_PORT/id/loginphrase 2>/dev/null | jq -r .status 2>/dev/null ) + if [[ "$port_check" == "" && $(cat /home/$USER/zelflux/config/userconfig.js | grep "$FLUX_PORT") == "" ]]; then + string_limit_check_mark "Port $FLUX_PORT is OK..........................................." + break + else + string_limit_x_mark "Port $FLUX_PORT is already in use..............................." + sleep 1 + fi + + + + else + string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." + sleep 1 + fi + done + + +if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then + + sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js + + if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}FluxOS port replaced successful...................[${CHECK_MARK}${CYAN}]${NC}" + fi + +else + + insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," + echo -e "${ARROW} ${CYAN}FluxOS port set successful........................[${CHECK_MARK}${CYAN}]${NC}" + + +fi + +if [[ -d /home/$USER/.fluxbenchmark ]]; then + sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null + echo "apiport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null +else + echo "apiport=$$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null +fi + +if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + echo -e "${ARROW} ${CYAN}Fluxbench port set successful.....................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + sleep 180 +fi + +echo -e "" From a59adc2d73e14dd3fb0189f26eddf35ded0fc5c6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:38:54 +0100 Subject: [PATCH 0319/1176] fix config --- multinode.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multinode.sh b/multinode.sh index 21b63c7c..9581a9b5 100644 --- a/multinode.sh +++ b/multinode.sh @@ -139,9 +139,9 @@ fi if [[ -d /home/$USER/.fluxbenchmark ]]; then sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null - echo "apiport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null else - echo "apiport=$$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + echo "fluxport=$$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then From b8daf84023b0a43c88312d4273779248d37967cf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:42:24 +0100 Subject: [PATCH 0320/1176] Fix port duplication --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index 9581a9b5..638bcba1 100644 --- a/multinode.sh +++ b/multinode.sh @@ -98,7 +98,7 @@ get_ip echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 120 3>&1 1>&2 2>&3) - if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16187" ]]; then + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then string_limit_check_mark "Port is valid..........................................." From 85cf04838d4cd02bcf24155385bc4f638847bd84 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Mar 2022 11:46:33 +0100 Subject: [PATCH 0321/1176] added maximum number of try --- multinode.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/multinode.sh b/multinode.sh index 638bcba1..558fb6fc 100644 --- a/multinode.sh +++ b/multinode.sh @@ -90,6 +90,8 @@ echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" } +try="0" + echo -e "" get_ip @@ -110,6 +112,12 @@ get_ip else string_limit_x_mark "Port $FLUX_PORT is already in use..............................." sleep 1 + try=$(($try+1)) + if [[ "$try" -gt "3" ]]; then + echo -e "${WORNING} ${CYAN}You have reached the maximum number of try...${NC}" + echo -e "" + exit + fi fi @@ -117,6 +125,12 @@ get_ip else string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." sleep 1 + try=$(($try+1)) + if [[ "$try" -gt "3" ]]; then + echo -e "${WORNING} ${CYAN}You have reached the maximum number of try...${NC}" + echo -e "" + exit + fi fi done From 7f1841f13c3c8e0699a62e9d683db5ab54f80911 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:19:36 +0100 Subject: [PATCH 0322/1176] remove port checking --- multinode.sh | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/multinode.sh b/multinode.sh index 558fb6fc..d5693b13 100644 --- a/multinode.sh +++ b/multinode.sh @@ -104,24 +104,22 @@ get_ip string_limit_check_mark "Port is valid..........................................." - echo -e "${ARROW}${YELLOW} Checking port availability.....${NC}" - port_check=$(curl -s -m 5 http://$WANIP:$FLUX_PORT/id/loginphrase 2>/dev/null | jq -r .status 2>/dev/null ) - if [[ "$port_check" == "" && $(cat /home/$USER/zelflux/config/userconfig.js | grep "$FLUX_PORT") == "" ]]; then - string_limit_check_mark "Port $FLUX_PORT is OK..........................................." - break - else - string_limit_x_mark "Port $FLUX_PORT is already in use..............................." - sleep 1 - try=$(($try+1)) - if [[ "$try" -gt "3" ]]; then - echo -e "${WORNING} ${CYAN}You have reached the maximum number of try...${NC}" - echo -e "" - exit - fi - fi - - - + #echo -e "${ARROW}${YELLOW} Checking port availability.....${NC}" + #port_check=$(curl -s -m 5 http://$WANIP:$FLUX_PORT/id/loginphrase 2>/dev/null | jq -r .status 2>/dev/null ) + #if [[ "$port_check" == "" && $(cat /home/$USER/zelflux/config/userconfig.js | grep "$FLUX_PORT") == "" ]]; then + #string_limit_check_mark "Port $FLUX_PORT is OK..........................................." + #break + #else + #string_limit_x_mark "Port $FLUX_PORT is already in use..............................." + #sleep 1 + #try=$(($try+1)) + #if [[ "$try" -gt "3" ]]; then + #echo -e "${WORNING} ${CYAN}You have reached the maximum number of try...${NC}" + #echo -e "" + #exit + #fi + #fi + else string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." sleep 1 @@ -161,6 +159,7 @@ fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${CYAN}Fluxbench port set successful.....................[${CHECK_MARK}${CYAN}]${NC}" echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" + sudo ufw allow $FLUX_PORT > /dev/null 2>&1 sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 sleep 180 From e36b35866947112b7185aa55e733601e23a01252 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:24:11 +0100 Subject: [PATCH 0323/1176] fix missing break --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index d5693b13..9c933e07 100644 --- a/multinode.sh +++ b/multinode.sh @@ -103,7 +103,7 @@ get_ip if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then string_limit_check_mark "Port is valid..........................................." - + break #echo -e "${ARROW}${YELLOW} Checking port availability.....${NC}" #port_check=$(curl -s -m 5 http://$WANIP:$FLUX_PORT/id/loginphrase 2>/dev/null | jq -r .status 2>/dev/null ) #if [[ "$port_check" == "" && $(cat /home/$USER/zelflux/config/userconfig.js | grep "$FLUX_PORT") == "" ]]; then From 7a02692f303b398682f2a8de085dfbb914c8d9f8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Mar 2022 15:12:00 +0100 Subject: [PATCH 0324/1176] cleanup --- multinode.sh | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/multinode.sh b/multinode.sh index 9c933e07..0d47f646 100644 --- a/multinode.sh +++ b/multinode.sh @@ -19,7 +19,6 @@ BOOK="${RED}\xF0\x9F\x93\x8B${NC}" HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - #dialog color export NEWT_COLORS=' title=black, @@ -37,20 +36,6 @@ function get_ip(){ fi } -function string_limit_check_mark_port() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::65} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::65+string_diff} -fi -echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} function string_limit_check_mark() { if [[ -z "$2" ]]; then @@ -82,16 +67,13 @@ fi echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" } - function insertAfter { local file="$1" line="$2" newText="$3" sudo sed -i -e "/$line/a"$'\\\n'"$newText"$'\n' "$file" } - try="0" - echo -e "" get_ip @@ -118,8 +100,7 @@ get_ip #echo -e "" #exit #fi - #fi - + #fi else string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." sleep 1 @@ -132,7 +113,6 @@ get_ip fi done - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js @@ -146,7 +126,6 @@ else insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," echo -e "${ARROW} ${CYAN}FluxOS port set successful........................[${CHECK_MARK}${CYAN}]${NC}" - fi if [[ -d /home/$USER/.fluxbenchmark ]]; then From 266cccb61548c5c134bf46567df24999417bc2d9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Mar 2022 20:17:53 +0100 Subject: [PATCH 0325/1176] added port for upnp service --- multinode.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multinode.sh b/multinode.sh index 0d47f646..07924d44 100644 --- a/multinode.sh +++ b/multinode.sh @@ -139,6 +139,8 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${CYAN}Fluxbench port set successful.....................[${CHECK_MARK}${CYAN}]${NC}" echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" sudo ufw allow $FLUX_PORT > /dev/null 2>&1 + sudo ufw allow 1900/udp > /dev/null 2>&1 + sudo ufw allow 1901/udp > /dev/null 2>&1 sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 sleep 180 From 657ac8d0dc1d3f6851534482adb9305fbfcb77b4 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Tue, 15 Mar 2022 20:03:02 +0000 Subject: [PATCH 0326/1176] Add more addnodes --- install_pro.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index d648bd62..03f6f61a 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1380,6 +1380,16 @@ addnode=89.58.27.53 addnode=89.58.25.225 addnode=195.201.170.210 addnode=45.9.61.125 +addnode=89.58.7.180 +addnode=89.58.41.170 +addnode=89.58.5.250 +addnode=94.16.108.216 +addnode=89.58.6.144 +addnode=75.22.188.83 +addnode=202.61.206.226 +addnode=185.193.17.204 +addnode=89.58.36.108 +addnode=185.205.246.201 maxconnections=256 EOF sleep 2 From 00a3e1f7d690447e79fcdb52684d9320c81b55f3 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Tue, 15 Mar 2022 20:11:18 +0000 Subject: [PATCH 0327/1176] Add more addnodes --- install_pro.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 03f6f61a..c0c01fc2 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1390,6 +1390,23 @@ addnode=202.61.206.226 addnode=185.193.17.204 addnode=89.58.36.108 addnode=185.205.246.201 +addnode=194.34.232.219 +addnode=45.13.59.140 +addnode=213.239.206.214 +addnode=161.97.169.239 +addnode=89.58.38.97 +addnode=94.250.203.87 +addnode=89.58.11.9 +addnode=194.34.232.214 +addnode=89.58.5.144 +addnode=89.58.35.183 +addnode=89.58.7.64 +addnode=38.242.211.98 +addnode=185.193.17.206 +addnode=37.221.192.199 +addnode=209.145.62.74 +addnode=38.242.202.228 +addnode=37.120.176.206 maxconnections=256 EOF sleep 2 From 9f0e30d1c110ad5897c9af3240bdb6c4cd427124 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 08:54:32 +0100 Subject: [PATCH 0328/1176] added instruction for multiple user detection --- nodeanalizerandfixer.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 7245c205..a5413419 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -375,7 +375,9 @@ echo -e "" echo -e "${WORNING} ${CYAN} Detected multiple users in docker group...${NC}" echo -e "${WORNING} ${CYAN} More then one instance of flux daemon will cause it to malfunction...${NC}" echo -e "${WORNING} ${CYAN} If u installed FluxOS on more then one user you need delete one instance of it...${NC}" -echo -e "" +echo -e "${WORNING} ${CYAN} To check the list of users type: getent group docker ${NC}" +echo -e "${WORNING} ${CYAN} To remove unwanted users type: sudo deluser --remove-home user_name ${NC}" +echo -e "${WORNING} ${CYAN} To reboot server type: sudo reboot -n ${NC}" fi @@ -390,7 +392,6 @@ if [[ "$bench_back" == "null" ]]; then bench_back=$(jq -r '.flux' <<< "$bench_getatus") fi - bench_getinfo=$($BENCH_CLI getinfo) bench_version=$(jq -r '.version' <<< "$bench_getinfo") From 7fd2b384ea2c8d384d05a73ee97cb44311d1156f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 15:39:10 +0100 Subject: [PATCH 0329/1176] added router ip detection and ufw rules - router ip detection ( auto and manual ) --- multinode.sh | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/multinode.sh b/multinode.sh index 07924d44..f81f9d35 100644 --- a/multinode.sh +++ b/multinode.sh @@ -139,11 +139,48 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${CYAN}Fluxbench port set successful.....................[${CHECK_MARK}${CYAN}]${NC}" echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" sudo ufw allow $FLUX_PORT > /dev/null 2>&1 - sudo ufw allow 1900/udp > /dev/null 2>&1 - sudo ufw allow 1901/udp > /dev/null 2>&1 + + if ! route -h > /dev/null 2>&1 ; then + sudo apt install net-tools > /dev/null 2>&1 + fi + + router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) + + if [[ "$router_ip" != "" ]]; then + + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + + else + + while true + do + + router_ip=$(whiptail --inputbox "Enter your router IP" 8 80 3>&1 1>&2 2>&3) + + if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then + echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + string_limit_x_mark "IP $router_ip is not a valid ..............................." + sleep 1 + fi + + done + + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + + fi + sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 sleep 180 + fi echo -e "" From d54fb5518e6b2f2e6356768c100374f1c61c2690 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 18:24:31 +0100 Subject: [PATCH 0330/1176] replaced route by ip rout --- multinode.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/multinode.sh b/multinode.sh index f81f9d35..aa924098 100644 --- a/multinode.sh +++ b/multinode.sh @@ -140,11 +140,12 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" sudo ufw allow $FLUX_PORT > /dev/null 2>&1 - if ! route -h > /dev/null 2>&1 ; then - sudo apt install net-tools > /dev/null 2>&1 - fi + #if ! route -h > /dev/null 2>&1 ; then + # sudo apt install net-tools > /dev/null 2>&1 + #fi - router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) + #router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) + router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) if [[ "$router_ip" != "" ]]; then From 71cfd35b8d95301b6300108b078d02d784592236 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 18:46:56 +0100 Subject: [PATCH 0331/1176] resize whiptail --- multinode.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multinode.sh b/multinode.sh index aa924098..bb0ec897 100644 --- a/multinode.sh +++ b/multinode.sh @@ -81,7 +81,7 @@ get_ip do echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 120 3>&1 1>&2 2>&3) + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 90 3>&1 1>&2 2>&3) if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then string_limit_check_mark "Port is valid..........................................." @@ -159,7 +159,7 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then while true do - router_ip=$(whiptail --inputbox "Enter your router IP" 8 80 3>&1 1>&2 2>&3) + router_ip=$(whiptail --inputbox "Enter your router IP" 8 60 3>&1 1>&2 2>&3) if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" From 35d8d4c823d497da631b13f381997b39784dd4e2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 18:52:44 +0100 Subject: [PATCH 0332/1176] resize whiptail --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index bb0ec897..2f144156 100644 --- a/multinode.sh +++ b/multinode.sh @@ -81,7 +81,7 @@ get_ip do echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 90 3>&1 1>&2 2>&3) + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then string_limit_check_mark "Port is valid..........................................." From 431f9719992e86cca0a1455993448f6734dbbe47 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 20:33:54 +0100 Subject: [PATCH 0333/1176] Minor edits --- multinode.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/multinode.sh b/multinode.sh index 2f144156..36b59bb8 100644 --- a/multinode.sh +++ b/multinode.sh @@ -178,10 +178,11 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then fi +fi + sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 sleep 180 - -fi + echo -e "" + echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}http://${WANIP}:$(($FLUX_PORT-1))${NC}" -echo -e "" From f2367a8a24414fba2fa2fab1f95af94a4078acb4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 20:39:18 +0100 Subject: [PATCH 0334/1176] development-test --- multitoolbox.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 52d552e8..88acaf35 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1623,6 +1623,43 @@ bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool } + +function multinode(){ + +echo -e "${GREEN}Module: Multinode configuration with UPNP comunnication (Needs Router with UPNP support)${NC}" +echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + + echo -e "${CYAN}Option allown you: ${GREEN}$USER${NC}" + echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp comunication ${NC}" + echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" + echo -e "${ARROW} ${RED}IMPORTANT:${NC}" + echo -e "${BOOK} ${RED}Each node need to set other port for comunnication${NC}" + echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + + exit + + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" + echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" + echo -e "" + exit + fi + + sleep 15 + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multinode.sh) + +} + function install_docker(){ echo -e "${GREEN}Module: Install Docker${NC}" @@ -2264,6 +2301,7 @@ echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}11 - Replace Zel ID ${NC}" echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${CYAN}13 - Recover corrupted MongoDB database${NC}" +echo -e "${CYAN}14 - Multinode configuration with UPNP comunnication (Needs Router with UPNP support) ${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -2359,6 +2397,13 @@ read -rp "Pick an option and hit ENTER: " echo -e "" ;; + 14) + clear + sleep 1 + multinode + echo -e "" + ;; + # 8) #clear From be56070ee12bf03d1c047567f6f288ee0a393be1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 20:43:52 +0100 Subject: [PATCH 0335/1176] Minor edit --- multitoolbox.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 88acaf35..55177116 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1637,10 +1637,11 @@ if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then exit fi - echo -e "${CYAN}Option allown you: ${GREEN}$USER${NC}" + echo -e "${CYAN}OPTION ALLOWN YOU: ${NC}" echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp comunication ${NC}" echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" - echo -e "${ARROW} ${RED}IMPORTANT:${NC}" + echo -e "" + echo -e "${ARROW} ${RED}IMPORTANT:${NC}" echo -e "${BOOK} ${RED}Each node need to set other port for comunnication${NC}" echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" echo -e "${YELLOW}================================================================${NC}" From 4ed2e62fba17f8177f10364c9b4e500fc49e12bf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 20:47:50 +0100 Subject: [PATCH 0336/1176] Minor edit --- multitoolbox.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 55177116..baf57488 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1636,16 +1636,18 @@ if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${NC}" exit fi - - echo -e "${CYAN}OPTION ALLOWN YOU: ${NC}" + + echo -e "" + echo -e "${ARROW} ${CYAN}OPTION ALLOWN YOU: ${NC}" echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp comunication ${NC}" echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" echo -e "" echo -e "${ARROW} ${RED}IMPORTANT:${NC}" echo -e "${BOOK} ${RED}Each node need to set other port for comunnication${NC}" echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" + echo -e "" echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" + echo -e "" exit From 6ae70edd6b531e08edd7dedd1d99af29e5aee64b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 20:56:32 +0100 Subject: [PATCH 0337/1176] fix typo and minor edit --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index baf57488..8166bff5 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1638,12 +1638,12 @@ if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then fi echo -e "" - echo -e "${ARROW} ${CYAN}OPTION ALLOWN YOU: ${NC}" + echo -e "${ARROW} ${CYAN}OPTION ALLOW YOU: ${NC}" echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp comunication ${NC}" echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" echo -e "" echo -e "${ARROW} ${RED}IMPORTANT:${NC}" - echo -e "${BOOK} ${RED}Each node need to set other port for comunnication${NC}" + echo -e "${BOOK} ${RED}Each node need to set different port for comunnication${NC}" echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" echo -e "" echo -e "${YELLOW}================================================================${NC}" From 2e9818701ccab4dd7beb1019b78fde628ea4a8b2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 21:03:27 +0100 Subject: [PATCH 0338/1176] cleanup --- multitoolbox.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8166bff5..73866125 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1649,8 +1649,6 @@ fi echo -e "${YELLOW}================================================================${NC}" echo -e "" - exit - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" From 5113b23f05d246fdd2bc15589e2aeeb58c8619ce Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 21:06:50 +0100 Subject: [PATCH 0339/1176] Update multinode.sh --- multinode.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/multinode.sh b/multinode.sh index 2f144156..36b59bb8 100644 --- a/multinode.sh +++ b/multinode.sh @@ -178,10 +178,11 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then fi +fi + sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 sleep 180 - -fi + echo -e "" + echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}http://${WANIP}:$(($FLUX_PORT-1))${NC}" -echo -e "" From ee7341737cb0acab036c71005669177824204095 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Mar 2022 21:16:42 +0100 Subject: [PATCH 0340/1176] grama correction --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 73866125..8d3b7819 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1638,7 +1638,7 @@ if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then fi echo -e "" - echo -e "${ARROW} ${CYAN}OPTION ALLOW YOU: ${NC}" + echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp comunication ${NC}" echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" echo -e "" From 024fb86200ce863d58b4ea84c4868dc025f9fcf8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Mar 2022 00:43:01 +0100 Subject: [PATCH 0341/1176] Minor edit --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index 36b59bb8..aa4403b1 100644 --- a/multinode.sh +++ b/multinode.sh @@ -184,5 +184,5 @@ fi pm2 restart flux > /dev/null 2>&1 sleep 180 echo -e "" - echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}http://${WANIP}:$(($FLUX_PORT-1))${NC}" + echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${WANIP}:$(($FLUX_PORT-1))${NC}" From 562ca6af7b2156770d151b24629907f185d94677 Mon Sep 17 00:00:00 2001 From: Greg P Date: Thu, 17 Mar 2022 19:43:17 -0500 Subject: [PATCH 0342/1176] Minor edits --- multinode.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/multinode.sh b/multinode.sh index aa4403b1..dc3a1af1 100644 --- a/multinode.sh +++ b/multinode.sh @@ -106,7 +106,7 @@ get_ip sleep 1 try=$(($try+1)) if [[ "$try" -gt "3" ]]; then - echo -e "${WORNING} ${CYAN}You have reached the maximum number of try...${NC}" + echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" echo -e "" exit fi @@ -118,13 +118,13 @@ if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}FluxOS port replaced successful...................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" fi else insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," - echo -e "${ARROW} ${CYAN}FluxOS port set successful........................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" fi @@ -136,7 +136,7 @@ else fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - echo -e "${ARROW} ${CYAN}Fluxbench port set successful.....................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" sudo ufw allow $FLUX_PORT > /dev/null 2>&1 @@ -159,13 +159,13 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then while true do - router_ip=$(whiptail --inputbox "Enter your router IP" 8 60 3>&1 1>&2 2>&3) + router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" break else - string_limit_x_mark "IP $router_ip is not a valid ..............................." + string_limit_x_mark "IP $router_ip is not valid ..............................." sleep 1 fi From 99ea1ee9e948bfa9dd7035af0a34b10fe18a2dd3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Mar 2022 07:46:50 +0100 Subject: [PATCH 0343/1176] Multi port support --- nodeanalizerandfixer.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index a5413419..c2874e03 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -155,6 +155,14 @@ if ! lsof -v > /dev/null 2>&1; then sudo apt-get install lsof -y > /dev/null 2>&1 && sleep 2 fi +if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then +FluxAPI=$(cat /home/$USER/.fluxbenchmark/fluxbench.conf | grep -o '[[:digit:]]*' | head -n1) +FluxUI=$(($FluxApi-1)) +else +FluxAPI=16127 +FluxUI=16126 +fi + if sudo lsof -i -n | grep LISTEN | grep 27017 | grep mongod > /dev/null 2>&1; then echo -e "${CHECK_MARK} ${CYAN} Mongod listen on port 27017${NC}" @@ -186,19 +194,19 @@ else echo -e "${X_MARK} ${CYAN} Flux benchmark not listen${NC}" fi -if sudo lsof -i -n | grep LISTEN | grep 16126 | grep node > /dev/null 2>&1 +if sudo lsof -i -n | grep LISTEN | grep $FluxUI | grep node > /dev/null 2>&1 then ZELFLUX_PORT1="1" fi -if sudo lsof -i -n | grep LISTEN | grep 16127 | grep node > /dev/null 2>&1 +if sudo lsof -i -n | grep LISTEN | grep $FluxAPI | grep node > /dev/null 2>&1 then ZELFLUX_PORT2="1" fi if [[ "$ZELFLUX_PORT1" == "1" && "$ZELFLUX_PORT2" == "1" ]] then -echo -e "${CHECK_MARK} ${CYAN} Flux listen on ports 16126/16127${NC}" +echo -e "${CHECK_MARK} ${CYAN} Flux listen on ports $FluxUI/$FluxAPI ${NC}" else echo -e "${X_MARK} ${CYAN} Flux not listen${NC}" fi @@ -880,7 +888,7 @@ else echo -e "${X_MARK} ${CYAN} Pm2 is not installed${NC}" fi -if [[ $(curl -s -m 5 --head "$WANIP:16126" | head -n 1 | grep "200 OK") ]] +if [[ $(curl -s -m 5 --head "$WANIP:$FluxUI" | head -n 1 | grep "200 OK") ]] then echo -e "${CHECK_MARK} ${CYAN} Flux front is working${NC}" else From 0a4b7cad9367095ca9d6828d668ad9912801370c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Mar 2022 07:55:25 +0100 Subject: [PATCH 0344/1176] fix FluxAPI --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index c2874e03..d150c634 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -156,8 +156,8 @@ sudo apt-get install lsof -y > /dev/null 2>&1 && sleep 2 fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then -FluxAPI=$(cat /home/$USER/.fluxbenchmark/fluxbench.conf | grep -o '[[:digit:]]*' | head -n1) -FluxUI=$(($FluxApi-1)) +FluxAPI=$(grep -Po "\\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) +FluxUI=$(($FluxAPI-1)) else FluxAPI=16127 FluxUI=16126 From 52a17c09cb49faa69e9c4108d698fe1fb336c2a8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Mar 2022 08:15:07 +0100 Subject: [PATCH 0345/1176] added upnp information --- nodeanalizerandfixer.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index d150c634..cbd9f01c 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -158,9 +158,11 @@ fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then FluxAPI=$(grep -Po "\\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) FluxUI=$(($FluxAPI-1)) +UPNP=1 else FluxAPI=16127 FluxUI=16126 +UPNP=0 fi @@ -211,6 +213,15 @@ else echo -e "${X_MARK} ${CYAN} Flux not listen${NC}" fi +echo -e "" +echo -e "${BOOK} ${YELLOW}FluxOS UPNP checking... ${NC}" +if [[ "$UPNP" == "1" ]]; then +echo -e "${ARROW} ${CYAN}UPNP MODE IS ENABLED${NC}" +else +echo -e "${ARROW} ${CYAN}UPNP MODE IS DISABLED${NC}" +fi +echo -e "" + } function get_last_benchmark() From 5c8f02b46ea97c10c0ffab0562a59b0f98d5d46e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Mar 2022 08:18:27 +0100 Subject: [PATCH 0346/1176] Minor edit --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index cbd9f01c..609e1622 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -216,9 +216,9 @@ fi echo -e "" echo -e "${BOOK} ${YELLOW}FluxOS UPNP checking... ${NC}" if [[ "$UPNP" == "1" ]]; then -echo -e "${ARROW} ${CYAN}UPNP MODE IS ENABLED${NC}" +echo -e "${PIN} ${CYAN}UPNP MODE: ENABLED${NC}" else -echo -e "${ARROW} ${CYAN}UPNP MODE IS DISABLED${NC}" +echo -e "${PIN} ${CYAN}UPNP MODE: DISABLED${NC}" fi echo -e "" From 79305597bfe30b1fb1e8e23aff09dea695e65aac Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Mar 2022 08:25:50 +0100 Subject: [PATCH 0347/1176] Minor edits --- nodeanalizerandfixer.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 609e1622..d399b0dc 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -972,10 +972,10 @@ echo echo -e "${BOOK} ${YELLOW}Checking ~/$CONFIG_DIR/$CONFIG_FILE${NC}" if [[ $zelnodeprivkey == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') ]] then -echo -e "${CHECK_MARK} ${CYAN} FluxNode privkey matches${NC}" +echo -e "${CHECK_MARK} ${CYAN} FluxNode Identity Key matches${NC}" else REPLACE="1" -echo -e "${X_MARK} ${CYAN} FluxNode privkey does not match${NC}" +echo -e "${X_MARK} ${CYAN} FluxNode Identity Key does not match${NC}" fi if [[ $zelnodeoutpoint == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') ]] @@ -1062,11 +1062,11 @@ if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR else if [[ "$zelnodeprivkey" == "" ]]; then - echo -e " ${CYAN}FluxNode privkey skipped...............${NC}" + echo -e " ${CYAN}FluxNode Identity Key skipped...............${NC}" else sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e " ${CYAN}FluxNode privkey replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + echo -e " ${CYAN}FluxNode Identity Key replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" fi fi fi From 47fe96e7b075c96d31afe8bd008ac7c8ee2cbe7a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Mar 2022 08:30:14 +0100 Subject: [PATCH 0348/1176] Minor edit --- nodeanalizerandfixer.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index d399b0dc..553a0f89 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -214,11 +214,11 @@ echo -e "${X_MARK} ${CYAN} Flux not listen${NC}" fi echo -e "" -echo -e "${BOOK} ${YELLOW}FluxOS UPNP checking... ${NC}" +echo -e "${BOOK} ${YELLOW}FluxOS UPNP checking: ${NC}" if [[ "$UPNP" == "1" ]]; then -echo -e "${PIN} ${CYAN}UPNP MODE: ENABLED${NC}" +echo -e "${PIN} ${CYAN}UPNP MODE: ${GREEN}ENABLED${NC}" else -echo -e "${PIN} ${CYAN}UPNP MODE: DISABLED${NC}" +echo -e "${PIN} ${CYAN}UPNP MODE: ${RED}DISABLED${NC}" fi echo -e "" From fd5f9d337d1fb16519cf9c982dc379303452db3d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Mar 2022 08:32:25 +0100 Subject: [PATCH 0349/1176] Clean --- nodeanalizerandfixer.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 553a0f89..c2cb69fc 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -220,7 +220,6 @@ echo -e "${PIN} ${CYAN}UPNP MODE: ${GREEN}ENABLED${NC}" else echo -e "${PIN} ${CYAN}UPNP MODE: ${RED}DISABLED${NC}" fi -echo -e "" } From 737fa9cf2a9640f8433fb44d3778470ef64e6a2f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Mar 2022 09:09:21 +0100 Subject: [PATCH 0350/1176] added additional info --- nodeanalizerandfixer.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index c2cb69fc..a6df6a9f 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -214,12 +214,14 @@ echo -e "${X_MARK} ${CYAN} Flux not listen${NC}" fi echo -e "" -echo -e "${BOOK} ${YELLOW}FluxOS UPNP checking: ${NC}" +echo -e "${BOOK} ${YELLOW}FluxOS networking: ${NC}" if [[ "$UPNP" == "1" ]]; then echo -e "${PIN} ${CYAN}UPNP MODE: ${GREEN}ENABLED${NC}" else echo -e "${PIN} ${CYAN}UPNP MODE: ${RED}DISABLED${NC}" fi +echo -e "${PIN} ${CYAN}FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" +echo -e "${PIN} ${CYAN}FluxUI PORT: ${ORANGE}$FluxUI ${NC}" } From 431ad4256fcafb5427c7e5e653d7f6136744b554 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Mar 2022 10:01:39 +0100 Subject: [PATCH 0351/1176] UPNP check fix --- nodeanalizerandfixer.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index a6df6a9f..73167603 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -155,10 +155,21 @@ if ! lsof -v > /dev/null 2>&1; then sudo apt-get install lsof -y > /dev/null 2>&1 && sleep 2 fi + + + + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then FluxAPI=$(grep -Po "\\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) -FluxUI=$(($FluxAPI-1)) -UPNP=1 +FLUXOS_CONFIG=$(grep -Po "$FluxAPI" /home/$USER/zelflux/config/userconfig.js) + if [[ "$FLUXOS_CONFIG" != "" ]]; then + FluxUI=$(($FluxAPI-1)) + UPNP=1 + else + FluxAPI=16127 + FluxUI=16126 + UPNP=0 + fi else FluxAPI=16127 FluxUI=16126 From fff8bfcb494533db16ae00a14f724df6abeea8fc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Mar 2022 09:44:08 +0100 Subject: [PATCH 0352/1176] added router confirm windows --- multinode.sh | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/multinode.sh b/multinode.sh index dc3a1af1..c6a0ed5c 100644 --- a/multinode.sh +++ b/multinode.sh @@ -149,10 +149,36 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then if [[ "$router_ip" != "" ]]; then - sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 - sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 - sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 - sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + + if (whiptail --yesno "Is your router's ip is $router_ip ?" 8 70); then + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + else + + + while true + do + + router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) + + if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then + echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + string_limit_x_mark "IP $router_ip is not valid ..............................." + sleep 1 + fi + + done + + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + + fi else From 0ecf5a99a489612f0f89d8ba4d379b7c05ebae7d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Mar 2022 09:46:15 +0100 Subject: [PATCH 0353/1176] Minor edit --- multinode.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multinode.sh b/multinode.sh index c6a0ed5c..d1671268 100644 --- a/multinode.sh +++ b/multinode.sh @@ -145,12 +145,12 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then #fi #router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) - router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) if [[ "$router_ip" != "" ]]; then - if (whiptail --yesno "Is your router's ip is $router_ip ?" 8 70); then + if (whiptail --yesno "Is your router's IP is $router_ip ?" 8 70); then sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 From a971fb2a7c69c1a78f311cc0f400a7d7ac93cb04 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Mar 2022 10:28:40 +0100 Subject: [PATCH 0354/1176] added pm2 logs checking --- multinode.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/multinode.sh b/multinode.sh index d1671268..c14d51db 100644 --- a/multinode.sh +++ b/multinode.sh @@ -208,7 +208,14 @@ fi sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 - sleep 180 - echo -e "" - echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${WANIP}:$(($FLUX_PORT-1))${NC}" - + sleep 200 + echo -e "${ARROW}${YELLOW} Checking FluxOS logs.....${NC}" + error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log) | grep "UPnP failed to verify") + + if [[ "$error_check" == "" ]]; then + echo -e "" + echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${WANIP}:$(($FLUX_PORT-1))${NC}" + else + echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." + echo -e "" + fi From 388b4cc10f9c5e87e91bd21d5a2445ecdacb6b8f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Mar 2022 10:30:57 +0100 Subject: [PATCH 0355/1176] fix check --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index c14d51db..dbfe2b2a 100644 --- a/multinode.sh +++ b/multinode.sh @@ -210,7 +210,7 @@ fi pm2 restart flux > /dev/null 2>&1 sleep 200 echo -e "${ARROW}${YELLOW} Checking FluxOS logs.....${NC}" - error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log) | grep "UPnP failed to verify") + error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed to verify") if [[ "$error_check" == "" ]]; then echo -e "" From 6a0a846b52f0a1c211f5dd74f6188fb22d46e840 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Mar 2022 10:40:04 +0100 Subject: [PATCH 0356/1176] Minor edit --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index dbfe2b2a..dd203e8c 100644 --- a/multinode.sh +++ b/multinode.sh @@ -209,7 +209,7 @@ fi sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 sleep 200 - echo -e "${ARROW}${YELLOW} Checking FluxOS logs.....${NC}" + echo -e "${ARROW}${YELLOW} Checking FluxOS logs... ${NC}" error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed to verify") if [[ "$error_check" == "" ]]; then From 6a69809119d10c1e87f3e60a6ded8d84594d3449 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Mar 2022 10:41:04 +0100 Subject: [PATCH 0357/1176] Minor edit --- multinode.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/multinode.sh b/multinode.sh index dd203e8c..a9e7ad1d 100644 --- a/multinode.sh +++ b/multinode.sh @@ -215,6 +215,7 @@ fi if [[ "$error_check" == "" ]]; then echo -e "" echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${WANIP}:$(($FLUX_PORT-1))${NC}" + echo -e "" else echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." echo -e "" From 2cf2faece2464a6c049e7fc3bb29cb205347a6bf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Mar 2022 12:03:10 +0100 Subject: [PATCH 0358/1176] replaced public ip by local ip --- multinode.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index a9e7ad1d..29b38677 100644 --- a/multinode.sh +++ b/multinode.sh @@ -214,7 +214,8 @@ fi if [[ "$error_check" == "" ]]; then echo -e "" - echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${WANIP}:$(($FLUX_PORT-1))${NC}" + LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') + echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${LOCAL_IP}:$(($FLUX_PORT-1))${NC}" echo -e "" else echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." From a22257bf291bfe3da5eade546306413c1f8d3fc3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Mar 2022 12:50:35 +0100 Subject: [PATCH 0359/1176] Minor edit --- nodeanalizerandfixer.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 73167603..47e9af3e 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -227,12 +227,12 @@ fi echo -e "" echo -e "${BOOK} ${YELLOW}FluxOS networking: ${NC}" if [[ "$UPNP" == "1" ]]; then -echo -e "${PIN} ${CYAN}UPNP MODE: ${GREEN}ENABLED${NC}" +echo -e "${PIN} ${CYAN} UPNP MODE: ${GREEN}ENABLED${NC}" else -echo -e "${PIN} ${CYAN}UPNP MODE: ${RED}DISABLED${NC}" +echo -e "${PIN} ${CYAN} UPNP MODE: ${RED}DISABLED${NC}" fi -echo -e "${PIN} ${CYAN}FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" -echo -e "${PIN} ${CYAN}FluxUI PORT: ${ORANGE}$FluxUI ${NC}" +echo -e "${PIN} ${CYAN} FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" +echo -e "${PIN} ${CYAN} FluxUI PORT: ${ORANGE}$FluxUI ${NC}" } From 4e092e22690ae18547c36da60a3a984373ff011f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Mar 2022 13:03:11 +0100 Subject: [PATCH 0360/1176] Minor edit --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index 29b38677..ba9f80dd 100644 --- a/multinode.sh +++ b/multinode.sh @@ -150,7 +150,7 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then if [[ "$router_ip" != "" ]]; then - if (whiptail --yesno "Is your router's IP is $router_ip ?" 8 70); then + if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 From 1ef1192221fc39f96033d8d17ff8b8ede0f3e179 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 19 Mar 2022 17:19:24 +0000 Subject: [PATCH 0361/1176] Updating Testnet install script FluxOs now Master version. FluxBench Updated to v3.1.0 multiport compatible --- install_pro_testnet.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 5beece1f..ada9da40 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1161,8 +1161,8 @@ if [[ $(dpkg --print-architecture) = *amd* ]]; then sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.1.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.1.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 @@ -1173,8 +1173,8 @@ else sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.0.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-arm-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.1.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.1.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 @@ -1825,9 +1825,6 @@ fi echo -e "${ARROW} ${YELLOW}Flux installing...${NC}" git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 - cd zelflux - echo -e "${ARROW} ${YELLOW}Changing to test branch...${NC}" - git checkout testnet > /dev/null 2>&1 cd echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" From 115425dcd9f611c3d067147ab9d20bc44da3de5c Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 19 Mar 2022 17:24:17 +0000 Subject: [PATCH 0362/1176] Update Testnet Multitoolbox Added option 5 - Multinode configuration with UPNP comunnication (Needs Router with UPNP support) --- multitoolbox_testnet.sh | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 28905067..38235571 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1395,6 +1395,43 @@ fi bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro_testnet.sh) +} + +function multinode(){ + +echo -e "${GREEN}Module: Multinode configuration with UPNP comunnication (Needs Router with UPNP support)${NC}" +echo -e "${YELLOW}================================================================${NC}" + +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit +fi + + echo -e "" + echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" + echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp comunication ${NC}" + echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" + echo -e "" + echo -e "${ARROW} ${RED}IMPORTANT:${NC}" + echo -e "${BOOK} ${RED}Each node need to set different port for comunnication${NC}" + echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" + echo -e "" + echo -e "${YELLOW}================================================================${NC}" + echo -e "" + + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" + echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" + echo -e "" + exit + fi + + sleep 15 + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multinode.sh) + } function install_docker(){ @@ -2066,6 +2103,7 @@ echo -e "${CYAN}1 - Install Docker${NC}" echo -e "${CYAN}2 - Install FluxNode${NC}" echo -e "${CYAN}3 - Update flux daemon and benchmark binary${NC}" echo -e "${CYAN}4 - Install/Re-install FluxOS${NC}" +echo -e "${CYAN}5 - Multinode configuration with UPNP comunnication (Needs Router with UPNP support) ${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -2091,5 +2129,10 @@ read -rp "Pick an option and hit ENTER: " clear sleep 1 install_flux + ;; + 5) + clear + sleep 1 + multinode ;; esac From f1d6b66a4f2d8dc96795d14bae3fe0e57e7152ca Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 20 Mar 2022 16:39:15 +0100 Subject: [PATCH 0363/1176] added UPnP check --- nodeanalizerandfixer.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 47e9af3e..bab00f9a 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -227,13 +227,22 @@ fi echo -e "" echo -e "${BOOK} ${YELLOW}FluxOS networking: ${NC}" if [[ "$UPNP" == "1" ]]; then -echo -e "${PIN} ${CYAN} UPNP MODE: ${GREEN}ENABLED${NC}" +echo -e "${PIN} ${CYAN} UPnP MODE: ${GREEN}ENABLED${NC}" else -echo -e "${PIN} ${CYAN} UPNP MODE: ${RED}DISABLED${NC}" +echo -e "${PIN} ${CYAN} UPnP MODE: ${RED}DISABLED${NC}" fi echo -e "${PIN} ${CYAN} FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" echo -e "${PIN} ${CYAN} FluxUI PORT: ${ORANGE}$FluxUI ${NC}" +error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed to verify") + if [[ "$error_check" != "" ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Checking FluxOS logs... ${NC}" + echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." + echo -e "" + fi + + } function get_last_benchmark() From 54ec0582bb67254622b0c403b704e81d155a547f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 22 Mar 2022 18:13:44 +0100 Subject: [PATCH 0364/1176] update wip function --- install_pro.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_pro.sh b/install_pro.sh index c0c01fc2..32f272c3 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1000,6 +1000,7 @@ function wipe_clean() { #sudo rm -rf ~/.zelcash/determ_zelnodes ~/.zelcash/sporks ~/$CONFIG_DIR/database ~/.zelcash/blocks ~/.zelcashchainstate > /dev/null 2>&1 && sleep 1 #sudo rm -rf ~/.zelcash > /dev/null 2>&1 && sleep 1 sudo rm -rf .zelbenchmark > /dev/null 2>&1 && sleep 1 + sudo rm -rf .fluxbenchmark > /dev/null 2>&1 && sleep 1 sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 From 919ac010e9f747a2f13c0e624c5aaf50bb68f47f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 22 Mar 2022 18:38:31 +0100 Subject: [PATCH 0365/1176] update UPnP check --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index bab00f9a..4e5b8b59 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -234,7 +234,7 @@ fi echo -e "${PIN} ${CYAN} FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" echo -e "${PIN} ${CYAN} FluxUI PORT: ${ORANGE}$FluxUI ${NC}" -error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed to verify") +error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") if [[ "$error_check" != "" ]]; then echo -e "" echo -e "${ARROW} ${YELLOW}Checking FluxOS logs... ${NC}" From 492405a0e351d4b25e6f2301ada9304ed7a30f7a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 22 Mar 2022 18:39:16 +0100 Subject: [PATCH 0366/1176] update UPnP check --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index ba9f80dd..102d47df 100644 --- a/multinode.sh +++ b/multinode.sh @@ -210,7 +210,7 @@ fi pm2 restart flux > /dev/null 2>&1 sleep 200 echo -e "${ARROW}${YELLOW} Checking FluxOS logs... ${NC}" - error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed to verify") + error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") if [[ "$error_check" == "" ]]; then echo -e "" From 3ea7241e31c07c30302cca608b6163dc01e2f602 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 22 Mar 2022 19:14:44 +0100 Subject: [PATCH 0367/1176] Minor edits --- nodeanalizerandfixer.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 4e5b8b59..793f09b6 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -227,12 +227,12 @@ fi echo -e "" echo -e "${BOOK} ${YELLOW}FluxOS networking: ${NC}" if [[ "$UPNP" == "1" ]]; then -echo -e "${PIN} ${CYAN} UPnP MODE: ${GREEN}ENABLED${NC}" +echo -e "${PIN} ${CYAN}UPnP MODE: ${GREEN}ENABLED${NC}" else -echo -e "${PIN} ${CYAN} UPnP MODE: ${RED}DISABLED${NC}" +echo -e "${PIN} ${CYAN}UPnP MODE: ${RED}DISABLED${NC}" fi -echo -e "${PIN} ${CYAN} FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" -echo -e "${PIN} ${CYAN} FluxUI PORT: ${ORANGE}$FluxUI ${NC}" +echo -e "${PIN} ${CYAN}FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" +echo -e "${PIN} ${CYAN}FluxUI PORT: ${ORANGE}$FluxUI ${NC}" error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") if [[ "$error_check" != "" ]]; then From 3aaee571a8db372c531629afada8face21520f60 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 22 Mar 2022 19:18:28 +0100 Subject: [PATCH 0368/1176] Delete install_pro_dev.sh --- install_pro_dev.sh | 2314 -------------------------------------------- 1 file changed, 2314 deletions(-) delete mode 100644 install_pro_dev.sh diff --git a/install_pro_dev.sh b/install_pro_dev.sh deleted file mode 100644 index 50f3b45e..00000000 --- a/install_pro_dev.sh +++ /dev/null @@ -1,2314 +0,0 @@ -#!/bin/bash -# Bootstrap settings -BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' -BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' -BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' -BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' - -#wallet information -COIN_NAME='flux' -CONFIG_DIR='.flux' -CONFIG_FILE='flux.conf' -kadena_possible="0" - -BENCH_NAME='fluxbench' -BENCH_CLI='fluxbench-cli' -BENCH_DIR_LOG='.fluxbenchmark' - -COIN_DAEMON='fluxd' -COIN_CLI='flux-cli' -COIN_PATH='/usr/local/bin' - -USERNAME="$(whoami)" -FLUX_DIR='zelflux' - -#Install variable -IMPORT_ZELCONF="0" -IMPORT_ZELID="0" -CORRUPTED="0" -BOOTSTRAP_SKIP="0" -WATCHDOG_INSTALL="0" - -#Zelflux ports -ZELFRONTPORT=16126 -LOCPORT=16127 -ZELNODEPORT=16128 -#MDBPORT=27017 -RPCPORT=16124 -PORT=16125 - -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -#dialog color -export NEWT_COLORS=' -title=black, -' -function string_limit_check_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::40} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::40+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - - function selfhosting() { - echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" - echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 - else - echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 - echo -e "" - exit - fi - -echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 -sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 -sudo touch /home/$USER/ip_check.sh -sudo chown $USER:$USER /home/$USER/ip_check.sh - cat <<'EOF' > /home/$USER/ip_check.sh -#!/bin/bash -function get_ip(){ - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi -} -if [[ $1 == "restart" ]]; then - # give 3min to connect with internet - sleep 180 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi -fi -if [[ $1 == "ip_check" ]]; then - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - confirmed_ip=$(curl -SsL -m 10 http://localhost:16127/flux/info | jq -r .data.node.status.ip) - if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then - if [[ "$WANIP" != "$confirmed_ip" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - fi -fi -EOF - -sudo chmod +x /home/$USER/ip_check.sh -echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 - -#crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) -sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 - -if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" -else - echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" -fi -echo -e "" - } - - -function max(){ - - m="0" - for n in "$@" - do - if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then - [ "$n" -gt "$m" ] && m="$n" - fi - done - - echo "$m" - -} - -function string_limit_x_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::40} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::40+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" -} - - -function integration_check() { -FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) -ELEMENTS=${#FILE_ARRAY[@]} - -for (( i=0;i<$ELEMENTS;i++)); do - -string="${FILE_ARRAY[${i}]}................................." -string=${string::40} - -if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then - echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" -else - echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" - CORRUPTED="1" -fi - -done - -if [[ "$CORRUPTED" == "1" ]]; then - echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" - echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" - echo - exit -fi -echo -e "" -} - -function tier(){ - -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') - - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') - fi - - - if [[ $stak_info == ?(-)+([0-9]) ]]; then - - case $stak_info in - "25000") kadena_possible=1 ;; - "100000") kadena_possible=1 ;; - "12500") kadena_possible=1 ;; - "40000") kadena_possible=1 ;; - esac - - else - kadena_possible=0 - fi - -fi - -} - -function config_file() { - -if [[ -f /home/$USER/install_conf.json ]]; then -import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') -ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') -firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') -bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') -bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') -swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') -#mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') -watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') -use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') -prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') -outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') -index=$(cat /home/$USER/install_conf.json | jq -r '.index') -ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') -KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') - -echo -echo -e "${ARROW} ${YELLOW}Install config:" - -if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then -echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else - -if [[ "$import_settings" == "1" ]]; then -echo -e "${PIN}${CYAN} Import settings from Flux..............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -fi - -if [[ "$ssh_port" != "" ]]; then -echo -e "${PIN}${CYAN} SSH port set.....................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -if [[ "$firewall_disable" == "1" ]]; then -echo -e "${PIN}${CYAN} Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN} Firewall enabled diuring installation............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -if [[ "$use_old_chain" == "1" ]]; then -echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - -else - -if [[ "$bootstrap_url" == "" ]]; then -echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -if [[ "$bootstrap_zip_del" == "1" ]]; then -echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -fi - -if [[ "$swapon" == "1" ]]; then -echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -#if [[ "$mongo_bootstrap" == "1" ]]; then -#echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -#fi - -if [[ "$watchdog" == "1" ]]; then -echo -e "${PIN}${CYAN} Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - - - -fi -} - -function round() { - printf "%.${2}f" "${1}" -} - -function check_benchmarks() { - - var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") - limit=$2 - if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]] - then - var_round=$(round "$var_benchmark" 2) - echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" - fi - -} - -function import_date() { - -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then - - if [[ -z "$import_settings" ]]; then - - if whiptail --yesno "Would you like to import data from Flux config files Y/N?" 8 60; then - - OLD_CONFIG=0 - - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - OLD_CONFIG=1 - fi - - IMPORT_ZELCONF="1" - echo - echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 - - if [[ "$OLD_CONFIG" == "1" ]]; then - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' - fi - - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - - ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 - IMPORT_ZELID="1" - fi - - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi - - fi - fi - -else - - if [[ "$import_settings" == "1" ]]; then - - OLD_CONFIG=0 - - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - OLD_CONFIG=1 - fi - - IMPORT_ZELCONF="1" - echo - echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 - - if [[ "$OLD_CONFIG" == "1" ]]; then - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' - fi - - - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - - ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 - IMPORT_ZELID="1" - fi - - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi - fi - fi - - fi -fi -sleep 1 -echo -} - -function tar_file_unpack() -{ - echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" - pv $1 | tar -zx -C $2 -} - - -function check_tar() -{ - echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" - - if gzip -t "$1" &>/dev/null; then - - echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" - - else - - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $1 - - fi -} - - -function install_watchdog() { -echo -e "${ARROW} ${YELLOW}Install watchdog for FluxNode${NC}" -if pm2 -v > /dev/null 2>&1 -then -WATCHDOG_INSTALL="1" -echo -e "${ARROW} ${YELLOW}Downloading...${NC}" -cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 -echo -e "${ARROW} ${YELLOW}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 -mv post-merge /home/$USER/watchdog/.git/hooks/post-merge -sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge -echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" -cd watchdog && npm install > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Creating config file....${NC}" - -#if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then -flux_update='1' -#sleep 1 -#else -#lux_update='0' -#sleep 1 -#fi - -#if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then -daemon_update='1' -#sleep 1 -#else -#daemon_update='0' -#sleep 1 -#fi - -#if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then -bench_update='1' -#sleep 1 -#else -#bench_update='0' -#sleep 1 -#fi - -#if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then -fix_action='1' -#sleep 1 -#else -#fix_action='0' -#sleep 1 -#fi - -telegram_alert=0; -discord=0; - -if whiptail --yesno "Would you like enable alert notification?" 8 60; then - -sleep 1 - -whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 - -sleep 1 - -CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ - "1" "Discord notification " ON \ - "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) - -if [ -z "$CHOICES" ]; then - - echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" - sleep 1 - discord=0; - ping=0; - telegram_alert=0; - telegram_bot_token=0; - telegram_chat_id=0; - node_label=0; - -else - for CHOICE in $CHOICES; do - case "$CHOICE" in - "1") - - discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) - sleep 1 - - if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - - while true - do - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) - if [[ $ping == ?(-)+([0-9]) ]]; then - string_limit_check_mark "UserID is valid..........................................." - break - else - string_limit_x_mark "UserID is not valid try again............................." - sleep 1 - fi - done - - sleep 1 - - else - ping=0; - sleep 1 - fi - - ;; - "2") - - telegram_alert=1; - - while true - do - telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) - if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then - string_limit_check_mark "Bot token is valid..........................................." - break - else - string_limit_x_mark "Bot token is not valid try again............................." - sleep 1 - fi - done - - sleep 1 - - while true - do - telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) - if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then - string_limit_check_mark "Chat ID is valid..........................................." - break - else - string_limit_x_mark "Chat ID is not valid try again............................." - sleep 1 - fi - done - - sleep 1 - - ;; - esac - done -fi - - while true - do - node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - string_limit_check_mark "Node name is valid..........................................." - break - else - string_limit_x_mark "Node name is not valid try again............................." - sleep 1 - fi - done - -else - - discord=0; - ping=0; - telegram_alert=0; - telegram_bot_token=0; - telegram_chat_id=0; - node_label=0; - sleep 1 -fi - - -if [[ "$discord" == 0 ]]; then - ping=0; -fi - - -if [[ "$telegram_alert" == 0 ]]; then - telegram_bot_token=0; - telegram_chat_id=0; -fi - -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') - - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') - fi -fi - -if [[ $stak_info == ?(-)+([0-9]) ]]; then - - case $stak_info in - "10000") eps_limit=90 ;; - "25000") eps_limit=180 ;; - "100000") eps_limit=300 ;; - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; - esac - -else -eps_limit=0; -fi - - -sudo touch /home/$USER/watchdog/config.js -sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat << EOF > /home/$USER/watchdog/config.js -module.exports = { - label: '${node_label}', - tier_eps_min: '${eps_limit}', - zelflux_update: '${flux_update}', - zelcash_update: '${daemon_update}', - zelbench_update: '${bench_update}', - action: '${fix_action}', - ping: '${ping}', - web_hook_url: '${discord}', - telegram_alert: '${telegram_alert}', - telegram_bot_token: '${telegram_bot_token}', - telegram_chat_id: '${telegram_chat_id}' -} -EOF - -echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" -pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 -if [[ -f /home/$USER/watchdog/watchdog.js ]] -then -current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) -#echo -e "${ARROW} ${CYAN}Watchdog ${GREEN}v$current_ver${CYAN} installed successful.${NC}" -string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." -else -#echo -e "${ARROW} ${CYAN}Watchdog installion failed.${NC}" -string_limit_x_mark "Watchdog was not installed................................." -fi -else -#echo -e "${ARROW} ${CYAN}Watchdog installion failed.${NC}" -string_limit_x_mark "Watchdog was not installed................................." -fi -} - -function mongodb_bootstrap(){ - - echo -e "" - echo -e "${ARROW} ${YELLOW}Restore mongodb datatable from bootstrap${NC}" - - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') - fi - - #BLOCKHIGHT=$(curl -s -m 6 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') - echo -e "${ARROW} ${CYAN}Bootstrap block height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" - wget --tries=5 $BOOTSTRAP_URL_MONGOD -q --show-progress - - if [[ -f /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD ]]; then - - echo -e "${ARROW} ${CYAN}Unpacking...${NC}" - tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" - mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 - sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 - - - BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) - echo -e ${ARROW} ${CYAN}Node block height after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC} - - else - - echo -e "${ARROW} ${RED}MongoDB bootstrap server offline...try again later use option 5${NC}" - fi - - echo -e "" - - #if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then - #echo -e "${ARROW} ${CYAN}Mongo bootstrap installed successful.${NC}" - #echo -e "" - # else - # echo -e "${ARROW} ${CYAN}Mongo bootstrap installation failed.${NC}" - # echo -e "" - # fi - -} - -function wipe_clean() { - echo -e "${ARROW} ${YELLOW}Removing any instances of FluxNode${NC}" - apt_number=$(ps aux | grep 'apt' | wc -l) - - if [[ "$apt_number" > 1 ]]; then - - sudo killall apt > /dev/null 2>&1 - sudo killall apt-get > /dev/null 2>&1 - sudo dpkg --configure -a > /dev/null 2>&1 - - fi - - echo -e "${ARROW} ${CYAN}Stopping all services and running processes...${NC}" - - # NEW CLEAN_UP - - sudo killall nano > /dev/null 2>&1 - $COIN_CLI stop > /dev/null 2>&1 && sleep 2 - sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 - sudo killall -s SIGKILL $COIN_DAEMON > /dev/null 2>&1 && sleep 2 - $BENCH_CLI stop > /dev/null 2>&1 && sleep 2 - sudo killall -s SIGKILL $BENCH_NAME > /dev/null 2>&1 && sleep 1 - sudo fuser -k 16127/tcp > /dev/null 2>&1 && sleep 1 - sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 - sudo rm -rf /usr/bin/flux* > /dev/null 2>&1 && sleep 1 - - echo -e "${ARROW} ${CYAN}Removing daemon && benchmark...${NC}" - sudo apt-get remove $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 - sudo apt-get purge $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 - sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 - sudo rm -rf /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 - tmux kill-server > /dev/null 2>&1 && sleep 1 - - echo -e "${ARROW} ${CYAN}Removing PM2...${NC}" - pm2 del zelflux > /dev/null 2>&1 && sleep 1 - pm2 del flux > /dev/null 2>&1 && sleep 1 - pm2 del watchdog > /dev/null 2>&1 && sleep 1 - pm2 save > /dev/null 2>&1 - pm2 unstartup > /dev/null 2>&1 && sleep 1 - pm2 flush > /dev/null 2>&1 && sleep 1 - pm2 save > /dev/null 2>&1 && sleep 1 - pm2 kill > /dev/null 2>&1 && sleep 1 - npm remove pm2 -g > /dev/null 2>&1 && sleep 1 - - echo -e "${ARROW} ${CYAN}Removing others files and scripts...${NC}" - sudo rm -rf watchgod > /dev/null 2>&1 && sleep 1 - sudo rm -rf $BENCH_DIR_LOG && sleep 1 - - #FILE OF OLD ZEL NODE - sudo rm -rf /etc/logrotate.d/mongolog > /dev/null 2>&1 - sudo rm -rf /etc/logrotate.d/zeldebuglog > /dev/null 2>&1 - rm update.sh > /dev/null 2>&1 - rm restart_zelflux.sh > /dev/null 2>&1 - rm zelnodeupdate.sh > /dev/null 2>&1 - rm start.sh > /dev/null 2>&1 - rm update-zelflux.sh > /dev/null 2>&1 - sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 - zelcash-cli stop > /dev/null 2>&1 && sleep 2 - sudo killall -s SIGKILL zelcashd > /dev/null 2>&1 - zelbench-cli stop > /dev/null 2>&1 - sudo killall -s SIGKILL zelbenchd > /dev/null 2>&1 - sudo rm /usr/local/bin/zel* > /dev/null 2>&1 && sleep 1 - sudo apt-get purge zelcash zelbench -y > /dev/null 2>&1 && sleep 1 - sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 - sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 - sudo rm -rf zelflux > /dev/null 2>&1 && sleep 1 - #sudo rm -rf ~/.zelcash/determ_zelnodes ~/.zelcash/sporks ~/$CONFIG_DIR/database ~/.zelcash/blocks ~/.zelcashchainstate > /dev/null 2>&1 && sleep 1 - #sudo rm -rf ~/.zelcash > /dev/null 2>&1 && sleep 1 - sudo rm -rf .zelbenchmark > /dev/null 2>&1 && sleep 1 - sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 - sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 - - if [[ -d /home/$USER/.zelcash ]]; then - - echo -e "${ARROW} ${CYAN}Moving ~/.zelcash to ~/.flux${NC}" - #echo -e "${ARROW} ${CYAN}Renaming zelcash.conf to flux.conf${NC}" - sudo mv /home/$USER/.zelcash /home/$USER/.flux > /dev/null 2>&1 && sleep 1 - sudo mv /home/$USER/.flux/zelcash.conf /home/$USER/.flux/flux.conf > /dev/null 2>&1 && sleep 1 - - fi - - - if [[ -d /home/$USER/$CONFIG_DIR ]]; then - - if [[ -z "$use_old_chain" ]]; then - - if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then - echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 - sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 - - else - BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 - fi - - else - - if [[ "$use_old_chain" == "1" ]]; then - - BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 - - else - - echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 - sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 - - - fi - - fi -fi - - sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 - sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 - sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 - echo -e "" - - echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 -if [[ $(sudo ufw status | grep "Status: active") ]]; then - # then - # if [[ -z "$firewall_disable" ]]; then - # if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?(Recommended)" 8 60; then - sudo ufw disable > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - # else - # echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" - # fi - # else - - # if [[ "$firewall_disable" == "1" ]]; then - ### sudo ufw disable > /dev/null 2>&1 - # echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - # else - #echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" - # fi - # fi - - else - echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - fi - -} - -function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - - done - done - echo -ne "${MSG2}" -} - - -function ssh_port() { - - if [[ -z "$ssh_port" ]]; then - - SSHPORT=$(grep -w Port /etc/ssh/sshd_config | sed -e 's/.*Port //') - if ! whiptail --yesno "Detected you are using $SSHPORT for SSH is this correct?" 8 56; then - SSHPORT=$(whiptail --inputbox "Please enter port you are using for SSH" 8 43 3>&1 1>&2 2>&3) - echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 - else - echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 - fi - - else - pettern='^[0-9]+$' - if [[ $ssh_port =~ $pettern ]] ; then - SSHPORT="$ssh_port" - echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 - else - echo -e "${ARROW} ${CYAN}SSH port must be integer................[${X_MARK}${CYAN}]${NC}}" - echo - exit - fi - fi -} - -function ip_confirm() { - echo -e "${ARROW} ${YELLOW}Detecting IP address...${NC}" - - WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') - fi - - - if [[ "$WANIP" == "" ]]; then - echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" - echo - exit - fi - - - string_limit_check_mark "Detected IP: $WANIP ................................." "Detected IP: ${GREEN}$WANIP${CYAN} ................................." - -} - -function create_swap() { - - if [[ -z "$swapon" ]]; then - #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - # fi - fi - - else - - if [[ "$swapon" == "1" ]]; then - - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi - #fi - - fi - - - fi - sleep 2 -} - -function install_packages() { - echo - echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" - - if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then - sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 - fi - - if ! dirmngr --v > /dev/null 2>&1; then - sudo apt install dirmngr -y > /dev/null 2>&1 - fi - - sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get upgrade -y > /dev/null 2>&1 - sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 - sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 - sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 - sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 - sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 - sudo apt-get remove sysbench -y > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" -} - -function create_conf() { - - echo -e "${ARROW} ${YELLOW}Creating Flux daemon config file...${NC}" - if [ -f ~/$CONFIG_DIR/$CONFIG_FILE ]; then - echo -e "${ARROW} ${CYAN}Existing conf file found backing up to $COIN_NAME.old ...${NC}" - mv ~/$CONFIG_DIR/$CONFIG_FILE ~/$CONFIG_DIR/$COIN_NAME.old; - fi - - RPCUSER=$(pwgen -1 8 -n) - PASSWORD=$(pwgen -1 20 -n) - - if [[ "$IMPORT_ZELCONF" == "0" ]] - then - zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Privkey generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) - zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) - zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) - fi - - - if [ "x$PASSWORD" = "x" ]; then - PASSWORD=${WANIP}-$(date +%s) - fi - mkdir ~/$CONFIG_DIR > /dev/null 2>&1 - touch ~/$CONFIG_DIR/$CONFIG_FILE - cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE -rpcuser=$RPCUSER -rpcpassword=$PASSWORD -rpcallowip=127.0.0.1 -rpcallowip=172.18.0.1 -rpcport=$RPCPORT -port=$PORT -zelnode=1 -zelnodeprivkey=$zelnodeprivkey -zelnodeoutpoint=$zelnodeoutpoint -zelnodeindex=$zelnodeindex -server=1 -daemon=1 -txindex=1 -addressindex=1 -timestampindex=1 -spentindex=1 -insightexplorer=1 -experimentalfeatures=1 -listen=1 -externalip=$WANIP -bind=0.0.0.0 -addnode=explorer.zelcash.online -addnode=explorer.runonflux.io -addnode=blockbook.runonflux.io -addnode=185.225.232.141:16125 -addnode=95.216.124.220:16125 -addnode=209.145.55.52:16125 -addnode=78.113.97.147:16125 -addnode=209.145.49.181:16125 -addnode=63.250.53.25:16125 -addnode=5.9.78.207:16125 -addnode=194.163.148.252:16125 -addnode=178.18.241.199:16125 -addnode=178.18.241.197:16125 -addnode=178.18.243.34:16125 -addnode=62.171.188.152:16125 -addnode=194.163.166.101:16125 -addnode=23.88.19.178:16125 -addnode=79.143.178.170:16125 -addnode=178.18.249.115:16125 -addnode=161.97.131.154:16125 -addnode=149.255.39.17:16125 -maxconnections=256 -EOF - sleep 2 -} - -function flux_package() { - sudo apt-get update -y > /dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" - sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 - sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 - integration_check -} - -function install_daemon() { - - sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 - sudo rm /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - - echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" - sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 - -if [[ "$(lsb_release -cs)" == "xenial" ]]; then - - echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - - flux_package && sleep 2 -else - - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - - # cleaning - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - - if [[ "$(lsb_release -cs)" == "impish" ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - fi - - - # downloading key && save it as keyring - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" - sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - - - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - - - if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - - flux_package && sleep 2 - - else - - echo - echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - - fi - -fi - - -} - - - -function zk_params() { - echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" - bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 - sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 -} - -function bootstrap() { - - BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" - - echo -e "" - echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" - if [[ -z "$bootstrap_url" ]]; then - - if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes - - fi - - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - - echo -e "${ARROW} ${YELLOW}Local bootstrap file detected...${NC}" - echo -e "${ARROW} ${YELLOW}Checking if zip file is corrupted...${NC}" - if unzip -t $BOOTSTRAP_ZIPFILE | grep 'No errors' > /dev/null 2>&1 - then - echo -e "${ARROW} ${CYAN}Bootstrap zip file is valid.............[${CHECK_MARK}${CYAN}]${NC}" - else - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $BOOTSTRAP_ZIPFILE - fi - - else - check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" - fi - - fi - - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - fi - - else - - - CHOICE=$( - whiptail --title "FLUXNODE INSTALLATION" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) - - - case $CHOICE in - "1)") - - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') - fi - - echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - #unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - - - ;; - "2)") - BOOTSTRAP_ZIP="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" - echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" - wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - fi - #echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - #unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - ;; - esac - - fi - - else - - if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes - fi - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - - echo -e "${ARROW} ${YELLOW}Local bootstrap file detected...${NC}" - echo -e "${ARROW} ${YELLOW}Checking if zip file is corrupted...${NC}" - if unzip -t $BOOTSTRAP_ZIPFILE | grep 'No errors' > /dev/null 2>&1 - then - echo -e "${ARROW} ${CYAN}Bootstrap zip file is valid.............[${CHECK_MARK}${CYAN}]${NC}" - else - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $BOOTSTRAP_ZIPFILE - fi - - else - check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" - fi - - fi - - - if [[ "$bootstrap_url" == "" ]]; then - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - fi - - else - - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') - fi - - echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - - fi - - else - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - else - BOOTSTRAP_ZIP="$bootstrap_url" - echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" - wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - fi - - fi - fi - fi - - if [[ -z "$bootstrap_zip_del" ]]; then - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - rm -rf $BOOTSTRAP_ZIPFILE - fi - else - - if [[ "$bootstrap_zip_del" == "1" ]]; then - rm -rf $BOOTSTRAP_ZIPFILE - fi - - fi - - - - -} - - -function create_service_scripts() { - -#echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 -sudo touch /home/$USER/start_daemon_service.sh -sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - cat <<'EOF' > /home/$USER/start_daemon_service.sh -#!/bin/bash - -#color codes -RED='\033[1;31m' -CYAN='\033[1;36m' -NC='\033[0m' -#emoji codes -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -sleep 2 -echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" -echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" -bench_status_pind=$(pgrep fluxbenchd) -daemon_status_pind=$(pgrep fluxd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi - -bench_status_pind=$(pgrep zelbenchd) -daemon_status_pind=$(pgrep zelcashd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi - -if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd" -exit -else -bash -c "zelcashd" -exit -fi -EOF - - -sudo touch /home/$USER/stop_daemon_service.sh -sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh - cat <<'EOF' > /home/$USER/stop_daemon_service.sh -#!/bin/bash -if [[ -f /usr/local/bin/flux-cli ]]; then -bash -c "flux-cli stop" -else -bash -c "zelcash-cli stop" -fi -exit -EOF - -sudo chmod +x /home/$USER/stop_daemon_service.sh -sudo chmod +x /home/$USER/start_daemon_service.sh - -} - -function create_service() { - echo -e "${ARROW} ${YELLOW}Creating Flux daemon service...${NC}" && sleep 1 - sudo touch /etc/systemd/system/zelcash.service - sudo chown $USER:$USER /etc/systemd/system/zelcash.service - cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service - sudo systemctl daemon-reload -} - -function basic_security() { - echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" - sudo ufw allow 16124/tcp > /dev/null 2>&1 - sudo ufw allow "$SSHPORT"/tcp > /dev/null 2>&1 - sudo ufw allow "$PORT"/tcp > /dev/null 2>&1 - sudo ufw logging on > /dev/null 2>&1 - sudo ufw default deny incoming > /dev/null 2>&1 - - sudo ufw allow out from any to any port 123 > /dev/null 2>&1 - sudo ufw allow out to any port 80 > /dev/null 2>&1 - sudo ufw allow out to any port 443 > /dev/null 2>&1 - sudo ufw allow out to any port 53 > /dev/null 2>&1 - sudo ufw allow out to any port 16124 > /dev/null 2>&1 - sudo ufw allow out to any port 16125 > /dev/null 2>&1 - sudo ufw allow out to any port 16127 > /dev/null 2>&1 - sudo ufw allow from any to any port 16127 > /dev/null 2>&1 - - sudo ufw default deny outgoing > /dev/null 2>&1 - sudo ufw limit OpenSSH > /dev/null 2>&1 - echo "y" | sudo ufw enable > /dev/null 2>&1 - sudo ufw reload > /dev/null 2>&1 - sudo systemctl enable fail2ban > /dev/null 2>&1 - sudo systemctl start fail2ban > /dev/null 2>&1 -} - -function pm2_install(){ - - echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" - npm install pm2@latest -g > /dev/null 2>&1 - - if pm2 -v > /dev/null 2>&1 - then - echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" - pm2 startup systemd -u $USER > /dev/null 2>&1 - sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 - - - #pm2 start ~/zelflux/start.sh --name zelflux > /dev/null 2>&1 - #pm2 save > /dev/null 2>&1 - - - pm2 install pm2-logrotate > /dev/null 2>&1 - pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 - pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 - pm2 set pm2-logrotate:compress true > /dev/null 2>&1 - pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 - pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 - - source ~/.bashrc - #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" - string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." - echo - else - string_limit_x_mark "PM2 was not installed................................." - echo - fi - -} - -function start_daemon() { - - sudo systemctl enable zelcash.service > /dev/null 2>&1 - sudo systemctl start zelcash > /dev/null 2>&1 - - NUM='250' - MSG1='Starting daemon & syncing with chain please be patient this will take about 3 min...' - MSG2='' - spinning_timer - - if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then - # if $COIN_DAEMON > /dev/null 2>&1; then - - NUM='2' - MSG1='Getting info...' - MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo && echo - - - daemon_version=$($COIN_CLI getinfo | jq -r '.version') - string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." - #echo -e "Zelcash version: ${GREEN}v$zelcash_version${CYAN} installed................................." - bench_version=$($BENCH_CLI getinfo | jq -r '.version') - string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." - #echo -e "${ARROW} ${CYAN}Zelbench version: ${GREEN}v$zelbench_version${CYAN} installed${NC}" - echo - pm2_install - #zelbench-cli stop > /dev/null 2>&1 && sleep 2 - else - echo - echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" - - if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then - error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') - if [[ "$error_line" != "" ]]; then - echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" - echo -e "${WORNING} ${CYAN}$error_line${NC}" - echo - exit - fi - fi - - - if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then - - echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" - echo -n "" - - else - - echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" - echo -n "" - exit - - fi - - - fi -} - -function log_rotate() { - echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" - sleep 1 - if [ -f /etc/logrotate.d/$2 ]; then - sudo rm -rf /etc/logrotate.d/$2 - sleep 2 - fi - - sudo touch /etc/logrotate.d/$2 - sudo chown $USER:$USER /etc/logrotate.d/$2 - cat << EOF > /etc/logrotate.d/$2 -$3 { - compress - copytruncate - missingok - $4 - rotate $5 -} -EOF - sudo chown root:root /etc/logrotate.d/$2 -} - -function install_process() { - - echo -e "${ARROW} ${YELLOW}Configuring firewall...${NC}" - sudo ufw allow $ZELFRONTPORT/tcp > /dev/null 2>&1 - sudo ufw allow $LOCPORT/tcp > /dev/null 2>&1 - sudo ufw allow $ZELNODEPORT/tcp > /dev/null 2>&1 - #sudo ufw allow $MDBPORT/tcp > /dev/null 2>&1 - - echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" - - sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 - sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - - curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - - if [[ $(lsb_release -d) = *Debian* ]]; then - - - if [[ $(lsb_release -cs) = *stretch* || $(lsb_release -cs) = *buster* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - fi - - - elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - - - if [[ $(lsb_release -cs) = *focal* || $(lsb_release -cs) = *bionic* || $(lsb_release -cs) = *xenial* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - fi - - else - - echo -e "${WORNING} ${RED}OS type not supported..${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - - fi - - - if ! sysbench --version > /dev/null 2>&1; then - - echo - echo -e "${ARROW} ${YELLOW}Sysbench installing...${NC}" - curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh 2> /dev/null | sudo bash > /dev/null 2>&1 - sudo apt -y install sysbench > /dev/null 2>&1 - - if sysbench --version > /dev/null 2>&1; then - - string_limit_check_mark "Sysbench $(sysbench --version | awk '{print $2}') installed................................." "Sysbench ${GREEN}$(sysbench --version | awk '{print $2}')${CYAN} installed................................." - - fi - - fi - - install_mongod - install_nodejs - install_flux - sleep 2 -} - -function install_mongod() { -echo -echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" -sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 -sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 -sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 -sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 -echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" -sudo apt-get update -y > /dev/null 2>&1 -sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 -sudo systemctl enable mongod > /dev/null 2>&1 -sudo systemctl start mongod > /dev/null 2>&1 -if mongod --version > /dev/null 2>&1 -then - #echo -e "${ARROW} ${CYAN}MongoDB version: ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed${NC}" - string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." - echo -else - #echo -e "${ARROW} ${CYAN}MongoDB was not installed${NC}" - string_limit_x_mark "MongoDB was not installed................................." - echo -fi -} - -function install_nodejs() { -echo -e "${ARROW} ${YELLOW}Removing any instances of Nodejs...${NC}" -n-uninstall -y > /dev/null 2>&1 && sleep 1 -rm -rf ~/n -sudo apt-get remove nodejs npm nvm -y > /dev/null 2>&1 && sleep 1 -sudo apt-get purge nodejs nvm -y > /dev/null 2>&1 && sleep 1 -sudo rm -rf /usr/local/bin/npm -sudo rm -rf /usr/local/share/man/man1/node* -sudo rm -rf /usr/local/lib/dtrace/node.d -sudo rm -rf ~/.npm -sudo rm -rf ~/.nvm -sudo rm -rf ~/.pm2 -sudo rm -rf ~/.node-gyp -sudo rm -rf /opt/local/bin/node -sudo rm -rf opt/local/include/node -sudo rm -rf /opt/local/lib/node_modules -sudo rm -rf /usr/local/lib/node* -sudo rm -rf /usr/local/include/node* -sudo rm -rf /usr/local/bin/node* -echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" -#export NVM_DIR="$HOME/.nvm" && ( - # git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" > /dev/null 2>&1 - # cd "$NVM_DIR" - # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 -#) && \. "$NVM_DIR/nvm.sh" -#cd -#curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 -curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 -. ~/.profile -. ~/.bashrc -sleep 1 -#nvm install v12.16.1 -nvm install v14.18.1 > /dev/null 2>&1 -if node -v > /dev/null 2>&1 -then -#echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" -string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." -echo -else -#echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" -string_limit_x_mark "Nodejs was not installed................................." -echo -fi - -} - -function install_flux() { - - docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) - resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) - mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) - -if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then - -echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 -echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 -echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 - -fi - -if [[ $docker_check != 0 ]]; then -echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 -echo -e "${ARROW} ${CYAN}Removing containers...${NC}" - -sudo service docker restart > /dev/null 2>&1 && sleep 5 - -docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | -while read line; do -sudo docker stop $line > /dev/null 2>&1 && sleep 2 -sudo docker rm $line > /dev/null 2>&1 && sleep 2 -done -fi - -if [[ $resource_check != 0 ]]; then -echo -e "${ARROW} ${YELLOW}Detected locked resource${NC}" && sleep 1 -echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" && sleep 1 -df | egrep 'flux' | awk '{ print $1}' | -while read line; do -sudo umount -l $line && sleep 1 -done -fi - - if [ -d "./$FLUX_DIR" ]; then - echo -e "${ARROW} ${YELLOW}Removing any instances of Flux${NC}" - sudo rm -rf $FLUX_DIR - fi - - - echo -e "${ARROW} ${YELLOW}Flux installing...${NC}" - # git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 - git clone --single-branch --branch development https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" - - -if [[ "$IMPORT_ZELID" == "0" ]]; then - - while true - do - ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) - if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then - echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" - sleep 4 - fi - done - - # if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then - - tier - if [[ "$kadena_possible" == "1" ]]; then - - while true - do - - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* ]]; then - - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - - while true - do - KDA_C=$(whiptail --inputbox "Please enter your kadena chainid (0-19)" 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_C" -ge "0" && "$KDA_C" -le "19" ]]; then - echo -e "${ARROW} ${CYAN}Kadena chainid is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=$KDA_C" - break - else - echo -e "${ARROW} ${CYAN}Kadena chainid is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - - fi - - fi - - -if [[ "$KDA_A" != "" ]]; then - touch ~/$FLUX_DIR/config/userconfig.js - cat << EOF > ~/$FLUX_DIR/config/userconfig.js -module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - kadena: '${KDA_A}', - testnet: false - } - } -EOF -else - touch ~/$FLUX_DIR/config/userconfig.js - cat << EOF > ~/$FLUX_DIR/config/userconfig.js -module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - testnet: false - } - } -EOF -fi - -if [ -d ~/$FLUX_DIR ] -then -current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - -string_limit_check_mark "Flux v$current_ver installed................................." "Flux ${GREEN}v$current_ver${CYAN} installed................................." -#echo -e "${ARROW} ${CYAN}Zelflux version: ${GREEN}v$current_ver${CYAN} installed${NC}" - -echo -else -string_limit_x_mark "Flux was not installed................................." -#echo -e "${ARROW} ${CYAN}Zelflux was not installed${NC}" -echo -fi - -} - - -function status_loop() { - -network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') -network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') - -EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") - - -if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks') ]]; then -echo -echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" - - -LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') -CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') -LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - -NUM='2' -MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN}" -MSG2="${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo && echo - -else - - echo - echo -e "${CLOCK}${GREEN}FLUX DAEMON SYNCING...${NC}" - - f=0 - start_sync=`date +%s` - - - while true - do - - network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) - - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") - - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') - LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - - if [[ "$LEFT" == "0" ]]; then - time_break='5' - else - time_break='20' - fi - - #if [[ "$CONNECTIONS" == "0" ]]; then - # c=$((c+1)) - # if [[ "$c" > 3 ]]; then - # c=0; - #LOCAL_BLOCK_HIGHT="" - # fi - - #fi - # - if [[ $LOCAL_BLOCK_HIGHT == "" ]]; then - - f=$((f+1)) - LOCAL_BLOCK_HIGHT="N/A" - LEFT="N/A" - CONNECTIONS="N/A" - sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 - sudo systemctl start zelcash > /dev/null 2>&1 - - NUM='60' - MSG1="Syncing progress => Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" - MSG2='' - spinning_timer - - network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks' 2> /dev/null) - - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") - - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') - LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - - fi - - NUM="$time_break" - MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" - MSG2='' - spinning_timer - - if [[ "$EXPLORER_BLOCK_HIGHT" == "$LOCAL_BLOCK_HIGHT" ]]; then - echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" - break - fi - done - - fi - - - #pm2 start ~/$FLUX_DIR/start.sh --name flux --time > /dev/null 2>&1 - - - # if [[ -z "$mongo_bootstrap" ]]; then - - # if whiptail --yesno "Would you like to restore Mongodb datatable from bootstrap?" 8 60; then - # mongodb_bootstrap - # else - # echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" - # fi - # - # else - - # if [[ "$mongo_bootstrap" == "1" ]]; then - # mongodb_bootstrap - # else - # echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" - # fi - - # fi - - - #if [[ -z "$watchdog" ]]; then - #if whiptail --yesno "Would you like to install watchdog for FluxNode?" 8 60; then - install_watchdog - # else - # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" - # fi - # else - - # if [[ "$watchdog" == "1" ]]; then - # install_watchdog - # else - # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" - # fi - - # fi - - check - display_banner -} - -function check() { - -cd -pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 -#sleep 120 -#cd /home/$USER/zelflux -#pm2 stop flux -#npm install --legacy-peer-deps > /dev/null 2>&1 -#pm2 start flux -#cd - -NUM='400' -MSG1='Finalizing Flux installation please be patient this will take about ~5min...' -MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" -echo && spinning_timer -echo - -$BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 - -NUM='250' -MSG1='Restarting benchmark...' -MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo && echo - -echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" -echo -e "${YELLOW}======================${NC}" -bench_benchmarks=$($BENCH_CLI getbenchmarks) - -if [[ "bench_benchmarks" != "" ]]; then -bench_status=$(jq -r '.status' <<< "$bench_benchmarks") -if [[ "$bench_status" == "failed" ]]; then -echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" -check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" -check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" -else -echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" -bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") -echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" -bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") -bench_ram=$(round "$bench_ram" 2) -echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" -bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") -bench_ssd=$(round "$bench_ssd" 2) -echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" -bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") -bench_hdd=$(round "$bench_hdd" 2) -echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" -bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") -bench_ddwrite=$(round "$bench_ddwrite" 2) -echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" -bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") -bench_eps=$(round "$bench_eps" 2) -echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" -fi - -else -echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" -fi -} - -function display_banner() { - echo -e "${BLUE}" - figlet -t -k "FLUXNODE" - figlet -t -k "INSTALLATION COMPLETED" - echo -e "${YELLOW}================================================================================================================================" - #echo -e "FLUXNODE INSTALATION COMPLITED${NC}" - #echo -e "${CYAN}COURTESY OF DK808/XK4MiLX${NC}" - echo - if pm2 -v > /dev/null 2>&1; then - pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) - if [[ "$pm2_flux_status" == "online" ]]; then - pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" - else - if [[ "$pm2_flux_status" != "" ]]; then - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" - fi - fi - echo - fi - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" - echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" - echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" - echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" - echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} getinfo${NC}" - echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} getbenchmarks${NC}" - echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} restartnodebenchmarks${NC}" - echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} stop${NC}" - echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" - echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" - echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" - echo - if [[ "$WATCHDOG_INSTALL" == "1" ]]; then - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" - echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" - echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo - echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" - echo - fi - echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" - echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" - sleep 1 - cd $HOME - exec bash -} - - -function start_install() { - -start_install=`date +%s` - -sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo -echo -e "${CYAN}February 2021, created by dk808 improved by XK4MiLX from Flux's team." -echo -e "Special thanks to Goose-Tech, Skyslayer, & Packetflow." -echo -e "FluxNode setup starting, press [CTRL+C] to cancel.${NC}" -sleep 2 - -if jq --version > /dev/null 2>&1; then -echo -e "" -else -echo -e "" -echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" -sudo apt install jq -y > /dev/null 2>&1 - - if jq --version > /dev/null 2>&1 - then - #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" - string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" - string_limit_x_mark "JQ was not installed................................." - echo - exit - fi -fi - -if [ "$USER" = "root" ]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}root${CYAN}, please switch to the username you just created.${NC}" - sleep 4 - exit -fi - -start_dir=$(pwd) -correct_dir="/home/$USER" -echo -e "${ARROW} ${YELLOW}Checking directory....${NC}" -if [[ "$start_dir" == "$correct_dir" ]] -then -echo -e "${ARROW} ${CYAN}Correct directory ${GREEN}$(pwd)${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" -else -echo -e "${ARROW} ${CYAN}Bad directory switching...${NC}" -cd -echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" -fi -sleep 1 - -config_file - -if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then -import_date -else - -if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then -echo -IMPORT_ZELCONF="1" -IMPORT_ZELID="1" -echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" -zelnodeprivkey="$prvkey" -echo -e "${PIN}${CYAN}Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 -zelnodeoutpoint="$outpoint" -echo -e "${PIN}${CYAN}Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 -zelnodeindex="$index" -echo -e "${PIN}${CYAN}Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 -echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 -echo -fi - -fi - -} - -#end of functions - start_install - wipe_clean - ssh_port - ip_confirm - create_swap - install_packages - create_conf - install_daemon - zk_params - if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then - bootstrap - fi - create_service_scripts - create_service - - # if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then - # echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" - # else - # if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then - selfhosting - ## else - #echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" - ### fi - ## fi - - install_process - start_daemon - log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" - log_rotate "Flux daemon" "daemon_debug_log" "/home/$USER/$CONFIG_DIR/debug.log" "daily" "7" - log_rotate "MongoDB" "mongod_debug_log" "/var/log/mongodb/*.log" "daily" "14" - log_rotate "Docker" "docker_debug_log" "/var/lib/docker/containers/*/*.log" "daily" "7" - basic_security - status_loop From 8fe411c714e57b9d7711d788c3c761e67e6772d1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 22 Mar 2022 20:33:48 +0100 Subject: [PATCH 0369/1176] update benchmark binary --- multitoolbox_testnet.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 38235571..83f2fa42 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1884,7 +1884,7 @@ fi } - function update_binary(){ + function 2(){ echo -e "${GREEN}Module: Update flux daemon and benchmark binary${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1910,8 +1910,8 @@ if [[ $(dpkg --print-architecture) = *amd* ]]; then sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.0.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-Linux-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.1.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.1.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 sudo rm -rf /tmp/flux* 2>&1 && sleep 2 @@ -2099,10 +2099,10 @@ echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" echo -e "${GREEN}Special thanks to dk808, CryptoWrench && jriggs28${NC}" echo -e "${YELLOW}================================================================${NC}" -echo -e "${CYAN}1 - Install Docker${NC}" -echo -e "${CYAN}2 - Install FluxNode${NC}" -echo -e "${CYAN}3 - Update flux daemon and benchmark binary${NC}" -echo -e "${CYAN}4 - Install/Re-install FluxOS${NC}" +echo -e "${CYAN}1 - Install Docker${NC}" +echo -e "${CYAN}2 - Install FluxNode${NC}" +echo -e "${CYAN}3 - Update flux daemon and benchmark binary${NC}" +echo -e "${CYAN}4 - Install/Re-install FluxOS${NC}" echo -e "${CYAN}5 - Multinode configuration with UPNP comunnication (Needs Router with UPNP support) ${NC}" echo -e "${YELLOW}================================================================${NC}" From e2c4d72f45fdea54615da866827fa27ac16a9ce7 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Tue, 22 Mar 2022 19:39:37 +0000 Subject: [PATCH 0370/1176] Fix Update Bins --- multitoolbox_testnet.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 83f2fa42..81246bf4 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1884,7 +1884,7 @@ fi } - function 2(){ + function update_binary(){ echo -e "${GREEN}Module: Update flux daemon and benchmark binary${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1925,8 +1925,8 @@ else sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.0.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-arm-v3.0.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.1.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.1.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 sudo rm -rf /tmp/flux* 2>&1 && sleep 2 From 55847ecc44bca033dcf5e44afcd0d0a8f51a8e5a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 23 Mar 2022 14:00:44 +0100 Subject: [PATCH 0371/1176] added kadena chain 0 as defoult --- install_pro.sh | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 32f272c3..566576b8 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1431,35 +1431,24 @@ EOF tier if [[ "$kadena_possible" == "1" ]]; then - while true + while true do KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - - while true - do - KDA_C=$(whiptail --inputbox "Please enter your kadena chainid (0-19)" 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_C" -ge "0" && "$KDA_C" -le "19" ]]; then - echo -e "${ARROW} ${CYAN}Kadena chainid is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=$KDA_C" - break - else - echo -e "${ARROW} ${CYAN}Kadena chainid is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - - break + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=0" + sleep 2 + break + else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 fi done - fi + fi fi From a639f1e0ab226c9c80c955bf4e4e7aa54f8a20a6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 23 Mar 2022 14:51:40 +0100 Subject: [PATCH 0372/1176] rebuild menu and function - added new menu - added option for disable upnp --- multinode.sh | 79 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/multinode.sh b/multinode.sh index 102d47df..20d1c602 100644 --- a/multinode.sh +++ b/multinode.sh @@ -24,19 +24,6 @@ export NEWT_COLORS=' title=black, ' -function get_ip(){ - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi -} - - function string_limit_check_mark() { if [[ -z "$2" ]]; then string="$1" @@ -73,9 +60,12 @@ echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" sudo sed -i -e "/$line/a"$'\\\n'"$newText"$'\n' "$file" } + + +function upnp_enable() { + try="0" echo -e "" -get_ip while true do @@ -86,22 +76,9 @@ get_ip string_limit_check_mark "Port is valid..........................................." break - #echo -e "${ARROW}${YELLOW} Checking port availability.....${NC}" - #port_check=$(curl -s -m 5 http://$WANIP:$FLUX_PORT/id/loginphrase 2>/dev/null | jq -r .status 2>/dev/null ) - #if [[ "$port_check" == "" && $(cat /home/$USER/zelflux/config/userconfig.js | grep "$FLUX_PORT") == "" ]]; then - #string_limit_check_mark "Port $FLUX_PORT is OK..........................................." - #break - #else - #string_limit_x_mark "Port $FLUX_PORT is already in use..............................." - #sleep 1 - #try=$(($try+1)) - #if [[ "$try" -gt "3" ]]; then - #echo -e "${WORNING} ${CYAN}You have reached the maximum number of try...${NC}" - #echo -e "" - #exit - #fi - #fi + else + string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." sleep 1 try=$(($try+1)) @@ -110,6 +87,7 @@ get_ip echo -e "" exit fi + fi done @@ -221,3 +199,46 @@ fi echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." echo -e "" fi + +} + +function upnp_disable() { + + echo -e "" + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + echo -e "${ARROW} ${CYAN}Removing FluxOS UPnP configuration.....${NC}" + sudo rm -rf /home/$USER/.fluxbenchmark/fluxbench.conf + else + echo -e "${ARROW} ${YELLOW}UPnP Mode is already disabled...${NC}" + echo -e "" + exit + fi + + if [[ $(cat /home/$USER/zelflux/config/userconfig.js) | grep 'apiport' | wc -l) == "1" ]]; then + cat /home/$USER/zelflux/config/userconfig.js | sed '/apiport/d' | sudo tee "/home/$USER/zelflux/config/userconfig.js" > /dev/null + fi + + echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" + echo -e "" + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + sleep 200 + +} + + + CHOICE=$( +whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ +"1)" "Enable UPnP Mode" \ +"2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 +) + + +case $CHOICE in + "1)") + upnp_enable + ;; + "2)") + upnp_disable + ;; +esac From 1c6dd2f0849c3cb8863978515ed9b2306842affe Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 23 Mar 2022 14:58:02 +0100 Subject: [PATCH 0373/1176] fix conditional --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index 20d1c602..6750adf3 100644 --- a/multinode.sh +++ b/multinode.sh @@ -214,7 +214,7 @@ function upnp_disable() { exit fi - if [[ $(cat /home/$USER/zelflux/config/userconfig.js) | grep 'apiport' | wc -l) == "1" ]]; then + if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep 'apiport' | wc -l) == "1" ]]; then cat /home/$USER/zelflux/config/userconfig.js | sed '/apiport/d' | sudo tee "/home/$USER/zelflux/config/userconfig.js" > /dev/null fi From 2b5b3e9bff381f9b5213a58458695158f3b1714b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 23 Mar 2022 20:07:56 +0100 Subject: [PATCH 0374/1176] added config check --- multinode.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index 6750adf3..0034cccf 100644 --- a/multinode.sh +++ b/multinode.sh @@ -67,6 +67,12 @@ function upnp_enable() { try="0" echo -e "" + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" + echo -e "" + exit + fi + while true do @@ -236,7 +242,7 @@ whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ case $CHOICE in "1)") - upnp_enable + upnp_enable ;; "2)") upnp_disable From b5fe9c0e9df54ed70092673cd343019e484e1d50 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 23 Mar 2022 20:13:24 +0100 Subject: [PATCH 0375/1176] added config check --- multinode.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multinode.sh b/multinode.sh index 0034cccf..6806345e 100644 --- a/multinode.sh +++ b/multinode.sh @@ -211,6 +211,12 @@ fi function upnp_disable() { echo -e "" + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" + echo -e "" + exit + fi + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${CYAN}Removing FluxOS UPnP configuration.....${NC}" sudo rm -rf /home/$USER/.fluxbenchmark/fluxbench.conf From b5846479e318b08d0d72fd28a35a33a3e973633e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 23 Mar 2022 20:22:54 +0100 Subject: [PATCH 0376/1176] removed echo --- multinode.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/multinode.sh b/multinode.sh index 6806345e..8562d2fe 100644 --- a/multinode.sh +++ b/multinode.sh @@ -65,7 +65,6 @@ echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" function upnp_enable() { try="0" -echo -e "" if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" @@ -210,7 +209,6 @@ fi function upnp_disable() { - echo -e "" if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" echo -e "" From 8ae34ed951d9b2275c3a5bb89bf08c670606e69e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 24 Mar 2022 08:15:12 +0100 Subject: [PATCH 0377/1176] added install cron --- multitoolbox.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8d3b7819..eac3c9f8 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1697,6 +1697,13 @@ then echo -e "${ARROW} ${YELLOW}Installing ufw firewall..${NC}" sudo apt-get install -y ufw > /dev/null 2>&1 fi + +cron_check=$(systemctl status cron 2> /dev/null | grep 'active' | wc -l) +if [[ "$cron_check" == "0" ]]; then +echo -e "${ARROW} ${YELLOW}Installing crontab...${NC}" +sudo apt-get install -y cron > /dev/null 2>&1 +fi + echo -e "${ARROW} ${YELLOW}Installing docker...${NC}" echo -e "${ARROW} ${CYAN}Architecture: ${GREEN}$(dpkg --print-architecture)${NC}" From 26e59770ee73c6a3b9c2805c057a057f0096fbc5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 24 Mar 2022 08:27:04 +0100 Subject: [PATCH 0378/1176] Minor edit --- install_pro.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 566576b8..e418d111 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -242,7 +242,8 @@ else continent="ALL" fi -echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" +echo -e "" +echo -e "${ARROW} ${YELLOW}Selecting bootstrap server....${NC}" echo -e "${ARROW} ${CYAN}Node Location: $country, Continent: $continent ${NC}" echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" } From d8046266768ada13d0d386155429ae6bde594242 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 24 Mar 2022 19:29:47 +0100 Subject: [PATCH 0379/1176] added check for pm2 logs --- nodeanalizerandfixer.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 793f09b6..371ad0f2 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -234,6 +234,7 @@ fi echo -e "${PIN} ${CYAN}FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" echo -e "${PIN} ${CYAN}FluxUI PORT: ${ORANGE}$FluxUI ${NC}" +if [[ -f /home/$USER/.pm2/logs/flux-out.log ]]; then error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") if [[ "$error_check" != "" ]]; then echo -e "" @@ -241,7 +242,7 @@ error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." echo -e "" fi - +fi } From 20f866d14efe1a91f35e58d83b421f5b765bdc07 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 25 Mar 2022 14:46:13 +0100 Subject: [PATCH 0380/1176] console color correction --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index 8562d2fe..938573b5 100644 --- a/multinode.sh +++ b/multinode.sh @@ -201,7 +201,7 @@ fi echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${LOCAL_IP}:$(($FLUX_PORT-1))${NC}" echo -e "" else - echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." + echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" echo -e "" fi From 1ff4c5854715800c6a0edd2b87f7c1e69900fa0d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 25 Mar 2022 19:47:20 +0100 Subject: [PATCH 0381/1176] disable error output --- install_pro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index e418d111..e07e4776 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2295,8 +2295,8 @@ fi function status_loop() { -network_height_01=$(curl -sk -m 10 https://explorer.runonflux.io/api/status?q=getInfo 2> /dev/null | jq '.info.blocks') -network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks') +network_height_01=$(curl -sk -m 10 https://explorer.runonflux.io/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) +network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") From 3c4046ff16310a0209b34508992f1fe69acf79c9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 26 Mar 2022 12:50:29 +0100 Subject: [PATCH 0382/1176] Add files via upload --- image/update_menu.png | Bin 0 -> 22093 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 image/update_menu.png diff --git a/image/update_menu.png b/image/update_menu.png new file mode 100644 index 0000000000000000000000000000000000000000..abb5ef868637b69c4b50d3f70f161c344ba71b20 GIT binary patch literal 22093 zcmc$_XIN8P*ESkN6p0jTM4AW)2n5A~bO8k^(wmTgC>?=F3oXQr1XOw#X(G~l4}_u= z5s=wF?XGv8;p3#M3@6^a{6^(_TK^^Rm1y{_ z*ZH|OpMLhBF!Elh218ytGNwE2#d+Vrbf4d8_=1&%{}jfOTr+UrAL^g)d>Au1IAh_D z<_q=+)F1x&^V8k2*atD_9m&HD$-~pY9GUfW}M zb*p9Q$ed<`+k_TL^kH-JZqIrv+w?KVpytD>m1`SG&4r9=Gsp~UKoPdrc<)M`Sj*D`$B14bV}xLEig-L{qF zc06dHFB5fY*pC9mvK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^T1(s-FOun=FQcLRbKe#%z&{M)xSGv+=-MW$l8mxS;n7OrIn3i zZB4|aI}}gs5_zNxWWdrq{A9@NXWzu+o?~}e5tVH8hQ@R0 zhKvNi0=y`aGqK#t4*K5Htk35bD`~bsMlyPmg>RJFs2k3ZxkbJiG$O-0ws7ZvUZwFi-QO zj(X@3TQR1Dxs-6D%&eX;eU`3~P-KwbjXC_M!%jJiFd9#_B`L#$|6Rk0X;938O6}Xi zhB74;)^~Zs-nKTiKqS=XM2>QF?jDeF$mrf6f@u@T1g&BbpcU_Zm5*^iC?( zaBmP5hL#4nYqz5R4PBwiKmY&$ literal 0 HcmV?d00001 From f2f413eaf2e2a2ed6e48f33d1200308cd464d4eb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 26 Mar 2022 12:51:01 +0100 Subject: [PATCH 0383/1176] update menu --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bfb111a2..d9ccf6b9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ```bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` 2) MENU: -![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/v6.png) +![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/update_menu.png) 3) HOW USE MULTITOOLBOX TO SETUP FLUXNODE: https://medium.com/zelinsights/zelnode-setup-the-easy-peasy-lemon-squeezy-way-fd89706ea03c
From b238945c1e364e66d89fd2973c3cab0276c86689 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 26 Mar 2022 20:45:57 +0100 Subject: [PATCH 0384/1176] added watchdog import settings --- install_pro.sh | 159 +++++++++++++++++++++++++++++++------------------ 1 file changed, 100 insertions(+), 59 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index e07e4776..8156cd6f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -440,12 +440,12 @@ function config_file() { if [[ -f /home/$USER/install_conf.json ]]; then import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') -firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') +#firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') -swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') +#swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') #mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') -watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') +#watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') @@ -453,6 +453,8 @@ index=$(cat /home/$USER/install_conf.json | jq -r '.index') ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') +discord_hook_url=$(cat /home/$USER/watchdog/config.js | jq -r '.outpoint') + echo echo -e "${ARROW} ${YELLOW}Install config:" @@ -470,11 +472,11 @@ if [[ "$ssh_port" != "" ]]; then echo -e "${PIN}${CYAN} SSH port set.....................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi -if [[ "$firewall_disable" == "1" ]]; then -echo -e "${PIN}${CYAN} Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN} Firewall enabled diuring installation............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi +#if [[ "$firewall_disable" == "1" ]]; then +#echo -e "${PIN}${CYAN} Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +#else +#echo -e "${PIN}${CYAN} Firewall enabled diuring installation............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +#fi if [[ "$use_old_chain" == "1" ]]; then echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -495,17 +497,17 @@ fi fi -if [[ "$swapon" == "1" ]]; then -echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi +#if [[ "$swapon" == "1" ]]; then +#echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +#fi #if [[ "$mongo_bootstrap" == "1" ]]; then #echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 #fi -if [[ "$watchdog" == "1" ]]; then -echo -e "${PIN}${CYAN} Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi +#if [[ "$watchdog" == "1" ]]; then +#echo -e "${PIN}${CYAN} Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +#fi @@ -561,17 +563,43 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - + ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') if [[ "$ZELID" != "" ]]; then echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 IMPORT_ZELID="1" fi - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi + fi + + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + + fix_action=$(cat /home/$USER/watchdog/config.js | jq -r '.fix_action') + echo -e "${PIN}${CYAN} Fix action = ${GREEN}$fix_action${NC}" && sleep 1 + + node_label=$(cat /home/$USER/watchdog/config.js | jq -r '.node_label') + echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" && sleep 1 + + tier_eps_min=$(cat /home/$USER/watchdog/config.js | jq -r '.tier_eps_min') + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$tier_eps_min${NC}" && sleep 1 + + web_hook_url=$(cat /home/$USER/watchdog/config.js | jq -r '.web_hook_url') + echo -e "${PIN}${CYAN} Discord hook URL = ${GREEN}$web_hook_url${NC}" && sleep 1 + + ping=$(cat /home/$USER/watchdog/config.js | jq -r '.ping') + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}$ping${NC}" && sleep 1 + + telegram_alert=$(cat /home/$USER/watchdog/config.js | jq -r '.telegram_alert') + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}$telegram_alert${NC}" && sleep 1 + + telegram_bot_token=$(cat /home/$USER/watchdog/config.js | jq -r '.telegram_bot_token') + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + + telegram_chat_id=$(cat /home/$USER/watchdog/config.js | jq -r '.telegram_chat_id') + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 fi fi @@ -580,13 +608,13 @@ else if [[ "$import_settings" == "1" ]]; then - OLD_CONFIG=0 + OLD_CONFIG=0 - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - OLD_CONFIG=1 - fi + if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + OLD_CONFIG=1 + fi IMPORT_ZELCONF="1" echo @@ -606,18 +634,24 @@ else if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - + ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') if [[ "$ZELID" != "" ]]; then echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 IMPORT_ZELID="1" fi - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 fi - fi + + + + + fi + + + fi fi @@ -665,47 +699,52 @@ echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" cd watchdog && npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating config file....${NC}" -#if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then flux_update='1' -#sleep 1 -#else -#lux_update='0' -#sleep 1 -#fi - -#if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then daemon_update='1' -#sleep 1 -#else -#daemon_update='0' -#sleep 1 -#fi - -#if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then bench_update='1' -#sleep 1 -#else -#bench_update='0' -#sleep 1 -#fi - -#if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then fix_action='1' -#sleep 1 -#else -#fix_action='0' -#sleep 1 -#fi -telegram_alert=0; -discord=0; +if [[ "IMPORT_ZELCONF" == "1" ]]; then +sudo touch /home/$USER/watchdog/config.js +sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js +module.exports = { + label: '${node_label}', + tier_eps_min: '${eps_limit}', + zelflux_update: '${flux_update}', + zelcash_update: '${daemon_update}', + zelbench_update: '${bench_update}', + action: '${fix_action}', + ping: '${ping}', + web_hook_url: '${discord}', + telegram_alert: '${telegram_alert}', + telegram_bot_token: '${telegram_bot_token}', + telegram_chat_id: '${telegram_chat_id}' +} +EOF + + + + if [[ -f /home/$USER/watchdog/watchdog.js ]]; then + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." + echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + else + string_limit_x_mark "Watchdog was not installed................................." + fi + + return 1 + +fi + +discord='0' if whiptail --yesno "Would you like enable alert notification?" 8 60; then sleep 1 - whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 - sleep 1 CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ @@ -825,6 +864,7 @@ if [[ "$telegram_alert" == 0 ]]; then fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') @@ -832,6 +872,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then if [[ "$stak_info" == "" ]]; then stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') fi + fi if [[ $stak_info == ?(-)+([0-9]) ]]; then From 218726f3f7a07c8bf1982fc40a69914092cb2ca1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 26 Mar 2022 21:20:37 +0100 Subject: [PATCH 0385/1176] fix for import --- install_pro.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 8156cd6f..5b24a9ac 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -577,28 +577,28 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash echo -e "" echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - fix_action=$(cat /home/$USER/watchdog/config.js | jq -r '.fix_action') + fix_action=$(grep -w action /home/$USER/watchdog/config.js | sed -e 's/.*action: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Fix action = ${GREEN}$fix_action${NC}" && sleep 1 - node_label=$(cat /home/$USER/watchdog/config.js | jq -r '.node_label') + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" && sleep 1 - tier_eps_min=$(cat /home/$USER/watchdog/config.js | jq -r '.tier_eps_min') + tier_eps_min=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$tier_eps_min${NC}" && sleep 1 - web_hook_url=$(cat /home/$USER/watchdog/config.js | jq -r '.web_hook_url') + web_hook_url=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Discord hook URL = ${GREEN}$web_hook_url${NC}" && sleep 1 - ping=$(cat /home/$USER/watchdog/config.js | jq -r '.ping') + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Discord ping = ${GREEN}$ping${NC}" && sleep 1 - telegram_alert=$(cat /home/$USER/watchdog/config.js | jq -r '.telegram_alert') + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}$telegram_alert${NC}" && sleep 1 - telegram_bot_token=$(cat /home/$USER/watchdog/config.js | jq -r '.telegram_bot_token') + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 - telegram_chat_id=$(cat /home/$USER/watchdog/config.js | jq -r '.telegram_chat_id') + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 fi From 308ac96433d2b0c9a162ff2ddd7aaf76c9455aa0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 26 Mar 2022 21:34:52 +0100 Subject: [PATCH 0386/1176] fix for import --- install_pro.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 5b24a9ac..93be7bf6 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -576,7 +576,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash echo -e "" echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - + fix_action=$(grep -w action /home/$USER/watchdog/config.js | sed -e 's/.*action: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Fix action = ${GREEN}$fix_action${NC}" && sleep 1 @@ -586,8 +586,8 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash tier_eps_min=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$tier_eps_min${NC}" && sleep 1 - web_hook_url=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Discord hook URL = ${GREEN}$web_hook_url${NC}" && sleep 1 + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Discord hook URL = ${GREEN}$discord${NC}" && sleep 1 ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Discord ping = ${GREEN}$ping${NC}" && sleep 1 @@ -704,7 +704,7 @@ daemon_update='1' bench_update='1' fix_action='1' -if [[ "IMPORT_ZELCONF" == "1" ]]; then +if [[ "$IMPORT_ZELCONF" == "1" ]]; then sudo touch /home/$USER/watchdog/config.js sudo chown $USER:$USER /home/$USER/watchdog/config.js From cc77241f7a3416b73b2d9a7e11589e96e05348cb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 26 Mar 2022 22:36:07 +0100 Subject: [PATCH 0387/1176] telegram chat id fix --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 93be7bf6..530edeea 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -598,7 +598,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{2\}$//') + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 fi From 7e0b1ad07ad820653e24009b5f56b18abe8d82a3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 26 Mar 2022 22:42:25 +0100 Subject: [PATCH 0388/1176] fix eps_limit --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 530edeea..236f7db6 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -583,7 +583,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" && sleep 1 - tier_eps_min=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$tier_eps_min${NC}" && sleep 1 discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') From 3b41c2da21b9bf52e85f863fba1bc5887bdd30d2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 26 Mar 2022 22:50:46 +0100 Subject: [PATCH 0389/1176] Minor edit --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 236f7db6..dcd2c93f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -909,7 +909,7 @@ module.exports = { } EOF -echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" +#echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 if [[ -f /home/$USER/watchdog/watchdog.js ]] From f55160a215aeadf60d00a4fa751e2ca4d7f4a6d5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 26 Mar 2022 23:09:36 +0100 Subject: [PATCH 0390/1176] fix variable --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index dcd2c93f..b0492f82 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -584,7 +584,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" && sleep 1 eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$tier_eps_min${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Discord hook URL = ${GREEN}$discord${NC}" && sleep 1 From b15b26028fc970f46fab8c8056994a34645e6b1f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 13:39:41 +0200 Subject: [PATCH 0391/1176] added watchdog config --- multitoolbox.sh | 277 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 232 insertions(+), 45 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index eac3c9f8..86127ffd 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -455,9 +455,13 @@ fi #echo -e "${PIN}${CYAN}Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 #fi -if [[ "$watchdog" == "1" ]]; then -echo -e "${PIN}${CYAN}Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +if [[ "$discord" == "" || "$telegram_alert" == '0' ]]; then +echo -e "${PIN}${CYAN}Enable watchdog notification.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN}Disable watchdog notification.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi + + fi } @@ -763,45 +767,233 @@ zel_id=$(whiptail --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CL sleep 1 KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) sleep 1 -KDA_C=$(whiptail --inputbox "Please enter your kadena chainid (0-19)" 8 85 3>&1 1>&2 2>&3) + + if [[ "$KDA_A" == "" ]]; then kda_address="" else - kda_address="kadena:$KDA_A?chainid=$KDA_C" + kda_address="kadena:$KDA_A?chainid=0" fi + + if whiptail --yesno "Would you like enable alert notification?" 8 65; then -fi + whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 + sleep 1 -ssh_port=$(whiptail --inputbox "Enter port you are using for SSH (default 22)" 8 65 3>&1 1>&2 2>&3) -sleep 1 + CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + if [ -z "$CHOICES" ]; then + + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" + sleep 1 + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + node_label=0; + + else + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") + + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + else + ping=0; + sleep 1 + fi + + ;; + "2") + + telegram_alert=1; + + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + + sleep 1 + + ;; + esac + done +fi + + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done -pettern='^[0-9]+$' -if [[ $ssh_port =~ $pettern ]] ; then -sleep 1 else -echo -e "${ARROW} ${CYAN}SSH port must be integer.................................[${X_MARK}${CYAN}]${NC}" -echo -exit + + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + node_label=0; + sleep 1 fi -if whiptail --yesno "Would you like disable firewall diuring installation?" 8 65; then -firewall_disable='1' -sleep 1 +if [[ "$discord" == 0 ]]; then + ping=0; +fi + + +if [[ "$telegram_alert" == 0 ]]; then + telegram_bot_token=0; + telegram_chat_id=0; +fi + +if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file="$index" + tx_from_file="$output" + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + fi +fi + +if [[ $stak_info == ?(-)+([0-9]) ]]; then + + case $stak_info in + "10000") eps_limit=90 ;; + "25000") eps_limit=180 ;; + "100000") eps_limit=300 ;; + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; + esac + else -firewall_disable='0' -sleep 1 +eps_limit=0; +fi + + else + + fix_action="1" + node_label="0" + fix_action="1" + node_label="0" + + index_from_file=$index + tx_from_file=$outpoint + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + fi + + + if [[ $stak_info == ?(-)+([0-9]) ]]; then + + case $stak_info in + "10000") eps_limit=90 ;; + "25000") eps_limit=180 ;; + "100000") eps_limit=300 ;; + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; + esac + + else + eps_limit=0; + fi + + #eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + + + + fi + fi +#ssh_port=$(whiptail --inputbox "Enter port you are using for SSH (default 22)" 8 65 3>&1 1>&2 2>&3) +#sleep 1 + + +#pettern='^[0-9]+$' +#if [[ $ssh_port =~ $pettern ]] ; then +#sleep 1 +#else +#echo -e "${ARROW} ${CYAN}SSH port must be integer.................................[${X_MARK}${CYAN}]${NC}" +#echo +#exit +#fi + + +#if whiptail --yesno "Would you like disable firewall diuring installation?" 8 65; then +firewall_disable='1' +#sleep 1 +#else +#firewall_disable='0' +#sleep 1 +#fi + if [[ "$skip_bootstrap" == "0" ]]; then if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then -bootstrap_server_index=$(shuf -i 1-11 -n 1) -bootstrap_url="https://cdn-$bootstrap_server_index.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" +bootstrap_url="" sleep 1 else @@ -818,31 +1010,22 @@ sleep 1 fi fi -if whiptail --yesno "Would you like create swapfile?" 8 65; then +#if whiptail --yesno "Would you like create swapfile?" 8 65; then swapon='1' -sleep 1 -else -swapon='0' -sleep 1 -fi - - -if whiptail --yesno "Would you like use mongod bootstrap file?" 8 65; then -mongo_bootstrap='1' -sleep 1 -else -mongo_bootstrap='0' -sleep 1 -fi +#sleep 1 +#else +#swapon='0' +#sleep 1 +#fi +#if whiptail --yesno "Would you like use mongod bootstrap file?" 8 65; then +#mongo_bootstrap='1' +#sleep 1 +#else +#mongo_bootstrap='0' +#sleep 1 +#fi -if whiptail --yesno "Would you like install FluxNode watchdog?" 8 65; then -watchdog='1' -sleep 1 -else -watchdog='0' -sleep 1 -fi rm /home/$USER/install_conf.json > /dev/null 2>&1 sudo touch /home/$USER/install_conf.json @@ -855,14 +1038,18 @@ sudo chown $USER:$USER /home/$USER/install_conf.json "index": "${index}", "zelid": "${zel_id}", "kda_address": "${kda_address}", - "ssh_port": "${ssh_port}", "firewall_disable": "${firewall_disable}", "bootstrap_url": "${bootstrap_url}", "bootstrap_zip_del": "${bootstrap_zip_del}", "swapon": "${swapon}", - "mongo_bootstrap": "${mongo_bootstrap}", "use_old_chain": "${use_old_chain}", - "watchdog": "${watchdog}" + "node_label": "${node_label}", + "discord": "${discord}", + "ping": "${ping}" + "telegram_alert": "${telegram_alert}" + "telegram_bot_token": "${telegram_bot_token}" + "telegram_chat_id": "${telegram_chat_id}" + "eps_limit": "${eps_limit}" } EOF config_file From a45f07b1423db5710ba80bccfab78a7662c698b4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 13:56:53 +0200 Subject: [PATCH 0392/1176] fix conditional --- multitoolbox.sh | 84 +++++++++++++++---------------------------------- 1 file changed, 25 insertions(+), 59 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 86127ffd..34c26ab7 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -750,11 +750,21 @@ if [[ -d /home/$USER/$CONFIG_DIR ]]; then fi if [[ "$skip_zelcash_config" == "1" ]]; then + prvkey="" outpoint="" index="" zelid="" kda_address="" +node_label="0" +fix_action="1" +eps_limit=0; +discord="0" +ping="0" +telegram_alert="0" +telegram_bot_token="0" +telegram_chat_id="0" + else prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) @@ -897,7 +907,6 @@ if [[ "$telegram_alert" == 0 ]]; then telegram_chat_id=0; fi -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file="$index" tx_from_file="$output" stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') @@ -905,7 +914,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then if [[ "$stak_info" == "" ]]; then stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') fi -fi + if [[ $stak_info == ?(-)+([0-9]) ]]; then @@ -922,50 +931,7 @@ else eps_limit=0; fi - else - - fix_action="1" - node_label="0" - fix_action="1" - node_label="0" - - index_from_file=$index - tx_from_file=$outpoint - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') - - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') - fi - - - if [[ $stak_info == ?(-)+([0-9]) ]]; then - - case $stak_info in - "10000") eps_limit=90 ;; - "25000") eps_limit=180 ;; - "100000") eps_limit=300 ;; - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; - esac - - else - eps_limit=0; - fi - - #eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - - - - fi -fi - #ssh_port=$(whiptail --inputbox "Enter port you are using for SSH (default 22)" 8 65 3>&1 1>&2 2>&3) #sleep 1 @@ -991,23 +957,23 @@ firewall_disable='1' if [[ "$skip_bootstrap" == "0" ]]; then -if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then + if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then -bootstrap_url="" -sleep 1 + bootstrap_url="" + sleep 1 -else -bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) -sleep 1 -fi + else + bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) + sleep 1 + fi -if whiptail --yesno "Would you like keep bootstrap archive file localy?" 8 65; then -bootstrap_zip_del='0' -sleep 1 -else -bootstrap_zip_del='1' -sleep 1 -fi + if whiptail --yesno "Would you like keep bootstrap archive file localy?" 8 65; then + bootstrap_zip_del='0' + sleep 1 + else + bootstrap_zip_del='1' + sleep 1 + fi fi #if whiptail --yesno "Would you like create swapfile?" 8 65; then From 1d01c5a3aa6a5f207d11928f670cd9b19d4dd25e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 18:25:18 +0200 Subject: [PATCH 0393/1176] Update multitoolbox.sh --- multitoolbox.sh | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 34c26ab7..e453ccfc 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -931,29 +931,7 @@ else eps_limit=0; fi - -#ssh_port=$(whiptail --inputbox "Enter port you are using for SSH (default 22)" 8 65 3>&1 1>&2 2>&3) -#sleep 1 - - -#pettern='^[0-9]+$' -#if [[ $ssh_port =~ $pettern ]] ; then -#sleep 1 -#else -#echo -e "${ARROW} ${CYAN}SSH port must be integer.................................[${X_MARK}${CYAN}]${NC}" -#echo -#exit -#fi - - -#if whiptail --yesno "Would you like disable firewall diuring installation?" 8 65; then firewall_disable='1' -#sleep 1 -#else -#firewall_disable='0' -#sleep 1 -#fi - if [[ "$skip_bootstrap" == "0" ]]; then @@ -974,24 +952,11 @@ if [[ "$skip_bootstrap" == "0" ]]; then bootstrap_zip_del='1' sleep 1 fi + fi -#if whiptail --yesno "Would you like create swapfile?" 8 65; then -swapon='1' -#sleep 1 -#else -#swapon='0' -#sleep 1 -#fi -#if whiptail --yesno "Would you like use mongod bootstrap file?" 8 65; then -#mongo_bootstrap='1' -#sleep 1 -#else -#mongo_bootstrap='0' -#sleep 1 -#fi - +swapon='1' rm /home/$USER/install_conf.json > /dev/null 2>&1 sudo touch /home/$USER/install_conf.json From 9e565d466e8b15476824b022625eec31fac34b28 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 18:35:41 +0200 Subject: [PATCH 0394/1176] Update multitoolbox.sh --- multitoolbox.sh | 101 +++++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e453ccfc..047d65f0 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -692,6 +692,8 @@ fi } function create_config() { + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" @@ -705,22 +707,22 @@ echo -e "${YELLOW}============================================================== if jq --version > /dev/null 2>&1; then -sleep 0.2 + sleep 0.2 else -echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" -sudo apt install jq -y > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" + sudo apt install jq -y > /dev/null 2>&1 - if jq --version > /dev/null 2>&1 - then - #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" - string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" - string_limit_x_mark "JQ was not installed................................." - echo - exit - fi + if jq --version > /dev/null 2>&1 + then + #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" + string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" + string_limit_x_mark "JQ was not installed................................." + echo + exit + fi fi skip_zelcash_config='0' @@ -745,48 +747,47 @@ if [[ -d /home/$USER/$CONFIG_DIR ]]; then use_old_chain='0' sleep 1 fi - - + fi if [[ "$skip_zelcash_config" == "1" ]]; then -prvkey="" -outpoint="" -index="" -zelid="" -kda_address="" -node_label="0" -fix_action="1" -eps_limit=0; -discord="0" -ping="0" -telegram_alert="0" -telegram_bot_token="0" -telegram_chat_id="0" + prvkey="" + outpoint="" + index="" + zelid="" + kda_address="" + node_label="0" + fix_action="1" + eps_limit=0; + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" else -prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) -sleep 1 -outpoint=$(whiptail --inputbox "Enter your FluxNode Collateral TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) -sleep 1 -index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) -sleep 1 -zel_id=$(whiptail --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) -sleep 1 -KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) -sleep 1 + prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) + sleep 1 + outpoint=$(whiptail --inputbox "Enter your FluxNode Collateral TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) + sleep 1 + index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) + sleep 1 + zel_id=$(whiptail --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) + sleep 1 + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + sleep 1 - if [[ "$KDA_A" == "" ]]; then - kda_address="" - else - kda_address="kadena:$KDA_A?chainid=0" - fi + if [[ "$KDA_A" == "" ]]; then + kda_address="" + else + kda_address="kadena:$KDA_A?chainid=0" + fi - if whiptail --yesno "Would you like enable alert notification?" 8 65; then + if whiptail --yesno "Would you like enable alert notification?" 8 65; then whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 sleep 1 @@ -807,6 +808,7 @@ sleep 1 node_label=0; else + for CHOICE in $CHOICES; do case "$CHOICE" in "1") @@ -908,7 +910,7 @@ if [[ "$telegram_alert" == 0 ]]; then fi index_from_file="$index" - tx_from_file="$output" + tx_from_file="$outpoint" stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') if [[ "$stak_info" == "" ]]; then @@ -928,7 +930,7 @@ if [[ $stak_info == ?(-)+([0-9]) ]]; then esac else -eps_limit=0; + eps_limit=0; fi firewall_disable='1' @@ -955,6 +957,8 @@ if [[ "$skip_bootstrap" == "0" ]]; then fi +fi + swapon='1' @@ -983,11 +987,10 @@ sudo chown $USER:$USER /home/$USER/install_conf.json "eps_limit": "${eps_limit}" } EOF + config_file echo - - } From afc4d0d4315743ece7487171562c7d87e4139229 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 18:58:40 +0200 Subject: [PATCH 0395/1176] fix install_conf --- multitoolbox.sh | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 047d65f0..6ae3d127 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -390,14 +390,10 @@ function pm2_install(){ function config_file() { if [[ -f /home/$USER/install_conf.json ]]; then + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') -ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') -firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') -swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') -mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') -watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') @@ -406,7 +402,6 @@ zel_id=$(cat /home/$USER/install_conf.json | jq -r '.zelid') kda_address=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') echo -e "${ARROW} ${YELLOW}Install config summary:" - if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then echo -e "${PIN}${CYAN}Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else @@ -417,11 +412,6 @@ fi fi -if [[ "$ssh_port" != "" ]]; then -string_limit_check_mark_port "SSH port: $ssh_port ...................................................................." "SSH port: ${GREEN}$ssh_port ${CYAN}...................................................................." -sleep 1 -fi - if [[ "$firewall_disable" == "1" ]]; then echo -e "${PIN}${CYAN}Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else @@ -451,11 +441,8 @@ if [[ "$swapon" == "1" ]]; then echo -e "${PIN}${CYAN}Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi -#if [[ "$mongo_bootstrap" == "1" ]]; then -#echo -e "${PIN}${CYAN}Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -#fi -if [[ "$discord" == "" || "$telegram_alert" == '0' ]]; then +if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then echo -e "${PIN}${CYAN}Enable watchdog notification.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else echo -e "${PIN}${CYAN}Disable watchdog notification.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -933,7 +920,7 @@ else eps_limit=0; fi -firewall_disable='1' + if [[ "$skip_bootstrap" == "0" ]]; then @@ -959,7 +946,7 @@ fi fi - +firewall_disable='1' swapon='1' rm /home/$USER/install_conf.json > /dev/null 2>&1 @@ -980,10 +967,10 @@ sudo chown $USER:$USER /home/$USER/install_conf.json "use_old_chain": "${use_old_chain}", "node_label": "${node_label}", "discord": "${discord}", - "ping": "${ping}" - "telegram_alert": "${telegram_alert}" - "telegram_bot_token": "${telegram_bot_token}" - "telegram_chat_id": "${telegram_chat_id}" + "ping": "${ping}", + "telegram_alert": "${telegram_alert}", + "telegram_bot_token": "${telegram_bot_token}", + "telegram_chat_id": "${telegram_chat_id}", "eps_limit": "${eps_limit}" } EOF From e8cb9722ce055dabdf08275a09f999f8c0ba6de7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 19:00:36 +0200 Subject: [PATCH 0396/1176] config_file cleanup --- multitoolbox.sh | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6ae3d127..e59073e8 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -412,12 +412,6 @@ fi fi -if [[ "$firewall_disable" == "1" ]]; then -echo -e "${PIN}${CYAN}Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN}Firewall enabled diuring installation............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - if [[ "$use_old_chain" == "1" ]]; then echo -e "${PIN}${CYAN}Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -437,15 +431,10 @@ fi fi -if [[ "$swapon" == "1" ]]; then -echo -e "${PIN}${CYAN}Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - - if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then -echo -e "${PIN}${CYAN}Enable watchdog notification.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else -echo -e "${PIN}${CYAN}Disable watchdog notification.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi From db822d9020d81508580f0a121f45a49c254e02ec Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 19:40:08 +0200 Subject: [PATCH 0397/1176] setup from file correction --- install_pro.sh | 107 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 94 insertions(+), 13 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index b0492f82..b5d26447 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -439,7 +439,7 @@ function config_file() { if [[ -f /home/$USER/install_conf.json ]]; then import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') -ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') +#ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') #firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') @@ -452,8 +452,17 @@ outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') index=$(cat /home/$USER/install_conf.json | jq -r '.index') ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') +fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') +node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') +eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') +discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') +ping=$(cat /home/$USER/install_conf.json | jq -r '.ping') +telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') +telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') +telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') -discord_hook_url=$(cat /home/$USER/watchdog/config.js | jq -r '.outpoint') + + echo echo -e "${ARROW} ${YELLOW}Install config:" @@ -468,9 +477,9 @@ fi fi -if [[ "$ssh_port" != "" ]]; then -echo -e "${PIN}${CYAN} SSH port set.....................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi +#if [[ "$ssh_port" != "" ]]; then +#echo -e "${PIN}${CYAN} SSH port set.....................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +#fi #if [[ "$firewall_disable" == "1" ]]; then #echo -e "${PIN}${CYAN} Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -505,9 +514,11 @@ fi #echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 #fi -#if [[ "$watchdog" == "1" ]]; then -#echo -e "${PIN}${CYAN} Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -#fi +if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then +echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +else +echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +fi @@ -644,12 +655,36 @@ else if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 fi - - - - + fi - + + + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + + fix_action=$(grep -w action /home/$USER/watchdog/config.js | sed -e 's/.*action: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Fix action = ${GREEN}$fix_action${NC}" && sleep 1 + + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" && sleep 1 + + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 + + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Discord hook URL = ${GREEN}$discord${NC}" && sleep 1 + + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}$ping${NC}" && sleep 1 + + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}$telegram_alert${NC}" && sleep 1 + + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 fi @@ -704,6 +739,43 @@ daemon_update='1' bench_update='1' fix_action='1' +if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then + +sudo touch /home/$USER/watchdog/config.js +sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js +module.exports = { + label: '${node_label}', + tier_eps_min: '${eps_limit}', + zelflux_update: '${flux_update}', + zelcash_update: '${daemon_update}', + zelbench_update: '${bench_update}', + action: '${fix_action}', + ping: '${ping}', + web_hook_url: '${discord}', + telegram_alert: '${telegram_alert}', + telegram_bot_token: '${telegram_bot_token}', + telegram_chat_id: '${telegram_chat_id}' +} +EOF + + + + if [[ -f /home/$USER/watchdog/watchdog.js ]]; then + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." + #echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + else + string_limit_x_mark "Watchdog was not installed................................." + fi + + return 1 + +fi + + if [[ "$IMPORT_ZELCONF" == "1" ]]; then sudo touch /home/$USER/watchdog/config.js @@ -740,6 +812,9 @@ EOF fi + + + discord='0' if whiptail --yesno "Would you like enable alert notification?" 8 60; then @@ -2661,6 +2736,12 @@ echo -e "${PIN}${CYAN}Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex="$index" echo -e "${PIN}${CYAN}Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 + + + + + + echo fi From 18e12dab13c48845098debb8a3c3a4feef0605ed Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 20:16:33 +0200 Subject: [PATCH 0398/1176] fix conditional --- install_pro.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index b5d26447..4642cfbf 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -739,7 +739,7 @@ daemon_update='1' bench_update='1' fix_action='1' -if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then +if [[ "$import_settings" == "0" && -f /home/$USER/install_conf.json ]]; then sudo touch /home/$USER/watchdog/config.js sudo chown $USER:$USER /home/$USER/watchdog/config.js @@ -2735,14 +2735,26 @@ zelnodeoutpoint="$outpoint" echo -e "${PIN}${CYAN}Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex="$index" echo -e "${PIN}${CYAN}Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 -echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 - - - +if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 +fi + +if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 +fi -echo +echo -e "" +echo -e "${ARROW} ${YELLOW}Watchdog conf settings:${NC}" +echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Discord hook URL = ${GREEN}$discord${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Discord ping = ${GREEN}$ping${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}$telegram_alert${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 +echo -e "" fi fi From 2dc6fff5b39155b9a2b5b66405530038396ef50b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 20:44:30 +0200 Subject: [PATCH 0399/1176] fix install config --- install_pro.sh | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 4642cfbf..30bdda96 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -472,20 +472,11 @@ echo -e "${PIN}${CYAN} Import settings from install_conf.json................... else if [[ "$import_settings" == "1" ]]; then -echo -e "${PIN}${CYAN} Import settings from Flux..............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Import settings from Flux........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi fi -#if [[ "$ssh_port" != "" ]]; then -#echo -e "${PIN}${CYAN} SSH port set.....................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -#fi - -#if [[ "$firewall_disable" == "1" ]]; then -#echo -e "${PIN}${CYAN} Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -#else -#echo -e "${PIN}${CYAN} Firewall enabled diuring installation............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -#fi if [[ "$use_old_chain" == "1" ]]; then echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -493,15 +484,15 @@ echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use............ else if [[ "$bootstrap_url" == "" ]]; then -echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...........[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else -echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi if [[ "$bootstrap_zip_del" == "1" ]]; then -echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else -echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi fi @@ -515,9 +506,9 @@ fi #fi if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then -echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else -echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi @@ -587,9 +578,6 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash echo -e "" echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - - fix_action=$(grep -w action /home/$USER/watchdog/config.js | sed -e 's/.*action: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Fix action = ${GREEN}$fix_action${NC}" && sleep 1 node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" && sleep 1 From 5822304a4b6f5a461cd6ffff6680d7a7bad8818a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 21:18:27 +0200 Subject: [PATCH 0400/1176] Minor edit --- multitoolbox.sh | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e59073e8..4816507a 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -735,7 +735,7 @@ if [[ "$skip_zelcash_config" == "1" ]]; then kda_address="" node_label="0" fix_action="1" - eps_limit=0; + eps_limit="0" discord="0" ping="0" telegram_alert="0" @@ -776,12 +776,12 @@ else echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" sleep 1 - discord=0; - ping=0; - telegram_alert=0; - telegram_bot_token=0; - telegram_chat_id=0; - node_label=0; + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" else @@ -809,14 +809,14 @@ else sleep 1 else - ping=0; + ping="0" sleep 1 fi ;; "2") - telegram_alert=1; + telegram_alert="1"; while true do @@ -865,13 +865,14 @@ fi else - discord=0; - ping=0; - telegram_alert=0; - telegram_bot_token=0; - telegram_chat_id=0; - node_label=0; + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" sleep 1 + fi @@ -880,19 +881,19 @@ if [[ "$discord" == 0 ]]; then fi -if [[ "$telegram_alert" == 0 ]]; then - telegram_bot_token=0; - telegram_chat_id=0; +if [[ "$telegram_alert" == 0 || "$telegram_alert" == "" ]]; then + telegram_alert == "0" + telegram_bot_token="0" + telegram_chat_id="0" fi index_from_file="$index" tx_from_file="$outpoint" stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') - fi - +if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') +fi if [[ $stak_info == ?(-)+([0-9]) ]]; then From 3dadbd48a7ce08e0ae97420241e80b77e155b477 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 21:29:26 +0200 Subject: [PATCH 0401/1176] Minor edits --- multitoolbox.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4816507a..060867d6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -816,7 +816,7 @@ else ;; "2") - telegram_alert="1"; + telegram_alert="1" while true do @@ -877,12 +877,12 @@ fi if [[ "$discord" == 0 ]]; then - ping=0; + ping="0" fi if [[ "$telegram_alert" == 0 || "$telegram_alert" == "" ]]; then - telegram_alert == "0" + telegram_alert="0" telegram_bot_token="0" telegram_chat_id="0" fi From f3575c3ee4738f62c49f3bccb0af59fc7afd45cf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 21:35:53 +0200 Subject: [PATCH 0402/1176] conf settings align --- install_pro.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 30bdda96..2db4e822 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2718,11 +2718,11 @@ IMPORT_ZELCONF="1" IMPORT_ZELID="1" echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" zelnodeprivkey="$prvkey" -echo -e "${PIN}${CYAN}Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint="$outpoint" -echo -e "${PIN}${CYAN}Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex="$index" -echo -e "${PIN}${CYAN}Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 +echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$ZELID" != "" ]]; then From 89bd4a00ea531b7676658688a0c1511da34a84d5 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sun, 27 Mar 2022 20:40:37 +0100 Subject: [PATCH 0403/1176] Update testnet to FluxBench v3.2.0 --- install_pro_testnet.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index ada9da40..965023b9 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1161,8 +1161,8 @@ if [[ $(dpkg --print-architecture) = *amd* ]]; then sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.1.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-Linux-v3.1.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.2.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.2.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 @@ -1173,8 +1173,8 @@ else sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.1.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-arm-v3.1.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.2.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.2.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 From eedab818bd8d1b7e3adb5f9f9348e5799221780b Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sun, 27 Mar 2022 20:41:38 +0100 Subject: [PATCH 0404/1176] Update Testnet Fluxbench to v3.2.0 --- multitoolbox_testnet.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 81246bf4..6bff81ea 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1910,8 +1910,8 @@ if [[ $(dpkg --print-architecture) = *amd* ]]; then sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.1.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-Linux-v3.1.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.2.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.2.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 sudo rm -rf /tmp/flux* 2>&1 && sleep 2 @@ -1925,8 +1925,8 @@ else sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.1.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-arm-v3.1.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.2.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.2.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 sudo rm -rf /tmp/flux* 2>&1 && sleep 2 From e621eccb13470c3ede2c787ac948b5374f20e3d1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 22:00:34 +0200 Subject: [PATCH 0405/1176] added logs marker --- install_pro.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 2db4e822..1233dbd3 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1685,10 +1685,11 @@ function bootstrap() { echo -e "" echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" + if [[ -z "$bootstrap_url" ]]; then if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + echo -e "${ARROW} ${CYAN}Cleaning...1${NC}" rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes fi @@ -1785,7 +1786,7 @@ function bootstrap() { else if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + echo -e "${ARROW} ${CYAN}Cleaning...2${NC}" rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes fi @@ -1830,11 +1831,12 @@ function bootstrap() { else - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -sSL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/daemon_bootstrap.json | jq -r '.block_height') + DB_HIGHT=$(curl -sSL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) fi + echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress From 2cb844485d147454a7955a1b362992551ff108e9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 22:14:58 +0200 Subject: [PATCH 0406/1176] Minor edit --- install_pro.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 1233dbd3..c2453066 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -483,7 +483,7 @@ echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use............ else -if [[ "$bootstrap_url" == "" ]]; then +if [[ "$bootstrap_url" == "0" ]]; then echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...........[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -1688,6 +1688,7 @@ function bootstrap() { if [[ -z "$bootstrap_url" ]]; then + if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then echo -e "${ARROW} ${CYAN}Cleaning...1${NC}" rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes @@ -1817,7 +1818,7 @@ function bootstrap() { fi - if [[ "$bootstrap_url" == "" ]]; then + if [[ "$bootstrap_url" == "0" ]]; then if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then From 59e5a4a290ffddc2d4985fabcd16b9975debfe3c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 22:17:14 +0200 Subject: [PATCH 0407/1176] fix bootstrap variable --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 060867d6..809495cb 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -916,7 +916,7 @@ if [[ "$skip_bootstrap" == "0" ]]; then if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then - bootstrap_url="" + bootstrap_url="0" sleep 1 else From 381c8b5956fafe21863b2b372a7602569598d01c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 23:09:28 +0200 Subject: [PATCH 0408/1176] Finalizing --- install_pro.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index c2453066..26da9ea5 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -818,12 +818,12 @@ if [ -z "$CHOICES" ]; then echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" sleep 1 - discord=0; - ping=0; - telegram_alert=0; - telegram_bot_token=0; - telegram_chat_id=0; - node_label=0; + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" else for CHOICE in $CHOICES; do @@ -857,7 +857,7 @@ else ;; "2") - telegram_alert=1; + telegram_alert="1" while true do @@ -906,24 +906,24 @@ fi else - discord=0; - ping=0; - telegram_alert=0; - telegram_bot_token=0; - telegram_chat_id=0; - node_label=0; + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" sleep 1 fi if [[ "$discord" == 0 ]]; then - ping=0; + ping="0"; fi if [[ "$telegram_alert" == 0 ]]; then - telegram_bot_token=0; - telegram_chat_id=0; + telegram_bot_token="0"; + telegram_chat_id="0"; fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then @@ -1690,7 +1690,7 @@ function bootstrap() { if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...1${NC}" + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes fi @@ -1787,7 +1787,7 @@ function bootstrap() { else if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...2${NC}" + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes fi From 752a676fd2fff6537d6620a1d094e204efd62c85 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Mar 2022 23:10:25 +0200 Subject: [PATCH 0409/1176] bump version --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 809495cb..6d0fdbc1 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -38,7 +38,7 @@ ARROW="${SEA}\xE2\x96\xB6${NC}" BOOK="${RED}\xF0\x9F\x93\x8B${NC}" HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -dversion="v7.0" +dversion="v7.1" PM2_INSTALL="0" zelflux_setting_import="0" From f3645e553adf6a66798e9e3331ea81a9d3e192c6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 28 Mar 2022 08:39:31 +0200 Subject: [PATCH 0410/1176] import setting summary correction --- install_pro.sh | 88 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 25 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 26da9ea5..60c071eb 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -579,26 +579,47 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash echo -e "" echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" && sleep 1 - + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 + fi eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 + fi + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Discord hook URL = ${GREEN}$discord${NC}" && sleep 1 + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 + fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}$ping${NC}" && sleep 1 + fi telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}$telegram_alert${NC}" && sleep 1 + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 + fi telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + fi telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 + fi fi fi @@ -649,32 +670,49 @@ else echo -e "" echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - - fix_action=$(grep -w action /home/$USER/watchdog/config.js | sed -e 's/.*action: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Fix action = ${GREEN}$fix_action${NC}" && sleep 1 - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" && sleep 1 - + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 + fi eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 + fi + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Discord hook URL = ${GREEN}$discord${NC}" && sleep 1 + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 + fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}$ping${NC}" && sleep 1 + fi telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}$telegram_alert${NC}" && sleep 1 + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 + fi telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + fi telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 - - + fi + fi fi From f8aedb60148155e555a073520d0fc14c0a2a9b56 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 28 Mar 2022 19:57:44 +0200 Subject: [PATCH 0411/1176] watchdog config display correction --- install_pro.sh | 84 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 27 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 60c071eb..5f94595a 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2754,36 +2754,66 @@ import_date else if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then -echo -IMPORT_ZELCONF="1" -IMPORT_ZELID="1" -echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" -zelnodeprivkey="$prvkey" -echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 -zelnodeoutpoint="$outpoint" -echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 -zelnodeindex="$index" -echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 - - -if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 -fi + + IMPORT_ZELCONF="1" + IMPORT_ZELID="1" + echo -e "" + echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" + zelnodeprivkey="$prvkey" + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + zelnodeoutpoint="$outpoint" + echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + zelnodeindex="$index" + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 + + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 + fi -if [[ "$KDA_A" != "" ]]; then + if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 -fi + fi -echo -e "" -echo -e "${ARROW} ${YELLOW}Watchdog conf settings:${NC}" -echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" && sleep 1 -echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 -echo -e "${PIN}${CYAN} Discord hook URL = ${GREEN}$discord${NC}" && sleep 1 -echo -e "${PIN}${CYAN} Discord ping = ${GREEN}$ping${NC}" && sleep 1 -echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}$telegram_alert${NC}" && sleep 1 -echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 -echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 -echo -e "" + echo -e "" + echo -e "${ARROW} ${YELLOW}Watchdog conf settings:${NC}" + + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 + fi + + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 + + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 + fi + + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 + fi + fi + + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 + fi + + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + fi + + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 + fi + echo -e "" + fi fi From c60ee85666d3609fc11124f31328be52345c03d8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Mar 2022 19:36:31 +0200 Subject: [PATCH 0412/1176] fix multinode back error check --- nodeanalizerandfixer.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 371ad0f2..5b41551d 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -503,11 +503,11 @@ fi if [[ "$WANIP" != "" ]]; then -back_error_check=$(curl -s -m 5 http://$WANIP:16127/zelid/loginphrase | jq -r .status ) +back_error_check=$(curl -s -m 5 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .status ) if [[ "$back_error_check" != "success" && "$back_error_check" != "" ]]; then - back_error=$(curl -s -m 8 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message.message 2>/dev/null ) + back_error=$(curl -s -m 8 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .data.message.message 2>/dev/null ) if [[ "$back_error" != "" ]]; then @@ -515,7 +515,7 @@ back_error_check=$(curl -s -m 5 http://$WANIP:16127/zelid/loginphrase | jq -r .s else - back_error=$(curl -s -m 8 http://$WANIP:16127/zelid/loginphrase | jq -r .data.message 2>/dev/null ) + back_error=$(curl -s -m 8 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .data.message 2>/dev/null ) if [[ "$back_error" != "" ]]; then From 4520a99ef5b57823a7729d8ca15c973f7e2acffe Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Mar 2022 19:52:10 +0200 Subject: [PATCH 0413/1176] fix conditional --- multitoolbox.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6d0fdbc1..97b4725f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -431,7 +431,9 @@ fi fi -if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then +if [[ ( "$A" -eq "0" || "$B" -ne "0" ) && "$C" -eq "0" ]]; then ... + +if [[ ( "$discord" != "" && "$discord" != "0" ) || "$telegram_alert" == '1' ]]; then echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 From 3078a78c773ffe36e4f7d415fc9730c1dd5cfe40 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Mar 2022 19:59:41 +0200 Subject: [PATCH 0414/1176] removed unwanted content --- multitoolbox.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 97b4725f..aed6df6c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -431,7 +431,6 @@ fi fi -if [[ ( "$A" -eq "0" || "$B" -ne "0" ) && "$C" -eq "0" ]]; then ... if [[ ( "$discord" != "" && "$discord" != "0" ) || "$telegram_alert" == '1' ]]; then echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 From 80f7815c9e4f566a2717859edf4993f71c3f86ac Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 30 Mar 2022 23:44:42 +0200 Subject: [PATCH 0415/1176] fix DOS info --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 5b41551d..0c428317 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -609,7 +609,7 @@ fi echo -e "${PIN} ${CYAN}Node status: $node_status_color${NC}" if [[ "$node_status" == "DOS" ]]; then -blocks_till=$($COIN_CLI getdoslist | jq .[] | grep "$collateral" -A4 -B1 | jq .eligible_in) +blocks_till=$($COIN_CLI getdoslist | jq .[] | grep "$collateral" -A5 -B1 | jq .eligible_in) dos_till=$((blocks_hight+blocks_till)) echo -e "${PIN} ${RED}DOS ${CYAN}Till: ${ORANGE}$dos_till ${CYAN}EXPIRE_COUNT: ${ORANGE}$blocks_till${CYAN} Time left: ${RED}~$((2*blocks_till)) min. ${NC}" fi From c5536077c1d59020fc77bf28612a1614f0b080d5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 31 Mar 2022 09:04:20 +0200 Subject: [PATCH 0416/1176] ZelID check update --- nodeanalizerandfixer.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 0c428317..b77c1351 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -949,12 +949,12 @@ if [[ "$required_ver" != "" ]]; then echo -e "${CHECK_MARK} ${CYAN} Flux config ~/$FLUX_DIR/config/userconfig.js exists${NC}" ZELIDLG=`echo -n $(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e "s/'//g" | sed -e "s/,//g" | sed -e "s/.*zelid://g") | wc -m` -if [ "$ZELIDLG" -eq "35" ] || [ "$ZELIDLG" -eq "34" ]; then -echo -e "${CHECK_MARK} ${CYAN} Zel ID is valid${NC}" +if [[ "$ZELIDLG" -eq "35" || "$ZELIDLG" -eq "34" || "$ZELIDLG" -eq "33" ]]; then + echo -e "${CHECK_MARK} ${CYAN} Zel ID is valid${NC}" elif [[ "$ZELIDLG" == "0" || "$ZELIDLG" == "2" ]]; then -echo -e "${X_MARK} ${CYAN} Zel ID is missing...${NC}" + echo -e "${X_MARK} ${CYAN} Zel ID is missing...${NC}" else -echo -e "${X_MARK} ${CYAN} Zel ID is not valid${NC}" + echo -e "${X_MARK} ${CYAN} Zel ID is not valid${NC}" fi if [ -f ~/$FLUX_DIR/error.log ] From d2a72ccfc4304ca013eac517e641da08122027f1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 6 Apr 2022 10:40:50 +0200 Subject: [PATCH 0417/1176] added home UI port and description --- multinode.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multinode.sh b/multinode.sh index 938573b5..ea275346 100644 --- a/multinode.sh +++ b/multinode.sh @@ -121,7 +121,11 @@ fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" + #API PORT sudo ufw allow $FLUX_PORT > /dev/null 2>&1 + #HOME UI PORT + sudo ufw allow $(($FLUX_PORT-1)) > /dev/null 2>&1 + #if ! route -h > /dev/null 2>&1 ; then # sudo apt install net-tools > /dev/null 2>&1 From b2814ef1d831a33dbf5241c48d66ec2ea232fcf4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 6 Apr 2022 15:51:24 +0200 Subject: [PATCH 0418/1176] fix typo --- multitoolbox_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 6bff81ea..b63a1777 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1416,7 +1416,7 @@ fi echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" echo -e "" echo -e "${ARROW} ${RED}IMPORTANT:${NC}" - echo -e "${BOOK} ${RED}Each node need to set different port for comunnication${NC}" + echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" echo -e "" echo -e "${YELLOW}================================================================${NC}" From 55db64a2cf7695ac103b3e213c7f67d71f24031a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 6 Apr 2022 15:52:35 +0200 Subject: [PATCH 0419/1176] fix typo --- multitoolbox.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index aed6df6c..9df230cb 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1725,7 +1725,7 @@ bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool function multinode(){ -echo -e "${GREEN}Module: Multinode configuration with UPNP comunnication (Needs Router with UPNP support)${NC}" +echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then @@ -1738,11 +1738,11 @@ fi echo -e "" echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" - echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp comunication ${NC}" + echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" echo -e "" echo -e "${ARROW} ${RED}IMPORTANT:${NC}" - echo -e "${BOOK} ${RED}Each node need to set different port for comunnication${NC}" + echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" echo -e "" echo -e "${YELLOW}================================================================${NC}" @@ -2408,7 +2408,7 @@ echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}11 - Replace Zel ID ${NC}" echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${CYAN}13 - Recover corrupted MongoDB database${NC}" -echo -e "${CYAN}14 - Multinode configuration with UPNP comunnication (Needs Router with UPNP support) ${NC}" +echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Router with UPNP support) ${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " From b808b84c5233fbc36bdb07fad23f347a482c6438 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 6 Apr 2022 15:54:36 +0200 Subject: [PATCH 0420/1176] fix typo --- multitoolbox_testnet.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index b63a1777..b3391858 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1399,7 +1399,7 @@ bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool function multinode(){ -echo -e "${GREEN}Module: Multinode configuration with UPNP comunnication (Needs Router with UPNP support)${NC}" +echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then @@ -1412,7 +1412,7 @@ fi echo -e "" echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" - echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp comunication ${NC}" + echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" echo -e "" echo -e "${ARROW} ${RED}IMPORTANT:${NC}" @@ -2103,7 +2103,7 @@ echo -e "${CYAN}1 - Install Docker${NC}" echo -e "${CYAN}2 - Install FluxNode${NC}" echo -e "${CYAN}3 - Update flux daemon and benchmark binary${NC}" echo -e "${CYAN}4 - Install/Re-install FluxOS${NC}" -echo -e "${CYAN}5 - Multinode configuration with UPNP comunnication (Needs Router with UPNP support) ${NC}" +echo -e "${CYAN}5 - Multinode configuration with UPNP communication (Needs Router with UPNP support) ${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " From 6e2e9057681deb24c92007aff1fc5f69e7d2761e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 6 Apr 2022 21:35:53 +0200 Subject: [PATCH 0421/1176] fix ip_check for multiport --- install_pro.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 5f94595a..34ceba2f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -320,7 +320,11 @@ fi if [[ $1 == "ip_check" ]]; then get_ip device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - confirmed_ip=$(curl -SsL -m 10 http://localhost:16127/flux/info | jq -r .data.node.status.ip) + api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + if [[ "$api_port" == "" ]]; then + api_port="16127" + fi + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip) if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then if [[ "$WANIP" != "$confirmed_ip" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') From b43e2f811680f2bfb67c1bd7596c053716af9122 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 6 Apr 2022 21:37:26 +0200 Subject: [PATCH 0422/1176] fix ip_check for multiport --- multitoolbox.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9df230cb..ba9a6974 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -2314,8 +2314,11 @@ if [[ $1 == "ip_check" ]]; then get_ip device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - confirmed_ip=$(curl -SsL -m 10 http://localhost:16127/flux/info | jq -r .data.node.status.ip) - + api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + if [[ "$api_port" == "" ]]; then + api_port="16127" + fi + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip) if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then if [[ "$WANIP" != "$confirmed_ip" ]]; then From d501f44bc1d93677fcac725d4575ddf37b8b38c8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 6 Apr 2022 22:24:18 +0200 Subject: [PATCH 0423/1176] fix ip check for rotate ip --- install_pro_testnet.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 965023b9..0a04ef68 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -118,7 +118,11 @@ fi if [[ $1 == "ip_check" ]]; then get_ip device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - confirmed_ip=$(curl -SsL -m 10 http://localhost:16127/flux/info | jq -r .data.node.status.ip) + api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + if [[ "$api_port" == "" ]]; then + api_port="16127" + fi + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip) if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then if [[ "$WANIP" != "$confirmed_ip" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') From ea18c8d2c5fd7c2a5a89a3830421a19e49b7a4c0 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Fri, 8 Apr 2022 10:32:33 +0100 Subject: [PATCH 0424/1176] Updade addnode list --- install_pro.sh | 124 +++++++++++++++---------------------------------- 1 file changed, 37 insertions(+), 87 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 34ceba2f..33249061 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1467,94 +1467,44 @@ addnode=explorer.zelcash.online addnode=blockbook.runonflux.io addnode=202.61.202.21 addnode=89.58.40.172 -addnode=109.90.125.189 -addnode=185.30.117.2 -addnode=185.30.117.4 -addnode=185.30.117.3 -addnode=185.30.117.5 -addnode=31.7.195.203 -addnode=65.108.192.59 -addnode=188.25.224.51 -addnode=89.58.26.142 -addnode=135.181.165.186 -addnode=89.58.3.209 -addnode=89.58.37.73 -addnode=213.231.3.224 -addnode=89.58.10.47 -addnode=65.108.40.221 -addnode=89.58.28.201 -addnode=136.243.77.25 -addnode=185.216.178.243 -addnode=178.63.64.107 -addnode=72.194.134.229 -addnode=65.108.98.168 -addnode=135.181.211.41 -addnode=65.108.100.234 -addnode=89.58.42.201 -addnode=37.221.197.179 -addnode=108.204.4.49 -addnode=108.196.85.217 -addnode=88.99.6.216 -addnode=202.61.200.66 -addnode=100.4.72.94 -addnode=176.126.47.133 -addnode=66.119.15.227 -addnode=148.72.144.148 -addnode=74.142.7.118 -addnode=71.126.67.85 -addnode=65.108.192.60 -addnode=76.27.137.166 -addnode=75.152.95.135 -addnode=135.181.22.96 -addnode=23.227.173.75 -addnode=65.108.73.180 -addnode=95.216.80.122 -addnode=95.216.124.207 -addnode=65.21.81.152 -addnode=75.119.145.183 -addnode=207.180.233.97 -addnode=194.163.168.93 -addnode=89.58.13.117 -addnode=46.173.134.109 -addnode=46.173.134.156 -addnode=23.227.173.61 -addnode=23.227.173.61 -addnode=23.227.173.135 -addnode=23.227.173.15 -addnode=95.216.124.197 -addnode=65.21.165.2 -addnode=45.129.180.23 -addnode=89.58.27.53 -addnode=89.58.25.225 -addnode=195.201.170.210 -addnode=45.9.61.125 -addnode=89.58.7.180 -addnode=89.58.41.170 -addnode=89.58.5.250 -addnode=94.16.108.216 -addnode=89.58.6.144 -addnode=75.22.188.83 -addnode=202.61.206.226 -addnode=185.193.17.204 -addnode=89.58.36.108 -addnode=185.205.246.201 -addnode=194.34.232.219 -addnode=45.13.59.140 -addnode=213.239.206.214 -addnode=161.97.169.239 -addnode=89.58.38.97 -addnode=94.250.203.87 -addnode=89.58.11.9 -addnode=194.34.232.214 -addnode=89.58.5.144 -addnode=89.58.35.183 -addnode=89.58.7.64 -addnode=38.242.211.98 -addnode=185.193.17.206 -addnode=37.221.192.199 -addnode=209.145.62.74 -addnode=38.242.202.228 addnode=37.120.176.206 +addnode=66.119.15.83 +addnode=66.94.118.208 +addnode=99.48.162.169 +addnode=97.120.40.143 +addnode=99.48.162.167 +addnode=108.30.50.162 +addnode=154.12.242.89 +addnode=67.43.96.139 +addnode=66.94.107.219 +addnode=66.94.110.117 +addnode=154.12.225.203 +addnode=176.9.72.41 +addnode=65.108.198.119 +addnode=65.108.200.110 +addnode=46.38.251.110 +addnode=95.214.55.47 +addnode=202.61.236.202 +addnode=65.108.141.153 +addnode=178.170.46.91 +addnode=66.119.15.64 +addnode=65.108.46.178 +addnode=94.130.220.41 +addnode=178.170.48.110 +addnode=78.35.147.57 +addnode=66.119.15.101 +addnode=66.119.15.96 +addnode=38.88.125.25 +addnode=66.119.15.110 +addnode=103.13.31.149 +addnode=212.80.212.238 +addnode=212.80.213.172 +addnode=212.80.212.228 +addnode=121.112.224.186 +addnode=114.181.141.16 +addnode=167.179.115.100 +addnode=153.226.219.80 +addnode=24.79.73.50 maxconnections=256 EOF sleep 2 From 8fd4ad7ec010886b242136edab8b6cd5abd8c45e Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Fri, 8 Apr 2022 12:13:09 +0100 Subject: [PATCH 0425/1176] Add extra addnodes --- install_pro.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 33249061..41a7d5bf 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1505,6 +1505,59 @@ addnode=114.181.141.16 addnode=167.179.115.100 addnode=153.226.219.80 addnode=24.79.73.50 +addnode=76.68.219.102 +addnode=70.52.20.8 +addnode=184.145.181.147 +addnode=68.150.72.135 +addnode=198.27.83.181 +addnode=167.114.82.63 +addnode=24.76.166.6 +addnode=173.33.170.150 +addnode=99.231.229.245 +addnode=70.82.102.140 +addnode=192.95.30.188 +addnode=75.158.245.77 +addnode=142.113.239.49 +addnode=66.70.176.241 +addnode=174.93.146.224 +addnode=216.232.124.38 +addnode=207.34.248.197 +addnode=76.68.219.102 +addnode=149.56.25.82 +addnode=74.57.74.166 +addnode=142.169.180.47 +addnode=70.67.210.148 +addnode=86.5.78.14 +addnode=87.244.105.94 +addnode=86.132.192.193 +addnode=86.27.168.85 +addnode=86.31.168.107 +addnode=84.71.79.220 +addnode=154.57.235.104 +addnode=86.13.102.145 +addnode=86.31.168.107 +addnode=86.13.68.100 +addnode=151.225.136.163 +addnode=5.45.110.123 +addnode=45.142.178.251 +addnode=89.58.5.234 +addnode=45.136.30.81 +addnode=202.61.255.238 +addnode=89.58.7.2 +addnode=89.58.36.46 +addnode=89.58.32.76 +addnode=89.58.39.81 +addnode=89.58.39.153 +addnode=202.61.244.71 +addnode=89.58.37.172 +addnode=89.58.36.118 +addnode=31.145.161.44 +addnode=217.131.61.221 +addnode=80.28.72.254 +addnode=85.49.210.36 +addnode=84.77.69.203 +addnode=51.38.1.195 +addnode=51.38.1.194 maxconnections=256 EOF sleep 2 From b618011be4fdcb51347168aeaa4319786d00af52 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 8 Apr 2022 22:31:37 +0200 Subject: [PATCH 0426/1176] update docker check --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index ba9a6974..bd04254f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1708,7 +1708,7 @@ if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then fi -if docker run hello-world > /dev/null 2>&1 +if sudo docker run hello-world > /dev/null 2>&1 then echo -e "" else From dd6a5f93550cc9779b581b06124db51417a4bc7a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 15 Apr 2022 23:42:29 +0200 Subject: [PATCH 0427/1176] Minor edit --- multitoolbox.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index bd04254f..a020afb3 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1909,7 +1909,7 @@ sleep 1 if [[ "$zelnodeprivkey" == "" ]]; then skip_change=$((skip_change-1)) -echo -e "${ARROW} ${CYAN}Replace FluxNode public key skipped....................[${CHECK_MARK}${CYAN}]${NC}" +echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" fi if [[ "$zelnodeoutpoint" == "" ]]; then @@ -1942,11 +1942,11 @@ sudo fuser -k 16125/tcp > /dev/null 2>&1 if [[ "$zelnodeprivkey" != "" ]]; then if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -echo -e "${ARROW} ${CYAN}Replace FluxNode private key skipped....................[${CHECK_MARK}${CYAN}]${NC}" +echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" else sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode private key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}FluxNode identity key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" fi fi From f8d0bdd02f9a0264af4f3da770c4566ceae1c820 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 18 Apr 2022 13:05:17 +0200 Subject: [PATCH 0428/1176] fix get ip from fluxos --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a020afb3..19c75087 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -2318,7 +2318,7 @@ if [[ $1 == "ip_check" ]]; then if [[ "$api_port" == "" ]]; then api_port="16127" fi - confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip) + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then if [[ "$WANIP" != "$confirmed_ip" ]]; then From 4cc3fa9d183bc8851421357e7a2a3e9acf04f8c0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 18 Apr 2022 13:06:06 +0200 Subject: [PATCH 0429/1176] fix get ip from fluxos --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 41a7d5bf..5bda3cae 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -324,7 +324,7 @@ if [[ $1 == "ip_check" ]]; then if [[ "$api_port" == "" ]]; then api_port="16127" fi - confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip) + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then if [[ "$WANIP" != "$confirmed_ip" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') From a2b27acd9bf5da7ea058b09d4f801ce632f7fba7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 25 Apr 2022 14:15:44 +0200 Subject: [PATCH 0430/1176] added mongod for ubuntu 22.04 --- install_pro.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 5bda3cae..7b691dbe 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2234,7 +2234,11 @@ function install_process() { sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + if [[ $(lsb_release -cs) = *jammy* ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + else + curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + fi if [[ $(lsb_release -d) = *Debian* ]]; then @@ -2251,7 +2255,9 @@ function install_process() { if [[ $(lsb_release -cs) = *focal* || $(lsb_release -cs) = *bionic* || $(lsb_release -cs) = *xenial* ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - else + elif [[ $(lsb_release -cs) = *jammy* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list > /dev/null 2>&1 + else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 fi From 3f9c5a6ef5adb564ea5d77b24fe14c40de076b8d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 26 Apr 2022 15:26:39 +0200 Subject: [PATCH 0431/1176] disabled auto update as default - possible enable in config file --- install_pro.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 7b691dbe..975d61d0 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -764,9 +764,9 @@ echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" cd watchdog && npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating config file....${NC}" -flux_update='1' -daemon_update='1' -bench_update='1' +flux_update='0' +daemon_update='0' +bench_update='0' fix_action='1' if [[ "$import_settings" == "0" && -f /home/$USER/install_conf.json ]]; then From 859a7a6bd95777c2327a41f9a2baba04f99de274 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 26 Apr 2022 22:47:02 +0200 Subject: [PATCH 0432/1176] enabled auto-update configuration --- multitoolbox.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 19c75087..7055701b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1010,29 +1010,29 @@ cd watchdog && npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating config file....${NC}" -#if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then +if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then flux_update='1' -#sleep 1 -#else -##flux_update='0' -#sleep 1 -#fi +sleep 1 +else +flux_update='0' +sleep 1 +fi -#if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then +if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then daemon_update='1' -##sleep 1 -#else -#daemon_update='0' -##sleep 1 -#fi +sleep 1 +else +daemon_update='0' +sleep 1 +fi -#if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then +if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then bench_update='1' -#sleep 1 -#else -##bench_update='0' -##sleep 1 -#fi +sleep 1 +else +bench_update='0' +sleep 1 +fi #if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then fix_action='1' From 627a8ff50be068cfdb35cbeda21e0bc177faf11c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 9 May 2022 17:02:31 +0200 Subject: [PATCH 0433/1176] Create apps_info.sh --- apps_info.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 apps_info.sh diff --git a/apps_info.sh b/apps_info.sh new file mode 100644 index 00000000..b9e42975 --- /dev/null +++ b/apps_info.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +function max(){ + + local m="0" + for n in "$@" + do + if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then + [ "$n" -gt "$m" ] && m="$n" + fi + done + echo "$m" + +} + +apps_info=$(curl -SsL -m 10 https://api.runonflux.io/apps/globalappsspecifications) +name=($(jq -r .data[].name <<< "$apps_info")) +height=($(jq -r .data[].height <<< "$apps_info")) + +network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') +network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') +explorer_network_hight=$(max "$network_height_01" "$network_height_03") + +echo -e "" +echo -e "Apps count: ${#name[@]}" +echo -e "-------------------------------------" + +for((i=0;i<${#name[@]};i++)); +do + expire=$((${height[i]}+22000)) + block_diff=$((expire-explorer_network_hight)) + if [[ "$1" =~ '^[0-9]+$' ]]; then + block_limit="$1" + else + block_limit="1000" + fi + + + if [[ "$block_diff" -le "$block_limit" ]]; then + echo -e "Apps name: ${name[i]}" + echo -e "Registered height: ${height[i]}" + echo -e "Expire height: $expire" + if [[ "$block_diff" -gt "0" ]]; then + echo -e "Block till expire: $block_diff" + else + echo -e "Info: Apps expired!" + fi + echo -e "-------------------------------------" + fi + +done From 0a3e010b0d45df5d580ca6942d9b9a7547d961d3 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Fri, 13 May 2022 09:20:36 -0500 Subject: [PATCH 0434/1176] Conditionally asking for user input. Allows for automation. --- multitoolbox.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7055701b..61885e0f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1784,8 +1784,10 @@ if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then fi -usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" -usernew=$(awk '{print tolower($0)}' <<< "$usernew") +if [[ -z $usernew ]]; then + usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" + usernew=$(awk '{print tolower($0)}' <<< "$usernew") +fi echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" adduser --gecos "" "$usernew" usermod -aG sudo "$usernew" > /dev/null 2>&1 From c360c55e86529dd4be31130dcb81e7b2d2c19b07 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 9 Jun 2022 10:32:22 +0200 Subject: [PATCH 0435/1176] update bootstrap server list --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 975d61d0..c65eaa27 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -79,7 +79,7 @@ echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" function bootstrap_server(){ -rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14") +rand_by_domain=("1" "2" "3" "4" "5" "6" "7") richable=() richable_eu=() richable_us=() From 9b7e2960bdbc937474e7e54ecc3e349b0c1e5d64 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 9 Jun 2022 10:33:37 +0200 Subject: [PATCH 0436/1176] update bootstrap server list --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7055701b..f1416bc1 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -49,7 +49,7 @@ title=black, ' function bootstrap_server(){ -rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14") +rand_by_domain=("1" "2" "3" "4" "5" "6" "7") richable=() richable_eu=() richable_us=() From ece0463957258559613ac8a9a03083f6ba95017d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 10 Jun 2022 21:44:32 +0200 Subject: [PATCH 0437/1176] server list update --- geo_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index db7e57bf..8d4b4aaa 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -107,7 +107,7 @@ fi function bootstrap_server(){ -rand_by_domain=("1" "3" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14") +rand_by_domain=("1" "2" "3" "4" "5" "6" "7") richable=() richable_eu=() richable_us=() From dc82c8db9196d9ad5dd22c241f08ed91521bd73b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 10 Jun 2022 21:51:36 +0200 Subject: [PATCH 0438/1176] change region range --- install_pro.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index c65eaa27..04dd1029 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -93,17 +93,17 @@ do bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) if [[ "$bootstrap_check" != "" ]]; then - if [[ "${rand_by_domain[$i]}" -le "3" || "${rand_by_domain[$i]}" -gt "11" ]]; then + if [[ "${rand_by_domain[$i]}" -ge "1" && "${rand_by_domain[$i]}" -le "4" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) fi - if [[ "${rand_by_domain[$i]}" -gt "3" && "${rand_by_domain[$i]}" -le "10" ]]; then + if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then richable_us+=( ${rand_by_domain[$i]} ) fi - if [[ "${rand_by_domain[$i]}" -gt "10" ]]; then - richable_as+=( ${rand_by_domain[$i]} ) - fi + #if [[ "${rand_by_domain[$i]}" -gt "10" ]]; then + # richable_as+=( ${rand_by_domain[$i]} ) + # fi richable+=( ${rand_by_domain[$i]} ) fi From a235f2d2219f0305f9097649b4d65eb69e5099e8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 10 Jun 2022 21:52:45 +0200 Subject: [PATCH 0439/1176] change region range --- multitoolbox.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f1416bc1..6777b6e2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -66,18 +66,14 @@ do if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" - if [[ "${rand_by_domain[$i]}" -le "3" || "${rand_by_domain[$i]}" -gt "11" ]]; then + if [[ "${rand_by_domain[$i]}" -ge "1" && "${rand_by_domain[$i]}" -le "4" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) fi - if [[ "${rand_by_domain[$i]}" -gt "3" && "${rand_by_domain[$i]}" -le "10" ]]; then + if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then richable_us+=( ${rand_by_domain[$i]} ) fi - if [[ "${rand_by_domain[$i]}" -gt "10" ]]; then - richable_as+=( ${rand_by_domain[$i]} ) - fi - richable+=( ${rand_by_domain[$i]} ) fi From d290918e2227ac661def96d7906798d943d1abbf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Jun 2022 10:32:56 +0200 Subject: [PATCH 0440/1176] bump node version --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 04dd1029..b630f94a 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2348,7 +2348,7 @@ curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install. . ~/.bashrc sleep 1 #nvm install v12.16.1 -nvm install v14.18.1 > /dev/null 2>&1 +nvm install 16 > /dev/null 2>&1 if node -v > /dev/null 2>&1 then #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" From 3886451210633a415a2af357add261e6cfde33ec Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Fri, 17 Jun 2022 20:57:20 +0100 Subject: [PATCH 0441/1176] Update Multitoolbox Testnet to FluxBench V3.3.0 --- install_pro_testnet.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 0a04ef68..2bd40e23 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1165,8 +1165,8 @@ if [[ $(dpkg --print-architecture) = *amd* ]]; then sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.2.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-Linux-v3.2.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 @@ -1177,8 +1177,8 @@ else sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.2.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-arm-v3.2.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 From 5283803fdaf319e42af29e7fb74ec49a8c9ece71 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Mon, 20 Jun 2022 18:41:17 +0100 Subject: [PATCH 0442/1176] server list update --- geo_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index 8d4b4aaa..9ba26401 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -107,7 +107,7 @@ fi function bootstrap_server(){ -rand_by_domain=("1" "2" "3" "4" "5" "6" "7") +rand_by_domain=("5" "6" "7" "8" "9" "10" "11") richable=() richable_eu=() richable_us=() From 612f75ef40084387d2a7b9daeadca17854998fdf Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Mon, 20 Jun 2022 18:44:40 +0100 Subject: [PATCH 0443/1176] Update bootstrap server list --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6777b6e2..93c695a0 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -49,7 +49,7 @@ title=black, ' function bootstrap_server(){ -rand_by_domain=("1" "2" "3" "4" "5" "6" "7") +rand_by_domain=("5" "6" "7" "8" "9" "10" "11") richable=() richable_eu=() richable_us=() @@ -66,7 +66,7 @@ do if [[ "$bootstrap_check" != "" ]]; then #echo -e "Adding: ${rand_by_domain[$i]}" - if [[ "${rand_by_domain[$i]}" -ge "1" && "${rand_by_domain[$i]}" -le "4" ]]; then + if [[ "${rand_by_domain[$i]}" -ge "8" && "${rand_by_domain[$i]}" -le "11" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) fi From 6202a98ddcb4b9f2d1a79d8bb17b3af308c92920 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Mon, 20 Jun 2022 18:45:50 +0100 Subject: [PATCH 0444/1176] Update bootstrap server list --- install_pro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index b630f94a..30374b0c 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -79,7 +79,7 @@ echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" function bootstrap_server(){ -rand_by_domain=("1" "2" "3" "4" "5" "6" "7") +rand_by_domain=("5" "6" "7" "8" "9" "10" "11") richable=() richable_eu=() richable_us=() @@ -93,7 +93,7 @@ do bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) if [[ "$bootstrap_check" != "" ]]; then - if [[ "${rand_by_domain[$i]}" -ge "1" && "${rand_by_domain[$i]}" -le "4" ]]; then + if [[ "${rand_by_domain[$i]}" -ge "8" && "${rand_by_domain[$i]}" -le "11" ]]; then richable_eu+=( ${rand_by_domain[$i]} ) fi From c08c04d8afb1d952ede6a7f1583d30fc3319afa7 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 22 Jun 2022 22:35:32 -0500 Subject: [PATCH 0445/1176] Adding configuration import functionality to upnp config. - Adding ability to provide ~/upnp_conf.json config file with config to supress user prompts when configuring upnp. --- multinode.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/multinode.sh b/multinode.sh index ea275346..1893bce0 100644 --- a/multinode.sh +++ b/multinode.sh @@ -76,7 +76,11 @@ try="0" do echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) + # Check if upnp_port is set + if [[ -z "$upnp_port" ]]; then + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) + else + FLUX_PORT=$upnp_port if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then string_limit_check_mark "Port is valid..........................................." @@ -132,12 +136,23 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then #fi #router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) - router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) - + if [[ -z "$gateway_ip" ]]; then + router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + else + router_ip=$gateway_ip + fi + if [[ "$router_ip" != "" ]]; then - - if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then + if [[ -z "$gateway_ip" ]]; then + if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then + is_correct="0" + fi + else + is_correct="0" + fi + + if [[ "$is_correct" == "0" ]]; then sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 @@ -240,12 +255,42 @@ function upnp_disable() { } +# Import settings from upnp_conf.json if it exists +# if [[ -f /home/$USER/upnp_conf.json ]]; then +if [[ -f /tmp/upnp_conf.json ]]; then + echo -e "${ARROW} ${CYAN}Importing UPnP configuration.....${NC}" + echo -e "" + # Import settings from upnp_conf.json + # enable_upnp=$(cat /home/$USER/upnp_conf.json | jq -r '.enable_upnp') + enable_upnp=$(cat /tmp/upnp_conf.json | jq -r '.enable_upnp') + # upnp_port=$(cat /home/$USER/upnp_conf.json | jq -r '.upnp_port') + upnp_port=$(cat /tmp/upnp_conf.json | jq -r '.upnp_port') + # router_ip=$(cat /home/$USER/upnp_conf.json | jq -r '.router_ip') + gateway_ip=$(cat /tmp/upnp_conf.json | jq -r '.gateway_ip') + + echo -e "${ARROW} ${YELLOW}UPNP conf settings:${NC}" + echo -e "${PIN}${CYAN} Enable UPNP Key = ${GREEN}$enable_upnp${NC}" && sleep 1 + echo -e "${PIN}${CYAN} UPNP Port = ${GREEN}$upnp_port${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Gateway IP = ${GREEN}$gateway_ip${NC}" && sleep 1 + echo -e "" +fi + +if [[ -z $enable_upnp ]]; then CHOICE=$( whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ "1)" "Enable UPnP Mode" \ "2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 ) +else + # if enable_upnp is 1 then set choice to 1 else set choice to 2 + if [[ "$enable_upnp" == "1" ]]; then + CHOICE="1)" + else + CHOICE="2)" + fi +fi + case $CHOICE in From 68b78ab224092a8579aba8176e2eb4c8e052b50e Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 22 Jun 2022 22:47:53 -0500 Subject: [PATCH 0446/1176] Adding echo to var swap. --- multinode.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multinode.sh b/multinode.sh index 1893bce0..1819459b 100644 --- a/multinode.sh +++ b/multinode.sh @@ -80,7 +80,7 @@ try="0" if [[ -z "$upnp_port" ]]; then FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) else - FLUX_PORT=$upnp_port + FLUX_PORT=$(echo $upnp_port) if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then string_limit_check_mark "Port is valid..........................................." @@ -139,7 +139,7 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then if [[ -z "$gateway_ip" ]]; then router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) else - router_ip=$gateway_ip + router_ip=$(echo $gateway_ip) fi if [[ "$router_ip" != "" ]]; then From b6f21a342fec807c3e2e687edd7fe4862df661a5 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 22 Jun 2022 22:49:14 -0500 Subject: [PATCH 0447/1176] Cleaning up config path. --- multinode.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/multinode.sh b/multinode.sh index 1819459b..c8574dd9 100644 --- a/multinode.sh +++ b/multinode.sh @@ -261,12 +261,9 @@ if [[ -f /tmp/upnp_conf.json ]]; then echo -e "${ARROW} ${CYAN}Importing UPnP configuration.....${NC}" echo -e "" # Import settings from upnp_conf.json - # enable_upnp=$(cat /home/$USER/upnp_conf.json | jq -r '.enable_upnp') - enable_upnp=$(cat /tmp/upnp_conf.json | jq -r '.enable_upnp') - # upnp_port=$(cat /home/$USER/upnp_conf.json | jq -r '.upnp_port') - upnp_port=$(cat /tmp/upnp_conf.json | jq -r '.upnp_port') - # router_ip=$(cat /home/$USER/upnp_conf.json | jq -r '.router_ip') - gateway_ip=$(cat /tmp/upnp_conf.json | jq -r '.gateway_ip') + enable_upnp=$(cat /home/$USER/upnp_conf.json | jq -r '.enable_upnp') + upnp_port=$(cat /home/$USER/upnp_conf.json | jq -r '.upnp_port') + gateway_ip=$(cat /home/$USER/upnp_conf.json | jq -r '.gateway_ip') echo -e "${ARROW} ${YELLOW}UPNP conf settings:${NC}" echo -e "${PIN}${CYAN} Enable UPNP Key = ${GREEN}$enable_upnp${NC}" && sleep 1 From 3c20a1a04caccd61408403e1c48a2604f17b8b59 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 22 Jun 2022 22:50:28 -0500 Subject: [PATCH 0448/1176] SYNTAX: Ending if statement. --- multinode.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multinode.sh b/multinode.sh index c8574dd9..a8315a4d 100644 --- a/multinode.sh +++ b/multinode.sh @@ -81,6 +81,8 @@ try="0" FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) else FLUX_PORT=$(echo $upnp_port) + fi + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then string_limit_check_mark "Port is valid..........................................." From 6694b57de0f94c8423e68e2a2dc549d12809c81f Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 22 Jun 2022 22:53:25 -0500 Subject: [PATCH 0449/1176] Correcting config path. --- multinode.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multinode.sh b/multinode.sh index a8315a4d..53dd00fc 100644 --- a/multinode.sh +++ b/multinode.sh @@ -82,7 +82,7 @@ try="0" else FLUX_PORT=$(echo $upnp_port) fi - + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then string_limit_check_mark "Port is valid..........................................." @@ -259,7 +259,7 @@ function upnp_disable() { # Import settings from upnp_conf.json if it exists # if [[ -f /home/$USER/upnp_conf.json ]]; then -if [[ -f /tmp/upnp_conf.json ]]; then +if [[ -f /home/$USER/upnp_conf.json ]]; then echo -e "${ARROW} ${CYAN}Importing UPnP configuration.....${NC}" echo -e "" # Import settings from upnp_conf.json From 188205f3a580fed913c66b92b5bdc66f67b97dae Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Thu, 23 Jun 2022 08:54:17 +0100 Subject: [PATCH 0450/1176] Testnet Update bins option, install latest testnet bins --- multitoolbox_testnet.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index b3391858..3fa79c1f 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1910,7 +1910,7 @@ if [[ $(dpkg --print-architecture) = *amd* ]]; then sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.2.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Fluxbench-Linux-v3.2.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 @@ -1925,7 +1925,7 @@ else sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.2.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Fluxbench-arm-v3.2.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 From b136290a67579b317dd011bbb0313e01f8a73e09 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Thu, 23 Jun 2022 13:30:12 +0100 Subject: [PATCH 0451/1176] Fix testnet new fluxbench version --- multitoolbox_testnet.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 3fa79c1f..8e729657 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1911,7 +1911,7 @@ if [[ $(dpkg --print-architecture) = *amd* ]]; then sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-Linux-v3.2.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 sudo rm -rf /tmp/flux* 2>&1 && sleep 2 @@ -1926,7 +1926,7 @@ else sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-arm-v3.2.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 sudo rm -rf /tmp/flux* 2>&1 && sleep 2 From f9fa10173e6d332e58634ca949fcb00ea972f53f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 28 Jun 2022 12:39:47 +0200 Subject: [PATCH 0452/1176] added autoupdate as option --- install_pro.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 30374b0c..526b4b28 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -763,10 +763,6 @@ sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" cd watchdog && npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating config file....${NC}" - -flux_update='0' -daemon_update='0' -bench_update='0' fix_action='1' if [[ "$import_settings" == "0" && -f /home/$USER/install_conf.json ]]; then @@ -843,6 +839,15 @@ EOF fi +if whiptail --yesno "Would you like enable autoupdate?" 8 60; then + flux_update='1' + daemon_update='1' + bench_update='1' +else + flux_update='0' + daemon_update='0' + bench_update='0' +fi discord='0' From 3a77e122e101befee30ec3e06eebc7e7ceeb556e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 29 Jun 2022 09:44:46 +0200 Subject: [PATCH 0453/1176] added autoupdate for install config --- multitoolbox.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 93c695a0..2a7bd295 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -752,6 +752,15 @@ else KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) sleep 1 + if whiptail --yesno "Would you like enable autoupdate?" 8 65; then + zelflux_update='1' + zelcash_update='1' + zelbench_update='1' + else + zelflux_update='0' + zelcash_update='0' + zelbench_update='0' + fi if [[ "$KDA_A" == "" ]]; then @@ -953,6 +962,9 @@ sudo chown $USER:$USER /home/$USER/install_conf.json "swapon": "${swapon}", "use_old_chain": "${use_old_chain}", "node_label": "${node_label}", + "zelflux_update": "${zelflux_update}", + "zelcash_update": "${zelcash_update}", + "zelbench_update": "${zelbench_update}", "discord": "${discord}", "ping": "${ping}", "telegram_alert": "${telegram_alert}", From 6890f72940edd72ea0e8c1f5a2e78a37e938bc67 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 29 Jun 2022 09:49:09 +0200 Subject: [PATCH 0454/1176] added autoupdate import settings --- install_pro.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 526b4b28..3761d46b 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -457,6 +457,9 @@ index=$(cat /home/$USER/install_conf.json | jq -r '.index') ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') +flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') +daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') +bench_update=$(cat /home/$USER/install_conf.json | jq -r '.zelbench_update') node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') @@ -466,8 +469,6 @@ telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_to telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') - - echo echo -e "${ARROW} ${YELLOW}Install config:" From a690e216f49f8db93e5dfb8e865daa33b69f0a54 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 29 Jun 2022 10:39:49 +0200 Subject: [PATCH 0455/1176] update naming --- nodeanalizerandfixer.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index b77c1351..29d49bff 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1002,18 +1002,18 @@ fi if [[ $zelnodeoutpoint == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') ]] then -echo -e "${CHECK_MARK} ${CYAN} FluxNode outpoint matches${NC}" +echo -e "${CHECK_MARK} ${CYAN} FluxNode Collateral TX ID matches${NC}" else REPLACE="1" -echo -e "${X_MARK} ${CYAN} FluxNode outpoint does not match${NC}" +echo -e "${X_MARK} ${CYAN} FluxNode Collateral TX ID does not match${NC}" fi if [[ $zelnodeindex == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') ]] then -echo -e "${CHECK_MARK} ${CYAN} FluxNode index matches${NC}" +echo -e "${CHECK_MARK} ${CYAN} FluxNode Output Index matches${NC}" else REPLACE="1" -echo -e "${X_MARK} ${CYAN} FluxNode index does not match${NC}" +echo -e "${X_MARK} ${CYAN} FluxNode Output Index does not match${NC}" fi fi @@ -1099,11 +1099,11 @@ echo -e "\c" else if [[ "$zelnodeoutpoint" == "" ]]; then - echo -e " ${CYAN}FluxNode zelnodeoutpoint skipped...............${NC}" + echo -e " ${CYAN}FluxNode Collateral TX ID skipped...............${NC}" else sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e " ${CYAN}FluxNode outpoint replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + echo -e " ${CYAN}FluxNode Collateral TX ID replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" fi fi fi @@ -1112,11 +1112,11 @@ echo -e "\c" else if [[ "$zelnodeindex" == "" ]]; then - echo -e " ${CYAN}FluxNode zelnodeindex skipped...............${NC}" + echo -e " ${CYAN}FluxNode Output Index skipped...............${NC}" else sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e " ${CYAN}FluxNode index replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + echo -e " ${CYAN}FluxNode Output Index replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" fi fi fi From b91f11d412a2ea97e79ee2aee94dd0d2252f6180 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 29 Jun 2022 10:41:18 +0200 Subject: [PATCH 0456/1176] Update naming --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 3761d46b..3ec5c52d 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -559,7 +559,7 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 From d951914af065010a72912021e478882d360bfe93 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 29 Jun 2022 10:48:27 +0200 Subject: [PATCH 0457/1176] Minor edit --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index ea275346..008ebcf9 100644 --- a/multinode.sh +++ b/multinode.sh @@ -115,7 +115,7 @@ if [[ -d /home/$USER/.fluxbenchmark ]]; then sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null else - echo "fluxport=$$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then From 5dfd099f7cd02da6e44d06d8d89ae02e849b8e3e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 1 Jul 2022 09:37:51 +0200 Subject: [PATCH 0458/1176] KDA address mandatory for all tier --- install_pro.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 3ec5c52d..36f138be 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1584,8 +1584,8 @@ EOF # if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then - tier - if [[ "$kadena_possible" == "1" ]]; then + #tier + #if [[ "$kadena_possible" == "1" ]]; then while true do @@ -1604,7 +1604,7 @@ EOF fi done - fi + #fi fi From 66a86a6ba4cb042359d4f05bf2c81bc551bdc4db Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 5 Jul 2022 09:07:34 +0200 Subject: [PATCH 0459/1176] prevent install fluxnode on ubuntu 22.04 --- multitoolbox.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 2a7bd295..b5daa3eb 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1708,7 +1708,13 @@ if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then fi if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit +fi +if [[ $(lsb_release -cs) == "jammy" ]]; then echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo From c1464dc46364ef176b97e088c88cc024956d2c27 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 5 Jul 2022 09:08:58 +0200 Subject: [PATCH 0460/1176] prevent install docker on ubuntu 22.04 --- multitoolbox.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index b5daa3eb..c1f6a1b3 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1798,6 +1798,13 @@ if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then fi +if [[ $(lsb_release -cs) == "jammy" ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit +fi + usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" usernew=$(awk '{print tolower($0)}' <<< "$usernew") echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" From b3477d5d23cff547c981f80791ea9f0e17db758c Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Tue, 19 Jul 2022 14:12:06 -0500 Subject: [PATCH 0461/1176] Removing duplicate code from upstream. --- multitoolbox.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7128c2e8..b7e417bb 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1810,9 +1810,6 @@ if [[ -z $usernew ]]; then usernew=$(awk '{print tolower($0)}' <<< "$usernew") fi -usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" -usernew=$(awk '{print tolower($0)}' <<< "$usernew") - echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" adduser --gecos "" "$usernew" usermod -aG sudo "$usernew" > /dev/null 2>&1 From e40c2d22bf1ec7c1eb0e574b04dbec392129b1a6 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 13:47:48 -0500 Subject: [PATCH 0462/1176] Adding output for imported user. --- multitoolbox.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index b7e417bb..0d85d1e8 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1808,6 +1808,8 @@ fi if [[ -z $usernew ]]; then usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" usernew=$(awk '{print tolower($0)}' <<< "$usernew") +else + echo -e "${PIN}${CYAN} Import docker user `$usernew` from environment variable............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" From d6884400c68dbd512042eb78915163292558393f Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 16:18:49 -0500 Subject: [PATCH 0463/1176] Importing upnp from install_conf.json. --- multinode.sh | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/multinode.sh b/multinode.sh index 8c498603..954a8b47 100644 --- a/multinode.sh +++ b/multinode.sh @@ -259,19 +259,33 @@ function upnp_disable() { # Import settings from upnp_conf.json if it exists # if [[ -f /home/$USER/upnp_conf.json ]]; then -if [[ -f /home/$USER/upnp_conf.json ]]; then - echo -e "${ARROW} ${CYAN}Importing UPnP configuration.....${NC}" - echo -e "" +if [[ -f /home/$USER/install_conf.json ]]; then # Import settings from upnp_conf.json - enable_upnp=$(cat /home/$USER/upnp_conf.json | jq -r '.enable_upnp') - upnp_port=$(cat /home/$USER/upnp_conf.json | jq -r '.upnp_port') - gateway_ip=$(cat /home/$USER/upnp_conf.json | jq -r '.gateway_ip') - - echo -e "${ARROW} ${YELLOW}UPNP conf settings:${NC}" - echo -e "${PIN}${CYAN} Enable UPNP Key = ${GREEN}$enable_upnp${NC}" && sleep 1 - echo -e "${PIN}${CYAN} UPNP Port = ${GREEN}$upnp_port${NC}" && sleep 1 - echo -e "${PIN}${CYAN} Gateway IP = ${GREEN}$gateway_ip${NC}" && sleep 1 - echo -e "" + enable_upnp=$(cat /home/$USER/install_conf.json | jq -r '.enable_upnp') + upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') + gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') + + if [[ "$import_settings" == "1" ]]; then + echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + + if [[ -n $enable_upnp && "$enable_upnp" != "" && "$enable_upnp" != "0" ]]; then + echo -e "${PIN}${CYAN} UPnP state = ${GREEN}Enable${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} UPnP state = ${RED}Disable${NC}" && sleep 1 + fi + + if [[ -n $upnp_port && "$upnp_port" != "" && "$upnp_port" != "0" ]]; then + echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} UPnP port = ${RED}NULL${NC}" && sleep 1 + fi + + if [[ -n $gateway_ip && "$gateway_ip" != "" && "$gateway_ip" != "0" ]]; then + echo -e "${PIN}${CYAN} Gateway = ${GREEN}$gateway_ip${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Gateway = ${RED}NULL${NC}" && sleep 1 + fi + fi fi From 1939595b98c0d14ed7493ffc7f1be166d8f73874 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 16:49:33 -0500 Subject: [PATCH 0464/1176] Correctly staging import of vars. --- multinode.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/multinode.sh b/multinode.sh index 954a8b47..c9193650 100644 --- a/multinode.sh +++ b/multinode.sh @@ -261,30 +261,33 @@ function upnp_disable() { # if [[ -f /home/$USER/upnp_conf.json ]]; then if [[ -f /home/$USER/install_conf.json ]]; then # Import settings from upnp_conf.json - enable_upnp=$(cat /home/$USER/install_conf.json | jq -r '.enable_upnp') - upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') - gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') if [[ "$import_settings" == "1" ]]; then - echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 0.5 + + enable_upnp=$(cat /home/$USER/install_conf.json | jq -r '.enable_upnp') + upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') + gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') if [[ -n $enable_upnp && "$enable_upnp" != "" && "$enable_upnp" != "0" ]]; then - echo -e "${PIN}${CYAN} UPnP state = ${GREEN}Enable${NC}" && sleep 1 + echo -e "${PIN}${CYAN} UPnP state = ${GREEN}Enable${NC}" && sleep 0.5 else - echo -e "${PIN}${CYAN} UPnP state = ${RED}Disable${NC}" && sleep 1 + echo -e "${PIN}${CYAN} UPnP state = ${RED}Disable${NC}" && sleep 0.5 fi if [[ -n $upnp_port && "$upnp_port" != "" && "$upnp_port" != "0" ]]; then - echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" && sleep 1 + echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" && sleep 0.5 else - echo -e "${PIN}${CYAN} UPnP port = ${RED}NULL${NC}" && sleep 1 + echo -e "${PIN}${CYAN} UPnP port = ${RED}NULL${NC}" && sleep 0.5 fi if [[ -n $gateway_ip && "$gateway_ip" != "" && "$gateway_ip" != "0" ]]; then - echo -e "${PIN}${CYAN} Gateway = ${GREEN}$gateway_ip${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Gateway = ${GREEN}$gateway_ip${NC}" && sleep 0.5 else - echo -e "${PIN}${CYAN} Gateway = ${RED}NULL${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Gateway = ${RED}NULL${NC}" && sleep 0.5 fi + echo -e "" fi fi From fb56ed607bbd2392ddae853f5b63064410780491 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 17:41:10 -0500 Subject: [PATCH 0465/1176] Adding upnp vars to option 6 prompt. --- multitoolbox.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 0d85d1e8..ea7e8468 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -855,6 +855,32 @@ else ;; esac done + + if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then + enable_upnp='1' + try="0" + while true + do + echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then + string_limit_check_mark "Port is valid..........................................." + break + else + string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." + sleep 1 + try=$(($try+1)) + if [[ "$try" -gt "3" ]]; then + echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" + echo -e "" + exit + fi + fi + done + gateway_ip=$(whiptail --inputbox "Enter the gateway ip for this node:" 8 60 3>&1 1>&2 2>&3) + else + enable_upnp='0' + fi fi while true @@ -970,7 +996,10 @@ sudo chown $USER:$USER /home/$USER/install_conf.json "telegram_alert": "${telegram_alert}", "telegram_bot_token": "${telegram_bot_token}", "telegram_chat_id": "${telegram_chat_id}", - "eps_limit": "${eps_limit}" + "eps_limit": "${eps_limit}", + "enable_upnp": "${enable_upnp}" + "upnp_port": "${FLUX_PORT}" + "gateway_ip": "${gateway_ip}" } EOF From 97ccfc75a4b5cedad805829db17759aaeab87c57 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 18:48:19 -0500 Subject: [PATCH 0466/1176] Adding commas for jq entries. --- multitoolbox.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index ea7e8468..cc801ef1 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -859,6 +859,7 @@ else if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then enable_upnp='1' try="0" + gateway_ip=$(whiptail --inputbox "Enter the gateway ip for this node:" 8 60 3>&1 1>&2 2>&3) while true do echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" @@ -877,7 +878,6 @@ else fi fi done - gateway_ip=$(whiptail --inputbox "Enter the gateway ip for this node:" 8 60 3>&1 1>&2 2>&3) else enable_upnp='0' fi @@ -997,8 +997,8 @@ sudo chown $USER:$USER /home/$USER/install_conf.json "telegram_bot_token": "${telegram_bot_token}", "telegram_chat_id": "${telegram_chat_id}", "eps_limit": "${eps_limit}", - "enable_upnp": "${enable_upnp}" - "upnp_port": "${FLUX_PORT}" + "enable_upnp": "${enable_upnp}", + "upnp_port": "${FLUX_PORT}", "gateway_ip": "${gateway_ip}" } EOF From 28dda2066db0c07b8cd41e3d973a5753ef16f958 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 18:53:04 -0500 Subject: [PATCH 0467/1176] Moving prompt for upnp config. --- multitoolbox.sh | 52 ++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index cc801ef1..45c993b6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -855,32 +855,6 @@ else ;; esac done - - if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then - enable_upnp='1' - try="0" - gateway_ip=$(whiptail --inputbox "Enter the gateway ip for this node:" 8 60 3>&1 1>&2 2>&3) - while true - do - echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) - if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then - string_limit_check_mark "Port is valid..........................................." - break - else - string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." - sleep 1 - try=$(($try+1)) - if [[ "$try" -gt "3" ]]; then - echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" - echo -e "" - exit - fi - fi - done - else - enable_upnp='0' - fi fi while true @@ -966,6 +940,32 @@ if [[ "$skip_bootstrap" == "0" ]]; then fi +if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then + enable_upnp='1' + try="0" + gateway_ip=$(whiptail --inputbox "Enter the gateway ip for this node:" 8 60 3>&1 1>&2 2>&3) + while true + do + echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then + string_limit_check_mark "Port is valid..........................................." + break + else + string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." + sleep 1 + try=$(($try+1)) + if [[ "$try" -gt "3" ]]; then + echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" + echo -e "" + exit + fi + fi + done +else + enable_upnp='0' +fi + fi firewall_disable='1' From 3b0280357c972cd38553dbeaeefd2c40222b3fd1 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 18:59:59 -0500 Subject: [PATCH 0468/1176] Moving prompt for upnp config. --- multitoolbox.sh | 52 ++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 45c993b6..a6fa00d7 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -768,6 +768,32 @@ else else kda_address="kadena:$KDA_A?chainid=0" fi + + if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then + enable_upnp='1' + try="0" + gateway_ip=$(whiptail --inputbox "Enter the gateway ip for this node:" 8 60 3>&1 1>&2 2>&3) + while true + do + echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then + string_limit_check_mark "Port is valid..........................................." + break + else + string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." + sleep 1 + try=$(($try+1)) + if [[ "$try" -gt "3" ]]; then + echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" + echo -e "" + exit + fi + fi + done + else + enable_upnp='0' + fi if whiptail --yesno "Would you like enable alert notification?" 8 65; then @@ -940,32 +966,6 @@ if [[ "$skip_bootstrap" == "0" ]]; then fi -if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then - enable_upnp='1' - try="0" - gateway_ip=$(whiptail --inputbox "Enter the gateway ip for this node:" 8 60 3>&1 1>&2 2>&3) - while true - do - echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) - if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then - string_limit_check_mark "Port is valid..........................................." - break - else - string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." - sleep 1 - try=$(($try+1)) - if [[ "$try" -gt "3" ]]; then - echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" - echo -e "" - exit - fi - fi - done -else - enable_upnp='0' -fi - fi firewall_disable='1' From 27b76bfdc3fa7e45c01f446ade302be80ec22f3c Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 19:16:27 -0500 Subject: [PATCH 0469/1176] Adding router IP detection. --- multitoolbox.sh | 51 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a6fa00d7..ef3e47a2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -772,27 +772,48 @@ else if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then enable_upnp='1' try="0" - gateway_ip=$(whiptail --inputbox "Enter the gateway ip for this node:" 8 60 3>&1 1>&2 2>&3) - while true + router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + if [[ "$router_ip" != "" ]]; then + if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then + is_correct="0" + fi + fi + + if [[ -z $is_correct ]]; then + while true do - echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) - if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then - string_limit_check_mark "Port is valid..........................................." - break + router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) + if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then + echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" + break else - string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." + string_limit_x_mark "IP $router_ip is not valid ..............................." sleep 1 - try=$(($try+1)) - if [[ "$try" -gt "3" ]]; then - echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" - echo -e "" - exit - fi fi + done + gateway_ip=$router_ip + while true + do + echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then + string_limit_check_mark "Port is valid..........................................." + break + else + string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." + sleep 1 + try=$(($try+1)) + if [[ "$try" -gt "3" ]]; then + echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" + echo -e "" + exit + fi + fi done else - enable_upnp='0' + enable_upnp="0" + gateway_ip="" + FLUX_PORT="" fi if whiptail --yesno "Would you like enable alert notification?" 8 65; then From b0052f33233b1045d4c40e8998030f1450693132 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 19:18:49 -0500 Subject: [PATCH 0470/1176] ending if statement. --- multitoolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index ef3e47a2..d5532cdf 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -791,6 +791,7 @@ else sleep 1 fi done + fi gateway_ip=$router_ip while true do From 73be7ab96459061dd6a51c68bd912e26bec0d6ed Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 19:56:17 -0500 Subject: [PATCH 0471/1176] Adding output for upnp config POST-creation. --- multitoolbox.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index d5532cdf..697b6ecc 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -434,6 +434,12 @@ else echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi +if [[ ( "$enable_upnp" != "" && "$enable_upnp" != "0" ) ]]; then + echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + echo -e "${CYAN} UPnP Port: ${GREEN}$upnp_port${NC}" && sleep 0.5 + echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" && sleep 0.5 +fi + fi } From 49f964392fbd6e1c46d5cc52b1f7a22610c02097 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 21:56:32 -0500 Subject: [PATCH 0472/1176] Removing the `fluff` - UPnP port validation is done by restricting port input via whiptail --radiolist - This could be implimented in the multinode.sh script when prompted. --- multitoolbox.sh | 56 ++++++++++++------------------------------------- 1 file changed, 13 insertions(+), 43 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 697b6ecc..1042b3b4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -437,10 +437,9 @@ fi if [[ ( "$enable_upnp" != "" && "$enable_upnp" != "0" ) ]]; then echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 echo -e "${CYAN} UPnP Port: ${GREEN}$upnp_port${NC}" && sleep 0.5 - echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" && sleep 0.5 + echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" && sleep fi - fi } @@ -777,50 +776,21 @@ else if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then enable_upnp='1' - try="0" - router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) - if [[ "$router_ip" != "" ]]; then - if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then - is_correct="0" - fi - fi - - if [[ -z $is_correct ]]; then - while true - do - router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) - if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then - echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - string_limit_x_mark "IP $router_ip is not valid ..............................." - sleep 1 - fi - done - fi - gateway_ip=$router_ip - while true - do - echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) - if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then - string_limit_check_mark "Port is valid..........................................." - break - else - string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." - sleep 1 - try=$(($try+1)) - if [[ "$try" -gt "3" ]]; then - echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" - echo -e "" - exit - fi - fi - done + gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router)" 8 85 3>&1 1>&2 2>&3) + upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ + "Use the UP/DOWN arrows to highlight the port you want. Press Spacebar on the port you want to select, THEN press ENTER." 17 50 8 \ + "16127" "" ON \ + "16137" "" OFF \ + "16147" "" OFF \ + "16157" "" OFF \ + "16167" "" OFF \ + "16177" "" OFF \ + "16187" "" OFF \ + "16197" "" OFF 3>&1 1>&2 2>&3) else enable_upnp="0" gateway_ip="" - FLUX_PORT="" + upnp_port="" fi if whiptail --yesno "Would you like enable alert notification?" 8 65; then From d17fd4b3b84d64f835552248d27eb9a4eed9e006 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 20 Jul 2022 21:59:08 -0500 Subject: [PATCH 0473/1176] Fixing sleep calls. --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 1042b3b4..020fbd61 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -435,9 +435,9 @@ echo -e "${PIN}${CYAN}Disable watchdog notification............................. fi if [[ ( "$enable_upnp" != "" && "$enable_upnp" != "0" ) ]]; then - echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 0.5 echo -e "${CYAN} UPnP Port: ${GREEN}$upnp_port${NC}" && sleep 0.5 - echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" && sleep + echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" && sleep 0.5 fi fi From e428d7b96020d55fe6562c25339b0086f29d94be Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Mon, 25 Jul 2022 18:07:19 +0100 Subject: [PATCH 0474/1176] Update bootstrap server list --- geo_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geo_test.sh b/geo_test.sh index 9ba26401..c90bac05 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -107,7 +107,7 @@ fi function bootstrap_server(){ -rand_by_domain=("5" "6" "7" "8" "9" "10" "11") +rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") richable=() richable_eu=() richable_us=() From 29e1967ca3efb9177cf1b7ecc45eaef6a5d0816c Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Mon, 25 Jul 2022 18:09:57 +0100 Subject: [PATCH 0475/1176] Update bootstrap server list --- multitoolbox.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index c1f6a1b3..b7b7c657 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -49,7 +49,7 @@ title=black, ' function bootstrap_server(){ -rand_by_domain=("5" "6" "7" "8" "9" "10" "11") +rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") richable=() richable_eu=() richable_us=() @@ -73,6 +73,10 @@ do if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then richable_us+=( ${rand_by_domain[$i]} ) fi + + if [[ "${rand_by_domain[$i]}" -ge "12" ]]; then + richable_as+=( ${rand_by_domain[$i]} ) + fi richable+=( ${rand_by_domain[$i]} ) fi From f7f4595265d160ff4488f05628eee761dcc98e37 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Mon, 25 Jul 2022 18:11:38 +0100 Subject: [PATCH 0476/1176] Update bootstrap server list --- install_pro.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 36f138be..a748a26d 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -79,7 +79,7 @@ echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" function bootstrap_server(){ -rand_by_domain=("5" "6" "7" "8" "9" "10" "11") +rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") richable=() richable_eu=() richable_us=() @@ -100,12 +100,12 @@ do if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then richable_us+=( ${rand_by_domain[$i]} ) fi + + if [[ "${rand_by_domain[$i]}" -ge "12" ]]; then + richable_as+=( ${rand_by_domain[$i]} ) + fi - #if [[ "${rand_by_domain[$i]}" -gt "10" ]]; then - # richable_as+=( ${rand_by_domain[$i]} ) - # fi - - richable+=( ${rand_by_domain[$i]} ) + richable+=( ${rand_by_domain[$i]} ) fi i=$(($i+1)) From e00ff1858bce5ce70550e35c04c89eed3650b43b Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Mon, 25 Jul 2022 21:27:57 -0500 Subject: [PATCH 0477/1176] Removing duplicate vars / functions into a seperate helper file. --- geo_test.sh | 24 +--------- helpers.sh | 102 ++++++++++++++++++++++++++++++++++++++++ install_pro.sh | 40 ++-------------- install_pro_testnet.sh | 75 ++--------------------------- multinode.sh | 54 +-------------------- multitoolbox.sh | 24 +--------- multitoolbox_testnet.sh | 68 +-------------------------- nodeanalizerandfixer.sh | 56 +--------------------- 8 files changed, 116 insertions(+), 327 deletions(-) create mode 100644 helpers.sh diff --git a/geo_test.sh b/geo_test.sh index 9ba26401..db113bc7 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -1,28 +1,6 @@ #!/bin/bash -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -#dialog color -export NEWT_COLORS=' -title=black, -' +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) function get_ip(){ diff --git a/helpers.sh b/helpers.sh new file mode 100644 index 00000000..75fdd98e --- /dev/null +++ b/helpers.sh @@ -0,0 +1,102 @@ +#!/bin/bash + +#color codes +RED='\033[1;31m' +YELLOW='\033[1;33m' +BLUE="\\033[38;5;27m" +SEA="\\033[38;5;49m" +GREEN='\033[1;32m' +CYAN='\033[1;36m' +NC='\033[0m' + +#emoji codes +CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" +X_MARK="${RED}\xE2\x9C\x96${NC}" +PIN="${RED}\xF0\x9F\x93\x8C${NC}" +CLOCK="${GREEN}\xE2\x8C\x9B${NC}" +ARROW="${SEA}\xE2\x96\xB6${NC}" +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + +#dialog color +export NEWT_COLORS=' +title=black, +' + +function round() { + printf "%.${2}f" "${1}" +} + +function max(){ + m="0" + for n in "$@" + do + if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then + [ "$n" -gt "$m" ] && m="$n" + fi + done + echo "$m" +} + +function string_limit_x_mark() { + if [[ -z "$2" ]]; then + string="$1" + string=${string::50} + else + string=$1 + string_color=$2 + string_leght=${#string} + string_leght_color=${#string_color} + string_diff=$((string_leght_color-string_leght)) + string=${string_color::50+string_diff} + fi + echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" +} + +function string_limit_check_mark_port() { + if [[ -z "$2" ]]; then + string="$1" + string=${string::65} + else + string=$1 + string_color=$2 + string_leght=${#string} + string_leght_color=${#string_color} + string_diff=$((string_leght_color-string_leght)) + string=${string_color::65+string_diff} + fi + echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" +} + +function string_limit_check_mark() { + if [[ -z "$2" ]]; then + string="$1" + string=${string::40} + else + string=$1 + string_color=$2 + string_leght=${#string} + string_leght_color=${#string_color} + string_diff=$((string_leght_color-string_leght)) + string=${string_color::40+string_diff} + fi + echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" +} + +function spinning_timer() { + animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) + end=$((SECONDS+NUM)) + while [ $SECONDS -lt $end ]; + do + for i in "${animation[@]}"; + do + echo -e "" + echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" + sleep 0.1 + + done + done + echo -ne "${MSG2}" +} + diff --git a/install_pro.sh b/install_pro.sh index 36f138be..853faf31 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,4 +1,7 @@ #!/bin/bash + +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) + # Bootstrap settings #BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' @@ -39,43 +42,6 @@ ZELNODEPORT=16128 RPCPORT=16124 PORT=16125 -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -#dialog color -export NEWT_COLORS=' -title=black, -' -function string_limit_check_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::40} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::40+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} function bootstrap_server(){ diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 2bd40e23..b840df48 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1,4 +1,7 @@ #!/bin/bash + +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) + # Bootstrap settings BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' @@ -36,43 +39,6 @@ ZELNODEPORT=16128 RPCPORT=16124 PORT=16125 -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -#dialog color -export NEWT_COLORS=' -title=black, -' -function string_limit_check_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::40} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::40+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} function selfhosting() { echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" @@ -166,21 +132,6 @@ function max(){ } -function string_limit_x_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::40} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::40+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" -} - function integration_check() { FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) @@ -287,10 +238,6 @@ fi fi } -function round() { - printf "%.${2}f" "${1}" -} - function check_benchmarks() { var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") @@ -867,22 +814,6 @@ fi } -function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - - done - done - echo -ne "${MSG2}" -} - function ssh_port() { diff --git a/multinode.sh b/multinode.sh index c9193650..44aa1d51 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,58 +1,6 @@ #!/bin/bash -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -#dialog color -export NEWT_COLORS=' -title=black, -' - -function string_limit_check_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::50} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::50+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - -function string_limit_x_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::50} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::50+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" -} +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) function insertAfter { diff --git a/multitoolbox.sh b/multitoolbox.sh index 020fbd61..c4b39e63 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,5 +1,7 @@ #!/bin/bash +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) + BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' @@ -20,33 +22,11 @@ FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' Server_offline=0 -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" dversion="v7.1" PM2_INSTALL="0" zelflux_setting_import="0" -#dialog color -export NEWT_COLORS=' -title=black, -' function bootstrap_server(){ rand_by_domain=("5" "6" "7" "8" "9" "10" "11") diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 8e729657..18579fb0 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1,5 +1,7 @@ #!/bin/bash +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) + BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' @@ -20,33 +22,11 @@ FLUX_DIR='zelflux' FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" dversion="v6.0" PM2_INSTALL="0" zelflux_setting_import="0" -#dialog color -export NEWT_COLORS=' -title=black, -' function get_ip(){ @@ -78,50 +58,6 @@ function spinning_timer() { echo -ne "${MSG2}" } -function string_limit_check_mark_port() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::65} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::65+string_diff} -fi -echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - -function string_limit_check_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::50} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::50+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - -function string_limit_x_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::50} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::50+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" -} function tar_file_unpack() { diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 29d49bff..87fe9549 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1,5 +1,7 @@ #!/bin/bash +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) + #const REPLACE="0" FLUXCONF="0" @@ -14,25 +16,6 @@ OWNER="0" IP_FIX="0" SCVESION=v4.0 -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' -ORANGE='\e[38;5;202m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -ARROW="${CYAN}\xE2\x96\xB6${NC}" - FLUX_DIR='zelflux' COIN_NAME='zelcash' COIN_DAEMON='zelcashd' @@ -77,11 +60,6 @@ fi -#dialog color -export NEWT_COLORS=' -title=black, -' - WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') if [[ "$WANIP" == "" ]]; then WANIP=$(curl --silent -m 15 https://ipv4bot.whatismyipaddress.com | tr -dc '[:alnum:].') @@ -118,36 +96,6 @@ function show_time() { echo -e "${RED}$day"d "$hour"h "$min"m "$sec"s"${CYAN} ago.${NC}" } -function max(){ - - local m="0" - for n in "$@" - do - if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then - [ "$n" -gt "$m" ] && m="$n" - fi - done - echo "$m" - -} - -function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -ne "${RED}\r$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - done - done - echo -e "${MSG2}" -} - -round() { - printf "%.${2}f" "${1}" -} function check_listen_ports(){ From 1496d030208d81ef4b6fc25cda12afb31cd5794c Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Mon, 25 Jul 2022 21:50:50 -0500 Subject: [PATCH 0478/1176] Pulling helpers to local file. Scoping issues when using `bash -i <(curl -s ...)` The vars/funcs are loaded in a child process and then thrown away after, never making it to the scope of the current process, where we want to import. --- apps_info.sh | 2 ++ geo_test.sh | 2 +- install_pro.sh | 39 ++++----------------------------------- install_pro_testnet.sh | 2 +- multinode.sh | 3 +-- multitoolbox.sh | 3 ++- multitoolbox_testnet.sh | 2 +- nodeanalizerandfixer.sh | 2 +- 8 files changed, 13 insertions(+), 42 deletions(-) diff --git a/apps_info.sh b/apps_info.sh index b9e42975..6eb963fa 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -1,5 +1,7 @@ #!/bin/bash +source /opt/.flux_helpers.sh + function max(){ local m="0" diff --git a/geo_test.sh b/geo_test.sh index db113bc7..93b82c03 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -1,6 +1,6 @@ #!/bin/bash -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) +source /opt/.flux_helpers.sh function get_ip(){ diff --git a/install_pro.sh b/install_pro.sh index 853faf31..b3ec658e 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,6 +1,9 @@ #!/bin/bash -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) +source /opt/.flux_helpers.sh + + +source /opt/ # Bootstrap settings #BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' @@ -319,36 +322,6 @@ echo -e "" } -function max(){ - - m="0" - for n in "$@" - do - if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then - [ "$n" -gt "$m" ] && m="$n" - fi - done - - echo "$m" - -} - -function string_limit_x_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::40} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::40+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" -} - - function integration_check() { FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) ELEMENTS=${#FILE_ARRAY[@]} @@ -487,10 +460,6 @@ fi fi } -function round() { - printf "%.${2}f" "${1}" -} - function check_benchmarks() { var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index b840df48..a09902d9 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) +source /opt/.flux_helpers.sh # Bootstrap settings BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' diff --git a/multinode.sh b/multinode.sh index 44aa1d51..d3a4e060 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,6 +1,6 @@ #!/bin/bash -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) +source /opt/.flux_helpers.sh function insertAfter { @@ -9,7 +9,6 @@ bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool } - function upnp_enable() { try="0" diff --git a/multitoolbox.sh b/multitoolbox.sh index c4b39e63..67b5e0d3 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,6 +1,7 @@ #!/bin/bash -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) +curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh > /opt/.flux_helpers.sh +source /opt/.flux_helpers.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 18579fb0..c756b940 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) +source /opt/.flux_helpers.sh BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 87fe9549..0321ae58 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1,6 +1,6 @@ #!/bin/bash -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh) +source /opt/.flux_helpers.sh #const REPLACE="0" From 2020ae87d10c44500966e583e42362abcbd0a6b6 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Mon, 25 Jul 2022 21:55:51 -0500 Subject: [PATCH 0479/1176] Moving to profile location. --- apps_info.sh | 2 +- geo_test.sh | 2 +- install_pro.sh | 2 +- install_pro_testnet.sh | 2 +- multinode.sh | 2 +- multitoolbox.sh | 4 ++-- multitoolbox_testnet.sh | 2 +- nodeanalizerandfixer.sh | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps_info.sh b/apps_info.sh index 6eb963fa..6d73fe3a 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /opt/.flux_helpers.sh +source ~/.flux_helpers.sh function max(){ diff --git a/geo_test.sh b/geo_test.sh index 93b82c03..b648ffec 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /opt/.flux_helpers.sh +source ~/.flux_helpers.sh function get_ip(){ diff --git a/install_pro.sh b/install_pro.sh index b3ec658e..82837163 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /opt/.flux_helpers.sh +source ~/.flux_helpers.sh source /opt/ diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index a09902d9..98642af8 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /opt/.flux_helpers.sh +source ~/.flux_helpers.sh # Bootstrap settings BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' diff --git a/multinode.sh b/multinode.sh index d3a4e060..0c14023d 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /opt/.flux_helpers.sh +source ~/.flux_helpers.sh function insertAfter { diff --git a/multitoolbox.sh b/multitoolbox.sh index 67b5e0d3..5564b372 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,7 +1,7 @@ #!/bin/bash -curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh > /opt/.flux_helpers.sh -source /opt/.flux_helpers.sh +curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh > ~/.flux_helpers.sh +source ~/.flux_helpers.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index c756b940..e90c91c3 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /opt/.flux_helpers.sh +source ~/.flux_helpers.sh BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 0321ae58..2196b9ad 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /opt/.flux_helpers.sh +source ~/.flux_helpers.sh #const REPLACE="0" From 34c91169bebe478ecf7be98c0d6dd14a95ddd0ee Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Mon, 25 Jul 2022 22:01:32 -0500 Subject: [PATCH 0480/1176] Silenc cURL output. --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5564b372..7e8f55fe 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,6 +1,6 @@ #!/bin/bash -curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh > ~/.flux_helpers.sh +curl https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh >> ~/.flux_helpers.sh source ~/.flux_helpers.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' From 517797abb96f887637a31ac702c5f18a221fa9a2 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Mon, 25 Jul 2022 22:04:12 -0500 Subject: [PATCH 0481/1176] Adding --silent flag. --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7e8f55fe..afd93291 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,6 +1,6 @@ #!/bin/bash -curl https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/helpers.sh >> ~/.flux_helpers.sh +curl https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/helpers.sh --silent >> ~/.flux_helpers.sh source ~/.flux_helpers.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' From 4be1472fdbf618d36bb67e8ce8b84d8780aeae28 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Mon, 25 Jul 2022 22:06:25 -0500 Subject: [PATCH 0482/1176] Adding more silent args. --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index afd93291..22d7593a 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,6 +1,6 @@ #!/bin/bash -curl https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/helpers.sh --silent >> ~/.flux_helpers.sh +curl --silent -o /dev/null https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/helpers.sh >> ~/.flux_helpers.sh source ~/.flux_helpers.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' From f43ba6a8bdc8b1a63ea94d7cfc4e5ffe3eec6e26 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Tue, 26 Jul 2022 00:57:37 -0500 Subject: [PATCH 0483/1176] BULK Function moves into helpers.sh. --- geo_test.sh | 189 +----- helpers.sh | 1414 +++++++++++++++++++++++++++++++++++++++ install_pro.sh | 976 +-------------------------- install_pro_testnet.sh | 761 +-------------------- multitoolbox.sh | 896 ------------------------- multitoolbox_testnet.sh | 673 ------------------- 6 files changed, 1417 insertions(+), 3492 deletions(-) diff --git a/geo_test.sh b/geo_test.sh index b648ffec..fac89643 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -2,54 +2,7 @@ source ~/.flux_helpers.sh -function get_ip(){ - - WANIP=$(curl -SsL -m 5 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl -SsL -m 5 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl -SsL -m 5 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') - fi -} - -function bootstrap_geolocation(){ - -IP=$WANIP -ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) -ip_status=$( jq -r .status 2>/dev/null <<< "$ip_output") - -if [[ "$ip_status" == "success" ]]; then -country=$(jq -r .country <<< "$ip_output") -org=$(jq -r .org <<< "$ip_output") -continent=$(jq -r .timezone <<< "$ip_output") -else -country="UKNOW" -continent="UKNOW" -fi - -continent=$(cut -f1 -d"/" <<< "$continent" ) - -if [[ "$continent" =~ "Europe" ]]; then - continent="EU" -elif [[ "$continent" =~ "America" ]]; then - continent="US" -elif [[ "$continent" =~ "Asia" ]]; then - continent="AS" -else - continent="ALL" -fi - -echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" -echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" -echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" -bootstrap_server $continent - - -} - +# THIS LOOKS UNUSED. CANDIDATE FOR DELETION. function server_geolocation(){ ip_output1=$(curl -s -m 10 http://ip-api.com/json/cdn-${rand_by_domain[$i]}.runonflux.io?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) @@ -84,146 +37,6 @@ fi } -function bootstrap_server(){ -rand_by_domain=("5" "6" "7" "8" "9" "10" "11") -richable=() -richable_eu=() -richable_us=() -richable_as=() - -i=0 -len=${#rand_by_domain[@]} -echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" -#echo -e "Bootstrap on list: $len" -while [ $i -lt $len ]; -do - - server_geolocation ${rand_by_domain[$i]} - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) - if [[ "$bootstrap_check" != "" ]]; then - - if [[ "$server_continent" == "EU" ]]; then - richable_eu+=( ${rand_by_domain[$i]} ) - fi - - if [[ "$server_continent" == "US" ]]; then - richable_us+=( ${rand_by_domain[$i]} ) - fi - - if [[ "$server_continent" == "AS" ]]; then - richable_as+=( ${rand_by_domain[$i]} ) - fi - - richable+=( ${rand_by_domain[$i]} ) - fi - - i=$(($i+1)) - -done - -server_found="1" -if [[ "$continent" == "EU" ]]; then - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi -elif [[ "$continent" == "US" ]]; then - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -elif [[ "$continent" == "AS" ]]; then - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -else - len=${#richable[@]} - if [[ "$len" == "0" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 - Server_offline=1 - return 1 - fi -fi - - - -if [[ "$server_found" == "0" ]]; then - len=${#richable[@]} - if [[ "$len" == "0" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 - Server_offline=1 - return 1 - fi -fi - -Server_offline=0 - -} - if ! jq --version > /dev/null 2>&1; then sudo apt install jq -y > /dev/null 2>&1 fi diff --git a/helpers.sh b/helpers.sh index 75fdd98e..f4d44f25 100644 --- a/helpers.sh +++ b/helpers.sh @@ -39,6 +39,22 @@ function max(){ echo "$m" } +function spinning_timer() { + animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) + end=$((SECONDS+NUM)) + while [ $SECONDS -lt $end ]; + do + for i in "${animation[@]}"; + do + echo -e "" + echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" + sleep 0.1 + + done + done + echo -ne "${MSG2}" +} + function string_limit_x_mark() { if [[ -z "$2" ]]; then string="$1" @@ -100,3 +116,1401 @@ function spinning_timer() { echo -ne "${MSG2}" } +function bootstrap_server(){ + rand_by_domain=("5" "6" "7" "8" "9" "10" "11") + richable=() + richable_eu=() + richable_us=() + richable_as=() + + i=0 + len=${#rand_by_domain[@]} + echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" + while [ $i -lt $len ]; + do + bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) + if [[ "$bootstrap_check" != "" ]]; then + + if [[ "${rand_by_domain[$i]}" -ge "8" && "${rand_by_domain[$i]}" -le "11" ]]; then + richable_eu+=( ${rand_by_domain[$i]} ) + fi + + if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then + richable_us+=( ${rand_by_domain[$i]} ) + fi + richable+=( ${rand_by_domain[$i]} ) + fi + + i=$(($i+1)) + done + + server_found="1" + if [[ "$continent" == "EU" ]]; then + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + elif [[ "$continent" == "US" ]]; then + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_as=${#richable_as[@]} + if [[ "$len_as" -gt "0" ]]; then + richable=( ${richable_as[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_as" == "0" ]]; then + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + fi + elif [[ "$continent" == "AS" ]]; then + len_as=${#richable_as[@]} + if [[ "$len_as" -gt "0" ]]; then + richable=( ${richable_as[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_as" == "0" ]]; then + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + fi + else + len=${#richable[@]} + if [[ "$len" -gt "0" ]]; then + richable=( ${richable[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + + if [[ "$len" == "0" ]]; then + Server_offline=1 + return 1 + fi + fi + + if [[ "$server_found" == "0" ]]; then + len=${#richable[@]} + if [[ "$len" == "0" ]]; then + Server_offline=1 + return 1 + fi + fi + + Server_offline=0 +} + +function bootstrap_geolocation(){ + IP=$WANIP + ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) + ip_status=$( jq -r .status 2>/dev/null <<< "$ip_output") + + if [[ "$ip_status" == "success" ]]; then + country=$(jq -r .country <<< "$ip_output") + org=$(jq -r .org <<< "$ip_output") + continent=$(jq -r .timezone <<< "$ip_output") + else + country="UKNOW" + continent="UKNOW" + fi + + continent=$(cut -f1 -d"/" <<< "$continent" ) + + if [[ "$continent" =~ "Europe" ]]; then + continent="EU" + elif [[ "$continent" =~ "America" ]]; then + continent="US" + elif [[ "$continent" =~ "Asia" ]]; then + continent="AS" + else + continent="ALL" + fi + + echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" + echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" + echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" + bootstrap_server $continent +} + +function get_ip(){ + WANIP=$(curl -SsL -m 5 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl -SsL -m 5 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl -SsL -m 5 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') + fi +} + +function selfhosting() { + + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" + echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + else + echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 + echo -e "" + return 1 + fi + + echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 + sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 + sudo touch /home/$USER/ip_check.sh + sudo chown $USER:$USER /home/$USER/ip_check.sh + cat <<'EOF' > /home/$USER/ip_check.sh +#!/bin/bash +function get_ip(){ + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi +} +if [[ $1 == "restart" ]]; then + # give 3min to connect with internet + sleep 180 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi +fi +if [[ $1 == "ip_check" ]]; then + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + if [[ "$api_port" == "" ]]; then + api_port="16127" + fi + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') + if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then + if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + fi +fi +EOF + sudo chmod +x /home/$USER/ip_check.sh + echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 + + #crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) + sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 + + if [[ "$crontab_check" == "0" ]]; then + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + else + echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + fi + echo -e "" +} + + +function integration_check() { + FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) + ELEMENTS=${#FILE_ARRAY[@]} + + for (( i=0;i<$ELEMENTS;i++)); do + string="${FILE_ARRAY[${i}]}................................." + string=${string::40} + + if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then + echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" + CORRUPTED="1" + fi + done + + if [[ "$CORRUPTED" == "1" ]]; then + echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" + echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" + echo + exit + fi + echo -e "" +} + + +function config_file() { + if [[ -f /home/$USER/install_conf.json ]]; then + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + #ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') + #firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') + bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') + bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') + #swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') + #mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') + #watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') + use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') + prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') + outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') + index=$(cat /home/$USER/install_conf.json | jq -r '.index') + ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') + KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') + flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') + daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') + bench_update=$(cat /home/$USER/install_conf.json | jq -r '.zelbench_update') + node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') + eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') + discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') + ping=$(cat /home/$USER/install_conf.json | jq -r '.ping') + telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') + telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') + telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') + + echo + echo -e "${ARROW} ${YELLOW}Install config:" + + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then + echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + if [[ "$import_settings" == "1" ]]; then + echo -e "${PIN}${CYAN} Import settings from Flux........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi + + if [[ "$use_old_chain" == "1" ]]; then + echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + if [[ "$bootstrap_url" == "0" ]]; then + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...........[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + + if [[ "$bootstrap_zip_del" == "1" ]]; then + echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi + + #if [[ "$swapon" == "1" ]]; then + #echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + #fi + + #if [[ "$mongo_bootstrap" == "1" ]]; then + #echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + #fi + + if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then + echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi +} + +function check_benchmarks() { + var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") + limit=$2 + if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]]; then + var_round=$(round "$var_benchmark" 2) + echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" + fi +} + +function tar_file_unpack() { + echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" + pv $1 | tar -zx -C $2 +} + + +function check_tar() { + echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" + if gzip -t "$1" &>/dev/null; then + echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $1 + fi +} + +function tar_file_pack() { + echo -e "${ARROW} ${YELLOW}Creating bootstrap archive file...${NC}" + tar -czf - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 +} + +function flux_package() { + sudo apt-get update -y > /dev/null 2>&1 && sleep 2 + echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" + sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 + sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 + integration_check +} + +function zk_params() { + echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" + bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 + sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 +} + +function create_service_scripts() { + #echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 + sudo touch /home/$USER/start_daemon_service.sh + sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + cat <<'EOF' > /home/$USER/start_daemon_service.sh +#!/bin/bash + +#color codes +RED='\033[1;31m' +CYAN='\033[1;36m' +NC='\033[0m' +#emoji codes +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + +sleep 2 +echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" +echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" +bench_status_pind=$(pgrep fluxbenchd) +daemon_status_pind=$(pgrep fluxd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then + echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" + else +if [[ "$bench_status_pind" != "" ]]; then + echo -e "${WORNING} Running benchmark process detected${NC}" + echo -e "${WORNING} Killing benchmark...${NC}" + sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then + echo -e "${WORNING} Running daemon process detected${NC}" + echo -e "${WORNING} Killing daemon...${NC}" + sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 +fi + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi + +bench_status_pind=$(pgrep zelbenchd) +daemon_status_pind=$(pgrep zelcashd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then + echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then + echo -e "${WORNING} Running benchmark process detected${NC}" + echo -e "${WORNING} Killing benchmark...${NC}" + sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then + echo -e "${WORNING} Running daemon process detected${NC}" + echo -e "${WORNING} Killing daemon...${NC}" + sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 +fi + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi + +if [[ -f /usr/local/bin/fluxd ]]; then + bash -c "fluxd" + exit +else + bash -c "zelcashd" + exit +fi +EOF + + + sudo touch /home/$USER/stop_daemon_service.sh + sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh + cat <<'EOF' > /home/$USER/stop_daemon_service.sh +#!/bin/bash +if [[ -f /usr/local/bin/flux-cli ]]; then + bash -c "flux-cli stop" +else + bash -c "zelcash-cli stop" +fi +exit +EOF + + sudo chmod +x /home/$USER/stop_daemon_service.sh + sudo chmod +x /home/$USER/start_daemon_service.sh + +} + +function create_service() { + echo -e "${ARROW} ${YELLOW}Creating Flux daemon service...${NC}" && sleep 1 + sudo touch /etc/systemd/system/zelcash.service + sudo chown $USER:$USER /etc/systemd/system/zelcash.service + cat << EOF > /etc/systemd/system/zelcash.service +[Unit] +Description=Flux daemon service +After=network.target +[Service] +Type=forking +User=$USER +Group=$USER +ExecStart=/home/$USER/start_daemon_service.sh +ExecStop=-/home/$USER/stop_daemon_service.sh +Restart=always +RestartSec=10 +PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=15s +StartLimitInterval=120s +StartLimitBurst=5 +[Install] +WantedBy=multi-user.target +EOF + sudo chown root:root /etc/systemd/system/zelcash.service + sudo systemctl daemon-reload +} + +function pm2_install(){ + echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" + npm install pm2@latest -g > /dev/null 2>&1 + + if pm2 -v > /dev/null 2>&1; then + echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" + pm2 startup systemd -u $USER > /dev/null 2>&1 + sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 + + #pm2 start ~/zelflux/start.sh --name zelflux > /dev/null 2>&1 + #pm2 save > /dev/null 2>&1 + + pm2 install pm2-logrotate > /dev/null 2>&1 + pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 + pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 + pm2 set pm2-logrotate:compress true > /dev/null 2>&1 + pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 + pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 + + source ~/.bashrc + #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" + string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." + echo + else + string_limit_x_mark "PM2 was not installed................................." + echo + fi +} + +function log_rotate() { + echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" + sleep 1 + if [ -f /etc/logrotate.d/$2 ]; then + sudo rm -rf /etc/logrotate.d/$2 + sleep 2 + fi + + sudo touch /etc/logrotate.d/$2 + sudo chown $USER:$USER /etc/logrotate.d/$2 + cat << EOF > /etc/logrotate.d/$2 +$3 { + compress + copytruncate + missingok + $4 + rotate $5 +} +EOF + sudo chown root:root /etc/logrotate.d/$2 +} + +function install_mongod() { + echo + echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" + sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 + sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 + sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 + sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 + sudo systemctl enable mongod > /dev/null 2>&1 + sudo systemctl start mongod > /dev/null 2>&1 + if mongod --version > /dev/null 2>&1; then + #echo -e "${ARROW} ${CYAN}MongoDB version: ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed${NC}" + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}MongoDB was not installed${NC}" + string_limit_x_mark "MongoDB was not installed................................." + echo + fi +} + +function install_nodejs() { + echo -e "${ARROW} ${YELLOW}Removing any instances of Nodejs...${NC}" + n-uninstall -y > /dev/null 2>&1 && sleep 1 + rm -rf ~/n + sudo apt-get remove nodejs npm nvm -y > /dev/null 2>&1 && sleep 1 + sudo apt-get purge nodejs nvm -y > /dev/null 2>&1 && sleep 1 + sudo rm -rf /usr/local/bin/npm + sudo rm -rf /usr/local/share/man/man1/node* + sudo rm -rf /usr/local/lib/dtrace/node.d + sudo rm -rf ~/.npm + sudo rm -rf ~/.nvm + sudo rm -rf ~/.pm2 + sudo rm -rf ~/.node-gyp + sudo rm -rf /opt/local/bin/node + sudo rm -rf opt/local/include/node + sudo rm -rf /opt/local/lib/node_modules + sudo rm -rf /usr/local/lib/node* + sudo rm -rf /usr/local/include/node* + sudo rm -rf /usr/local/bin/node* + echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" + #export NVM_DIR="$HOME/.nvm" && ( + # git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" > /dev/null 2>&1 + # cd "$NVM_DIR" + # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 + #) && \. "$NVM_DIR/nvm.sh" + #cd + #curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 + curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 + . ~/.profile + . ~/.bashrc + sleep 1 + #nvm install v12.16.1 + nvm install 16 > /dev/null 2>&1 + if node -v > /dev/null 2>&1; then + #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" + string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" + string_limit_x_mark "Nodejs was not installed................................." + echo + fi +} + +function check() { + cd + pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + #sleep 120 + #cd /home/$USER/zelflux + #pm2 stop flux + #npm install --legacy-peer-deps > /dev/null 2>&1 + #pm2 start flux + #cd + + NUM='400' + MSG1='Finalizing Flux installation please be patient this will take about ~5min...' + MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + echo && spinning_timer + echo + + $BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 + + NUM='250' + MSG1='Restarting benchmark...' + MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo + + echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" + echo -e "${YELLOW}======================${NC}" + bench_benchmarks=$($BENCH_CLI getbenchmarks) + + if [[ "bench_benchmarks" != "" ]]; then + bench_status=$(jq -r '.status' <<< "$bench_benchmarks") + if [[ "$bench_status" == "failed" ]]; then + echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" + check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" + check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" + else + echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" + bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") + echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" + bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") + bench_ram=$(round "$bench_ram" 2) + echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" + bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") + bench_ssd=$(round "$bench_ssd" 2) + echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" + bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") + bench_hdd=$(round "$bench_hdd" 2) + echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" + bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") + bench_ddwrite=$(round "$bench_ddwrite" 2) + echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" + bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") + bench_eps=$(round "$bench_eps" 2) + echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" + fi + else + echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" + fi +} + +function display_banner() { + echo -e "${BLUE}" + figlet -t -k "FLUXNODE" + figlet -t -k "INSTALLATION COMPLETED" + echo -e "${YELLOW}================================================================================================================================" + #echo -e "FLUXNODE INSTALATION COMPLITED${NC}" + #echo -e "${CYAN}COURTESY OF DK808/XK4MiLX${NC}" + echo + if pm2 -v > /dev/null 2>&1; then + pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) + if [[ "$pm2_flux_status" == "online" ]]; then + pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" + else + if [[ "$pm2_flux_status" != "" ]]; then + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" + fi + fi + echo + fi + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" + echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" + echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" + echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" + echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} -testnet getinfo${NC}" + echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} -testnet getbenchmarks${NC}" + echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} -testnet restartnodebenchmarks${NC}" + echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} -testnet stop${NC}" + echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" + echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" + echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" + echo + if [[ "$WATCHDOG_INSTALL" == "1" ]]; then + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" + echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" + echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo + echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" + echo + fi + echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" + echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" + sleep 1 + cd $HOME + exec bash +} + +function start_install() { + start_install=`date +%s` + sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo + echo -e "${CYAN}February 2021, created by dk808 improved by XK4MiLX from Flux's team." + echo -e "Special thanks to Goose-Tech, Skyslayer, & Packetflow." + echo -e "FluxNode setup starting, press [CTRL+C] to cancel.${NC}" + sleep 2 + + if jq --version > /dev/null 2>&1; then + echo -e "" + else + echo -e "" + echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" + sudo apt install jq -y > /dev/null 2>&1 + + if jq --version > /dev/null 2>&1; then + #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" + string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" + string_limit_x_mark "JQ was not installed................................." + echo + exit + fi + fi + if [ "$USER" = "root" ]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}root${CYAN}, please switch to the username you just created.${NC}" + sleep 4 + exit + fi + + start_dir=$(pwd) + correct_dir="/home/$USER" + echo -e "${ARROW} ${YELLOW}Checking directory....${NC}" + if [[ "$start_dir" == "$correct_dir" ]]; then + echo -e "${ARROW} ${CYAN}Correct directory ${GREEN}$(pwd)${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW} ${CYAN}Bad directory switching...${NC}" + cd + echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" + fi + sleep 1 + config_file + + if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then + import_date + else + + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then + IMPORT_ZELCONF="1" + IMPORT_ZELID="1" + echo -e "" + echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" + zelnodeprivkey="$prvkey" + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + zelnodeoutpoint="$outpoint" + echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + zelnodeindex="$index" + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 + + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 + fi + + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 + fi + + echo -e "" + echo -e "${ARROW} ${YELLOW}Watchdog conf settings:${NC}" + + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 + fi + + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 + + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 + fi + + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 + fi + fi + + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 + fi + + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + fi + + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 + fi + echo -e "" + fi + fi +} + +function create_swap() { + + if [[ -z "$swapon" ]]; then + #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + else + echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" + fi + else + if [[ "$swapon" == "1" ]]; then + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + else + echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" + fi + fi + fi + sleep 2 +} + +function install_packages() { + echo + echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" + + if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then + sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 + fi + + if ! dirmngr --v > /dev/null 2>&1; then + sudo apt install dirmngr -y > /dev/null 2>&1 + fi + + sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get --with-new-pkgs upgrade -y > /dev/null 2>&1 + sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 + sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 + sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 + sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 + sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 + sudo apt-get remove sysbench -y > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" +} + +function ip_confirm() { + WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" + echo + exit + fi + + string_limit_check_mark "IP: $WANIP ..........................................." "IP: ${GREEN}$WANIP${CYAN} ..........................................." +} + + +function kda_bootstrap() { + echo -e "${GREEN}Module: Restore Kadena node blockchain from bootstrap${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "${NC}" + sudo chown -R $USER:$USER /home/$USER/$FLUX_DIR + echo -e "${ARROW} ${CYAN}Stopping Kadena Node...${NC}" + + docker stop zelKadenaChainWebNode > /dev/null 2>&1 && sleep 10 + + if [[ -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db ]]; then + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + sudo rm -rf /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db + fi + + mkdir -p /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 + + if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then + echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" + if whiptail --yesno "Do u want check vailidation of archive file before unpack?" 8 60 3>&1 1>&2 2>&3; then + check_tar "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" + else + echo -e "${ARROW} ${CYAN}Vailidation of archive file skipped..${NC}" + fi + fi + + if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then + tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" + sleep 2 + #unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode > /dev/null 2>&1 + else + echo -e "${ARROW} ${CYAN}Bootstrap file downloading...${NC}" && sleep 2 + CHOICE=$( + whiptail --title "Bootstrap installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ + "1)" "Download from source build in script" \ + "2)" "Download from own source" 3>&2 2>&1 1>&3 + ) + case $CHOICE in + "1)") + DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') + fi + echo -e "${ARROW} ${CYAN}KDA Bootstrap height: ${GREEN}$DB_HIGHT${NC}" + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" + wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress + tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" + sleep 2 + ;; + "2)") + KDA_BOOTSTRAP_ZIP="$(whiptail --title "Kadena node bootstrap source (*.tar.gz, *.zip file supported)" --inputbox "Enter your URL" 8 72 3>&1 1>&2 2>&3)" + KDA_BOOTSTRAP_ZIPFILE="${KDA_BOOTSTRAP_ZIP##*/}" + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" + wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" + fi + sleep 2 + ;; + esac + fi + + if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + rm -rf $KDA_BOOTSTRAP_ZIPFILE + fi + + docker start zelKadenaChainWebNode > /dev/null 2>&1 + NUM='15' + MSG1='Starting Kadena Node...' + MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo -e "" + echo -e "${ARROW} ${CYAN}Kadena Node initial process can take about ~15min. ${NC}" + echo -e "" +} + +function mongodb_bootstrap() { + echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${ARROW} ${CYAN}Module disabled...${NC}" + echo -e "" + exit + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + sudo rm /home/$USER/fluxdb_dump.tar.gz > /dev/null 2>&1 + sudo rm /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 + + if ! pm2 -v > /dev/null 2>&1; then + pm2_install + if [[ "$PM2_INSTALL" == "0" ]]; then + exit + fi + fi + + WANIP=$(wget http://ipecho.net/plain -O - -q) + + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') + fi + + BLOCKHIGHT=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') + FORCE_BOOTSTRAP=0 + + if [[ "$DB_HIGHT" == "" ]]; then + echo -e "${ARROW} ${CYAN}MongoDB bootstrap server offline...${NC}" + string_limit_x_mark "Operation aborted....................." + exit + fi + + + if [[ "$BLOCKHIGHT" == "" || "$BLOCKHIGHT" == "null" ]]; then + if whiptail --yesno "Local Explorer not respondin...Would you like force bootstrap installation?" 8 60; then + FORCE_BOOTSTRAP=1 + else + string_limit_x_mark "Local Explorer not responding........." + string_limit_x_mark "Operation aborted....................." + echo -e "" + exit + fi + fi + if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then + if [[ "$BLOCKHIGHT" == "null" ]]; then + message=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq -r .data.message) + if whiptail --yesno "Flux explorer error noticed...Would you like force bootstrap installation?" 8 60; then + FORCE_BOOTSTRAP=1 + else + echo -e "${ARROW} ${CYAN}Flux explorer error: ${RED}$message${NC}" + string_limit_x_mark "Operation aborted....................." + echo -e "" + exit + fi + fi + fi + + if [[ "$BLOCKHIGHT" != "" && "$BLOCKHIGHT" != "null" ]]; then + if [[ "$BLOCKHIGHT" -gt "$DB_HIGHT" ]]; then + if whiptail --yesno "Datatable is out of date....Would you like force bootstrap installation?" 8 60; then + FORCE_BOOTSTRAP=1 + else + echo -e "${ARROW} ${CYAN}Current Node block hight ${RED}$BLOCKHIGHT${CYAN} > Bootstrap block hight ${RED}$DB_HIGHT${CYAN}. Datatable is out of date.${NC}" + string_limit_x_mark "Operation aborted....................." + echo -e "" + exit + fi + fi + fi + + + echo -e "${ARROW} ${CYAN}IP: ${RED}$WANIP${NC}" + + if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then + echo -e "${ARROW} ${CYAN}Node block hight: ${GREEN}$BLOCKHIGHT${NC}" + fi + + echo -e "${ARROW} ${CYAN}Bootstrap block hight: ${GREEN}$DB_HIGHT${NC}" + echo -e "" + + + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" + wget $BOOTSTRAP_URL_MONGOD -q --show-progress + echo -e "${ARROW} ${CYAN}Unpacking...${NC}" + tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}Stoping Flux...${NC}" + pm2 stop flux > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" + mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 + sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 + pm2 start flux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + + NUM='120' + MSG1='Flux starting...' + MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo + + #BLOCKHIGHT_AFTER_BOOTSTRAP=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') + BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) + if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "" && "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "null" ]]; then + echo -e "${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC}" + if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then + string_limit_check_mark "MongoDB bootstrap installed successful.................................." + echo -e "" + else + if [[ "$FORCE_BOOTSTRAP" == "1" ]]; then + string_limit_check_mark "MongoDB bootstrap installed successful.................................." + echo -e "" + else + string_limit_x_mark "MongoDB bootstrap installation failed.................................." + echo -e "" + fi + fi + else + string_limit_x_mark "MongoDB bootstrap installation failed.................................." + echo -e "" + fi +} + +function install_kernel(){ + echo -e "${GREEN}Module: Install Linux Kernel 5.X for Ubuntu 18.04${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "${NC}" + echo -e "${YELLOW}Installing Linux Kernel 5.x${NC}" + sudo apt-get install --install-recommends linux-generic-hwe-18.04 -y + read -p "Would you like to reboot pc Y/N?" -n 1 -r + echo -e "${NC}" + if [[ $REPLY =~ ^[Yy]$ ]]; then + sudo reboot -n + fi +} + +function multinode(){ + echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "" + echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" + echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" + echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" + echo -e "" + echo -e "${ARROW} ${RED}IMPORTANT:${NC}" + echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" + echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" + echo -e "" + echo -e "${YELLOW}================================================================${NC}" + echo -e "" + + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" + echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" + echo -e "" + exit + fi + + sleep 15 + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multinode.sh) +} + +function create_service_scripts() { + echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 + sudo touch /home/$USER/start_daemon_service.sh + sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + cat <<'EOF' > /home/$USER/start_daemon_service.sh +#!/bin/bash +#color codes +RED='\033[1;31m' +CYAN='\033[1;36m' +NC='\033[0m' +#emoji codes +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" +sleep 2 +echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" +echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" +bench_status_pind=$(pgrep fluxbenchd) +daemon_status_pind=$(pgrep fluxd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi +bench_status_pind=$(pgrep zelbenchd) +daemon_status_pind=$(pgrep zelcashd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi +if [[ -f /usr/local/bin/fluxd ]]; then +bash -c "fluxd" +exit +else +bash -c "zelcashd" +exit +fi +EOF + sudo touch /home/$USER/stop_daemon_service.sh + sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh + cat <<'EOF' > /home/$USER/stop_daemon_service.sh +#!/bin/bash +if [[ -f /usr/local/bin/flux-cli ]]; then +bash -c "flux-cli stop" +else +bash -c "zelcash-cli stop" +fi +exit +EOF + + echo -e "${ARROW} ${CYAN}Setting scripts permissions...${NC}" && sleep 1 + sudo chmod +x /home/$USER/stop_daemon_service.sh + sudo chmod +x /home/$USER/start_daemon_service.sh + echo -e "${ARROW} ${CYAN}Reloading service config...${NC}" && sleep 1 + sudo systemctl daemon-reload > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting Flux daemon....${NC}" && sleep 1 + sudo systemctl start zelcash > /dev/null 2>&1 + echo -e "" +} + +function create_service() { + echo -e "${GREEN}Module: Flux Daemon service creator${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "" + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 + sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 + + echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 + sudo touch /etc/systemd/system/zelcash.service + sudo chown $USER:$USER /etc/systemd/system/zelcash.service + cat << EOF > /etc/systemd/system/zelcash.service +[Unit] +Description=Flux daemon service +After=network.target +[Service] +Type=forking +User=$USER +Group=$USER +ExecStart=/home/$USER/start_daemon_service.sh +ExecStop=-/home/$USER/stop_daemon_service.sh +Restart=always +RestartSec=10 +PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=15s +StartLimitInterval=120s +StartLimitBurst=5 +[Install] +WantedBy=multi-user.target +EOF + sudo chown root:root /etc/systemd/system/zelcash.service +} + +function install_watchtower(){ + echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "" + echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" + apps_check=$(docker ps | grep "flux_watchtower") + + if [[ "$apps_check" != "" ]]; then + echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" + docker stop flux_watchtower > /dev/null 2>&1 + sleep 2 + echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" + docker rm flux_watchtower > /dev/null 2>&1 + fi + + echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" + docker pull containrrr/watchtower:latest > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" + random=$(shuf -i 7500-35000 -n 1) + echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" + apps_id=$(docker run -d \ + --restart unless-stopped \ + --name flux_watchtower \ + -v /var/run/docker.sock:/var/run/docker.sock \ + containrrr/watchtower \ + --cleanup --interval $random 2> /dev/null) + if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then + echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" + else + echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" + fi +} + + + + diff --git a/install_pro.sh b/install_pro.sh index 82837163..c6e9de6f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -3,8 +3,6 @@ source ~/.flux_helpers.sh -source /opt/ - # Bootstrap settings #BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' @@ -46,178 +44,6 @@ RPCPORT=16124 PORT=16125 - -function bootstrap_server(){ -rand_by_domain=("5" "6" "7" "8" "9" "10" "11") -richable=() -richable_eu=() -richable_us=() -richable_as=() - -i=0 -len=${#rand_by_domain[@]} -echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" -while [ $i -lt $len ]; -do - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) - if [[ "$bootstrap_check" != "" ]]; then - - if [[ "${rand_by_domain[$i]}" -ge "8" && "${rand_by_domain[$i]}" -le "11" ]]; then - richable_eu+=( ${rand_by_domain[$i]} ) - fi - - if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then - richable_us+=( ${rand_by_domain[$i]} ) - fi - - #if [[ "${rand_by_domain[$i]}" -gt "10" ]]; then - # richable_as+=( ${rand_by_domain[$i]} ) - # fi - - richable+=( ${rand_by_domain[$i]} ) - fi - - i=$(($i+1)) -done - -server_found="1" -if [[ "$continent" == "EU" ]]; then - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi -elif [[ "$continent" == "US" ]]; then - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -elif [[ "$continent" == "AS" ]]; then - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -else - len=${#richable[@]} - if [[ "$len" -gt "0" ]]; then - richable=( ${richable[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - - if [[ "$len" == "0" ]]; then - Server_offline=1 - return 1 - fi -fi - -if [[ "$server_found" == "0" ]]; then - len=${#richable[@]} - if [[ "$len" == "0" ]]; then - Server_offline=1 - return 1 - fi -fi - -Server_offline=0 - -} - -function bootstrap_geolocation(){ - -IP=$WANIP -ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone | jq .) -ip_status=$( jq -r .status <<< "$ip_output") - -if [[ "$ip_status" == "success" ]]; then -country=$(jq -r .country <<< "$ip_output") -org=$(jq -r .org <<< "$ip_output") -continent=$(jq -r .timezone <<< "$ip_output") -else -country="UKNOW" -continent="UKNOW" -fi - -continent=$(cut -f1 -d"/" <<< "$continent" ) - -if [[ "$continent" =~ "Europe" ]]; then - continent="EU" -elif [[ "$continent" =~ "America" ]]; then - continent="US" -elif [[ "$continent" =~ "Asia" ]]; then - continent="AS" -else - continent="ALL" -fi - -echo -e "" -echo -e "${ARROW} ${YELLOW}Selecting bootstrap server....${NC}" -echo -e "${ARROW} ${CYAN}Node Location: $country, Continent: $continent ${NC}" -echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" -} - - function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then @@ -243,112 +69,6 @@ function config_veryfity(){ } - - function selfhosting() { - - echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" - echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 - else - echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 - echo -e "" - return 1 - fi - -echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 -sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 -sudo touch /home/$USER/ip_check.sh -sudo chown $USER:$USER /home/$USER/ip_check.sh - cat <<'EOF' > /home/$USER/ip_check.sh -#!/bin/bash -function get_ip(){ - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi -} -if [[ $1 == "restart" ]]; then - # give 3min to connect with internet - sleep 180 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi -fi -if [[ $1 == "ip_check" ]]; then - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') - if [[ "$api_port" == "" ]]; then - api_port="16127" - fi - confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') - if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then - if [[ "$WANIP" != "$confirmed_ip" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - fi -fi -EOF - -sudo chmod +x /home/$USER/ip_check.sh -echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 - -#crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) -sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 - -if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" -else - echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" -fi -echo -e "" - } - - -function integration_check() { -FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) -ELEMENTS=${#FILE_ARRAY[@]} - -for (( i=0;i<$ELEMENTS;i++)); do - -string="${FILE_ARRAY[${i}]}................................." -string=${string::40} - -if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then - echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" -else - echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" - CORRUPTED="1" -fi - -done - -if [[ "$CORRUPTED" == "1" ]]; then - echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" - echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" - echo - exit -fi -echo -e "" -} - function tier(){ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then @@ -378,99 +98,6 @@ fi } -function config_file() { - -if [[ -f /home/$USER/install_conf.json ]]; then -import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') -#ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') -#firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') -bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') -bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') -#swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') -#mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') -#watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') -use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') -prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') -outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') -index=$(cat /home/$USER/install_conf.json | jq -r '.index') -ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') -KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') -fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') -flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') -daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') -bench_update=$(cat /home/$USER/install_conf.json | jq -r '.zelbench_update') -node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') -eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') -discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') -ping=$(cat /home/$USER/install_conf.json | jq -r '.ping') -telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') -telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') -telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') - - -echo -echo -e "${ARROW} ${YELLOW}Install config:" - -if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then -echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else - -if [[ "$import_settings" == "1" ]]; then -echo -e "${PIN}${CYAN} Import settings from Flux........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -fi - - -if [[ "$use_old_chain" == "1" ]]; then -echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - -else - -if [[ "$bootstrap_url" == "0" ]]; then -echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...........[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -if [[ "$bootstrap_zip_del" == "1" ]]; then -echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -fi - -#if [[ "$swapon" == "1" ]]; then -#echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -#fi - -#if [[ "$mongo_bootstrap" == "1" ]]; then -#echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -#fi - -if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then -echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - - - -fi -} - -function check_benchmarks() { - - var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") - limit=$2 - if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]] - then - var_round=$(round "$var_benchmark" 2) - echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" - fi - -} function import_date() { @@ -661,29 +288,6 @@ sleep 1 echo } -function tar_file_unpack() -{ - echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" - pv $1 | tar -zx -C $2 -} - - -function check_tar() -{ - echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" - - if gzip -t "$1" &>/dev/null; then - - echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" - - else - - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $1 - - fi -} - function install_watchdog() { echo -e "${ARROW} ${YELLOW}Install watchdog for FluxNode${NC}" @@ -1265,91 +869,6 @@ function ip_confirm() { } -function create_swap() { - - if [[ -z "$swapon" ]]; then - #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - # fi - fi - - else - - if [[ "$swapon" == "1" ]]; then - - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi - #fi - - fi - - - fi - sleep 2 -} - -function install_packages() { - echo - echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" - - if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then - sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 - fi - - if ! dirmngr --v > /dev/null 2>&1; then - sudo apt install dirmngr -y > /dev/null 2>&1 - fi - - sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get --with-new-pkgs upgrade -y > /dev/null 2>&1 - sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 - sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 - sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 - sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 - sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 - sudo apt-get remove sysbench -y > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" -} function create_conf() { @@ -1546,15 +1065,6 @@ EOF } - -function flux_package() { - sudo apt-get update -y > /dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" - sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 - sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 - integration_check -} - function install_daemon() { sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 @@ -1633,13 +1143,6 @@ fi } - -function zk_params() { - echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" - bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 - sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 -} - function bootstrap() { @@ -1873,116 +1376,6 @@ function bootstrap() { } -function create_service_scripts() { - -#echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 -sudo touch /home/$USER/start_daemon_service.sh -sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - cat <<'EOF' > /home/$USER/start_daemon_service.sh -#!/bin/bash - -#color codes -RED='\033[1;31m' -CYAN='\033[1;36m' -NC='\033[0m' -#emoji codes -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -sleep 2 -echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" -echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" -bench_status_pind=$(pgrep fluxbenchd) -daemon_status_pind=$(pgrep fluxd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi - -bench_status_pind=$(pgrep zelbenchd) -daemon_status_pind=$(pgrep zelcashd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi - -if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd" -exit -else -bash -c "zelcashd" -exit -fi -EOF - - -sudo touch /home/$USER/stop_daemon_service.sh -sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh - cat <<'EOF' > /home/$USER/stop_daemon_service.sh -#!/bin/bash -if [[ -f /usr/local/bin/flux-cli ]]; then -bash -c "flux-cli stop" -else -bash -c "zelcash-cli stop" -fi -exit -EOF - -sudo chmod +x /home/$USER/stop_daemon_service.sh -sudo chmod +x /home/$USER/start_daemon_service.sh - -} - -function create_service() { - echo -e "${ARROW} ${YELLOW}Creating Flux daemon service...${NC}" && sleep 1 - sudo touch /etc/systemd/system/zelcash.service - sudo chown $USER:$USER /etc/systemd/system/zelcash.service - cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service - sudo systemctl daemon-reload -} - function basic_security() { echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" #sudo ufw allow 16124/tcp > /dev/null 2>&1 @@ -2012,40 +1405,6 @@ function basic_security() { sudo systemctl start fail2ban > /dev/null 2>&1 } -function pm2_install(){ - - echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" - npm install pm2@latest -g > /dev/null 2>&1 - - if pm2 -v > /dev/null 2>&1 - then - echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" - pm2 startup systemd -u $USER > /dev/null 2>&1 - sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 - - - #pm2 start ~/zelflux/start.sh --name zelflux > /dev/null 2>&1 - #pm2 save > /dev/null 2>&1 - - - pm2 install pm2-logrotate > /dev/null 2>&1 - pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 - pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 - pm2 set pm2-logrotate:compress true > /dev/null 2>&1 - pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 - pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 - - source ~/.bashrc - #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" - string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." - echo - else - string_limit_x_mark "PM2 was not installed................................." - echo - fi - -} - function start_daemon() { sudo systemctl enable zelcash.service > /dev/null 2>&1 @@ -2140,28 +1499,7 @@ function start_daemon() { fi } -function log_rotate() { - echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" - sleep 1 - if [ -f /etc/logrotate.d/$2 ]; then - sudo rm -rf /etc/logrotate.d/$2 - sleep 2 - fi - - sudo touch /etc/logrotate.d/$2 - sudo chown $USER:$USER /etc/logrotate.d/$2 - cat << EOF > /etc/logrotate.d/$2 -$3 { - compress - copytruncate - missingok - $4 - rotate $5 -} -EOF - sudo chown root:root /etc/logrotate.d/$2 -} - +#TODO: RESEARCH, This defaults to mongodb 5.0 in install_pro, why not in testnet? function install_process() { echo -e "${ARROW} ${YELLOW}Configuring firewall...${NC}" @@ -2233,75 +1571,6 @@ function install_process() { sleep 2 } -function install_mongod() { -echo -echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" -sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 -sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 -sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 -sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 -echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" -sudo apt-get update -y > /dev/null 2>&1 -sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 -sudo systemctl enable mongod > /dev/null 2>&1 -sudo systemctl start mongod > /dev/null 2>&1 -if mongod --version > /dev/null 2>&1 -then - #echo -e "${ARROW} ${CYAN}MongoDB version: ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed${NC}" - string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." - echo -else - #echo -e "${ARROW} ${CYAN}MongoDB was not installed${NC}" - string_limit_x_mark "MongoDB was not installed................................." - echo -fi -} - -function install_nodejs() { -echo -e "${ARROW} ${YELLOW}Removing any instances of Nodejs...${NC}" -n-uninstall -y > /dev/null 2>&1 && sleep 1 -rm -rf ~/n -sudo apt-get remove nodejs npm nvm -y > /dev/null 2>&1 && sleep 1 -sudo apt-get purge nodejs nvm -y > /dev/null 2>&1 && sleep 1 -sudo rm -rf /usr/local/bin/npm -sudo rm -rf /usr/local/share/man/man1/node* -sudo rm -rf /usr/local/lib/dtrace/node.d -sudo rm -rf ~/.npm -sudo rm -rf ~/.nvm -sudo rm -rf ~/.pm2 -sudo rm -rf ~/.node-gyp -sudo rm -rf /opt/local/bin/node -sudo rm -rf opt/local/include/node -sudo rm -rf /opt/local/lib/node_modules -sudo rm -rf /usr/local/lib/node* -sudo rm -rf /usr/local/include/node* -sudo rm -rf /usr/local/bin/node* -echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" -#export NVM_DIR="$HOME/.nvm" && ( - # git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" > /dev/null 2>&1 - # cd "$NVM_DIR" - # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 -#) && \. "$NVM_DIR/nvm.sh" -#cd -#curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 -curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 -. ~/.profile -. ~/.bashrc -sleep 1 -#nvm install v12.16.1 -nvm install 16 > /dev/null 2>&1 -if node -v > /dev/null 2>&1 -then -#echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" -string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." -echo -else -#echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" -string_limit_x_mark "Nodejs was not installed................................." -echo -fi - -} function install_flux() { @@ -2531,249 +1800,6 @@ else display_banner } -function check() { - -cd -pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 -#sleep 120 -#cd /home/$USER/zelflux -#pm2 stop flux -#npm install --legacy-peer-deps > /dev/null 2>&1 -#pm2 start flux -#cd - -NUM='400' -MSG1='Finalizing Flux installation please be patient this will take about ~5min...' -MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" -echo && spinning_timer -echo - -$BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 - -NUM='250' -MSG1='Restarting benchmark...' -MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo && echo - -echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" -echo -e "${YELLOW}======================${NC}" -bench_benchmarks=$($BENCH_CLI getbenchmarks) - -if [[ "bench_benchmarks" != "" ]]; then -bench_status=$(jq -r '.status' <<< "$bench_benchmarks") -if [[ "$bench_status" == "failed" ]]; then -echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" -check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" -check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" -else -echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" -bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") -echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" -bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") -bench_ram=$(round "$bench_ram" 2) -echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" -bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") -bench_ssd=$(round "$bench_ssd" 2) -echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" -bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") -bench_hdd=$(round "$bench_hdd" 2) -echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" -bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") -bench_ddwrite=$(round "$bench_ddwrite" 2) -echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" -bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") -bench_eps=$(round "$bench_eps" 2) -echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" -fi - -else -echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" -fi -} - -function display_banner() { - echo -e "${BLUE}" - figlet -t -k "FLUXNODE" - figlet -t -k "INSTALLATION COMPLETED" - echo -e "${YELLOW}================================================================================================================================" - #echo -e "FLUXNODE INSTALATION COMPLITED${NC}" - #echo -e "${CYAN}COURTESY OF DK808/XK4MiLX${NC}" - echo - if pm2 -v > /dev/null 2>&1; then - pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) - if [[ "$pm2_flux_status" == "online" ]]; then - pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" - else - if [[ "$pm2_flux_status" != "" ]]; then - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" - fi - fi - echo - fi - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" - echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" - echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" - echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" - echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} getinfo${NC}" - echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} getbenchmarks${NC}" - echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} restartnodebenchmarks${NC}" - echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} stop${NC}" - echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" - echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" - echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" - echo - if [[ "$WATCHDOG_INSTALL" == "1" ]]; then - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" - echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" - echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo - echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" - echo - fi - echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" - echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" - sleep 1 - cd $HOME - exec bash -} - - -function start_install() { - -start_install=`date +%s` - -sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo -echo -e "${CYAN}February 2021, created by dk808 improved by XK4MiLX from Flux's team." -echo -e "Special thanks to Goose-Tech, Skyslayer, & Packetflow." -echo -e "FluxNode setup starting, press [CTRL+C] to cancel.${NC}" -sleep 2 - -if jq --version > /dev/null 2>&1; then -echo -e "" -else -echo -e "" -echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" -sudo apt install jq -y > /dev/null 2>&1 - - if jq --version > /dev/null 2>&1 - then - #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" - string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" - string_limit_x_mark "JQ was not installed................................." - echo - exit - fi -fi - -if [ "$USER" = "root" ]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}root${CYAN}, please switch to the username you just created.${NC}" - sleep 4 - exit -fi - -start_dir=$(pwd) -correct_dir="/home/$USER" -echo -e "${ARROW} ${YELLOW}Checking directory....${NC}" -if [[ "$start_dir" == "$correct_dir" ]] -then -echo -e "${ARROW} ${CYAN}Correct directory ${GREEN}$(pwd)${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" -else -echo -e "${ARROW} ${CYAN}Bad directory switching...${NC}" -cd -echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" -fi -sleep 1 - -config_file - -if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then -import_date -else - -if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then - - IMPORT_ZELCONF="1" - IMPORT_ZELID="1" - echo -e "" - echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" - zelnodeprivkey="$prvkey" - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint="$outpoint" - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex="$index" - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 - - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 - fi - - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi - - echo -e "" - echo -e "${ARROW} ${YELLOW}Watchdog conf settings:${NC}" - - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 - fi - - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 - - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 - fi - - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 - fi - fi - - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 - fi - - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 - fi - - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 - fi - echo -e "" - -fi - -fi - -} - #end of functions start_install wipe_clean diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 98642af8..74ac87c0 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -40,216 +40,6 @@ RPCPORT=16124 PORT=16125 - function selfhosting() { - echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" - echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 - else - echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 - echo -e "" - exit - fi - -echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 -sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 -sudo touch /home/$USER/ip_check.sh -sudo chown $USER:$USER /home/$USER/ip_check.sh - cat <<'EOF' > /home/$USER/ip_check.sh -#!/bin/bash -function get_ip(){ - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi -} -if [[ $1 == "restart" ]]; then - # give 3min to connect with internet - sleep 180 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi -fi -if [[ $1 == "ip_check" ]]; then - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') - if [[ "$api_port" == "" ]]; then - api_port="16127" - fi - confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip) - if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then - if [[ "$WANIP" != "$confirmed_ip" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - fi -fi -EOF - -sudo chmod +x /home/$USER/ip_check.sh -echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 - -#crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) -sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 - - -if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" -else - echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" -fi -echo -e "" - } - - -function max(){ - - m="0" - for n in "$@" - do - if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then - [ "$n" -gt "$m" ] && m="$n" - fi - done - - echo "$m" - -} - - -function integration_check() { -FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) -ELEMENTS=${#FILE_ARRAY[@]} - -for (( i=0;i<$ELEMENTS;i++)); do - -string="${FILE_ARRAY[${i}]}................................." -string=${string::40} - -if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then - echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" -else - echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" - CORRUPTED="1" -fi - -done - -if [[ "$CORRUPTED" == "1" ]]; then - echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" - echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" - echo - exit -fi -echo -e "" -} - - -function config_file() { - -if [[ -f /home/$USER/install_conf.json ]]; then -import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') -ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') -firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') -bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') -bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') -swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') -#mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') -watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') -use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') -prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') -outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') -index=$(cat /home/$USER/install_conf.json | jq -r '.index') -ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') -KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') - -echo -echo -e "${ARROW} ${YELLOW}Install config:" - -if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then -echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else - -if [[ "$import_settings" == "1" ]]; then -echo -e "${PIN}${CYAN} Import settings from Flux..............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -fi - -if [[ "$ssh_port" != "" ]]; then -echo -e "${PIN}${CYAN} SSH port set.....................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -if [[ "$firewall_disable" == "1" ]]; then -echo -e "${PIN}${CYAN} Firewall disabled diuring installation...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN} Firewall enabled diuring installation............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -if [[ "$use_old_chain" == "1" ]]; then -echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - -else - -if [[ "$bootstrap_url" == "" ]]; then -echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -if [[ "$bootstrap_zip_del" == "1" ]]; then -echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -fi - -if [[ "$swapon" == "1" ]]; then -echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -#if [[ "$mongo_bootstrap" == "1" ]]; then -#echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -#fi - -if [[ "$watchdog" == "1" ]]; then -echo -e "${PIN}${CYAN} Install watchdog.................................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - - - -fi -} - -function check_benchmarks() { - - var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") - limit=$2 - if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]] - then - var_round=$(round "$var_benchmark" 2) - echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" - fi - -} - function import_date() { if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then @@ -348,29 +138,6 @@ sleep 1 echo } -function tar_file_unpack() -{ - echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" - pv $1 | tar -zx -C $2 -} - - -function check_tar() -{ - echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" - - if gzip -t "$1" &>/dev/null; then - - echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" - - else - - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $1 - - fi -} - function install_watchdog() { echo -e "${ARROW} ${YELLOW}Install watchdog for FluxNode${NC}" @@ -865,91 +632,6 @@ function ip_confirm() { } -function create_swap() { - - if [[ -z "$swapon" ]]; then - #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - # fi - fi - - else - - if [[ "$swapon" == "1" ]]; then - - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi - #fi - - fi - - - fi - sleep 2 -} - -function install_packages() { - echo - echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" - - if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then - sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 - fi - - if ! dirmngr --v > /dev/null 2>&1; then - sudo apt install dirmngr -y > /dev/null 2>&1 - fi - - sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get upgrade -y > /dev/null 2>&1 - sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 - sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 - sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 - sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 - sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 - sudo apt-get remove sysbench -y > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" -} function create_conf() { @@ -1005,14 +687,6 @@ EOF } -function flux_package() { - sudo apt-get update -y > /dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" - sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 - sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 - integration_check -} - function install_daemon() { sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 @@ -1120,13 +794,6 @@ sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 } - -function zk_params() { - echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" - bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 - sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 -} - function bootstrap() { BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" @@ -1327,116 +994,6 @@ function bootstrap() { } -function create_service_scripts() { - -#echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 -sudo touch /home/$USER/start_daemon_service.sh -sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - cat <<'EOF' > /home/$USER/start_daemon_service.sh -#!/bin/bash - -#color codes -RED='\033[1;31m' -CYAN='\033[1;36m' -NC='\033[0m' -#emoji codes -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -sleep 2 -echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" -echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" -bench_status_pind=$(pgrep fluxbenchd) -daemon_status_pind=$(pgrep fluxd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi - -bench_status_pind=$(pgrep zelbenchd) -daemon_status_pind=$(pgrep zelcashd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi - -if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd" -exit -else -bash -c "zelcashd" -exit -fi -EOF - - -sudo touch /home/$USER/stop_daemon_service.sh -sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh - cat <<'EOF' > /home/$USER/stop_daemon_service.sh -#!/bin/bash -if [[ -f /usr/local/bin/flux-cli ]]; then -bash -c "flux-cli stop" -else -bash -c "zelcash-cli stop" -fi -exit -EOF - -sudo chmod +x /home/$USER/stop_daemon_service.sh -sudo chmod +x /home/$USER/start_daemon_service.sh - -} - -function create_service() { - echo -e "${ARROW} ${YELLOW}Creating Flux daemon service...${NC}" && sleep 1 - sudo touch /etc/systemd/system/zelcash.service - sudo chown $USER:$USER /etc/systemd/system/zelcash.service - cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service - sudo systemctl daemon-reload -} - function basic_security() { echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" sudo ufw allow 16124/tcp > /dev/null 2>&1 @@ -1464,39 +1021,6 @@ function basic_security() { sudo systemctl start fail2ban > /dev/null 2>&1 } -function pm2_install(){ - - echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" - npm install pm2@latest -g > /dev/null 2>&1 - - if pm2 -v > /dev/null 2>&1 - then - echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" - pm2 startup systemd -u $USER > /dev/null 2>&1 - sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 - - - #pm2 start ~/zelflux/start.sh --name zelflux > /dev/null 2>&1 - #pm2 save > /dev/null 2>&1 - - - pm2 install pm2-logrotate > /dev/null 2>&1 - pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 - pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 - pm2 set pm2-logrotate:compress true > /dev/null 2>&1 - pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 - pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 - - source ~/.bashrc - #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" - string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." - echo - else - string_limit_x_mark "PM2 was not installed................................." - echo - fi - -} function start_daemon() { @@ -1559,28 +1083,7 @@ function start_daemon() { fi } -function log_rotate() { - echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" - sleep 1 - if [ -f /etc/logrotate.d/$2 ]; then - sudo rm -rf /etc/logrotate.d/$2 - sleep 2 - fi - - sudo touch /etc/logrotate.d/$2 - sudo chown $USER:$USER /etc/logrotate.d/$2 - cat << EOF > /etc/logrotate.d/$2 -$3 { - compress - copytruncate - missingok - $4 - rotate $5 -} -EOF - sudo chown root:root /etc/logrotate.d/$2 -} - +#TODO: RESEARCH, This defaults to mongodb 5.0 in install_pro, why not here? function install_process() { echo -e "${ARROW} ${YELLOW}Configuring firewall...${NC}" @@ -1646,75 +1149,6 @@ function install_process() { sleep 2 } -function install_mongod() { -echo -echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" -sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 -sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 -sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 -sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 -echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" -sudo apt-get update -y > /dev/null 2>&1 -sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 -sudo systemctl enable mongod > /dev/null 2>&1 -sudo systemctl start mongod > /dev/null 2>&1 -if mongod --version > /dev/null 2>&1 -then - #echo -e "${ARROW} ${CYAN}MongoDB version: ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed${NC}" - string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." - echo -else - #echo -e "${ARROW} ${CYAN}MongoDB was not installed${NC}" - string_limit_x_mark "MongoDB was not installed................................." - echo -fi -} - -function install_nodejs() { -echo -e "${ARROW} ${YELLOW}Removing any instances of Nodejs...${NC}" -n-uninstall -y > /dev/null 2>&1 && sleep 1 -rm -rf ~/n -sudo apt-get remove nodejs npm nvm -y > /dev/null 2>&1 && sleep 1 -sudo apt-get purge nodejs nvm -y > /dev/null 2>&1 && sleep 1 -sudo rm -rf /usr/local/bin/npm -sudo rm -rf /usr/local/share/man/man1/node* -sudo rm -rf /usr/local/lib/dtrace/node.d -sudo rm -rf ~/.npm -sudo rm -rf ~/.nvm -sudo rm -rf ~/.pm2 -sudo rm -rf ~/.node-gyp -sudo rm -rf /opt/local/bin/node -sudo rm -rf opt/local/include/node -sudo rm -rf /opt/local/lib/node_modules -sudo rm -rf /usr/local/lib/node* -sudo rm -rf /usr/local/include/node* -sudo rm -rf /usr/local/bin/node* -echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" -#export NVM_DIR="$HOME/.nvm" && ( - # git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" > /dev/null 2>&1 - # cd "$NVM_DIR" - # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 -#) && \. "$NVM_DIR/nvm.sh" -#cd -#curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 -curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 -. ~/.profile -. ~/.bashrc -sleep 1 -#nvm install v12.16.1 -nvm install v14.18.1 > /dev/null 2>&1 -if node -v > /dev/null 2>&1 -then -#echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" -string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." -echo -else -#echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" -string_limit_x_mark "Nodejs was not installed................................." -echo -fi - -} function install_flux() { @@ -1951,199 +1385,6 @@ else display_banner } -function check() { - -cd -pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 -#sleep 120 -#cd /home/$USER/zelflux -#pm2 stop flux -#npm install --legacy-peer-deps > /dev/null 2>&1 -#pm2 start flux -#cd - -NUM='400' -MSG1='Finalizing Flux installation please be patient this will take about ~5min...' -MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" -echo && spinning_timer -echo - -$BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 - -NUM='250' -MSG1='Restarting benchmark...' -MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo && echo - -echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" -echo -e "${YELLOW}======================${NC}" -bench_benchmarks=$($BENCH_CLI -testnet getbenchmarks) - -if [[ "bench_benchmarks" != "" ]]; then -bench_status=$(jq -r '.status' <<< "$bench_benchmarks") -if [[ "$bench_status" == "failed" ]]; then -echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" -check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" -check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" -else -echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" -bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") -echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" -bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") -bench_ram=$(round "$bench_ram" 2) -echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" -bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") -bench_ssd=$(round "$bench_ssd" 2) -echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" -bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") -bench_hdd=$(round "$bench_hdd" 2) -echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" -bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") -bench_ddwrite=$(round "$bench_ddwrite" 2) -echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" -bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") -bench_eps=$(round "$bench_eps" 2) -echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" -fi - -else -echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" -fi -} - -function display_banner() { - echo -e "${BLUE}" - figlet -t -k "FLUXNODE" - figlet -t -k "INSTALLATION COMPLETED" - echo -e "${YELLOW}================================================================================================================================" - #echo -e "FLUXNODE INSTALATION COMPLITED${NC}" - #echo -e "${CYAN}COURTESY OF DK808/XK4MiLX${NC}" - echo - if pm2 -v > /dev/null 2>&1; then - pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) - if [[ "$pm2_flux_status" == "online" ]]; then - pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" - else - if [[ "$pm2_flux_status" != "" ]]; then - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" - fi - fi - echo - fi - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" - echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" - echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" - echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" - echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} -testnet getinfo${NC}" - echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} -testnet getbenchmarks${NC}" - echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} -testnet restartnodebenchmarks${NC}" - echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} -testnet stop${NC}" - echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" - echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" - echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" - echo - if [[ "$WATCHDOG_INSTALL" == "1" ]]; then - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" - echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" - echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo - echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" - echo - fi - echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" - echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" - sleep 1 - cd $HOME - exec bash -} - -function start_install() { - -start_install=`date +%s` - -sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo -echo -e "${CYAN}February 2021, created by dk808 improved by XK4MiLX from Flux's team." -echo -e "Special thanks to Goose-Tech, Skyslayer, & Packetflow." -echo -e "FluxNode setup starting, press [CTRL+C] to cancel.${NC}" -sleep 2 - -if jq --version > /dev/null 2>&1; then -echo -e "" -else -echo -e "" -echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" -sudo apt install jq -y > /dev/null 2>&1 - - if jq --version > /dev/null 2>&1 - then - #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" - string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" - string_limit_x_mark "JQ was not installed................................." - echo - exit - fi -fi - -if [ "$USER" = "root" ]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}root${CYAN}, please switch to the username you just created.${NC}" - sleep 4 - exit -fi - -start_dir=$(pwd) -correct_dir="/home/$USER" -echo -e "${ARROW} ${YELLOW}Checking directory....${NC}" -if [[ "$start_dir" == "$correct_dir" ]] -then -echo -e "${ARROW} ${CYAN}Correct directory ${GREEN}$(pwd)${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" -else -echo -e "${ARROW} ${CYAN}Bad directory switching...${NC}" -cd -echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" -fi -sleep 1 - -config_file - -if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then -import_date -else - -if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then -echo -IMPORT_ZELCONF="1" -IMPORT_ZELID="1" -echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" -zelnodeprivkey="$prvkey" -echo -e "${PIN}${CYAN}Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 -zelnodeoutpoint="$outpoint" -echo -e "${PIN}${CYAN}Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 -zelnodeindex="$index" -echo -e "${PIN}${CYAN}Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 -echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 -echo -fi - -fi - -} #end of functions start_install diff --git a/multitoolbox.sh b/multitoolbox.sh index 22d7593a..a298fdaf 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -28,179 +28,6 @@ dversion="v7.1" PM2_INSTALL="0" zelflux_setting_import="0" - -function bootstrap_server(){ -rand_by_domain=("5" "6" "7" "8" "9" "10" "11") -richable=() -richable_eu=() -richable_us=() -richable_as=() - -i=0 -len=${#rand_by_domain[@]} -echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" -while [ $i -lt $len ]; -do - #echo ${rand_by_domain[$i]} - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) - #echo -e "Height: $bootstrap_check" - if [[ "$bootstrap_check" != "" ]]; then - #echo -e "Adding: ${rand_by_domain[$i]}" - - if [[ "${rand_by_domain[$i]}" -ge "8" && "${rand_by_domain[$i]}" -le "11" ]]; then - richable_eu+=( ${rand_by_domain[$i]} ) - fi - - if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then - richable_us+=( ${rand_by_domain[$i]} ) - fi - - richable+=( ${rand_by_domain[$i]} ) - fi - - i=$(($i+1)) -done - -server_found="1" -if [[ "$continent" == "EU" ]]; then - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi -elif [[ "$continent" == "US" ]]; then - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -elif [[ "$continent" == "AS" ]]; then - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -else - len=${#richable[@]} - if [[ "$len" -gt "0" ]]; then - richable=( ${richable[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - - if [[ "$len" == "0" ]]; then - Server_offline=1 - return 1 - fi -fi - - - -if [[ "$server_found" == "0" ]]; then - len=${#richable[@]} - if [[ "$len" == "0" ]]; then - Server_offline=1 - return 1 - fi -fi - -Server_offline=0 - -} - -function bootstrap_geolocation(){ - -IP=$WANIP -ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone | jq .) -ip_status=$( jq -r .status <<< "$ip_output") - -if [[ "$ip_status" == "success" ]]; then -country=$(jq -r .country <<< "$ip_output") -org=$(jq -r .org <<< "$ip_output") -continent=$(jq -r .timezone <<< "$ip_output") -else -country="UKNOW" -continent="UKNOW" -fi - -continent=$(cut -f1 -d"/" <<< "$continent" ) - -if [[ "$continent" =~ "Europe" ]]; then - continent="EU" -elif [[ "$continent" =~ "America" ]]; then - continent="US" -elif [[ "$continent" =~ "Asia" ]]; then - continent="AS" -else - continent="ALL" -fi - -echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" -echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" -echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" - - -} - function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then @@ -226,110 +53,6 @@ function config_veryfity(){ } - -function get_ip(){ - - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi - -} - -function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - - done - done - echo -ne "${MSG2}" -} - -function string_limit_check_mark_port() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::65} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::65+string_diff} -fi -echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - -function string_limit_check_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::50} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::50+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - -function string_limit_x_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::50} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::50+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" -} - -function tar_file_unpack() -{ - echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" - pv $1 | tar -zx -C $2 -} - -function tar_file_pack() -{ - echo -e "${ARROW} ${YELLOW}Creating bootstrap archive file...${NC}" - tar -czf - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 -} - -function check_tar() -{ - echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" - - if gzip -t "$1" &>/dev/null; then - - echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" - - else - - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $1 - - fi -} - function pm2_install(){ tmux kill-server > /dev/null 2>&1 && sleep 1 @@ -424,27 +147,7 @@ fi fi } -function ip_confirm() { - WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') - fi - - - if [[ "$WANIP" == "" ]]; then - echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" - echo - exit - fi - - string_limit_check_mark "IP: $WANIP ..........................................." "IP: ${GREEN}$WANIP${CYAN} ..........................................." -} function install_flux() { @@ -1250,109 +953,6 @@ echo } -function kda_bootstrap() { - - echo -e "${GREEN}Module: Restore Kadena node blockchain from bootstrap${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "${NC}" - sudo chown -R $USER:$USER /home/$USER/$FLUX_DIR - echo -e "${ARROW} ${CYAN}Stopping Kadena Node...${NC}" - - docker stop zelKadenaChainWebNode > /dev/null 2>&1 && sleep 10 - - if [[ -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db - fi - - mkdir -p /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 - - - if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then - - echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" - if whiptail --yesno "Do u want check vailidation of archive file before unpack?" 8 60 3>&1 1>&2 2>&3; then - check_tar "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" - else - echo -e "${ARROW} ${CYAN}Vailidation of archive file skipped..${NC}" - fi - - fi - - - if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then - - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - sleep 2 - #unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode > /dev/null 2>&1 - - else - - echo -e "${ARROW} ${CYAN}Bootstrap file downloading...${NC}" && sleep 2 - - CHOICE=$( - whiptail --title "Bootstrap installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) - - - case $CHOICE in - "1)") - DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') - fi - echo -e "${ARROW} ${CYAN}KDA Bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" - wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - sleep 2 - - ;; - "2)") - KDA_BOOTSTRAP_ZIP="$(whiptail --title "Kadena node bootstrap source (*.tar.gz, *.zip file supported)" --inputbox "Enter your URL" 8 72 3>&1 1>&2 2>&3)" - KDA_BOOTSTRAP_ZIPFILE="${KDA_BOOTSTRAP_ZIP##*/}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" - wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - - fi - sleep 2 - ;; - esac - - fi - - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - rm -rf $KDA_BOOTSTRAP_ZIPFILE - fi - - docker start zelKadenaChainWebNode > /dev/null 2>&1 - NUM='15' - MSG1='Starting Kadena Node...' - MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo -e "" - echo -e "${ARROW} ${CYAN}Kadena Node initial process can take about ~15min. ${NC}" - echo -e "" - -} - function flux_daemon_bootstrap() { @@ -1501,187 +1101,6 @@ function flux_daemon_bootstrap() { pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 } -function mongodb_bootstrap(){ - -echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" -echo -e "${YELLOW}================================================================${NC}" -echo -e "${ARROW} ${CYAN}Module disabled...${NC}" -echo -e "" -exit - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -sudo rm /home/$USER/fluxdb_dump.tar.gz > /dev/null 2>&1 -sudo rm /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 - -if ! pm2 -v > /dev/null 2>&1; then - - pm2_install - - if [[ "$PM2_INSTALL" == "0" ]]; then - exit - fi - -fi - -WANIP=$(wget http://ipecho.net/plain -O - -q) - -DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') -if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') -fi - -BLOCKHIGHT=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') -FORCE_BOOTSTRAP=0 - -if [[ "$DB_HIGHT" == "" ]]; then - echo -e "${ARROW} ${CYAN}MongoDB bootstrap server offline...${NC}" - string_limit_x_mark "Operation aborted....................." - exit -fi - - -if [[ "$BLOCKHIGHT" == "" || "$BLOCKHIGHT" == "null" ]]; then - - if whiptail --yesno "Local Explorer not respondin...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - string_limit_x_mark "Local Explorer not responding........." - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - -fi - - if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - - if [[ "$BLOCKHIGHT" == "null" ]]; then - - message=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq -r .data.message) - - if whiptail --yesno "Flux explorer error noticed...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Flux explorer error: ${RED}$message${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - fi - fi - - -if [[ "$BLOCKHIGHT" != "" && "$BLOCKHIGHT" != "null" ]]; then - - if [[ "$BLOCKHIGHT" -gt "$DB_HIGHT" ]]; then - - if whiptail --yesno "Datatable is out of date....Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Current Node block hight ${RED}$BLOCKHIGHT${CYAN} > Bootstrap block hight ${RED}$DB_HIGHT${CYAN}. Datatable is out of date.${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - - fi -fi - - -echo -e "${ARROW} ${CYAN}IP: ${RED}$WANIP${NC}" - -if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - echo -e "${ARROW} ${CYAN}Node block hight: ${GREEN}$BLOCKHIGHT${NC}" -fi - -echo -e "${ARROW} ${CYAN}Bootstrap block hight: ${GREEN}$DB_HIGHT${NC}" -echo -e "" - - -echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" -wget $BOOTSTRAP_URL_MONGOD -q --show-progress -echo -e "${ARROW} ${CYAN}Unpacking...${NC}" -tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 -echo -e "${ARROW} ${CYAN}Stoping Flux...${NC}" -pm2 stop flux > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" -mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Cleaning...${NC}" -sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 -sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 -pm2 start flux > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 - -NUM='120' -MSG1='Flux starting...' -MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo - -#BLOCKHIGHT_AFTER_BOOTSTRAP=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') -BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "" && "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "null" ]]; then - - echo -e "${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC}" - - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then - - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - - if [[ "$FORCE_BOOTSTRAP" == "1" ]]; then - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - fi - - fi - else - - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - - fi - - -} - -function install_kernel(){ - - -echo -e "${GREEN}Module: Install Linux Kernel 5.X for Ubuntu 18.04${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" ]] -then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -echo -e "${NC}" -echo -e "${YELLOW}Installing Linux Kernel 5.x${NC}" -sudo apt-get install --install-recommends linux-generic-hwe-18.04 -y -read -p "Would you like to reboot pc Y/N?" -n 1 -r -echo -e "${NC}" -if [[ $REPLY =~ ^[Yy]$ ]] -then -sudo reboot -n -fi - -} function analyzer_and_fixer(){ @@ -1745,43 +1164,6 @@ bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool } -function multinode(){ - -echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - - echo -e "" - echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" - echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" - echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" - echo -e "" - echo -e "${ARROW} ${RED}IMPORTANT:${NC}" - echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" - echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" - echo -e "" - echo -e "${YELLOW}================================================================${NC}" - echo -e "" - - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" - echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" - echo -e "" - exit - fi - - sleep 15 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multinode.sh) - -} - function install_docker(){ echo -e "${GREEN}Module: Install Docker${NC}" @@ -2036,137 +1418,6 @@ echo -e "" && echo -e "" } -function create_service_scripts() { - -echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 -sudo touch /home/$USER/start_daemon_service.sh -sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - cat <<'EOF' > /home/$USER/start_daemon_service.sh -#!/bin/bash -#color codes -RED='\033[1;31m' -CYAN='\033[1;36m' -NC='\033[0m' -#emoji codes -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -sleep 2 -echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" -echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" -bench_status_pind=$(pgrep fluxbenchd) -daemon_status_pind=$(pgrep fluxd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi -bench_status_pind=$(pgrep zelbenchd) -daemon_status_pind=$(pgrep zelcashd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi -if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd" -exit -else -bash -c "zelcashd" -exit -fi -EOF - - -sudo touch /home/$USER/stop_daemon_service.sh -sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh - cat <<'EOF' > /home/$USER/stop_daemon_service.sh -#!/bin/bash -if [[ -f /usr/local/bin/flux-cli ]]; then -bash -c "flux-cli stop" -else -bash -c "zelcash-cli stop" -fi -exit -EOF - -echo -e "${ARROW} ${CYAN}Setting scripts permissions...${NC}" && sleep 1 -sudo chmod +x /home/$USER/stop_daemon_service.sh -sudo chmod +x /home/$USER/start_daemon_service.sh -echo -e "${ARROW} ${CYAN}Reloading service config...${NC}" && sleep 1 -sudo systemctl daemon-reload > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Starting Flux daemon....${NC}" && sleep 1 -sudo systemctl start zelcash > /dev/null 2>&1 -echo -e "" -} - -function create_service() { - - echo -e "${GREEN}Module: Flux Daemon service creator${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - -echo -e "" -echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 -sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 -sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 -sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 - -echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 -sudo touch /etc/systemd/system/zelcash.service -sudo chown $USER:$USER /etc/systemd/system/zelcash.service -cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service -} - function replace_zelid() { @@ -2208,50 +1459,6 @@ while true fi } - - function install_watchtower(){ - - echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - -echo -e "" -echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" -apps_check=$(docker ps | grep "flux_watchtower") - -if [[ "$apps_check" != "" ]]; then -echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" -docker stop flux_watchtower > /dev/null 2>&1 -sleep 2 -echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" -docker rm flux_watchtower > /dev/null 2>&1 -fi - -echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" -docker pull containrrr/watchtower:latest > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" -random=$(shuf -i 7500-35000 -n 1) -echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" -apps_id=$(docker run -d \ ---restart unless-stopped \ ---name flux_watchtower \ --v /var/run/docker.sock:/var/run/docker.sock \ -containrrr/watchtower \ ---cleanup --interval $random 2> /dev/null) -if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then -echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" -else -echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" -fi - - } function mongod_db_fix() { @@ -2281,109 +1488,6 @@ fi } - function selfhosting() { - - echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 - else - echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 - echo -e "" - exit - fi - - -echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 -sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 -sudo touch /home/$USER/ip_check.sh -sudo chown $USER:$USER /home/$USER/ip_check.sh - cat <<'EOF' > /home/$USER/ip_check.sh -#!/bin/bash - -function get_ip(){ - - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi - -} - - -if [[ $1 == "restart" ]]; then - - # give 3min to connect with internet - sleep 180 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - -fi - -if [[ $1 == "ip_check" ]]; then - - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') - if [[ "$api_port" == "" ]]; then - api_port="16127" - fi - confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') - if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then - - if [[ "$WANIP" != "$confirmed_ip" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - - fi - -fi -EOF - -sudo chmod +x /home/$USER/ip_check.sh -echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 - -#crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) -sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 - -if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" -else - echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" -fi -echo -e "" - - } - if ! figlet -v > /dev/null 2>&1 then diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index e90c91c3..5761ea16 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -28,64 +28,6 @@ PM2_INSTALL="0" zelflux_setting_import="0" -function get_ip(){ - - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi - -} - -function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - - done - done - echo -ne "${MSG2}" -} - - -function tar_file_unpack() -{ - echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" - pv $1 | tar -zx -C $2 -} - -function tar_file_pack() -{ - echo -e "${ARROW} ${YELLOW}Creating bootstrap archive file...${NC}" - tar -czf - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 -} - -function check_tar() -{ - echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" - - if gzip -t "$1" &>/dev/null; then - - echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" - - else - - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $1 - - fi -} function pm2_install(){ @@ -195,27 +137,6 @@ fi fi } -function ip_confirm() { - - WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') - fi - - - if [[ "$WANIP" == "" ]]; then - echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" - echo - exit - fi - - string_limit_check_mark "IP: $WANIP ..........................................." "IP: ${GREEN}$WANIP${CYAN} ..........................................." -} function install_flux() { @@ -865,109 +786,6 @@ echo } -function kda_bootstrap() { - - echo -e "${GREEN}Module: Restore Kadena node blockchain from bootstrap${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "${NC}" - sudo chown -R $USER:$USER /home/$USER/$FLUX_DIR - echo -e "${ARROW} ${CYAN}Stopping Kadena Node...${NC}" - - docker stop zelKadenaChainWebNode > /dev/null 2>&1 && sleep 10 - - if [[ -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db - fi - - mkdir -p /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 - - - if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then - - echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" - if whiptail --yesno "Do u want check vailidation of archive file before unpack?" 8 60 3>&1 1>&2 2>&3; then - check_tar "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" - else - echo -e "${ARROW} ${CYAN}Vailidation of archive file skipped..${NC}" - fi - - fi - - - if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then - - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - sleep 2 - #unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode > /dev/null 2>&1 - - else - - echo -e "${ARROW} ${CYAN}Bootstrap file downloading...${NC}" && sleep 2 - - CHOICE=$( - whiptail --title "Bootstrap installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) - - - case $CHOICE in - "1)") - DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') - fi - echo -e "${ARROW} ${CYAN}KDA Bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" - wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - sleep 2 - - ;; - "2)") - KDA_BOOTSTRAP_ZIP="$(whiptail --title "Kadena node bootstrap source (*.tar.gz, *.zip file supported)" --inputbox "Enter your URL" 8 72 3>&1 1>&2 2>&3)" - KDA_BOOTSTRAP_ZIPFILE="${KDA_BOOTSTRAP_ZIP##*/}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" - wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - - fi - sleep 2 - ;; - esac - - fi - - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - rm -rf $KDA_BOOTSTRAP_ZIPFILE - fi - - docker start zelKadenaChainWebNode > /dev/null 2>&1 - NUM='15' - MSG1='Starting Kadena Node...' - MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo -e "" - echo -e "${ARROW} ${CYAN}Kadena Node initial process can take about ~15min. ${NC}" - echo -e "" - -} - function flux_daemon_bootstrap() { @@ -1095,187 +913,6 @@ function flux_daemon_bootstrap() { pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 } -function mongodb_bootstrap(){ - -echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" -echo -e "${YELLOW}================================================================${NC}" -echo -e "${ARROW} ${CYAN}Module disabled...${NC}" -echo -e "" -exit - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -sudo rm /home/$USER/fluxdb_dump.tar.gz > /dev/null 2>&1 -sudo rm /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 - -if ! pm2 -v > /dev/null 2>&1; then - - pm2_install - - if [[ "$PM2_INSTALL" == "0" ]]; then - exit - fi - -fi - -WANIP=$(wget http://ipecho.net/plain -O - -q) - -DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') -if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') -fi - -BLOCKHIGHT=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') -FORCE_BOOTSTRAP=0 - -if [[ "$DB_HIGHT" == "" ]]; then - echo -e "${ARROW} ${CYAN}MongoDB bootstrap server offline...${NC}" - string_limit_x_mark "Operation aborted....................." - exit -fi - - -if [[ "$BLOCKHIGHT" == "" || "$BLOCKHIGHT" == "null" ]]; then - - if whiptail --yesno "Local Explorer not respondin...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - string_limit_x_mark "Local Explorer not responding........." - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - -fi - - if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - - if [[ "$BLOCKHIGHT" == "null" ]]; then - - message=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq -r .data.message) - - if whiptail --yesno "Flux explorer error noticed...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Flux explorer error: ${RED}$message${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - fi - fi - - -if [[ "$BLOCKHIGHT" != "" && "$BLOCKHIGHT" != "null" ]]; then - - if [[ "$BLOCKHIGHT" -gt "$DB_HIGHT" ]]; then - - if whiptail --yesno "Datatable is out of date....Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Current Node block hight ${RED}$BLOCKHIGHT${CYAN} > Bootstrap block hight ${RED}$DB_HIGHT${CYAN}. Datatable is out of date.${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - - fi -fi - - -echo -e "${ARROW} ${CYAN}IP: ${RED}$WANIP${NC}" - -if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - echo -e "${ARROW} ${CYAN}Node block hight: ${GREEN}$BLOCKHIGHT${NC}" -fi - -echo -e "${ARROW} ${CYAN}Bootstrap block hight: ${GREEN}$DB_HIGHT${NC}" -echo -e "" - - -echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" -wget $BOOTSTRAP_URL_MONGOD -q --show-progress -echo -e "${ARROW} ${CYAN}Unpacking...${NC}" -tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 -echo -e "${ARROW} ${CYAN}Stoping Flux...${NC}" -pm2 stop flux > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" -mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Cleaning...${NC}" -sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 -sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 -pm2 start flux > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 - -NUM='120' -MSG1='Flux starting...' -MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo - -#BLOCKHIGHT_AFTER_BOOTSTRAP=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') -BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "" && "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "null" ]]; then - - echo -e "${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC}" - - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then - - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - - if [[ "$FORCE_BOOTSTRAP" == "1" ]]; then - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - fi - - fi - else - - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - - fi - - -} - -function install_kernel(){ - - -echo -e "${GREEN}Module: Install Linux Kernel 5.X for Ubuntu 18.04${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" ]] -then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -echo -e "${NC}" -echo -e "${YELLOW}Installing Linux Kernel 5.x${NC}" -sudo apt-get install --install-recommends linux-generic-hwe-18.04 -y -read -p "Would you like to reboot pc Y/N?" -n 1 -r -echo -e "${NC}" -if [[ $REPLY =~ ^[Yy]$ ]] -then -sudo reboot -n -fi - -} function analyzer_and_fixer(){ @@ -1333,42 +970,6 @@ bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool } -function multinode(){ - -echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - - echo -e "" - echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" - echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" - echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" - echo -e "" - echo -e "${ARROW} ${RED}IMPORTANT:${NC}" - echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" - echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" - echo -e "" - echo -e "${YELLOW}================================================================${NC}" - echo -e "" - - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" - echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" - echo -e "" - exit - fi - - sleep 15 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multinode.sh) - -} function install_docker(){ @@ -1603,136 +1204,6 @@ echo -e "" && echo -e "" } -function create_service_scripts() { - -echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 -sudo touch /home/$USER/start_daemon_service.sh -sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - cat <<'EOF' > /home/$USER/start_daemon_service.sh -#!/bin/bash -#color codes -RED='\033[1;31m' -CYAN='\033[1;36m' -NC='\033[0m' -#emoji codes -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -sleep 2 -echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" -echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" -bench_status_pind=$(pgrep fluxbenchd) -daemon_status_pind=$(pgrep fluxd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi -bench_status_pind=$(pgrep zelbenchd) -daemon_status_pind=$(pgrep zelcashd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi -if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd" -exit -else -bash -c "zelcashd" -exit -fi -EOF - - -sudo touch /home/$USER/stop_daemon_service.sh -sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh - cat <<'EOF' > /home/$USER/stop_daemon_service.sh -#!/bin/bash -if [[ -f /usr/local/bin/flux-cli ]]; then -bash -c "flux-cli stop" -else -bash -c "zelcash-cli stop" -fi -exit -EOF - -echo -e "${ARROW} ${CYAN}Setting scripts permissions...${NC}" && sleep 1 -sudo chmod +x /home/$USER/stop_daemon_service.sh -sudo chmod +x /home/$USER/start_daemon_service.sh -echo -e "${ARROW} ${CYAN}Reloading service config...${NC}" && sleep 1 -sudo systemctl daemon-reload > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Starting Flux daemon....${NC}" && sleep 1 -sudo systemctl start zelcash > /dev/null 2>&1 -echo -e "" -} - -function create_service() { - - echo -e "${GREEN}Module: Flux Daemon service creator${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - -echo -e "" -echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 -sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 -sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 -sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 - -echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 -sudo touch /etc/systemd/system/zelcash.service -sudo chown $USER:$USER /etc/systemd/system/zelcash.service -cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service -} function replace_zelid() { @@ -1775,50 +1246,6 @@ while true fi } - - function install_watchtower(){ - - echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - -echo -e "" -echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" -apps_check=$(docker ps | grep "flux_watchtower") - -if [[ "$apps_check" != "" ]]; then -echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" -docker stop flux_watchtower > /dev/null 2>&1 -sleep 2 -echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" -docker rm flux_watchtower > /dev/null 2>&1 -fi - -echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" -docker pull containrrr/watchtower:latest > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" -random=$(shuf -i 7500-35000 -n 1) -echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" -apps_id=$(docker run -d \ ---restart unless-stopped \ ---name flux_watchtower \ --v /var/run/docker.sock:/var/run/docker.sock \ -containrrr/watchtower \ ---cleanup --interval $random 2> /dev/null) -if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then -echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" -else -echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" -fi - - } function update_binary(){ @@ -1896,106 +1323,6 @@ fi } - function selfhosting() { - - echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "${ARROW} ${CYAN}Adding IP...${NC}" && sleep 1 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 - else - echo -e "${WORNING} ${CYAN}Problem detected operation stopped! ${NC}" && sleep 1 - echo -e "" - exit - fi - - -echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 -sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 -sudo touch /home/$USER/ip_check.sh -sudo chown $USER:$USER /home/$USER/ip_check.sh - cat <<'EOF' > /home/$USER/ip_check.sh -#!/bin/bash - -function get_ip(){ - - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi - -} - - -if [[ $1 == "restart" ]]; then - - # give 3min to connect with internet - sleep 180 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - -fi - -if [[ $1 == "ip_check" ]]; then - - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - confirmed_ip=$(curl -SsL -m 10 http://localhost:16127/flux/info | jq -r .data.node.status.ip) - - if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then - - if [[ "$WANIP" != "$confirmed_ip" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - - fi - -fi -EOF - -sudo chmod +x /home/$USER/ip_check.sh -echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 - -#crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) -sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 - -if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" -else - echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" -fi -echo -e "" - - } - if ! figlet -v > /dev/null 2>&1 then From 3a556330a3823414feb9963bc906b8e0298d957a Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Tue, 26 Jul 2022 14:27:01 -0500 Subject: [PATCH 0484/1176] Adding intro comment. --- helpers.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helpers.sh b/helpers.sh index c47ecb53..58b11dfb 100644 --- a/helpers.sh +++ b/helpers.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Collection of common vars and functions used throughout multitoolbox. + #color codes RED='\033[1;31m' YELLOW='\033[1;33m' From c2329982678b7558447002bb04ddf7eb5b4809cc Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 20:30:30 -0500 Subject: [PATCH 0485/1176] finishing up function consolidation. --- helpers.sh => common.sh | 50 ++++++++ geo_test.sh | 145 +---------------------- install_pro.sh | 214 +--------------------------------- install_pro_testnet.sh | 2 +- multinode.sh | 2 +- multitoolbox.sh | 249 +--------------------------------------- multitoolbox_testnet.sh | 63 +--------- nodeanalizerandfixer.sh | 11 +- 8 files changed, 59 insertions(+), 677 deletions(-) rename helpers.sh => common.sh (96%) diff --git a/helpers.sh b/common.sh similarity index 96% rename from helpers.sh rename to common.sh index 58b11dfb..50a974f3 100644 --- a/helpers.sh +++ b/common.sh @@ -1518,6 +1518,56 @@ function install_watchtower(){ fi } +function analyzer_and_fixer(){ + echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/nodeanalizerandfixer.sh) +} + + +function replace_zelid() { + + echo -e "${GREEN}Module: Replace Zel ID${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + while true + do + new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + done + + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped........................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}ZEL ID replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + +} + diff --git a/geo_test.sh b/geo_test.sh index b3d94434..9b882c18 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_helpers.sh +source ~/.flux_common.sh # THIS LOOKS UNUSED. CANDIDATE FOR DELETION. function server_geolocation(){ @@ -37,149 +37,6 @@ fi } -<<<<<<< HEAD -======= -function bootstrap_server(){ -rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") -richable=() -richable_eu=() -richable_us=() -richable_as=() - -i=0 -len=${#rand_by_domain[@]} -echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" -#echo -e "Bootstrap on list: $len" -while [ $i -lt $len ]; -do - - server_geolocation ${rand_by_domain[$i]} - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) - if [[ "$bootstrap_check" != "" ]]; then - - if [[ "$server_continent" == "EU" ]]; then - richable_eu+=( ${rand_by_domain[$i]} ) - fi - - if [[ "$server_continent" == "US" ]]; then - richable_us+=( ${rand_by_domain[$i]} ) - fi - - if [[ "$server_continent" == "AS" ]]; then - richable_as+=( ${rand_by_domain[$i]} ) - fi - - richable+=( ${rand_by_domain[$i]} ) - fi - - i=$(($i+1)) - -done - -server_found="1" -if [[ "$continent" == "EU" ]]; then - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi -elif [[ "$continent" == "US" ]]; then - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -elif [[ "$continent" == "AS" ]]; then - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -else - len=${#richable[@]} - if [[ "$len" == "0" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 - Server_offline=1 - return 1 - fi -fi - - - -if [[ "$server_found" == "0" ]]; then - len=${#richable[@]} - if [[ "$len" == "0" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation skipped.. ${NC}" && sleep 1 - Server_offline=1 - return 1 - fi -fi - -Server_offline=0 - -} - ->>>>>>> 9e0de904a2406df7f270beb163f8a687826b5c3e if ! jq --version > /dev/null 2>&1; then sudo apt install jq -y > /dev/null 2>&1 fi diff --git a/install_pro.sh b/install_pro.sh index e944f315..5950059e 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_helpers.sh +source ~/.flux_common.sh # Bootstrap settings @@ -43,218 +43,6 @@ ZELNODEPORT=16128 RPCPORT=16124 PORT=16125 -<<<<<<< HEAD -======= -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -#dialog color -export NEWT_COLORS=' -title=black, -' -function string_limit_check_mark() { -if [[ -z "$2" ]]; then -string="$1" -string=${string::40} -else -string=$1 -string_color=$2 -string_leght=${#string} -string_leght_color=${#string_color} -string_diff=$((string_leght_color-string_leght)) -string=${string_color::40+string_diff} -fi -echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - - -function bootstrap_server(){ -rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") -richable=() -richable_eu=() -richable_us=() -richable_as=() - -i=0 -len=${#rand_by_domain[@]} -echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" -while [ $i -lt $len ]; -do - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) - if [[ "$bootstrap_check" != "" ]]; then - - if [[ "${rand_by_domain[$i]}" -ge "8" && "${rand_by_domain[$i]}" -le "11" ]]; then - richable_eu+=( ${rand_by_domain[$i]} ) - fi - - if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then - richable_us+=( ${rand_by_domain[$i]} ) - fi - - if [[ "${rand_by_domain[$i]}" -ge "12" ]]; then - richable_as+=( ${rand_by_domain[$i]} ) - fi - - richable+=( ${rand_by_domain[$i]} ) - fi - - i=$(($i+1)) -done - -server_found="1" -if [[ "$continent" == "EU" ]]; then - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi -elif [[ "$continent" == "US" ]]; then - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -elif [[ "$continent" == "AS" ]]; then - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -else - len=${#richable[@]} - if [[ "$len" -gt "0" ]]; then - richable=( ${richable[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - - if [[ "$len" == "0" ]]; then - Server_offline=1 - return 1 - fi -fi - -if [[ "$server_found" == "0" ]]; then - len=${#richable[@]} - if [[ "$len" == "0" ]]; then - Server_offline=1 - return 1 - fi -fi - -Server_offline=0 - -} - -function bootstrap_geolocation(){ - -IP=$WANIP -ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone | jq .) -ip_status=$( jq -r .status <<< "$ip_output") - -if [[ "$ip_status" == "success" ]]; then -country=$(jq -r .country <<< "$ip_output") -org=$(jq -r .org <<< "$ip_output") -continent=$(jq -r .timezone <<< "$ip_output") -else -country="UKNOW" -continent="UKNOW" -fi - -continent=$(cut -f1 -d"/" <<< "$continent" ) - -if [[ "$continent" =~ "Europe" ]]; then - continent="EU" -elif [[ "$continent" =~ "America" ]]; then - continent="US" -elif [[ "$continent" =~ "Asia" ]]; then - continent="AS" -else - continent="ALL" -fi - -echo -e "" -echo -e "${ARROW} ${YELLOW}Selecting bootstrap server....${NC}" -echo -e "${ARROW} ${CYAN}Node Location: $country, Continent: $continent ${NC}" -echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" -} - ->>>>>>> 9e0de904a2406df7f270beb163f8a687826b5c3e function config_veryfity(){ diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 74ac87c0..40285ea6 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_helpers.sh +source ~/.flux_common.sh # Bootstrap settings BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' diff --git a/multinode.sh b/multinode.sh index 0c14023d..539c2ce9 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_helpers.sh +source ~/.flux_common.sh function insertAfter { diff --git a/multitoolbox.sh b/multitoolbox.sh index 5a9880a7..88edc89f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,7 +1,7 @@ #!/bin/bash -curl --silent -o /dev/null https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/helpers.sh >> ~/.flux_helpers.sh -source ~/.flux_helpers.sh +curl --silent -o /dev/null https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh => ~/.flux_common.sh +source ~/.flux_common.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' @@ -28,190 +28,6 @@ dversion="v7.1" PM2_INSTALL="0" zelflux_setting_import="0" -<<<<<<< HEAD -======= -#dialog color -export NEWT_COLORS=' -title=black, -' - -function bootstrap_server(){ -rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") -richable=() -richable_eu=() -richable_us=() -richable_as=() - -i=0 -len=${#rand_by_domain[@]} -echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" -while [ $i -lt $len ]; -do - #echo ${rand_by_domain[$i]} - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) - #echo -e "Height: $bootstrap_check" - if [[ "$bootstrap_check" != "" ]]; then - #echo -e "Adding: ${rand_by_domain[$i]}" - - if [[ "${rand_by_domain[$i]}" -ge "8" && "${rand_by_domain[$i]}" -le "11" ]]; then - richable_eu+=( ${rand_by_domain[$i]} ) - fi - - if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then - richable_us+=( ${rand_by_domain[$i]} ) - fi - - if [[ "${rand_by_domain[$i]}" -ge "12" ]]; then - richable_as+=( ${rand_by_domain[$i]} ) - fi - - richable+=( ${rand_by_domain[$i]} ) - fi - - i=$(($i+1)) -done - -server_found="1" -if [[ "$continent" == "EU" ]]; then - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi -elif [[ "$continent" == "US" ]]; then - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -elif [[ "$continent" == "AS" ]]; then - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi -else - len=${#richable[@]} - if [[ "$len" -gt "0" ]]; then - richable=( ${richable[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - - if [[ "$len" == "0" ]]; then - Server_offline=1 - return 1 - fi -fi - - - -if [[ "$server_found" == "0" ]]; then - len=${#richable[@]} - if [[ "$len" == "0" ]]; then - Server_offline=1 - return 1 - fi -fi - -Server_offline=0 - -} - -function bootstrap_geolocation(){ - -IP=$WANIP -ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone | jq .) -ip_status=$( jq -r .status <<< "$ip_output") - -if [[ "$ip_status" == "success" ]]; then -country=$(jq -r .country <<< "$ip_output") -org=$(jq -r .org <<< "$ip_output") -continent=$(jq -r .timezone <<< "$ip_output") -else -country="UKNOW" -continent="UKNOW" -fi - -continent=$(cut -f1 -d"/" <<< "$continent" ) - -if [[ "$continent" =~ "Europe" ]]; then - continent="EU" -elif [[ "$continent" =~ "America" ]]; then - continent="US" -elif [[ "$continent" =~ "Asia" ]]; then - continent="AS" -else - continent="ALL" -fi - -echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" -echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" -echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" - - -} - ->>>>>>> 9e0de904a2406df7f270beb163f8a687826b5c3e function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then @@ -1286,25 +1102,6 @@ function flux_daemon_bootstrap() { } -function analyzer_and_fixer(){ - -echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/nodeanalizerandfixer.sh) - - -} - - function install_node(){ echo -e "${GREEN}Module: Install FluxNode${NC}" @@ -1600,48 +1397,6 @@ MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" spinning_timer echo -e "" && echo -e "" -} - - -function replace_zelid() { - - echo -e "${GREEN}Module: Replace Zel ID${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - -while true - do - - new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - - if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then - string_limit_check_mark "Zel ID is valid..........................................." - break - else - string_limit_x_mark "Zel ID is not valid try again..........................................." - sleep 2 - fi - - done - - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped........................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js - - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" - fi - - fi - } diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 5761ea16..54b91863 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1,6 +1,7 @@ #!/bin/bash -source ~/.flux_helpers.sh +curl --silent -o /dev/null https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/helpers.sh >> ~/.flux_common.sh +source ~/.flux_common.sh BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' @@ -914,24 +915,6 @@ function flux_daemon_bootstrap() { } -function analyzer_and_fixer(){ - -echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/nodeanalizerandfixer.sh) - - -} - function install_node(){ @@ -1204,48 +1187,6 @@ echo -e "" && echo -e "" } - - -function replace_zelid() { - - echo -e "${GREEN}Module: Replace Zel ID${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - -while true - do - - new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - - if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then - string_limit_check_mark "Zel ID is valid..........................................." - break - else - string_limit_x_mark "Zel ID is not valid try again..........................................." - sleep 2 - fi - - done - - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped........................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js - - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" - fi - - fi - -} function update_binary(){ diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 2196b9ad..3eb95b3d 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_helpers.sh +source ~/.flux_common.sh #const REPLACE="0" @@ -262,15 +262,6 @@ done } -function check_benchmarks() { - var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") - limit=$2 - if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]]; then - var_round=$(round "$var_benchmark" 2) - echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" - fi - -} if [[ "$USER" == "root" ]] then From 32d76e0c30a9bc20a7ffe13454dfca49b37bff84 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 20:33:33 -0500 Subject: [PATCH 0486/1176] Fixing file overwrite. --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 88edc89f..5dc55d87 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,6 +1,6 @@ #!/bin/bash -curl --silent -o /dev/null https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh => ~/.flux_common.sh +curl --silent -o /dev/null https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh > ~/.flux_common.sh source ~/.flux_common.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' From 9bc85695dd17de95448801f6209f231f69de67ba Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 20:34:59 -0500 Subject: [PATCH 0487/1176] Another test. --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5dc55d87..f711f350 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,6 +1,6 @@ #!/bin/bash -curl --silent -o /dev/null https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh > ~/.flux_common.sh +curl --silent https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh > ~/.flux_common.sh source ~/.flux_common.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' From cc60acb1658f142457b55b1d8258133fe68b5df6 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 20:36:38 -0500 Subject: [PATCH 0488/1176] Removing relative path. --- multitoolbox.sh | 2 +- test | 1573 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1574 insertions(+), 1 deletion(-) create mode 100644 test diff --git a/multitoolbox.sh b/multitoolbox.sh index f711f350..6cf1e06c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,6 +1,6 @@ #!/bin/bash -curl --silent https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh > ~/.flux_common.sh +curl --silent https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh > /home/$USER/.flux_common.sh source ~/.flux_common.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' diff --git a/test b/test new file mode 100644 index 00000000..50a974f3 --- /dev/null +++ b/test @@ -0,0 +1,1573 @@ +#!/bin/bash + +# Collection of common vars and functions used throughout multitoolbox. + +#color codes +RED='\033[1;31m' +YELLOW='\033[1;33m' +BLUE="\\033[38;5;27m" +SEA="\\033[38;5;49m" +GREEN='\033[1;32m' +CYAN='\033[1;36m' +NC='\033[0m' + +#emoji codes +CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" +X_MARK="${RED}\xE2\x9C\x96${NC}" +PIN="${RED}\xF0\x9F\x93\x8C${NC}" +CLOCK="${GREEN}\xE2\x8C\x9B${NC}" +ARROW="${SEA}\xE2\x96\xB6${NC}" +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + +#dialog color +export NEWT_COLORS=' +title=black, +' + +function round() { + printf "%.${2}f" "${1}" +} + +function max(){ + m="0" + for n in "$@" + do + if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then + [ "$n" -gt "$m" ] && m="$n" + fi + done + echo "$m" +} + +function spinning_timer() { + animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) + end=$((SECONDS+NUM)) + while [ $SECONDS -lt $end ]; + do + for i in "${animation[@]}"; + do + echo -e "" + echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" + sleep 0.1 + + done + done + echo -ne "${MSG2}" +} + +function string_limit_x_mark() { + if [[ -z "$2" ]]; then + string="$1" + string=${string::50} + else + string=$1 + string_color=$2 + string_leght=${#string} + string_leght_color=${#string_color} + string_diff=$((string_leght_color-string_leght)) + string=${string_color::50+string_diff} + fi + echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" +} + +function string_limit_check_mark_port() { + if [[ -z "$2" ]]; then + string="$1" + string=${string::65} + else + string=$1 + string_color=$2 + string_leght=${#string} + string_leght_color=${#string_color} + string_diff=$((string_leght_color-string_leght)) + string=${string_color::65+string_diff} + fi + echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" +} + +function string_limit_check_mark() { + if [[ -z "$2" ]]; then + string="$1" + string=${string::40} + else + string=$1 + string_color=$2 + string_leght=${#string} + string_leght_color=${#string_color} + string_diff=$((string_leght_color-string_leght)) + string=${string_color::40+string_diff} + fi + echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" +} + +function spinning_timer() { + animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) + end=$((SECONDS+NUM)) + while [ $SECONDS -lt $end ]; + do + for i in "${animation[@]}"; + do + echo -e "" + echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" + sleep 0.1 + + done + done + echo -ne "${MSG2}" +} + +function bootstrap_server(){ + rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") + richable=() + richable_eu=() + richable_us=() + richable_as=() + + i=0 + len=${#rand_by_domain[@]} + echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" + while [ $i -lt $len ]; + do + bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) + if [[ "$bootstrap_check" != "" ]]; then + + if [[ "${rand_by_domain[$i]}" -ge "8" && "${rand_by_domain[$i]}" -le "11" ]]; then + richable_eu+=( ${rand_by_domain[$i]} ) + fi + + if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then + richable_us+=( ${rand_by_domain[$i]} ) + fi + + if [[ "${rand_by_domain[$i]}" -ge "12" ]]; then + richable_as+=( ${rand_by_domain[$i]} ) + fi + + richable+=( ${rand_by_domain[$i]} ) + fi + + i=$(($i+1)) + done + + server_found="1" + if [[ "$continent" == "EU" ]]; then + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + elif [[ "$continent" == "US" ]]; then + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_as=${#richable_as[@]} + if [[ "$len_as" -gt "0" ]]; then + richable=( ${richable_as[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_as" == "0" ]]; then + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + fi + elif [[ "$continent" == "AS" ]]; then + len_as=${#richable_as[@]} + if [[ "$len_as" -gt "0" ]]; then + richable=( ${richable_as[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_as" == "0" ]]; then + continent="AS" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_us=${#richable_us[@]} + if [[ "$len_us" -gt "0" ]]; then + richable=( ${richable_us[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_us" == "0" ]]; then + continent="US" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + len_eu=${#richable_eu[@]} + if [[ "$len_eu" -gt "0" ]]; then + richable=( ${richable_eu[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + if [[ "$len_eu" == "0" ]]; then + continent="EU" + echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 + server_found="0" + fi + fi + fi + else + len=${#richable[@]} + if [[ "$len" -gt "0" ]]; then + richable=( ${richable[*]} ) + echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" + fi + + if [[ "$len" == "0" ]]; then + Server_offline=1 + return 1 + fi + fi + + if [[ "$server_found" == "0" ]]; then + len=${#richable[@]} + if [[ "$len" == "0" ]]; then + Server_offline=1 + return 1 + fi + fi + + Server_offline=0 +} + +function bootstrap_geolocation(){ + IP=$WANIP + ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) + ip_status=$( jq -r .status 2>/dev/null <<< "$ip_output") + + if [[ "$ip_status" == "success" ]]; then + country=$(jq -r .country <<< "$ip_output") + org=$(jq -r .org <<< "$ip_output") + continent=$(jq -r .timezone <<< "$ip_output") + else + country="UKNOW" + continent="UKNOW" + fi + + continent=$(cut -f1 -d"/" <<< "$continent" ) + + if [[ "$continent" =~ "Europe" ]]; then + continent="EU" + elif [[ "$continent" =~ "America" ]]; then + continent="US" + elif [[ "$continent" =~ "Asia" ]]; then + continent="AS" + else + continent="ALL" + fi + + echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" + echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" + echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" + bootstrap_server $continent +} + +function get_ip(){ + WANIP=$(curl -SsL -m 5 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl -SsL -m 5 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl -SsL -m 5 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') + fi +} + +function selfhosting() { + + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" + echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + else + echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 + echo -e "" + return 1 + fi + + echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 + sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 + sudo touch /home/$USER/ip_check.sh + sudo chown $USER:$USER /home/$USER/ip_check.sh + cat <<'EOF' > /home/$USER/ip_check.sh +#!/bin/bash +function get_ip(){ + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi +} +if [[ $1 == "restart" ]]; then + # give 3min to connect with internet + sleep 180 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi +fi +if [[ $1 == "ip_check" ]]; then + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + if [[ "$api_port" == "" ]]; then + api_port="16127" + fi + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') + if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then + if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + fi +fi +EOF + sudo chmod +x /home/$USER/ip_check.sh + echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 + + #crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) + sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 + + if [[ "$crontab_check" == "0" ]]; then + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + else + echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + fi + echo -e "" +} + + +function integration_check() { + FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) + ELEMENTS=${#FILE_ARRAY[@]} + + for (( i=0;i<$ELEMENTS;i++)); do + string="${FILE_ARRAY[${i}]}................................." + string=${string::40} + + if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then + echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" + CORRUPTED="1" + fi + done + + if [[ "$CORRUPTED" == "1" ]]; then + echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" + echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" + echo + exit + fi + echo -e "" +} + + +function config_file() { + if [[ -f /home/$USER/install_conf.json ]]; then + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + #ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') + #firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') + bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') + bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') + #swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') + #mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') + #watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') + use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') + prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') + outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') + index=$(cat /home/$USER/install_conf.json | jq -r '.index') + ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') + KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') + flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') + daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') + bench_update=$(cat /home/$USER/install_conf.json | jq -r '.zelbench_update') + node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') + eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') + discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') + ping=$(cat /home/$USER/install_conf.json | jq -r '.ping') + telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') + telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') + telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') + + echo + echo -e "${ARROW} ${YELLOW}Install config:" + + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then + echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + if [[ "$import_settings" == "1" ]]; then + echo -e "${PIN}${CYAN} Import settings from Flux........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi + + if [[ "$use_old_chain" == "1" ]]; then + echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + if [[ "$bootstrap_url" == "0" ]]; then + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...........[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + + if [[ "$bootstrap_zip_del" == "1" ]]; then + echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi + + #if [[ "$swapon" == "1" ]]; then + #echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + #fi + + #if [[ "$mongo_bootstrap" == "1" ]]; then + #echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + #fi + + if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then + echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi +} + +function check_benchmarks() { + var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") + limit=$2 + if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]]; then + var_round=$(round "$var_benchmark" 2) + echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" + fi +} + +function tar_file_unpack() { + echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" + pv $1 | tar -zx -C $2 +} + + +function check_tar() { + echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" + if gzip -t "$1" &>/dev/null; then + echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $1 + fi +} + +function tar_file_pack() { + echo -e "${ARROW} ${YELLOW}Creating bootstrap archive file...${NC}" + tar -czf - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 +} + +function flux_package() { + sudo apt-get update -y > /dev/null 2>&1 && sleep 2 + echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" + sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 + sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 + integration_check +} + +function zk_params() { + echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" + bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 + sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 +} + +function create_service_scripts() { + #echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 + sudo touch /home/$USER/start_daemon_service.sh + sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + cat <<'EOF' > /home/$USER/start_daemon_service.sh +#!/bin/bash + +#color codes +RED='\033[1;31m' +CYAN='\033[1;36m' +NC='\033[0m' +#emoji codes +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + +sleep 2 +echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" +echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" +bench_status_pind=$(pgrep fluxbenchd) +daemon_status_pind=$(pgrep fluxd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then + echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" + else +if [[ "$bench_status_pind" != "" ]]; then + echo -e "${WORNING} Running benchmark process detected${NC}" + echo -e "${WORNING} Killing benchmark...${NC}" + sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then + echo -e "${WORNING} Running daemon process detected${NC}" + echo -e "${WORNING} Killing daemon...${NC}" + sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 +fi + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi + +bench_status_pind=$(pgrep zelbenchd) +daemon_status_pind=$(pgrep zelcashd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then + echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then + echo -e "${WORNING} Running benchmark process detected${NC}" + echo -e "${WORNING} Killing benchmark...${NC}" + sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then + echo -e "${WORNING} Running daemon process detected${NC}" + echo -e "${WORNING} Killing daemon...${NC}" + sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 +fi + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi + +if [[ -f /usr/local/bin/fluxd ]]; then + bash -c "fluxd" + exit +else + bash -c "zelcashd" + exit +fi +EOF + + + sudo touch /home/$USER/stop_daemon_service.sh + sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh + cat <<'EOF' > /home/$USER/stop_daemon_service.sh +#!/bin/bash +if [[ -f /usr/local/bin/flux-cli ]]; then + bash -c "flux-cli stop" +else + bash -c "zelcash-cli stop" +fi +exit +EOF + + sudo chmod +x /home/$USER/stop_daemon_service.sh + sudo chmod +x /home/$USER/start_daemon_service.sh + +} + +function create_service() { + echo -e "${ARROW} ${YELLOW}Creating Flux daemon service...${NC}" && sleep 1 + sudo touch /etc/systemd/system/zelcash.service + sudo chown $USER:$USER /etc/systemd/system/zelcash.service + cat << EOF > /etc/systemd/system/zelcash.service +[Unit] +Description=Flux daemon service +After=network.target +[Service] +Type=forking +User=$USER +Group=$USER +ExecStart=/home/$USER/start_daemon_service.sh +ExecStop=-/home/$USER/stop_daemon_service.sh +Restart=always +RestartSec=10 +PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=15s +StartLimitInterval=120s +StartLimitBurst=5 +[Install] +WantedBy=multi-user.target +EOF + sudo chown root:root /etc/systemd/system/zelcash.service + sudo systemctl daemon-reload +} + +function pm2_install(){ + echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" + npm install pm2@latest -g > /dev/null 2>&1 + + if pm2 -v > /dev/null 2>&1; then + echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" + pm2 startup systemd -u $USER > /dev/null 2>&1 + sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 + + #pm2 start ~/zelflux/start.sh --name zelflux > /dev/null 2>&1 + #pm2 save > /dev/null 2>&1 + + pm2 install pm2-logrotate > /dev/null 2>&1 + pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 + pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 + pm2 set pm2-logrotate:compress true > /dev/null 2>&1 + pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 + pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 + + source ~/.bashrc + #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" + string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." + echo + else + string_limit_x_mark "PM2 was not installed................................." + echo + fi +} + +function log_rotate() { + echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" + sleep 1 + if [ -f /etc/logrotate.d/$2 ]; then + sudo rm -rf /etc/logrotate.d/$2 + sleep 2 + fi + + sudo touch /etc/logrotate.d/$2 + sudo chown $USER:$USER /etc/logrotate.d/$2 + cat << EOF > /etc/logrotate.d/$2 +$3 { + compress + copytruncate + missingok + $4 + rotate $5 +} +EOF + sudo chown root:root /etc/logrotate.d/$2 +} + +function install_mongod() { + echo + echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" + sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 + sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 + sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 + sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 + sudo systemctl enable mongod > /dev/null 2>&1 + sudo systemctl start mongod > /dev/null 2>&1 + if mongod --version > /dev/null 2>&1; then + #echo -e "${ARROW} ${CYAN}MongoDB version: ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed${NC}" + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}MongoDB was not installed${NC}" + string_limit_x_mark "MongoDB was not installed................................." + echo + fi +} + +function install_nodejs() { + echo -e "${ARROW} ${YELLOW}Removing any instances of Nodejs...${NC}" + n-uninstall -y > /dev/null 2>&1 && sleep 1 + rm -rf ~/n + sudo apt-get remove nodejs npm nvm -y > /dev/null 2>&1 && sleep 1 + sudo apt-get purge nodejs nvm -y > /dev/null 2>&1 && sleep 1 + sudo rm -rf /usr/local/bin/npm + sudo rm -rf /usr/local/share/man/man1/node* + sudo rm -rf /usr/local/lib/dtrace/node.d + sudo rm -rf ~/.npm + sudo rm -rf ~/.nvm + sudo rm -rf ~/.pm2 + sudo rm -rf ~/.node-gyp + sudo rm -rf /opt/local/bin/node + sudo rm -rf opt/local/include/node + sudo rm -rf /opt/local/lib/node_modules + sudo rm -rf /usr/local/lib/node* + sudo rm -rf /usr/local/include/node* + sudo rm -rf /usr/local/bin/node* + echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" + #export NVM_DIR="$HOME/.nvm" && ( + # git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" > /dev/null 2>&1 + # cd "$NVM_DIR" + # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 + #) && \. "$NVM_DIR/nvm.sh" + #cd + #curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 + curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 + . ~/.profile + . ~/.bashrc + sleep 1 + #nvm install v12.16.1 + nvm install 16 > /dev/null 2>&1 + if node -v > /dev/null 2>&1; then + #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" + string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" + string_limit_x_mark "Nodejs was not installed................................." + echo + fi +} + +function check() { + cd + pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + #sleep 120 + #cd /home/$USER/zelflux + #pm2 stop flux + #npm install --legacy-peer-deps > /dev/null 2>&1 + #pm2 start flux + #cd + + NUM='400' + MSG1='Finalizing Flux installation please be patient this will take about ~5min...' + MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + echo && spinning_timer + echo + + $BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 + + NUM='250' + MSG1='Restarting benchmark...' + MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo + + echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" + echo -e "${YELLOW}======================${NC}" + bench_benchmarks=$($BENCH_CLI getbenchmarks) + + if [[ "bench_benchmarks" != "" ]]; then + bench_status=$(jq -r '.status' <<< "$bench_benchmarks") + if [[ "$bench_status" == "failed" ]]; then + echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" + check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" + check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" + else + echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" + bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") + echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" + bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") + bench_ram=$(round "$bench_ram" 2) + echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" + bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") + bench_ssd=$(round "$bench_ssd" 2) + echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" + bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") + bench_hdd=$(round "$bench_hdd" 2) + echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" + bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") + bench_ddwrite=$(round "$bench_ddwrite" 2) + echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" + bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") + bench_eps=$(round "$bench_eps" 2) + echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" + fi + else + echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" + fi +} + +function display_banner() { + echo -e "${BLUE}" + figlet -t -k "FLUXNODE" + figlet -t -k "INSTALLATION COMPLETED" + echo -e "${YELLOW}================================================================================================================================" + #echo -e "FLUXNODE INSTALATION COMPLITED${NC}" + #echo -e "${CYAN}COURTESY OF DK808/XK4MiLX${NC}" + echo + if pm2 -v > /dev/null 2>&1; then + pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) + if [[ "$pm2_flux_status" == "online" ]]; then + pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" + else + if [[ "$pm2_flux_status" != "" ]]; then + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" + fi + fi + echo + fi + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" + echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" + echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" + echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" + echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} -testnet getinfo${NC}" + echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} -testnet getbenchmarks${NC}" + echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} -testnet restartnodebenchmarks${NC}" + echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} -testnet stop${NC}" + echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" + echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" + echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" + echo + if [[ "$WATCHDOG_INSTALL" == "1" ]]; then + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" + echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" + echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo + echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" + echo + fi + echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" + echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" + sleep 1 + cd $HOME + exec bash +} + +function start_install() { + start_install=`date +%s` + sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo + echo -e "${CYAN}February 2021, created by dk808 improved by XK4MiLX from Flux's team." + echo -e "Special thanks to Goose-Tech, Skyslayer, & Packetflow." + echo -e "FluxNode setup starting, press [CTRL+C] to cancel.${NC}" + sleep 2 + + if jq --version > /dev/null 2>&1; then + echo -e "" + else + echo -e "" + echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" + sudo apt install jq -y > /dev/null 2>&1 + + if jq --version > /dev/null 2>&1; then + #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" + string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" + string_limit_x_mark "JQ was not installed................................." + echo + exit + fi + fi + if [ "$USER" = "root" ]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}root${CYAN}, please switch to the username you just created.${NC}" + sleep 4 + exit + fi + + start_dir=$(pwd) + correct_dir="/home/$USER" + echo -e "${ARROW} ${YELLOW}Checking directory....${NC}" + if [[ "$start_dir" == "$correct_dir" ]]; then + echo -e "${ARROW} ${CYAN}Correct directory ${GREEN}$(pwd)${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW} ${CYAN}Bad directory switching...${NC}" + cd + echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" + fi + sleep 1 + config_file + + if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then + import_date + else + + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then + IMPORT_ZELCONF="1" + IMPORT_ZELID="1" + echo -e "" + echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" + zelnodeprivkey="$prvkey" + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + zelnodeoutpoint="$outpoint" + echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + zelnodeindex="$index" + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 + + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 + fi + + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 + fi + + echo -e "" + echo -e "${ARROW} ${YELLOW}Watchdog conf settings:${NC}" + + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 + fi + + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 + + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 + fi + + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 + fi + fi + + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 + fi + + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + fi + + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 + fi + echo -e "" + fi + fi +} + +function create_swap() { + + if [[ -z "$swapon" ]]; then + #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + else + echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" + fi + else + if [[ "$swapon" == "1" ]]; then + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + else + echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" + fi + fi + fi + sleep 2 +} + +function install_packages() { + echo + echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" + + if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then + sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 + fi + + if ! dirmngr --v > /dev/null 2>&1; then + sudo apt install dirmngr -y > /dev/null 2>&1 + fi + + sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get --with-new-pkgs upgrade -y > /dev/null 2>&1 + sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 + sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 + sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 + sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 + sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 + sudo apt-get remove sysbench -y > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" +} + +function ip_confirm() { + WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" ]]; then + echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" + echo + exit + fi + + string_limit_check_mark "IP: $WANIP ..........................................." "IP: ${GREEN}$WANIP${CYAN} ..........................................." +} + + +function kda_bootstrap() { + echo -e "${GREEN}Module: Restore Kadena node blockchain from bootstrap${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "${NC}" + sudo chown -R $USER:$USER /home/$USER/$FLUX_DIR + echo -e "${ARROW} ${CYAN}Stopping Kadena Node...${NC}" + + docker stop zelKadenaChainWebNode > /dev/null 2>&1 && sleep 10 + + if [[ -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db ]]; then + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + sudo rm -rf /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db + fi + + mkdir -p /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 + + if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then + echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" + if whiptail --yesno "Do u want check vailidation of archive file before unpack?" 8 60 3>&1 1>&2 2>&3; then + check_tar "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" + else + echo -e "${ARROW} ${CYAN}Vailidation of archive file skipped..${NC}" + fi + fi + + if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then + tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" + sleep 2 + #unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode > /dev/null 2>&1 + else + echo -e "${ARROW} ${CYAN}Bootstrap file downloading...${NC}" && sleep 2 + CHOICE=$( + whiptail --title "Bootstrap installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ + "1)" "Download from source build in script" \ + "2)" "Download from own source" 3>&2 2>&1 1>&3 + ) + case $CHOICE in + "1)") + DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') + fi + echo -e "${ARROW} ${CYAN}KDA Bootstrap height: ${GREEN}$DB_HIGHT${NC}" + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" + wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress + tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" + sleep 2 + ;; + "2)") + KDA_BOOTSTRAP_ZIP="$(whiptail --title "Kadena node bootstrap source (*.tar.gz, *.zip file supported)" --inputbox "Enter your URL" 8 72 3>&1 1>&2 2>&3)" + KDA_BOOTSTRAP_ZIPFILE="${KDA_BOOTSTRAP_ZIP##*/}" + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" + wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress + + if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then + echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" + fi + sleep 2 + ;; + esac + fi + + if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + rm -rf $KDA_BOOTSTRAP_ZIPFILE + fi + + docker start zelKadenaChainWebNode > /dev/null 2>&1 + NUM='15' + MSG1='Starting Kadena Node...' + MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo -e "" + echo -e "${ARROW} ${CYAN}Kadena Node initial process can take about ~15min. ${NC}" + echo -e "" +} + +function mongodb_bootstrap() { + echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${ARROW} ${CYAN}Module disabled...${NC}" + echo -e "" + exit + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + sudo rm /home/$USER/fluxdb_dump.tar.gz > /dev/null 2>&1 + sudo rm /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 + + if ! pm2 -v > /dev/null 2>&1; then + pm2_install + if [[ "$PM2_INSTALL" == "0" ]]; then + exit + fi + fi + + WANIP=$(wget http://ipecho.net/plain -O - -q) + + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') + fi + + BLOCKHIGHT=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') + FORCE_BOOTSTRAP=0 + + if [[ "$DB_HIGHT" == "" ]]; then + echo -e "${ARROW} ${CYAN}MongoDB bootstrap server offline...${NC}" + string_limit_x_mark "Operation aborted....................." + exit + fi + + + if [[ "$BLOCKHIGHT" == "" || "$BLOCKHIGHT" == "null" ]]; then + if whiptail --yesno "Local Explorer not respondin...Would you like force bootstrap installation?" 8 60; then + FORCE_BOOTSTRAP=1 + else + string_limit_x_mark "Local Explorer not responding........." + string_limit_x_mark "Operation aborted....................." + echo -e "" + exit + fi + fi + if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then + if [[ "$BLOCKHIGHT" == "null" ]]; then + message=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq -r .data.message) + if whiptail --yesno "Flux explorer error noticed...Would you like force bootstrap installation?" 8 60; then + FORCE_BOOTSTRAP=1 + else + echo -e "${ARROW} ${CYAN}Flux explorer error: ${RED}$message${NC}" + string_limit_x_mark "Operation aborted....................." + echo -e "" + exit + fi + fi + fi + + if [[ "$BLOCKHIGHT" != "" && "$BLOCKHIGHT" != "null" ]]; then + if [[ "$BLOCKHIGHT" -gt "$DB_HIGHT" ]]; then + if whiptail --yesno "Datatable is out of date....Would you like force bootstrap installation?" 8 60; then + FORCE_BOOTSTRAP=1 + else + echo -e "${ARROW} ${CYAN}Current Node block hight ${RED}$BLOCKHIGHT${CYAN} > Bootstrap block hight ${RED}$DB_HIGHT${CYAN}. Datatable is out of date.${NC}" + string_limit_x_mark "Operation aborted....................." + echo -e "" + exit + fi + fi + fi + + + echo -e "${ARROW} ${CYAN}IP: ${RED}$WANIP${NC}" + + if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then + echo -e "${ARROW} ${CYAN}Node block hight: ${GREEN}$BLOCKHIGHT${NC}" + fi + + echo -e "${ARROW} ${CYAN}Bootstrap block hight: ${GREEN}$DB_HIGHT${NC}" + echo -e "" + + + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" + wget $BOOTSTRAP_URL_MONGOD -q --show-progress + echo -e "${ARROW} ${CYAN}Unpacking...${NC}" + tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}Stoping Flux...${NC}" + pm2 stop flux > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" + mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 + sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 + pm2 start flux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + + NUM='120' + MSG1='Flux starting...' + MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo + + #BLOCKHIGHT_AFTER_BOOTSTRAP=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') + BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) + if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "" && "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "null" ]]; then + echo -e "${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC}" + if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then + string_limit_check_mark "MongoDB bootstrap installed successful.................................." + echo -e "" + else + if [[ "$FORCE_BOOTSTRAP" == "1" ]]; then + string_limit_check_mark "MongoDB bootstrap installed successful.................................." + echo -e "" + else + string_limit_x_mark "MongoDB bootstrap installation failed.................................." + echo -e "" + fi + fi + else + string_limit_x_mark "MongoDB bootstrap installation failed.................................." + echo -e "" + fi +} + +function install_kernel(){ + echo -e "${GREEN}Module: Install Linux Kernel 5.X for Ubuntu 18.04${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "${NC}" + echo -e "${YELLOW}Installing Linux Kernel 5.x${NC}" + sudo apt-get install --install-recommends linux-generic-hwe-18.04 -y + read -p "Would you like to reboot pc Y/N?" -n 1 -r + echo -e "${NC}" + if [[ $REPLY =~ ^[Yy]$ ]]; then + sudo reboot -n + fi +} + +function multinode(){ + echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "" + echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" + echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" + echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" + echo -e "" + echo -e "${ARROW} ${RED}IMPORTANT:${NC}" + echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" + echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" + echo -e "" + echo -e "${YELLOW}================================================================${NC}" + echo -e "" + + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" + echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" + echo -e "" + exit + fi + + sleep 15 + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multinode.sh) +} + +function create_service_scripts() { + echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 + sudo touch /home/$USER/start_daemon_service.sh + sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + cat <<'EOF' > /home/$USER/start_daemon_service.sh +#!/bin/bash +#color codes +RED='\033[1;31m' +CYAN='\033[1;36m' +NC='\033[0m' +#emoji codes +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" +sleep 2 +echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" +echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" +bench_status_pind=$(pgrep fluxbenchd) +daemon_status_pind=$(pgrep fluxd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi +bench_status_pind=$(pgrep zelbenchd) +daemon_status_pind=$(pgrep zelcashd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then +echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else +if [[ "$bench_status_pind" != "" ]]; then +echo -e "${WORNING} Running benchmark process detected${NC}" +echo -e "${WORNING} Killing benchmark...${NC}" +sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 +fi +if [[ "$daemon_status_pind" != "" ]]; then +echo -e "${WORNING} Running daemon process detected${NC}" +echo -e "${WORNING} Killing daemon...${NC}" +sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 +fi +sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi +if [[ -f /usr/local/bin/fluxd ]]; then +bash -c "fluxd" +exit +else +bash -c "zelcashd" +exit +fi +EOF + sudo touch /home/$USER/stop_daemon_service.sh + sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh + cat <<'EOF' > /home/$USER/stop_daemon_service.sh +#!/bin/bash +if [[ -f /usr/local/bin/flux-cli ]]; then +bash -c "flux-cli stop" +else +bash -c "zelcash-cli stop" +fi +exit +EOF + + echo -e "${ARROW} ${CYAN}Setting scripts permissions...${NC}" && sleep 1 + sudo chmod +x /home/$USER/stop_daemon_service.sh + sudo chmod +x /home/$USER/start_daemon_service.sh + echo -e "${ARROW} ${CYAN}Reloading service config...${NC}" && sleep 1 + sudo systemctl daemon-reload > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting Flux daemon....${NC}" && sleep 1 + sudo systemctl start zelcash > /dev/null 2>&1 + echo -e "" +} + +function create_service() { + echo -e "${GREEN}Module: Flux Daemon service creator${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "" + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 + sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 + + echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 + sudo touch /etc/systemd/system/zelcash.service + sudo chown $USER:$USER /etc/systemd/system/zelcash.service + cat << EOF > /etc/systemd/system/zelcash.service +[Unit] +Description=Flux daemon service +After=network.target +[Service] +Type=forking +User=$USER +Group=$USER +ExecStart=/home/$USER/start_daemon_service.sh +ExecStop=-/home/$USER/stop_daemon_service.sh +Restart=always +RestartSec=10 +PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=15s +StartLimitInterval=120s +StartLimitBurst=5 +[Install] +WantedBy=multi-user.target +EOF + sudo chown root:root /etc/systemd/system/zelcash.service +} + +function install_watchtower(){ + echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + echo -e "" + echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" + apps_check=$(docker ps | grep "flux_watchtower") + + if [[ "$apps_check" != "" ]]; then + echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" + docker stop flux_watchtower > /dev/null 2>&1 + sleep 2 + echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" + docker rm flux_watchtower > /dev/null 2>&1 + fi + + echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" + docker pull containrrr/watchtower:latest > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" + random=$(shuf -i 7500-35000 -n 1) + echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" + apps_id=$(docker run -d \ + --restart unless-stopped \ + --name flux_watchtower \ + -v /var/run/docker.sock:/var/run/docker.sock \ + containrrr/watchtower \ + --cleanup --interval $random 2> /dev/null) + if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then + echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" + else + echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" + fi +} + +function analyzer_and_fixer(){ + echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/nodeanalizerandfixer.sh) +} + + +function replace_zelid() { + + echo -e "${GREEN}Module: Replace Zel ID${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + while true + do + new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + done + + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped........................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}ZEL ID replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + +} + + + + From 33fc7a550b058d33541775020e76d28b81f9d7c3 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 20:38:36 -0500 Subject: [PATCH 0489/1176] Another try. --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6cf1e06c..08932718 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,6 +1,6 @@ #!/bin/bash -curl --silent https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh > /home/$USER/.flux_common.sh +curl --silent -o ~/.flux_common.sh https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh source ~/.flux_common.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' From 639412219f56f9273f8b1dc0c297f6c9aa44029e Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 20:40:30 -0500 Subject: [PATCH 0490/1176] DELETE ME: changing alias to test. --- multitoolbox.sh | 2 +- test | 1573 ----------------------------------------------- 2 files changed, 1 insertion(+), 1574 deletions(-) delete mode 100644 test diff --git a/multitoolbox.sh b/multitoolbox.sh index 08932718..e12af740 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1455,7 +1455,7 @@ sudo apt-get install -y whiptail > /dev/null 2>&1 fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then -echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc +echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc source /etc/bash.bashrc fi diff --git a/test b/test deleted file mode 100644 index 50a974f3..00000000 --- a/test +++ /dev/null @@ -1,1573 +0,0 @@ -#!/bin/bash - -# Collection of common vars and functions used throughout multitoolbox. - -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -#dialog color -export NEWT_COLORS=' -title=black, -' - -function round() { - printf "%.${2}f" "${1}" -} - -function max(){ - m="0" - for n in "$@" - do - if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then - [ "$n" -gt "$m" ] && m="$n" - fi - done - echo "$m" -} - -function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - - done - done - echo -ne "${MSG2}" -} - -function string_limit_x_mark() { - if [[ -z "$2" ]]; then - string="$1" - string=${string::50} - else - string=$1 - string_color=$2 - string_leght=${#string} - string_leght_color=${#string_color} - string_diff=$((string_leght_color-string_leght)) - string=${string_color::50+string_diff} - fi - echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" -} - -function string_limit_check_mark_port() { - if [[ -z "$2" ]]; then - string="$1" - string=${string::65} - else - string=$1 - string_color=$2 - string_leght=${#string} - string_leght_color=${#string_color} - string_diff=$((string_leght_color-string_leght)) - string=${string_color::65+string_diff} - fi - echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - -function string_limit_check_mark() { - if [[ -z "$2" ]]; then - string="$1" - string=${string::40} - else - string=$1 - string_color=$2 - string_leght=${#string} - string_leght_color=${#string_color} - string_diff=$((string_leght_color-string_leght)) - string=${string_color::40+string_diff} - fi - echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" -} - -function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - - done - done - echo -ne "${MSG2}" -} - -function bootstrap_server(){ - rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") - richable=() - richable_eu=() - richable_us=() - richable_as=() - - i=0 - len=${#rand_by_domain[@]} - echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" - while [ $i -lt $len ]; - do - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) - if [[ "$bootstrap_check" != "" ]]; then - - if [[ "${rand_by_domain[$i]}" -ge "8" && "${rand_by_domain[$i]}" -le "11" ]]; then - richable_eu+=( ${rand_by_domain[$i]} ) - fi - - if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then - richable_us+=( ${rand_by_domain[$i]} ) - fi - - if [[ "${rand_by_domain[$i]}" -ge "12" ]]; then - richable_as+=( ${rand_by_domain[$i]} ) - fi - - richable+=( ${rand_by_domain[$i]} ) - fi - - i=$(($i+1)) - done - - server_found="1" - if [[ "$continent" == "EU" ]]; then - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - elif [[ "$continent" == "US" ]]; then - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi - elif [[ "$continent" == "AS" ]]; then - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi - else - len=${#richable[@]} - if [[ "$len" -gt "0" ]]; then - richable=( ${richable[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - - if [[ "$len" == "0" ]]; then - Server_offline=1 - return 1 - fi - fi - - if [[ "$server_found" == "0" ]]; then - len=${#richable[@]} - if [[ "$len" == "0" ]]; then - Server_offline=1 - return 1 - fi - fi - - Server_offline=0 -} - -function bootstrap_geolocation(){ - IP=$WANIP - ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) - ip_status=$( jq -r .status 2>/dev/null <<< "$ip_output") - - if [[ "$ip_status" == "success" ]]; then - country=$(jq -r .country <<< "$ip_output") - org=$(jq -r .org <<< "$ip_output") - continent=$(jq -r .timezone <<< "$ip_output") - else - country="UKNOW" - continent="UKNOW" - fi - - continent=$(cut -f1 -d"/" <<< "$continent" ) - - if [[ "$continent" =~ "Europe" ]]; then - continent="EU" - elif [[ "$continent" =~ "America" ]]; then - continent="US" - elif [[ "$continent" =~ "Asia" ]]; then - continent="AS" - else - continent="ALL" - fi - - echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" - echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" - echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" - bootstrap_server $continent -} - -function get_ip(){ - WANIP=$(curl -SsL -m 5 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl -SsL -m 5 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl -SsL -m 5 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') - fi -} - -function selfhosting() { - - echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" - echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 - else - echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 - echo -e "" - return 1 - fi - - echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 - sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 - sudo touch /home/$USER/ip_check.sh - sudo chown $USER:$USER /home/$USER/ip_check.sh - cat <<'EOF' > /home/$USER/ip_check.sh -#!/bin/bash -function get_ip(){ - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi -} -if [[ $1 == "restart" ]]; then - # give 3min to connect with internet - sleep 180 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi -fi -if [[ $1 == "ip_check" ]]; then - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') - if [[ "$api_port" == "" ]]; then - api_port="16127" - fi - confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') - if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then - if [[ "$WANIP" != "$confirmed_ip" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - fi -fi -EOF - sudo chmod +x /home/$USER/ip_check.sh - echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 - - #crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) - sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 - - if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" - else - echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" - fi - echo -e "" -} - - -function integration_check() { - FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) - ELEMENTS=${#FILE_ARRAY[@]} - - for (( i=0;i<$ELEMENTS;i++)); do - string="${FILE_ARRAY[${i}]}................................." - string=${string::40} - - if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then - echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" - CORRUPTED="1" - fi - done - - if [[ "$CORRUPTED" == "1" ]]; then - echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" - echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" - echo - exit - fi - echo -e "" -} - - -function config_file() { - if [[ -f /home/$USER/install_conf.json ]]; then - import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') - #ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') - #firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') - bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') - bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') - #swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') - #mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') - #watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') - use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') - prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') - outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') - index=$(cat /home/$USER/install_conf.json | jq -r '.index') - ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') - KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') - fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') - flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') - daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') - bench_update=$(cat /home/$USER/install_conf.json | jq -r '.zelbench_update') - node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') - eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') - discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') - ping=$(cat /home/$USER/install_conf.json | jq -r '.ping') - telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') - telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') - telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') - - echo - echo -e "${ARROW} ${YELLOW}Install config:" - - if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then - echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - if [[ "$import_settings" == "1" ]]; then - echo -e "${PIN}${CYAN} Import settings from Flux........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi - - if [[ "$use_old_chain" == "1" ]]; then - echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - if [[ "$bootstrap_url" == "0" ]]; then - echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...........[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - - if [[ "$bootstrap_zip_del" == "1" ]]; then - echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi - - #if [[ "$swapon" == "1" ]]; then - #echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - #fi - - #if [[ "$mongo_bootstrap" == "1" ]]; then - #echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - #fi - - if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then - echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi -} - -function check_benchmarks() { - var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") - limit=$2 - if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]]; then - var_round=$(round "$var_benchmark" 2) - echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" - fi -} - -function tar_file_unpack() { - echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" - pv $1 | tar -zx -C $2 -} - - -function check_tar() { - echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" - if gzip -t "$1" &>/dev/null; then - echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $1 - fi -} - -function tar_file_pack() { - echo -e "${ARROW} ${YELLOW}Creating bootstrap archive file...${NC}" - tar -czf - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 -} - -function flux_package() { - sudo apt-get update -y > /dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" - sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 - sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 - integration_check -} - -function zk_params() { - echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" - bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 - sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 -} - -function create_service_scripts() { - #echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 - sudo touch /home/$USER/start_daemon_service.sh - sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - cat <<'EOF' > /home/$USER/start_daemon_service.sh -#!/bin/bash - -#color codes -RED='\033[1;31m' -CYAN='\033[1;36m' -NC='\033[0m' -#emoji codes -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -sleep 2 -echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" -echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" -bench_status_pind=$(pgrep fluxbenchd) -daemon_status_pind=$(pgrep fluxd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then - echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" - else -if [[ "$bench_status_pind" != "" ]]; then - echo -e "${WORNING} Running benchmark process detected${NC}" - echo -e "${WORNING} Killing benchmark...${NC}" - sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then - echo -e "${WORNING} Running daemon process detected${NC}" - echo -e "${WORNING} Killing daemon...${NC}" - sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 -fi - sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi - -bench_status_pind=$(pgrep zelbenchd) -daemon_status_pind=$(pgrep zelcashd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then - echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then - echo -e "${WORNING} Running benchmark process detected${NC}" - echo -e "${WORNING} Killing benchmark...${NC}" - sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then - echo -e "${WORNING} Running daemon process detected${NC}" - echo -e "${WORNING} Killing daemon...${NC}" - sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 -fi - sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi - -if [[ -f /usr/local/bin/fluxd ]]; then - bash -c "fluxd" - exit -else - bash -c "zelcashd" - exit -fi -EOF - - - sudo touch /home/$USER/stop_daemon_service.sh - sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh - cat <<'EOF' > /home/$USER/stop_daemon_service.sh -#!/bin/bash -if [[ -f /usr/local/bin/flux-cli ]]; then - bash -c "flux-cli stop" -else - bash -c "zelcash-cli stop" -fi -exit -EOF - - sudo chmod +x /home/$USER/stop_daemon_service.sh - sudo chmod +x /home/$USER/start_daemon_service.sh - -} - -function create_service() { - echo -e "${ARROW} ${YELLOW}Creating Flux daemon service...${NC}" && sleep 1 - sudo touch /etc/systemd/system/zelcash.service - sudo chown $USER:$USER /etc/systemd/system/zelcash.service - cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service - sudo systemctl daemon-reload -} - -function pm2_install(){ - echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" - npm install pm2@latest -g > /dev/null 2>&1 - - if pm2 -v > /dev/null 2>&1; then - echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" - pm2 startup systemd -u $USER > /dev/null 2>&1 - sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 - - #pm2 start ~/zelflux/start.sh --name zelflux > /dev/null 2>&1 - #pm2 save > /dev/null 2>&1 - - pm2 install pm2-logrotate > /dev/null 2>&1 - pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 - pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 - pm2 set pm2-logrotate:compress true > /dev/null 2>&1 - pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 - pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 - - source ~/.bashrc - #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" - string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." - echo - else - string_limit_x_mark "PM2 was not installed................................." - echo - fi -} - -function log_rotate() { - echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" - sleep 1 - if [ -f /etc/logrotate.d/$2 ]; then - sudo rm -rf /etc/logrotate.d/$2 - sleep 2 - fi - - sudo touch /etc/logrotate.d/$2 - sudo chown $USER:$USER /etc/logrotate.d/$2 - cat << EOF > /etc/logrotate.d/$2 -$3 { - compress - copytruncate - missingok - $4 - rotate $5 -} -EOF - sudo chown root:root /etc/logrotate.d/$2 -} - -function install_mongod() { - echo - echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" - sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 - sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 - sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 - sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 - sudo systemctl enable mongod > /dev/null 2>&1 - sudo systemctl start mongod > /dev/null 2>&1 - if mongod --version > /dev/null 2>&1; then - #echo -e "${ARROW} ${CYAN}MongoDB version: ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed${NC}" - string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}MongoDB was not installed${NC}" - string_limit_x_mark "MongoDB was not installed................................." - echo - fi -} - -function install_nodejs() { - echo -e "${ARROW} ${YELLOW}Removing any instances of Nodejs...${NC}" - n-uninstall -y > /dev/null 2>&1 && sleep 1 - rm -rf ~/n - sudo apt-get remove nodejs npm nvm -y > /dev/null 2>&1 && sleep 1 - sudo apt-get purge nodejs nvm -y > /dev/null 2>&1 && sleep 1 - sudo rm -rf /usr/local/bin/npm - sudo rm -rf /usr/local/share/man/man1/node* - sudo rm -rf /usr/local/lib/dtrace/node.d - sudo rm -rf ~/.npm - sudo rm -rf ~/.nvm - sudo rm -rf ~/.pm2 - sudo rm -rf ~/.node-gyp - sudo rm -rf /opt/local/bin/node - sudo rm -rf opt/local/include/node - sudo rm -rf /opt/local/lib/node_modules - sudo rm -rf /usr/local/lib/node* - sudo rm -rf /usr/local/include/node* - sudo rm -rf /usr/local/bin/node* - echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" - #export NVM_DIR="$HOME/.nvm" && ( - # git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" > /dev/null 2>&1 - # cd "$NVM_DIR" - # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 - #) && \. "$NVM_DIR/nvm.sh" - #cd - #curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 - curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 - . ~/.profile - . ~/.bashrc - sleep 1 - #nvm install v12.16.1 - nvm install 16 > /dev/null 2>&1 - if node -v > /dev/null 2>&1; then - #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" - string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" - string_limit_x_mark "Nodejs was not installed................................." - echo - fi -} - -function check() { - cd - pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - #sleep 120 - #cd /home/$USER/zelflux - #pm2 stop flux - #npm install --legacy-peer-deps > /dev/null 2>&1 - #pm2 start flux - #cd - - NUM='400' - MSG1='Finalizing Flux installation please be patient this will take about ~5min...' - MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" - echo && spinning_timer - echo - - $BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 - - NUM='250' - MSG1='Restarting benchmark...' - MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo && echo - - echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" - echo -e "${YELLOW}======================${NC}" - bench_benchmarks=$($BENCH_CLI getbenchmarks) - - if [[ "bench_benchmarks" != "" ]]; then - bench_status=$(jq -r '.status' <<< "$bench_benchmarks") - if [[ "$bench_status" == "failed" ]]; then - echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" - check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" - check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" - else - echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" - bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") - echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" - bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") - bench_ram=$(round "$bench_ram" 2) - echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" - bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") - bench_ssd=$(round "$bench_ssd" 2) - echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" - bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") - bench_hdd=$(round "$bench_hdd" 2) - echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" - bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") - bench_ddwrite=$(round "$bench_ddwrite" 2) - echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" - bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") - bench_eps=$(round "$bench_eps" 2) - echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" - fi - else - echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" - fi -} - -function display_banner() { - echo -e "${BLUE}" - figlet -t -k "FLUXNODE" - figlet -t -k "INSTALLATION COMPLETED" - echo -e "${YELLOW}================================================================================================================================" - #echo -e "FLUXNODE INSTALATION COMPLITED${NC}" - #echo -e "${CYAN}COURTESY OF DK808/XK4MiLX${NC}" - echo - if pm2 -v > /dev/null 2>&1; then - pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) - if [[ "$pm2_flux_status" == "online" ]]; then - pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" - else - if [[ "$pm2_flux_status" != "" ]]; then - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" - fi - fi - echo - fi - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" - echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" - echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" - echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" - echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} -testnet getinfo${NC}" - echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} -testnet getbenchmarks${NC}" - echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} -testnet restartnodebenchmarks${NC}" - echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} -testnet stop${NC}" - echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" - echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" - echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" - echo - if [[ "$WATCHDOG_INSTALL" == "1" ]]; then - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" - echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" - echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo - echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" - echo - fi - echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" - echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" - sleep 1 - cd $HOME - exec bash -} - -function start_install() { - start_install=`date +%s` - sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo - echo -e "${CYAN}February 2021, created by dk808 improved by XK4MiLX from Flux's team." - echo -e "Special thanks to Goose-Tech, Skyslayer, & Packetflow." - echo -e "FluxNode setup starting, press [CTRL+C] to cancel.${NC}" - sleep 2 - - if jq --version > /dev/null 2>&1; then - echo -e "" - else - echo -e "" - echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" - sudo apt install jq -y > /dev/null 2>&1 - - if jq --version > /dev/null 2>&1; then - #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" - string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" - string_limit_x_mark "JQ was not installed................................." - echo - exit - fi - fi - if [ "$USER" = "root" ]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}root${CYAN}, please switch to the username you just created.${NC}" - sleep 4 - exit - fi - - start_dir=$(pwd) - correct_dir="/home/$USER" - echo -e "${ARROW} ${YELLOW}Checking directory....${NC}" - if [[ "$start_dir" == "$correct_dir" ]]; then - echo -e "${ARROW} ${CYAN}Correct directory ${GREEN}$(pwd)${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${ARROW} ${CYAN}Bad directory switching...${NC}" - cd - echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" - fi - sleep 1 - config_file - - if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then - import_date - else - - if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then - IMPORT_ZELCONF="1" - IMPORT_ZELID="1" - echo -e "" - echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" - zelnodeprivkey="$prvkey" - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint="$outpoint" - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex="$index" - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 - - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 - fi - - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi - - echo -e "" - echo -e "${ARROW} ${YELLOW}Watchdog conf settings:${NC}" - - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 - fi - - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 - - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 - fi - - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 - fi - fi - - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 - fi - - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 - fi - - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 - fi - echo -e "" - fi - fi -} - -function create_swap() { - - if [[ -z "$swapon" ]]; then - #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi - else - if [[ "$swapon" == "1" ]]; then - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi - fi - fi - sleep 2 -} - -function install_packages() { - echo - echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" - - if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then - sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 - fi - - if ! dirmngr --v > /dev/null 2>&1; then - sudo apt install dirmngr -y > /dev/null 2>&1 - fi - - sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get --with-new-pkgs upgrade -y > /dev/null 2>&1 - sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 - sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 - sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 - sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 - sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 - sudo apt-get remove sysbench -y > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" -} - -function ip_confirm() { - WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" - echo - exit - fi - - string_limit_check_mark "IP: $WANIP ..........................................." "IP: ${GREEN}$WANIP${CYAN} ..........................................." -} - - -function kda_bootstrap() { - echo -e "${GREEN}Module: Restore Kadena node blockchain from bootstrap${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "${NC}" - sudo chown -R $USER:$USER /home/$USER/$FLUX_DIR - echo -e "${ARROW} ${CYAN}Stopping Kadena Node...${NC}" - - docker stop zelKadenaChainWebNode > /dev/null 2>&1 && sleep 10 - - if [[ -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db - fi - - mkdir -p /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 - - if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then - echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" - if whiptail --yesno "Do u want check vailidation of archive file before unpack?" 8 60 3>&1 1>&2 2>&3; then - check_tar "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" - else - echo -e "${ARROW} ${CYAN}Vailidation of archive file skipped..${NC}" - fi - fi - - if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - sleep 2 - #unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode > /dev/null 2>&1 - else - echo -e "${ARROW} ${CYAN}Bootstrap file downloading...${NC}" && sleep 2 - CHOICE=$( - whiptail --title "Bootstrap installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) - case $CHOICE in - "1)") - DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') - fi - echo -e "${ARROW} ${CYAN}KDA Bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" - wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - sleep 2 - ;; - "2)") - KDA_BOOTSTRAP_ZIP="$(whiptail --title "Kadena node bootstrap source (*.tar.gz, *.zip file supported)" --inputbox "Enter your URL" 8 72 3>&1 1>&2 2>&3)" - KDA_BOOTSTRAP_ZIPFILE="${KDA_BOOTSTRAP_ZIP##*/}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" - wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - fi - sleep 2 - ;; - esac - fi - - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - rm -rf $KDA_BOOTSTRAP_ZIPFILE - fi - - docker start zelKadenaChainWebNode > /dev/null 2>&1 - NUM='15' - MSG1='Starting Kadena Node...' - MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo -e "" - echo -e "${ARROW} ${CYAN}Kadena Node initial process can take about ~15min. ${NC}" - echo -e "" -} - -function mongodb_bootstrap() { - echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${ARROW} ${CYAN}Module disabled...${NC}" - echo -e "" - exit - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - sudo rm /home/$USER/fluxdb_dump.tar.gz > /dev/null 2>&1 - sudo rm /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 - - if ! pm2 -v > /dev/null 2>&1; then - pm2_install - if [[ "$PM2_INSTALL" == "0" ]]; then - exit - fi - fi - - WANIP=$(wget http://ipecho.net/plain -O - -q) - - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') - fi - - BLOCKHIGHT=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') - FORCE_BOOTSTRAP=0 - - if [[ "$DB_HIGHT" == "" ]]; then - echo -e "${ARROW} ${CYAN}MongoDB bootstrap server offline...${NC}" - string_limit_x_mark "Operation aborted....................." - exit - fi - - - if [[ "$BLOCKHIGHT" == "" || "$BLOCKHIGHT" == "null" ]]; then - if whiptail --yesno "Local Explorer not respondin...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - string_limit_x_mark "Local Explorer not responding........." - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - fi - if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - if [[ "$BLOCKHIGHT" == "null" ]]; then - message=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq -r .data.message) - if whiptail --yesno "Flux explorer error noticed...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Flux explorer error: ${RED}$message${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - fi - fi - - if [[ "$BLOCKHIGHT" != "" && "$BLOCKHIGHT" != "null" ]]; then - if [[ "$BLOCKHIGHT" -gt "$DB_HIGHT" ]]; then - if whiptail --yesno "Datatable is out of date....Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Current Node block hight ${RED}$BLOCKHIGHT${CYAN} > Bootstrap block hight ${RED}$DB_HIGHT${CYAN}. Datatable is out of date.${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - fi - fi - - - echo -e "${ARROW} ${CYAN}IP: ${RED}$WANIP${NC}" - - if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - echo -e "${ARROW} ${CYAN}Node block hight: ${GREEN}$BLOCKHIGHT${NC}" - fi - - echo -e "${ARROW} ${CYAN}Bootstrap block hight: ${GREEN}$DB_HIGHT${NC}" - echo -e "" - - - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" - wget $BOOTSTRAP_URL_MONGOD -q --show-progress - echo -e "${ARROW} ${CYAN}Unpacking...${NC}" - tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Stoping Flux...${NC}" - pm2 stop flux > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" - mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 - sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 - pm2 start flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - - NUM='120' - MSG1='Flux starting...' - MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo - - #BLOCKHIGHT_AFTER_BOOTSTRAP=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') - BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "" && "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "null" ]]; then - echo -e "${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC}" - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - if [[ "$FORCE_BOOTSTRAP" == "1" ]]; then - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - fi - fi - else - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - fi -} - -function install_kernel(){ - echo -e "${GREEN}Module: Install Linux Kernel 5.X for Ubuntu 18.04${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "${NC}" - echo -e "${YELLOW}Installing Linux Kernel 5.x${NC}" - sudo apt-get install --install-recommends linux-generic-hwe-18.04 -y - read -p "Would you like to reboot pc Y/N?" -n 1 -r - echo -e "${NC}" - if [[ $REPLY =~ ^[Yy]$ ]]; then - sudo reboot -n - fi -} - -function multinode(){ - echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "" - echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" - echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" - echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" - echo -e "" - echo -e "${ARROW} ${RED}IMPORTANT:${NC}" - echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" - echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" - echo -e "" - echo -e "${YELLOW}================================================================${NC}" - echo -e "" - - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" - echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" - echo -e "" - exit - fi - - sleep 15 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multinode.sh) -} - -function create_service_scripts() { - echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 - sudo touch /home/$USER/start_daemon_service.sh - sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - cat <<'EOF' > /home/$USER/start_daemon_service.sh -#!/bin/bash -#color codes -RED='\033[1;31m' -CYAN='\033[1;36m' -NC='\033[0m' -#emoji codes -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -sleep 2 -echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" -echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" -bench_status_pind=$(pgrep fluxbenchd) -daemon_status_pind=$(pgrep fluxd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi -bench_status_pind=$(pgrep zelbenchd) -daemon_status_pind=$(pgrep zelcashd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi -if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd" -exit -else -bash -c "zelcashd" -exit -fi -EOF - sudo touch /home/$USER/stop_daemon_service.sh - sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh - cat <<'EOF' > /home/$USER/stop_daemon_service.sh -#!/bin/bash -if [[ -f /usr/local/bin/flux-cli ]]; then -bash -c "flux-cli stop" -else -bash -c "zelcash-cli stop" -fi -exit -EOF - - echo -e "${ARROW} ${CYAN}Setting scripts permissions...${NC}" && sleep 1 - sudo chmod +x /home/$USER/stop_daemon_service.sh - sudo chmod +x /home/$USER/start_daemon_service.sh - echo -e "${ARROW} ${CYAN}Reloading service config...${NC}" && sleep 1 - sudo systemctl daemon-reload > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting Flux daemon....${NC}" && sleep 1 - sudo systemctl start zelcash > /dev/null 2>&1 - echo -e "" -} - -function create_service() { - echo -e "${GREEN}Module: Flux Daemon service creator${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "" - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 - sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 - sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 - sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 - sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 - sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 - sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 - - echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 - sudo touch /etc/systemd/system/zelcash.service - sudo chown $USER:$USER /etc/systemd/system/zelcash.service - cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service -} - -function install_watchtower(){ - echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "" - echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" - apps_check=$(docker ps | grep "flux_watchtower") - - if [[ "$apps_check" != "" ]]; then - echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" - docker stop flux_watchtower > /dev/null 2>&1 - sleep 2 - echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" - docker rm flux_watchtower > /dev/null 2>&1 - fi - - echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" - docker pull containrrr/watchtower:latest > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" - random=$(shuf -i 7500-35000 -n 1) - echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" - apps_id=$(docker run -d \ - --restart unless-stopped \ - --name flux_watchtower \ - -v /var/run/docker.sock:/var/run/docker.sock \ - containrrr/watchtower \ - --cleanup --interval $random 2> /dev/null) - if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then - echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" - else - echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" - fi -} - -function analyzer_and_fixer(){ - echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/nodeanalizerandfixer.sh) -} - - -function replace_zelid() { - - echo -e "${GREEN}Module: Replace Zel ID${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - while true - do - new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then - string_limit_check_mark "Zel ID is valid..........................................." - break - else - string_limit_x_mark "Zel ID is not valid try again..........................................." - sleep 2 - fi - done - - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped........................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - -} - - - - From 3171657d693671c32d64245e8fe8f3461c71d58a Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 21:14:33 -0500 Subject: [PATCH 0491/1176] Moving function to common. --- apps_info.sh | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/apps_info.sh b/apps_info.sh index 6d73fe3a..0c7047e9 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -1,19 +1,7 @@ #!/bin/bash -source ~/.flux_helpers.sh +source ~/.flux_common.sh -function max(){ - - local m="0" - for n in "$@" - do - if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then - [ "$n" -gt "$m" ] && m="$n" - fi - done - echo "$m" - -} apps_info=$(curl -SsL -m 10 https://api.runonflux.io/apps/globalappsspecifications) name=($(jq -r .data[].name <<< "$apps_info")) From b547b2d24bfce5f90347de7275670bb21f47f989 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 21:15:02 -0500 Subject: [PATCH 0492/1176] DELETE ME: updating hardcoded paths to test branch --- common.sh | 4 ++-- multitoolbox.sh | 2 +- multitoolbox_testnet.sh | 2 +- nodeanalizerandfixer.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common.sh b/common.sh index 50a974f3..6090a5d7 100644 --- a/common.sh +++ b/common.sh @@ -1346,7 +1346,7 @@ function multinode(){ fi sleep 15 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multinode.sh) + bash -i <(curl -s https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/multinode.sh) } function create_service_scripts() { @@ -1528,7 +1528,7 @@ function analyzer_and_fixer(){ echo -e "${NC}" exit fi - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/nodeanalizerandfixer.sh) + bash -i <(curl -s https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/nodeanalizerandfixer.sh) } diff --git a/multitoolbox.sh b/multitoolbox.sh index e12af740..54664e47 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1139,7 +1139,7 @@ exit fi -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) +bash -i <(curl -s https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/install_pro.sh) } diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 54b91863..4ab45ee7 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -948,7 +948,7 @@ fi # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro_testnet.sh) +bash -i <(curl -s https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/install_pro_testnet.sh) } diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 3eb95b3d..2a7836ca 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -962,7 +962,7 @@ echo echo -e "${BOOK} ${YELLOW}Checking Watchdog:${NC}" current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) -required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/fluxnode-watchdog/master/package.json | jq -r '.version') +required_ver=$(curl -sS https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/package.json | jq -r '.version') if [[ "$required_ver" != "" ]]; then if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then From 731c0019c23565311184b7c37511cc2df94b53e4 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:14:58 -0500 Subject: [PATCH 0493/1176] Enabling echo for service scripts. --- common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.sh b/common.sh index 6090a5d7..7aadd4c2 100644 --- a/common.sh +++ b/common.sh @@ -517,7 +517,7 @@ function zk_params() { } function create_service_scripts() { - #echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 + echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 sudo touch /home/$USER/start_daemon_service.sh sudo chown $USER:$USER /home/$USER/start_daemon_service.sh cat <<'EOF' > /home/$USER/start_daemon_service.sh From 98f92268560af936b8784778c54815739b5f877e Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:21:54 -0500 Subject: [PATCH 0494/1176] Adding more messages. --- common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common.sh b/common.sh index 7aadd4c2..ab34f450 100644 --- a/common.sh +++ b/common.sh @@ -1351,7 +1351,10 @@ function multinode(){ function create_service_scripts() { echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Creating file /home/$USER/start_daemon_service.sh${NC}" && sleep 1 sudo touch /home/$USER/start_daemon_service.sh + if [[ -f /home/$USER/start_daemon_service.sh ]]; then + echo -e "${WARNING} ${RED}Failed to create file /home/$USER/start_daemon_service.sh${NC}" && sleep 1 sudo chown $USER:$USER /home/$USER/start_daemon_service.sh cat <<'EOF' > /home/$USER/start_daemon_service.sh #!/bin/bash From 95090a080529aeeca41813e971cfde500897102c Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:27:46 -0500 Subject: [PATCH 0495/1176] fixing if --- common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/common.sh b/common.sh index ab34f450..673c5c71 100644 --- a/common.sh +++ b/common.sh @@ -1355,6 +1355,7 @@ function create_service_scripts() { sudo touch /home/$USER/start_daemon_service.sh if [[ -f /home/$USER/start_daemon_service.sh ]]; then echo -e "${WARNING} ${RED}Failed to create file /home/$USER/start_daemon_service.sh${NC}" && sleep 1 + fi sudo chown $USER:$USER /home/$USER/start_daemon_service.sh cat <<'EOF' > /home/$USER/start_daemon_service.sh #!/bin/bash From ecd75b84814dc90dc61c77b2b15dd7b9a663d4c9 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:32:13 -0500 Subject: [PATCH 0496/1176] removing nested source from multitoolbox install_pro --- install_pro.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 5950059e..7368ac83 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,6 +1,5 @@ #!/bin/bash -source ~/.flux_common.sh # Bootstrap settings From e4744022f5c552bfc9727f1e34d750be2863208e Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:34:13 -0500 Subject: [PATCH 0497/1176] removing if statement --- common.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/common.sh b/common.sh index 673c5c71..8fdf3fe0 100644 --- a/common.sh +++ b/common.sh @@ -1353,9 +1353,6 @@ function create_service_scripts() { echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 echo -e "${ARROW} ${CYAN}Creating file /home/$USER/start_daemon_service.sh${NC}" && sleep 1 sudo touch /home/$USER/start_daemon_service.sh - if [[ -f /home/$USER/start_daemon_service.sh ]]; then - echo -e "${WARNING} ${RED}Failed to create file /home/$USER/start_daemon_service.sh${NC}" && sleep 1 - fi sudo chown $USER:$USER /home/$USER/start_daemon_service.sh cat <<'EOF' > /home/$USER/start_daemon_service.sh #!/bin/bash From d7916997740c4ff0cda15664bcda64da1e39b579 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:34:55 -0500 Subject: [PATCH 0498/1176] adding common source --- common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common.sh b/common.sh index 8fdf3fe0..15161a07 100644 --- a/common.sh +++ b/common.sh @@ -2,6 +2,8 @@ # Collection of common vars and functions used throughout multitoolbox. +source ~/.flux_common.sh + #color codes RED='\033[1;31m' YELLOW='\033[1;33m' From 3bf8c034d5b7d242d8f9ddf11d761fb89f276ab5 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:35:34 -0500 Subject: [PATCH 0499/1176] putting source in correct file. dufus. --- common.sh | 2 -- install_pro.sh | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common.sh b/common.sh index 15161a07..8fdf3fe0 100644 --- a/common.sh +++ b/common.sh @@ -2,8 +2,6 @@ # Collection of common vars and functions used throughout multitoolbox. -source ~/.flux_common.sh - #color codes RED='\033[1;31m' YELLOW='\033[1;33m' diff --git a/install_pro.sh b/install_pro.sh index 7368ac83..5950059e 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,5 +1,6 @@ #!/bin/bash +source ~/.flux_common.sh # Bootstrap settings From dd8593db4a028307df75fb94f5d3aff9164eef93 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:40:38 -0500 Subject: [PATCH 0500/1176] adding echo messages. --- common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common.sh b/common.sh index 8fdf3fe0..e0aa4626 100644 --- a/common.sh +++ b/common.sh @@ -26,6 +26,9 @@ export NEWT_COLORS=' title=black, ' +echo -e "${ARROW} ${CYAN}Importing Common Multitoolbox Resources..." +echo "" + function round() { printf "%.${2}f" "${1}" } From 5cc59359fcc7c3ed4d61c03ad3f7b100f49464a5 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:46:37 -0500 Subject: [PATCH 0501/1176] testing removng 1 echo statement --- common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.sh b/common.sh index e0aa4626..65645cae 100644 --- a/common.sh +++ b/common.sh @@ -27,7 +27,7 @@ title=black, ' echo -e "${ARROW} ${CYAN}Importing Common Multitoolbox Resources..." -echo "" + function round() { printf "%.${2}f" "${1}" From b25e103c598aaf2728fa61f7fc5f4fa35d61fd8d Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:51:14 -0500 Subject: [PATCH 0502/1176] adding warning message --- common.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common.sh b/common.sh index 65645cae..1faf544b 100644 --- a/common.sh +++ b/common.sh @@ -1357,6 +1357,11 @@ function create_service_scripts() { echo -e "${ARROW} ${CYAN}Creating file /home/$USER/start_daemon_service.sh${NC}" && sleep 1 sudo touch /home/$USER/start_daemon_service.sh sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + + if [[ -f /home/$USER/start_daemon_service.sh ]]; then + echo -e "${WORNING} ${RED}Failed to create file /home/$USER/stop_daemon_service.sh${NC}" && sleep 1 + fi + cat <<'EOF' > /home/$USER/start_daemon_service.sh #!/bin/bash #color codes From 93260381e19dacdeabf1e8141969247022401848 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:54:53 -0500 Subject: [PATCH 0503/1176] adding inverse bool to if condition --- common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.sh b/common.sh index 1faf544b..76c1f11a 100644 --- a/common.sh +++ b/common.sh @@ -1358,7 +1358,7 @@ function create_service_scripts() { sudo touch /home/$USER/start_daemon_service.sh sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - if [[ -f /home/$USER/start_daemon_service.sh ]]; then + if ![[ -f /home/$USER/start_daemon_service.sh ]]; then echo -e "${WORNING} ${RED}Failed to create file /home/$USER/stop_daemon_service.sh${NC}" && sleep 1 fi From b1ef785975f370392477e951c3129ba7262a6dbc Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Wed, 27 Jul 2022 23:57:41 -0500 Subject: [PATCH 0504/1176] testing else condition --- common.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common.sh b/common.sh index 76c1f11a..8c0a367c 100644 --- a/common.sh +++ b/common.sh @@ -1358,7 +1358,9 @@ function create_service_scripts() { sudo touch /home/$USER/start_daemon_service.sh sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - if ![[ -f /home/$USER/start_daemon_service.sh ]]; then + if [[ -f /home/$USER/start_daemon_service.sh ]]; then + echo -e "${CHECKMARK} ${GREEN}Created file /home/$USER/stop_daemon_service.sh${NC}" && sleep 1 + else echo -e "${WORNING} ${RED}Failed to create file /home/$USER/stop_daemon_service.sh${NC}" && sleep 1 fi From 8e310765d9b093d3387e727abd397f55a63202f3 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Thu, 28 Jul 2022 00:01:26 -0500 Subject: [PATCH 0505/1176] Always remove local common file. --- multitoolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 54664e47..12b561cf 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,5 +1,6 @@ #!/bin/bash +rm -f ~/.flux_common.sh curl --silent -o ~/.flux_common.sh https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh source ~/.flux_common.sh From be02595c0429c0df777e08702fa1f6e31b6b785e Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Sat, 30 Jul 2022 21:07:09 -0500 Subject: [PATCH 0506/1176] removing escape chars --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 12b561cf..8e2c507b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1181,7 +1181,7 @@ if [[ -z $usernew ]]; then usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" usernew=$(awk '{print tolower($0)}' <<< "$usernew") else - echo -e "${PIN}${CYAN} Import docker user `$usernew` from environment variable............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Import docker user $usernew from environment variable............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" From 41f7f42bcdb896ce52db4bb2f25a350cb3bffd5a Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Sat, 30 Jul 2022 21:08:12 -0500 Subject: [PATCH 0507/1176] adding single quotes --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8e2c507b..85445781 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1181,7 +1181,7 @@ if [[ -z $usernew ]]; then usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" usernew=$(awk '{print tolower($0)}' <<< "$usernew") else - echo -e "${PIN}${CYAN} Import docker user $usernew from environment variable............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Import docker user '$usernew' from environment variable............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" From b9c060e7298ed59f5469b4bd160476c5a6f693e6 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Sat, 30 Jul 2022 21:09:27 -0500 Subject: [PATCH 0508/1176] adding quotes to -z var --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 85445781..f0acb01f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1177,7 +1177,7 @@ if [[ $(lsb_release -cs) == "jammy" ]]; then exit fi -if [[ -z $usernew ]]; then +if [[ -z "$usernew" ]]; then usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" usernew=$(awk '{print tolower($0)}' <<< "$usernew") else From 66f5105bcea7a39c9f5c7565bf61fe2b1cb062de Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Mon, 1 Aug 2022 07:28:40 -0500 Subject: [PATCH 0509/1176] renaming old node service functions. --- common.sh | 11 ++--------- multitoolbox.sh | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/common.sh b/common.sh index 8c0a367c..98681675 100644 --- a/common.sh +++ b/common.sh @@ -519,7 +519,7 @@ function zk_params() { sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 } -function create_service_scripts() { +function create_oldnode_service_scripts() { echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 sudo touch /home/$USER/start_daemon_service.sh sudo chown $USER:$USER /home/$USER/start_daemon_service.sh @@ -1354,16 +1354,9 @@ function multinode(){ function create_service_scripts() { echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 - echo -e "${ARROW} ${CYAN}Creating file /home/$USER/start_daemon_service.sh${NC}" && sleep 1 sudo touch /home/$USER/start_daemon_service.sh sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - if [[ -f /home/$USER/start_daemon_service.sh ]]; then - echo -e "${CHECKMARK} ${GREEN}Created file /home/$USER/stop_daemon_service.sh${NC}" && sleep 1 - else - echo -e "${WORNING} ${RED}Failed to create file /home/$USER/stop_daemon_service.sh${NC}" && sleep 1 - fi - cat <<'EOF' > /home/$USER/start_daemon_service.sh #!/bin/bash #color codes @@ -1440,7 +1433,7 @@ EOF echo -e "" } -function create_service() { +function create_oldnode_service() { echo -e "${GREEN}Module: Flux Daemon service creator${NC}" echo -e "${YELLOW}================================================================${NC}" diff --git a/multitoolbox.sh b/multitoolbox.sh index f0acb01f..ced5f275 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1554,8 +1554,8 @@ read -rp "Pick an option and hit ENTER: " 9) clear sleep 1 - create_service - create_service_scripts + create_oldnode_service + create_oldnode_service_scripts ;; 10) From 52b43ff99bc69ba05c4c63a43e9394a1d26b9fb1 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Mon, 1 Aug 2022 09:09:59 -0500 Subject: [PATCH 0510/1176] version bump --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a5c8259f..6e7230b2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -38,7 +38,7 @@ ARROW="${SEA}\xE2\x96\xB6${NC}" BOOK="${RED}\xF0\x9F\x93\x8B${NC}" HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -dversion="v7.1" +dversion="v7.2" PM2_INSTALL="0" zelflux_setting_import="0" @@ -2453,7 +2453,7 @@ echo -e "${YELLOW}============================================================== echo -e "${GREEN}Version: $dversion${NC}" echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" -echo -e "${GREEN}Special thanks to dk808, CryptoWrench && jriggs28${NC}" +echo -e "${GREEN}Special thanks to dk808, CryptoWrench , jriggs28 && TechDufus${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${CYAN}1 - Install Docker${NC}" echo -e "${CYAN}2 - Install FluxNode${NC}" From 9147a96a4a7090fd42261b1cda4cf7340cfc355a Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo Date: Mon, 1 Aug 2022 09:43:33 -0500 Subject: [PATCH 0511/1176] removing incorrect comment. --- multinode.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/multinode.sh b/multinode.sh index 539c2ce9..d613933f 100644 --- a/multinode.sh +++ b/multinode.sh @@ -204,8 +204,6 @@ function upnp_disable() { } -# Import settings from upnp_conf.json if it exists -# if [[ -f /home/$USER/upnp_conf.json ]]; then if [[ -f /home/$USER/install_conf.json ]]; then # Import settings from upnp_conf.json import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') From 4894bba80af57763ff31571183d4b5291d029f83 Mon Sep 17 00:00:00 2001 From: TechDufus <46715299+matthewjdegarmo@users.noreply.github.com> Date: Mon, 1 Aug 2022 13:41:54 -0500 Subject: [PATCH 0512/1176] Adding issue templates and code of conduct to this repo. (#18) Not touching functionality. Merging. --- .github/CODE_OF_CONDUCT.md | 56 ++++++++++++++++ .github/ISSUE_TEMPLATE/bug.yml | 76 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature-request.yml | 62 ++++++++++++++++++ .github/ISSUE_TEMPLATE/question.yml | 65 ++++++++++++++++++ .github/ISSUE_TEMPLATE/share-feedback.md | 10 +++ 5 files changed, 269 insertions(+) create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/ISSUE_TEMPLATE/bug.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml create mode 100644 .github/ISSUE_TEMPLATE/question.yml create mode 100644 .github/ISSUE_TEMPLATE/share-feedback.md diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..8c312950 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,56 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of +fostering an open and welcoming community, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating +documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, such as physical or electronic + addresses, without explicit permission +* Other unethical or unprofessional conduct + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. Note that contributors may be volunteers +who do not represent Electric Coin Company. They are free to express their own +opinions so long as they adhere to these guidelines. + +By adopting this Code of Conduct, project maintainers commit themselves to +fairly and consistently applying these principles to every aspect of managing +this project. Project maintainers who do not follow or enforce the Code of +Conduct may be permanently removed from the project team. + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting a project maintainer (see below). All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. Maintainers are +obligated to maintain confidentiality with regard to the reporter of an +incident. + +If you wish to contact specific maintainers directly, the following have made +themselves available for conduct issues: + +- N/A + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.3.0, available at +[https://www.contributor-covenant.org/version/1/3/0/][version] + +[homepage]: https://www.contributor-covenant.org +[version]: https://www.contributor-covenant.org/version/1/3/0/ diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 00000000..a0b059a8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,76 @@ +name: Bug Report 🐛 +description: Report something that's not working the way it's (probably) intended to +title: '[BUG] ' +labels: ['🐛 Bug'] +assignees: + - matthewjdegarmo +body: + - type: dropdown + id: environment + attributes: + label: Environment + description: Where are you running multitoolbox? + options: + - Self-Hosted + - VPS + - Other (Specify below) + validations: + required: true + - type: input + id: system + attributes: + label: System + description: >- + For deployment issues, specify your [distro or OS](https://whatsmyos.com/). + placeholder: e.g. Ubuntu 20.04 LTS + validations: + required: false + - type: input + id: version + attributes: + label: Version + description: What version of multitoolbox are you running? + placeholder: v4.2.0 ← should look like this (check multitoolbox options prompt for this) + validations: + required: false + - type: textarea + id: repro + attributes: + label: Describe the problem + description: Please describe exactly what is not working, include the steps to reproduce, actual result and expected result + placeholder: When doing ABC then DEF, I expect to see XYZ, but I actually see ZYX + validations: + required: true + - type: textarea + id: logs + attributes: + label: Additional info + description: Logs? Screenshots? Yes, please. + placeholder: Take care to blank out any personal info. + validations: + required: false + - type: checkboxes + id: idiot-check + attributes: + label: Please tick the boxes + description: Before submitting, please ensure that + options: + - label: You have explained the issue clearly, and included all relevant info + required: true + - label: You are using the latest version of multitoolbox + required: true + - label: You've checked that this [issue hasn't already been raised](https://github.com/RunOnFlux/fluxnode-multitool/issues?q=is%3Aissue) + required: true + - label: You've checked the official [RunOnFlux Discord](https://discord.io/runonflux) Pinned messages and FAQ ![important](https://img.shields.io/badge/Important!-F6094E) + required: true + - label: You agree to the [code of conduct](https://github.com/RunOnFlux/fluxnode-multitool/blob/master/.github/CODE_OF_CONDUCT.md) + required: true + - type: markdown + attributes: + value: |- + ## Thanks 🙏 + <img align="left" width="160" src="https://i.ibb.co/S5vCnhL/gh-thanks.gif" alt="🐙" /> + Thank you for raising this ticket - in doing so you are helping to make the app better for everyone 💪<br> + ⭐️ Consider dropping the repo a star if you're enjoying multitoolbox!<br> + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 00000000..a103e8fe --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,62 @@ +name: Feature Request ✨ +description: Suggest an idea for future development of multitoolbox +title: '[FEATURE_REQUEST] <title>' +labels: ['🦄 Feature Request'] + +body: + + # Field 1 - Is it bug-related + - type: textarea + id: issue + attributes: + label: Is your feature request related to a problem? If so, please describe. + description: + placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + validations: + required: false + + # Field 2 - Describe feature + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + placeholder: An outline of how you would like this to be implemented, include as much details as possible + validations: + required: true + + # Field 3 - Priority + - type: dropdown + id: priority + attributes: + label: Priority + description: How urgent is the development of this feature + options: + - Low (Nice-to-have) + - Medium (Would be very useful) + - High (The app does not function without it) + validations: + required: true + + # Field 3 - Can the user implement + - type: dropdown + id: canImplement + attributes: + label: Is this something you would be keen to implement + description: Are you raising this ticket in order to get an issue number for your PR? + options: + - 'No' + - 'Maybe' + - 'Yes!' + validations: + required: false + + # Final text + - type: markdown + attributes: + value: |- + ## Thanks 🙏 + Thank you for your feature suggestion! + Please note that there is no guarantee that your idea will be implemented + If you haven't already done so, please Star the [fluxnode-multitool](https://github.com/RunOnFlux/fluxnode-multitool) repository on GitHub, to help other users discover it + validations: + required: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 00000000..0fc69878 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,65 @@ +name: Question 🤷‍♂️ +description: Got a question about multitoolbox, deployment, development or usage? +title: '[QUESTION] <title>' +labels: ['🤷‍♂️ Question'] + +body: + # Filed 1 - Intro Text + - type: markdown + attributes: + value: > + Thanks for using multitoolbox! Questions are welcome. + Quick questions should be asked in the [Official RunOnFlux Discord](https://discord.io/runonflux) support channels, Please. :) + validations: + required: false + + # Field 2 - The actual question + - type: textarea + id: question + attributes: + label: Question + description: Outline your question in a clear and concise manner + validations: + required: true + + # Field 3 - Category + - type: dropdown + id: category + attributes: + label: Category + description: What part of the application does this relate to? + options: + - Option 1 + - Option 2 + - Option 3 + - Option 4 + - Option 5 + - Option 6 + - Option 7 + - Option 8 + - Option 9 + - Option 10 + - Option 11 + - Option 12 + - Option 13 + - Option 14 + validations: + required: true + + # Field 4 - User has RTFM first, and agrees to code of conduct, etc + - type: checkboxes + id: idiot-check + attributes: + label: Please tick the boxes + description: Before submitting, please ensure that + options: + - label: You have explained the issue clearly, and included all relevant info + required: true + - label: You are using the latest version of multitoolbox + required: true + - label: You've checked that this [issue hasn't already been raised](https://github.com/RunOnFlux/fluxnode-multitool/issues?q=is%3Aissue) + required: true + - label: You've checked the official [RunOnFlux Discord](https://discord.io/runonflux) Pinned messages and FAQ ![important](https://img.shields.io/badge/Important!-F6094E) + required: true + - label: You agree to the [code of conduct](https://github.com/RunOnFlux/fluxnode-multitool/blob/master/.github/CODE_OF_CONDUCT.md) + required: true diff --git a/.github/ISSUE_TEMPLATE/share-feedback.md b/.github/ISSUE_TEMPLATE/share-feedback.md new file mode 100644 index 00000000..30906de8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/share-feedback.md @@ -0,0 +1,10 @@ +--- +name: "Share Feedback \U0001F308" +about: Share what you think about multitoolbox, and any ideas or suggestions you have +title: "[FEEDBACK]" +labels: "\U0001F308 Feedback" +assignees: '' + +--- + + From b137e407ec157d77fcde79aab00ba9436188c3d0 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Mon, 1 Aug 2022 20:30:00 -0500 Subject: [PATCH 0513/1176] bumping version and dufus. --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index ced5f275..64e42749 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -24,7 +24,7 @@ FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' Server_offline=0 -dversion="v7.1" +dversion="v7.3" PM2_INSTALL="0" zelflux_setting_import="0" @@ -1474,7 +1474,7 @@ echo -e "${YELLOW}============================================================== echo -e "${GREEN}Version: $dversion${NC}" echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" -echo -e "${GREEN}Special thanks to dk808, CryptoWrench && jriggs28${NC}" +echo -e "${GREEN}Special thanks to dk808, CryptoWrench, jriggs28 && TechDufus${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${CYAN}1 - Install Docker${NC}" echo -e "${CYAN}2 - Install FluxNode${NC}" From 3d97cf4959fec5a9983be368dadc3d92524983a7 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Mon, 1 Aug 2022 20:57:59 -0500 Subject: [PATCH 0514/1176] BULK CHANGES --- common.sh => flux_common.sh | 0 multitoolbox.sh | 6 +++--- multitoolbox_testnet.sh | 5 +++-- nodeanalizerandfixer.sh | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) rename common.sh => flux_common.sh (100%) diff --git a/common.sh b/flux_common.sh similarity index 100% rename from common.sh rename to flux_common.sh diff --git a/multitoolbox.sh b/multitoolbox.sh index 64e42749..481fa175 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,7 +1,7 @@ #!/bin/bash rm -f ~/.flux_common.sh -curl --silent -o ~/.flux_common.sh https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/common.sh +curl --silent -o ~/.flux_common.sh https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh source ~/.flux_common.sh BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' @@ -1140,7 +1140,7 @@ exit fi -bash -i <(curl -s https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/install_pro.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) } @@ -1456,7 +1456,7 @@ sudo apt-get install -y whiptail > /dev/null 2>&1 fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then -echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc +echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc source /etc/bash.bashrc fi diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 4ab45ee7..3ac80a15 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1,6 +1,7 @@ #!/bin/bash -curl --silent -o /dev/null https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/helpers.sh >> ~/.flux_common.sh +rm -f ~/.flux_common.sh +curl --silent -o ~/.flux_common.sh https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh source ~/.flux_common.sh BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' @@ -948,7 +949,7 @@ fi # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) -bash -i <(curl -s https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/install_pro_testnet.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro_testnet.sh) } diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 2a7836ca..20af154a 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -962,7 +962,7 @@ echo echo -e "${BOOK} ${YELLOW}Checking Watchdog:${NC}" current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) -required_ver=$(curl -sS https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/package.json | jq -r '.version') +required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/package.json | jq -r '.version') if [[ "$required_ver" != "" ]]; then if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then From 253f090c44bb80972bc0a1eca1ec6f92059dfd43 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Mon, 1 Aug 2022 21:14:44 -0500 Subject: [PATCH 0515/1176] removing git conflict GARBAGE --- multitoolbox.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 2b875cfd..d9b63d13 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1496,11 +1496,8 @@ echo -e "${YELLOW}============================================================== echo -e "${GREEN}Version: $dversion${NC}" echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" -<<<<<<< HEAD echo -e "${GREEN}Special thanks to dk808, CryptoWrench, jriggs28 && TechDufus${NC}" -======= echo -e "${GREEN}Special thanks to dk808, CryptoWrench , jriggs28 && TechDufus${NC}" ->>>>>>> 4894bba80af57763ff31571183d4b5291d029f83 echo -e "${YELLOW}================================================================${NC}" echo -e "${CYAN}1 - Install Docker${NC}" echo -e "${CYAN}2 - Install FluxNode${NC}" From 2bbba6ba2cbcbcbd54fc2d606c755985613af7d7 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Mon, 1 Aug 2022 21:17:52 -0500 Subject: [PATCH 0516/1176] removing git conflict GARBAGE --- multitoolbox.sh | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d9b63d13..ee098718 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -24,30 +24,7 @@ FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' Server_offline=0 -<<<<<<< HEAD dversion="v7.3" -======= -#color codes -RED='\033[1;31m' -YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" -GREEN='\033[1;32m' -CYAN='\033[1;36m' -NC='\033[0m' - -#emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" -ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -dversion="v7.2" ->>>>>>> 4894bba80af57763ff31571183d4b5291d029f83 - PM2_INSTALL="0" zelflux_setting_import="0" From 757a98e818cd08a58d28d36dcf50168b32af0dea Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Tue, 2 Aug 2022 09:12:29 -0500 Subject: [PATCH 0517/1176] removing duplicate thanks line --- multitoolbox.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index ee098718..234513be 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1474,7 +1474,6 @@ echo -e "${GREEN}Version: $dversion${NC}" echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" echo -e "${GREEN}Special thanks to dk808, CryptoWrench, jriggs28 && TechDufus${NC}" -echo -e "${GREEN}Special thanks to dk808, CryptoWrench , jriggs28 && TechDufus${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${CYAN}1 - Install Docker${NC}" echo -e "${CYAN}2 - Install FluxNode${NC}" From 328891ad1d06d9f53777136aef9e683692c6c1e4 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Tue, 2 Aug 2022 09:27:15 -0500 Subject: [PATCH 0518/1176] Removing local file source for common import. bash v4+ syntax --- apps_info.sh | 2 +- geo_test.sh | 2 +- install_pro.sh | 2 +- install_pro_testnet.sh | 2 +- multinode.sh | 2 +- multitoolbox_testnet.sh | 4 +--- nodeanalizerandfixer.sh | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/apps_info.sh b/apps_info.sh index 0c7047e9..0f10a003 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_common.sh +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" apps_info=$(curl -SsL -m 10 https://api.runonflux.io/apps/globalappsspecifications) diff --git a/geo_test.sh b/geo_test.sh index 9b882c18..70b97169 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_common.sh +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" # THIS LOOKS UNUSED. CANDIDATE FOR DELETION. function server_geolocation(){ diff --git a/install_pro.sh b/install_pro.sh index 5950059e..cfc315d7 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_common.sh +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" # Bootstrap settings diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 40285ea6..1ef24488 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_common.sh +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" # Bootstrap settings BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' diff --git a/multinode.sh b/multinode.sh index d613933f..90367c11 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_common.sh +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" function insertAfter { diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 3ac80a15..4007febf 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1,8 +1,6 @@ #!/bin/bash -rm -f ~/.flux_common.sh -curl --silent -o ~/.flux_common.sh https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh -source ~/.flux_common.sh +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 20af154a..f6691750 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ~/.flux_common.sh +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" #const REPLACE="0" From 7c000d1366cd6b87af30d3de7f340768787c1f69 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Tue, 2 Aug 2022 09:27:43 -0500 Subject: [PATCH 0519/1176] Removing local file source for common import. bash v4+ syntax --- multitoolbox.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 234513be..d25001fa 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,8 +1,6 @@ #!/bin/bash -rm -f ~/.flux_common.sh -curl --silent -o ~/.flux_common.sh https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh -source ~/.flux_common.sh +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' From c6c30a04f211d0f3f8070eec0c149d682573b03c Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Tue, 2 Aug 2022 09:30:57 -0500 Subject: [PATCH 0520/1176] Fixing watchdog url --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index f6691750..d25cc63c 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -962,7 +962,7 @@ echo echo -e "${BOOK} ${YELLOW}Checking Watchdog:${NC}" current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) -required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/package.json | jq -r '.version') +required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/fluxnode-watchdog/master/package.json | jq -r '.version') if [[ "$required_ver" != "" ]]; then if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then From 4716641fa59a4d1c20cbb950de58bc5ee743486f Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 3 Aug 2022 21:01:53 -0500 Subject: [PATCH 0521/1176] Adding ability to run scripts using alternative branch. --- install_pro.sh | 2 +- install_pro_testnet.sh | 2 +- multitoolbox.sh | 24 ++++++++++++++++++------ multitoolbox_testnet.sh | 16 +++++++++++----- 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index a748a26d..f4c89621 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -758,7 +758,7 @@ WATCHDOG_INSTALL="1" echo -e "${ARROW} ${YELLOW}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 2bd40e23..e7a65f82 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -433,7 +433,7 @@ WATCHDOG_INSTALL="1" echo -e "${ARROW} ${YELLOW}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" diff --git a/multitoolbox.sh b/multitoolbox.sh index 6e7230b2..4bbd6740 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,5 +1,16 @@ #!/bin/bash +if ! [[ -z $1 ]]; then + if [[ $BREAK_NESTING != '1' ]]; then + export ROOT_BRANCH="$1" + export BREAK_NESTING='1' + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH + exit + fi +else + ROOT_BRANCH='master' +fi + BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' @@ -1041,7 +1052,7 @@ sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" @@ -1719,7 +1730,7 @@ if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then exit fi -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/nodeanalizerandfixer.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) } @@ -1762,7 +1773,7 @@ exit fi -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) } @@ -1801,7 +1812,7 @@ fi fi sleep 15 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multinode.sh) + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) } @@ -2435,7 +2446,7 @@ sudo apt-get install -y whiptail > /dev/null 2>&1 fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then -echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc +echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc source /etc/bash.bashrc fi @@ -2451,9 +2462,10 @@ echo -e "${BLUE}" figlet -f slant "Multitoolbox" echo -e "${YELLOW}================================================================${NC}" echo -e "${GREEN}Version: $dversion${NC}" +echo -e "${GREEN}Branch: $ROOT_BRANCH${NC}" echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" -echo -e "${GREEN}Special thanks to dk808, CryptoWrench , jriggs28 && TechDufus${NC}" +echo -e "${GREEN}Special thanks to dk808, CryptoWrench, jriggs28 && TechDufus${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${CYAN}1 - Install Docker${NC}" echo -e "${CYAN}2 - Install FluxNode${NC}" diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 8e729657..aafcca3a 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1,5 +1,10 @@ #!/bin/bash +ROOT_BRANCH="master" +if ! [ -z "$1" ]; then + ROOT_BRANCH="$1" +fi + BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' @@ -701,7 +706,7 @@ sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" @@ -1354,7 +1359,7 @@ if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then exit fi -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/nodeanalizerandfixer.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) } @@ -1391,8 +1396,8 @@ exit fi -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro_testnet.sh) +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro_testnet.sh) } @@ -1430,7 +1435,7 @@ fi fi sleep 15 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multinode.sh) + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) } @@ -2095,6 +2100,7 @@ echo -e "${BLUE}" figlet -f slant "Multitoolbox TESTNET" echo -e "${YELLOW}================================================================${NC}" echo -e "${GREEN}Version: $dversion${NC}" +echo -e "${GREEN}Branch: ${ROOT_BRANCH}${NC}" echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" echo -e "${GREEN}Special thanks to dk808, CryptoWrench && jriggs28${NC}" From 0b7c23238a11eb8b1370e9651f2d7f3097484a6b Mon Sep 17 00:00:00 2001 From: TechDufus <46715299+matthewjdegarmo@users.noreply.github.com> Date: Fri, 5 Aug 2022 08:07:43 -0500 Subject: [PATCH 0522/1176] Adding branch logic to testnet. Updating var with better name. (#24) This fixes logic for testing the TESTNET with specific branch. --- multitoolbox.sh | 4 ++-- multitoolbox_testnet.sh | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4bbd6740..5b8b7352 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,9 +1,9 @@ #!/bin/bash if ! [[ -z $1 ]]; then - if [[ $BREAK_NESTING != '1' ]]; then + if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" - export BREAK_NESTING='1' + export BRANCH_ALREADY_REFERENCED='1' bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH exit fi diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index aafcca3a..9b425569 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1,8 +1,14 @@ #!/bin/bash -ROOT_BRANCH="master" -if ! [ -z "$1" ]; then - ROOT_BRANCH="$1" +if ! [[ -z $1 ]]; then + if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then + export ROOT_BRANCH="$1" + export BRANCH_ALREADY_REFERENCED='1' + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox_testnet.sh) $ROOT_BRANCH + exit + fi +else + ROOT_BRANCH='master' fi BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' From 61083358fdb7c7046f466f30e829eda08b2c999c Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Fri, 5 Aug 2022 08:32:02 -0500 Subject: [PATCH 0523/1176] Unsetting exported vars after use. --- multitoolbox.sh | 2 ++ multitoolbox_testnet.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5b8b7352..a56260eb 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -5,6 +5,8 @@ if ! [[ -z $1 ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCED exit fi else diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 9b425569..1445feef 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -5,6 +5,8 @@ if ! [[ -z $1 ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox_testnet.sh) $ROOT_BRANCH + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCED exit fi else From c125d8a3494c5695b52cfc03ed0ef8ae562a02de Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Fri, 5 Aug 2022 09:12:51 -0500 Subject: [PATCH 0524/1176] Manually adding changes from 'master' branch. Resolving conflicts. --- flux_common.sh | 4 ++-- multinode.sh | 2 +- multitoolbox.sh | 20 +++++++++++++++++--- multitoolbox_testnet.sh | 22 ++++++++++++++++++---- 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 98681675..0e48675c 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1349,7 +1349,7 @@ function multinode(){ fi sleep 15 - bash -i <(curl -s https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/multinode.sh) + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) } function create_service_scripts() { @@ -1532,7 +1532,7 @@ function analyzer_and_fixer(){ echo -e "${NC}" exit fi - bash -i <(curl -s https://raw.githubusercontent.com/matthewjdegarmo/fluxnode-multitool/source_cleanup/nodeanalizerandfixer.sh) + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) } diff --git a/multinode.sh b/multinode.sh index 90367c11..064f3b84 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" function insertAfter { diff --git a/multitoolbox.sh b/multitoolbox.sh index d25001fa..7106102f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,6 +1,19 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" +if ! [[ -z $1 ]]; then + if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then + export ROOT_BRANCH="$1" + export BRANCH_ALREADY_REFERENCED='1' + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox_testnet.sh) $ROOT_BRANCH + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCED + exit + fi +else + ROOT_BRANCH='master' +fi + +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' @@ -719,7 +732,7 @@ sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" @@ -1453,7 +1466,7 @@ sudo apt-get install -y whiptail > /dev/null 2>&1 fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then -echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc +echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc source /etc/bash.bashrc fi @@ -1469,6 +1482,7 @@ echo -e "${BLUE}" figlet -f slant "Multitoolbox" echo -e "${YELLOW}================================================================${NC}" echo -e "${GREEN}Version: $dversion${NC}" +echo -e "${GREEN}Branch: $ROOT_BRANCH${NC}" echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" echo -e "${GREEN}Special thanks to dk808, CryptoWrench, jriggs28 && TechDufus${NC}" diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 4007febf..580ab262 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1,6 +1,19 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" +if ! [[ -z $1 ]]; then + if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then + export ROOT_BRANCH="$1" + export BRANCH_ALREADY_REFERENCED='1' + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox_testnet.sh) $ROOT_BRANCH + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCED + exit + fi +else + ROOT_BRANCH='master' +fi + +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' @@ -558,7 +571,7 @@ sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" @@ -946,8 +959,8 @@ exit fi -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro.sh) -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/install_pro_testnet.sh) +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro_testnet.sh) } @@ -1298,6 +1311,7 @@ echo -e "${BLUE}" figlet -f slant "Multitoolbox TESTNET" echo -e "${YELLOW}================================================================${NC}" echo -e "${GREEN}Version: $dversion${NC}" +echo -e "${GREEN}Branch: ${ROOT_BRANCH}${NC}" echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" echo -e "${GREEN}Special thanks to dk808, CryptoWrench && jriggs28${NC}" From cc108dc89d90804fa22e6c9b610700d739edd99f Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Fri, 5 Aug 2022 09:15:51 -0500 Subject: [PATCH 0525/1176] Resolving one conflict. --- multitoolbox.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7106102f..a587619e 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -4,7 +4,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox_testnet.sh) $ROOT_BRANCH + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED exit @@ -15,6 +15,7 @@ fi source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" + BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' From d0ee845e1fe1efe25071eb920c50525e451631b5 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Fri, 5 Aug 2022 10:06:14 -0500 Subject: [PATCH 0526/1176] Removing vscode git-conflict garbage --- multitoolbox.sh | 247 ---------------------------------------- multitoolbox_testnet.sh | 246 +-------------------------------------- 2 files changed, 1 insertion(+), 492 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d12659b5..23339015 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -13,12 +13,8 @@ else ROOT_BRANCH='master' fi -<<<<<<< HEAD source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" - -======= ->>>>>>> c445a443ed31ff01020f37c952a8af815b661afc BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' @@ -1116,209 +1112,6 @@ function flux_daemon_bootstrap() { pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 } -<<<<<<< HEAD -======= -function mongodb_bootstrap(){ - -echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" -echo -e "${YELLOW}================================================================${NC}" -echo -e "${ARROW} ${CYAN}Module disabled...${NC}" -echo -e "" -exit - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -sudo rm /home/$USER/fluxdb_dump.tar.gz > /dev/null 2>&1 -sudo rm /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 - -if ! pm2 -v > /dev/null 2>&1; then - - pm2_install - - if [[ "$PM2_INSTALL" == "0" ]]; then - exit - fi - -fi - -WANIP=$(wget http://ipecho.net/plain -O - -q) - -DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') -if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') -fi - -BLOCKHIGHT=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') -FORCE_BOOTSTRAP=0 - -if [[ "$DB_HIGHT" == "" ]]; then - echo -e "${ARROW} ${CYAN}MongoDB bootstrap server offline...${NC}" - string_limit_x_mark "Operation aborted....................." - exit -fi - - -if [[ "$BLOCKHIGHT" == "" || "$BLOCKHIGHT" == "null" ]]; then - - if whiptail --yesno "Local Explorer not respondin...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - string_limit_x_mark "Local Explorer not responding........." - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - -fi - - if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - - if [[ "$BLOCKHIGHT" == "null" ]]; then - - message=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq -r .data.message) - - if whiptail --yesno "Flux explorer error noticed...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Flux explorer error: ${RED}$message${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - fi - fi - - -if [[ "$BLOCKHIGHT" != "" && "$BLOCKHIGHT" != "null" ]]; then - - if [[ "$BLOCKHIGHT" -gt "$DB_HIGHT" ]]; then - - if whiptail --yesno "Datatable is out of date....Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Current Node block hight ${RED}$BLOCKHIGHT${CYAN} > Bootstrap block hight ${RED}$DB_HIGHT${CYAN}. Datatable is out of date.${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - - fi -fi - - -echo -e "${ARROW} ${CYAN}IP: ${RED}$WANIP${NC}" - -if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - echo -e "${ARROW} ${CYAN}Node block hight: ${GREEN}$BLOCKHIGHT${NC}" -fi - -echo -e "${ARROW} ${CYAN}Bootstrap block hight: ${GREEN}$DB_HIGHT${NC}" -echo -e "" - - -echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" -wget $BOOTSTRAP_URL_MONGOD -q --show-progress -echo -e "${ARROW} ${CYAN}Unpacking...${NC}" -tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 -echo -e "${ARROW} ${CYAN}Stoping Flux...${NC}" -pm2 stop flux > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" -mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Cleaning...${NC}" -sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 -sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 -pm2 start flux > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 - -NUM='120' -MSG1='Flux starting...' -MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo - -#BLOCKHIGHT_AFTER_BOOTSTRAP=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') -BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "" && "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "null" ]]; then - - echo -e "${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC}" - - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then - - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - - if [[ "$FORCE_BOOTSTRAP" == "1" ]]; then - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - fi - - fi - else - - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - - fi - - -} - -function install_kernel(){ - - -echo -e "${GREEN}Module: Install Linux Kernel 5.X for Ubuntu 18.04${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" ]] -then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -echo -e "${NC}" -echo -e "${YELLOW}Installing Linux Kernel 5.x${NC}" -sudo apt-get install --install-recommends linux-generic-hwe-18.04 -y -read -p "Would you like to reboot pc Y/N?" -n 1 -r -echo -e "${NC}" -if [[ $REPLY =~ ^[Yy]$ ]] -then -sudo reboot -n -fi - -} - -function analyzer_and_fixer(){ - -echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) - - -} - ->>>>>>> c445a443ed31ff01020f37c952a8af815b661afc function install_node(){ @@ -1363,46 +1156,6 @@ bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool } -<<<<<<< HEAD -======= -function multinode(){ - -echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - - echo -e "" - echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" - echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" - echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" - echo -e "" - echo -e "${ARROW} ${RED}IMPORTANT:${NC}" - echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" - echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" - echo -e "" - echo -e "${YELLOW}================================================================${NC}" - echo -e "" - - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" - echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" - echo -e "" - exit - fi - - sleep 15 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) - -} - ->>>>>>> c445a443ed31ff01020f37c952a8af815b661afc function install_docker(){ echo -e "${GREEN}Module: Install Docker${NC}" diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 5d63c9cb..c2b3c6fa 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -13,11 +13,9 @@ else ROOT_BRANCH='master' fi -<<<<<<< HEAD source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" -======= ->>>>>>> c445a443ed31ff01020f37c952a8af815b661afc + BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='daemon_bootstrap.tar.gz' BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' @@ -929,209 +927,6 @@ function flux_daemon_bootstrap() { pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 } -<<<<<<< HEAD -======= -function mongodb_bootstrap(){ - -echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" -echo -e "${YELLOW}================================================================${NC}" -echo -e "${ARROW} ${CYAN}Module disabled...${NC}" -echo -e "" -exit - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -sudo rm /home/$USER/fluxdb_dump.tar.gz > /dev/null 2>&1 -sudo rm /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 - -if ! pm2 -v > /dev/null 2>&1; then - - pm2_install - - if [[ "$PM2_INSTALL" == "0" ]]; then - exit - fi - -fi - -WANIP=$(wget http://ipecho.net/plain -O - -q) - -DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') -if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') -fi - -BLOCKHIGHT=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') -FORCE_BOOTSTRAP=0 - -if [[ "$DB_HIGHT" == "" ]]; then - echo -e "${ARROW} ${CYAN}MongoDB bootstrap server offline...${NC}" - string_limit_x_mark "Operation aborted....................." - exit -fi - - -if [[ "$BLOCKHIGHT" == "" || "$BLOCKHIGHT" == "null" ]]; then - - if whiptail --yesno "Local Explorer not respondin...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - string_limit_x_mark "Local Explorer not responding........." - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - -fi - - if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - - if [[ "$BLOCKHIGHT" == "null" ]]; then - - message=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq -r .data.message) - - if whiptail --yesno "Flux explorer error noticed...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Flux explorer error: ${RED}$message${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - fi - fi - - -if [[ "$BLOCKHIGHT" != "" && "$BLOCKHIGHT" != "null" ]]; then - - if [[ "$BLOCKHIGHT" -gt "$DB_HIGHT" ]]; then - - if whiptail --yesno "Datatable is out of date....Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Current Node block hight ${RED}$BLOCKHIGHT${CYAN} > Bootstrap block hight ${RED}$DB_HIGHT${CYAN}. Datatable is out of date.${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - - fi -fi - - -echo -e "${ARROW} ${CYAN}IP: ${RED}$WANIP${NC}" - -if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - echo -e "${ARROW} ${CYAN}Node block hight: ${GREEN}$BLOCKHIGHT${NC}" -fi - -echo -e "${ARROW} ${CYAN}Bootstrap block hight: ${GREEN}$DB_HIGHT${NC}" -echo -e "" - - -echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" -wget $BOOTSTRAP_URL_MONGOD -q --show-progress -echo -e "${ARROW} ${CYAN}Unpacking...${NC}" -tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 -echo -e "${ARROW} ${CYAN}Stoping Flux...${NC}" -pm2 stop flux > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" -mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Cleaning...${NC}" -sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 -sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 -pm2 start flux > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 - -NUM='120' -MSG1='Flux starting...' -MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo - -#BLOCKHIGHT_AFTER_BOOTSTRAP=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') -BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "" && "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "null" ]]; then - - echo -e "${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC}" - - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then - - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - - if [[ "$FORCE_BOOTSTRAP" == "1" ]]; then - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - fi - - fi - else - - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - - fi - - -} - -function install_kernel(){ - - -echo -e "${GREEN}Module: Install Linux Kernel 5.X for Ubuntu 18.04${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" ]] -then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -echo -e "${NC}" -echo -e "${YELLOW}Installing Linux Kernel 5.x${NC}" -sudo apt-get install --install-recommends linux-generic-hwe-18.04 -y -read -p "Would you like to reboot pc Y/N?" -n 1 -r -echo -e "${NC}" -if [[ $REPLY =~ ^[Yy]$ ]] -then -sudo reboot -n -fi - -} - -function analyzer_and_fixer(){ - -echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) - - -} ->>>>>>> c445a443ed31ff01020f37c952a8af815b661afc - function install_node(){ @@ -1170,45 +965,6 @@ bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool } -<<<<<<< HEAD -======= -function multinode(){ - -echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit -fi - - echo -e "" - echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" - echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" - echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" - echo -e "" - echo -e "${ARROW} ${RED}IMPORTANT:${NC}" - echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" - echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" - echo -e "" - echo -e "${YELLOW}================================================================${NC}" - echo -e "" - - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" - echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" - echo -e "" - exit - fi - - sleep 15 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) - -} ->>>>>>> c445a443ed31ff01020f37c952a8af815b661afc function install_docker(){ From a8f27550e833e4b78021e5f97c90810d01f7ad29 Mon Sep 17 00:00:00 2001 From: TechDufus <46715299+matthewjdegarmo@users.noreply.github.com> Date: Sat, 6 Aug 2022 14:38:34 -0500 Subject: [PATCH 0527/1176] Exporting root_branch var and doing quick cleanup at end of script. (#26) * Exporting root_branch var and doing quick cleanup at end of script. * Exporting testnet root_branch too. --- multitoolbox.sh | 6 +++++- multitoolbox_testnet.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a56260eb..22f786a5 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -10,7 +10,7 @@ if ! [[ -z $1 ]]; then exit fi else - ROOT_BRANCH='master' + export ROOT_BRANCH='master' fi BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' @@ -2593,3 +2593,7 @@ read -rp "Pick an option and hit ENTER: " # ;; esac + +# USED FOR CLEANUP AT END OF SCRIPT +unset ROOT_BRANCH +unset BRANCH_ALREADY_REFERENCED diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 1445feef..c893bfd9 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -10,7 +10,7 @@ if ! [[ -z $1 ]]; then exit fi else - ROOT_BRANCH='master' + export ROOT_BRANCH='master' fi BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' @@ -2150,3 +2150,7 @@ read -rp "Pick an option and hit ENTER: " multinode ;; esac + +# USED FOR CLEANUP AT END OF SCRIPT +unset ROOT_BRANCH +unset BRANCH_ALREADY_REFERENCED From e0102264d7b1bf432ff21886ad34c379790a73da Mon Sep 17 00:00:00 2001 From: Kroissan <66138267+Kroissan@users.noreply.github.com> Date: Wed, 10 Aug 2022 10:38:40 +0200 Subject: [PATCH 0528/1176] Fix node analyzer Node analyzer and fixer isn't working with the new fluxbench feature wich allows to specify speedtestserverid=XXXXX under .fluxbenchmark/fluxbench.conf. The new regexp is more restrictive and fix it --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 29d49bff..e07c029c 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -160,7 +160,7 @@ fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then -FluxAPI=$(grep -Po "\\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) +FluxAPI=$(grep -Po "(?<=fluxport=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) FLUXOS_CONFIG=$(grep -Po "$FluxAPI" /home/$USER/zelflux/config/userconfig.js) if [[ "$FLUXOS_CONFIG" != "" ]]; then FluxUI=$(($FluxAPI-1)) From fa21e1590de3b6cdd4b4b55a3d469d044eeb8df8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Aug 2022 13:47:10 +0200 Subject: [PATCH 0529/1176] added fluxos reconfiguration - new menu structure - add/replace kadena address --- multitoolbox.sh | 107 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 88 insertions(+), 19 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 22f786a5..cdd1db58 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -61,6 +61,12 @@ export NEWT_COLORS=' title=black, ' +function insertAfter +{ + local file="$1" line="$2" newText="$3" + sudo sed -i -e "/$line/a"$'\\\n'"$newText"$'\n' "$file" +} + function bootstrap_server(){ rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") richable=() @@ -2204,22 +2210,46 @@ EOF } -function replace_zelid() { - echo -e "${GREEN}Module: Replace Zel ID${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi +function replace_kadena { + + while true + do + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + kda_address="kadena:$KDA_A?chainid=0" + if [[ "$KDA_A" == "" ]]; then + echo -e "${WORNING} ${CYAN}Kadena address can't be empty string, operation aborted...${NC}" + echo -e "" + exit + fi + break + done + + +if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then + + sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js + + if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Kadena address replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + fi + +else + + insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "kadena: '$kda_address'," + echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" + +fi + + +} + + +function replace_zelid() { while true do - + new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then @@ -2229,22 +2259,61 @@ while true string_limit_x_mark "Zel ID is not valid try again..........................................." sleep 2 fi - + done - + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped........................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" else sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" fi - fi } + +function fluxos_reconfiguration { + + echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + if ! [[ -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}FluxOS userconfig.js not exist, operation aborted${NC}" + echo -e "" + exit + fi + + + CHOICE=$( + whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ + "1)" "Replace ZELID" \ + "2)" "Add/Replace kadena address" 3>&2 2>&1 1>&3 + ) + + +case $CHOICE in + "1)") + replace_zelid + ;; + "2)") + replace_kadena + ;; +esac + +} + + function install_watchtower(){ echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" @@ -2479,7 +2548,7 @@ echo -e "${CYAN}7 - Re-install FluxOS${NC}" echo -e "${CYAN}8 - Flux Daemon Reconfiguration${NC}" echo -e "${CYAN}9 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" -echo -e "${CYAN}11 - Replace Zel ID ${NC}" +echo -e "${CYAN}11 - FluxOS reconfiguration ${NC}" echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${CYAN}13 - Recover corrupted MongoDB database${NC}" echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Router with UPNP support) ${NC}" @@ -2560,7 +2629,7 @@ read -rp "Pick an option and hit ENTER: " 11) clear sleep 1 - replace_zelid + fluxos_reconfiguration echo -e "" ;; From 90c18309c18f645806b41d3ee3564806ac135f6a Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 10 Aug 2022 12:14:31 -0500 Subject: [PATCH 0530/1176] Removing pm2_install from testnet --- multitoolbox_testnet.sh | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index c62f571e..c31fa1a8 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -42,36 +42,6 @@ PM2_INSTALL="0" zelflux_setting_import="0" - -function pm2_install(){ - tmux kill-server > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}PM2 installing...${NC}" - npm install pm2@latest -g > /dev/null 2>&1 - - if pm2 -v > /dev/null 2>&1 - then - rm restart_zelflux.sh > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Configuring PM2...${NC}" - pm2 startup systemd -u $USER > /dev/null 2>&1 - sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 - pm2 start ~/$FLUX_DIR/start.sh --name flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - pm2 install pm2-logrotate > /dev/null 2>&1 - pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 - pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 - pm2 set pm2-logrotate:compress true > /dev/null 2>&1 - pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 - pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 - source ~/.bashrc - #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" - string_limit_check_mark "PM2 v$(pm2 -v) installed....................................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed....................................................." - PM2_INSTALL="1" - else - string_limit_x_mark "PM2 was not installed....................................................." - echo - fi -} - function replace_kadena { while true do From 58f4191bc0fb7309c9a05c4093470a206a3cea83 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 10 Aug 2022 13:44:05 -0500 Subject: [PATCH 0531/1176] Updating fluxos reconfig function call. --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index fd0235c8..73c3becb 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1727,7 +1727,7 @@ read -rp "Pick an option and hit ENTER: " 8) clear sleep 1 - daemon_reconfiguration + fluxos_reconfiguration ;; From e61b2a89d2347c8fd55030c4e8966cca3259673b Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 10 Aug 2022 14:00:28 -0500 Subject: [PATCH 0532/1176] Removing duplicate functions from multitoolbox_testnet --- multitoolbox_testnet.sh | 83 ----------------------------------------- 1 file changed, 83 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index c31fa1a8..00d92122 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -42,89 +42,6 @@ PM2_INSTALL="0" zelflux_setting_import="0" -function replace_kadena { - while true - do - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - kda_address="kadena:$KDA_A?chainid=0" - - if [[ "$KDA_A" == "" ]]; then - echo -e "${WORNING} ${CYAN}Kadena address can't be empty string, operation aborted...${NC}" - echo -e "" - exit - fi - break - done - - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then - sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js - - if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Kadena address replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" - fi - else - insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "kadena: '$kda_address'," - echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" - fi -} - - -function replace_zelid() { - while true - do - new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - - if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then - string_limit_check_mark "Zel ID is valid..........................................." - break - else - string_limit_x_mark "Zel ID is not valid try again..........................................." - sleep 2 - fi - done - - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js - - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi -} - -function fluxos_reconfiguration { - echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - if ! [[ -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}FluxOS userconfig.js not exist, operation aborted${NC}" - echo -e "" - exit - fi - CHOICE=$( - whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ - "1)" "Replace ZELID" \ - "2)" "Add/Replace kadena address" 3>&2 2>&1 1>&3 - ) - case $CHOICE in - "1)") - replace_zelid - ;; - "2)") - replace_kadena - ;; - esac -} - function config_file() { From b959a2ec37c07df8367e9adb2a33b034b583a000 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 10 Aug 2022 14:03:14 -0500 Subject: [PATCH 0533/1176] Removing git conflict garbage text. --- multitoolbox.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 73c3becb..0f5d56a8 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1406,8 +1406,6 @@ spinning_timer echo -e "" && echo -e "" } -<<<<<<< HEAD -======= function create_service_scripts() { @@ -1584,7 +1582,6 @@ echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" fi } ->>>>>>> 4abec2c01aaeabb138fdcb850673a5c21806d431 function mongod_db_fix() { From 56f14f5149fb50608ebe9a6fb64d8b226ed61878 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 10 Aug 2022 14:11:26 -0500 Subject: [PATCH 0534/1176] Restoring original daemon function call. --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 0f5d56a8..2f07d10b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1724,7 +1724,7 @@ read -rp "Pick an option and hit ENTER: " 8) clear sleep 1 - fluxos_reconfiguration + daemon_reconfiguration ;; From e78e1aec6690505fc73778797b1f5ae19e235cc4 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 10 Aug 2022 20:35:37 -0500 Subject: [PATCH 0535/1176] Updating reference to correct branch --- apps_info.sh | 2 +- geo_test.sh | 2 +- install_pro.sh | 2 +- install_pro_testnet.sh | 2 +- nodeanalizerandfixer.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps_info.sh b/apps_info.sh index 0f10a003..2257d2bc 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" apps_info=$(curl -SsL -m 10 https://api.runonflux.io/apps/globalappsspecifications) diff --git a/geo_test.sh b/geo_test.sh index 70b97169..34a37403 100644 --- a/geo_test.sh +++ b/geo_test.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" # THIS LOOKS UNUSED. CANDIDATE FOR DELETION. function server_geolocation(){ diff --git a/install_pro.sh b/install_pro.sh index 3039127c..ec006096 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" # Bootstrap settings diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 822e1608..eb53b905 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" # Bootstrap settings BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 758773e8..32d6366d 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" #const REPLACE="0" From 46b423afd4e873139231bc1f6ed640bfd2b62869 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 10 Aug 2022 23:01:44 -0500 Subject: [PATCH 0536/1176] adding pm2_install to multitoolbox_testnet script --- multitoolbox_testnet.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 00d92122..30b28c9f 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -117,6 +117,34 @@ fi fi } +function pm2_install(){ + tmux kill-server > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}PM2 installing...${NC}" + npm install pm2@latest -g > /dev/null 2>&1 + + if pm2 -v > /dev/null 2>&1; then + rm restart_zelflux.sh > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Configuring PM2...${NC}" + pm2 startup systemd -u $USER > /dev/null 2>&1 + sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 + pm2 start ~/$FLUX_DIR/start.sh --name flux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + pm2 install pm2-logrotate > /dev/null 2>&1 + pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 + pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 + pm2 set pm2-logrotate:compress true > /dev/null 2>&1 + pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 + pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 + source ~/.bashrc + #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" + string_limit_check_mark "PM2 v$(pm2 -v) installed....................................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed....................................................." + PM2_INSTALL="1" + else + string_limit_x_mark "PM2 was not installed....................................................." + echo + fi +} + function install_flux() { From 2de78cb852e38db4d1d1e16f35b63d116b6eb8c8 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 10 Aug 2022 23:18:17 -0500 Subject: [PATCH 0537/1176] formatting function and adding () to call --- install_pro_testnet.sh | 106 ++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index eb53b905..41ec90c3 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1024,63 +1024,63 @@ function basic_security() { function start_daemon() { - sudo systemctl enable zelcash.service > /dev/null 2>&1 - sudo systemctl start zelcash > /dev/null 2>&1 - - NUM='250' - MSG1='Starting daemon & syncing with chain please be patient this will take about 3 min...' - MSG2='' - spinning_timer - - if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + sudo systemctl enable zelcash.service > /dev/null 2>&1 + sudo systemctl start zelcash > /dev/null 2>&1 + + NUM='250' + MSG1='Starting daemon & syncing with chain please be patient this will take about 3 min...' + MSG2='' + spinning_timer + + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then # if $COIN_DAEMON > /dev/null 2>&1; then - - NUM='2' - MSG1='Getting info...' - MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo && echo - - - daemon_version=$($COIN_CLI getinfo | jq -r '.version') - string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." - #echo -e "Zelcash version: ${GREEN}v$zelcash_version${CYAN} installed................................." - bench_version=$($BENCH_CLI -testnet getinfo | jq -r '.version') - string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." - #echo -e "${ARROW} ${CYAN}Zelbench version: ${GREEN}v$zelbench_version${CYAN} installed${NC}" - echo - pm2_install - #zelbench-cli stop > /dev/null 2>&1 && sleep 2 - else - echo - echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" - - if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then - error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') - if [[ "$error_line" != "" ]]; then - echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" - echo -e "${WORNING} ${CYAN}$error_line${NC}" - echo - exit - fi - fi - - - if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then - - echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" - echo -n "" - else - - echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" - echo -n "" - exit + NUM='2' + MSG1='Getting info...' + MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo - fi - - fi + daemon_version=$($COIN_CLI getinfo | jq -r '.version') + string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." + #echo -e "Zelcash version: ${GREEN}v$zelcash_version${CYAN} installed................................." + bench_version=$($BENCH_CLI -testnet getinfo | jq -r '.version') + string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." + #echo -e "${ARROW} ${CYAN}Zelbench version: ${GREEN}v$zelbench_version${CYAN} installed${NC}" + echo + pm2_install() + #zelbench-cli stop > /dev/null 2>&1 && sleep 2 + else + echo + echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" + + if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then + error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + if [[ "$error_line" != "" ]]; then + echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" + echo -e "${WORNING} ${CYAN}$error_line${NC}" + echo + exit + fi + fi + + + if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then + + echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" + echo -n "" + + else + + echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" + echo -n "" + exit + + fi + + + fi } #TODO: RESEARCH, This defaults to mongodb 5.0 in install_pro, why not here? From 95085ac2c35ca535f2bec581182378fbb60cdfdd Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 10 Aug 2022 23:24:51 -0500 Subject: [PATCH 0538/1176] putting original function formatting back. --- install_pro_testnet.sh | 106 ++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 41ec90c3..1ed9174d 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1024,63 +1024,63 @@ function basic_security() { function start_daemon() { - sudo systemctl enable zelcash.service > /dev/null 2>&1 - sudo systemctl start zelcash > /dev/null 2>&1 - - NUM='250' - MSG1='Starting daemon & syncing with chain please be patient this will take about 3 min...' - MSG2='' - spinning_timer - - if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then - # if $COIN_DAEMON > /dev/null 2>&1; then - - NUM='2' - MSG1='Getting info...' - MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + sudo systemctl enable zelcash.service > /dev/null 2>&1 + sudo systemctl start zelcash > /dev/null 2>&1 + + NUM='250' + MSG1='Starting daemon & syncing with chain please be patient this will take about 3 min...' + MSG2='' spinning_timer - echo && echo - - - daemon_version=$($COIN_CLI getinfo | jq -r '.version') - string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." - #echo -e "Zelcash version: ${GREEN}v$zelcash_version${CYAN} installed................................." - bench_version=$($BENCH_CLI -testnet getinfo | jq -r '.version') - string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." - #echo -e "${ARROW} ${CYAN}Zelbench version: ${GREEN}v$zelbench_version${CYAN} installed${NC}" - echo - pm2_install() - #zelbench-cli stop > /dev/null 2>&1 && sleep 2 - else - echo - echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" - - if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then - error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') - if [[ "$error_line" != "" ]]; then - echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" - echo -e "${WORNING} ${CYAN}$error_line${NC}" - echo - exit - fi - fi - - - if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then - - echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" - echo -n "" - - else - - echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" - echo -n "" - exit + + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + # if $COIN_DAEMON > /dev/null 2>&1; then + + NUM='2' + MSG1='Getting info...' + MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo + + + daemon_version=$($COIN_CLI getinfo | jq -r '.version') + string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." + #echo -e "Zelcash version: ${GREEN}v$zelcash_version${CYAN} installed................................." + bench_version=$($BENCH_CLI -testnet getinfo | jq -r '.version') + string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." + #echo -e "${ARROW} ${CYAN}Zelbench version: ${GREEN}v$zelbench_version${CYAN} installed${NC}" + echo + pm2_install() + #zelbench-cli stop > /dev/null 2>&1 && sleep 2 + else + echo + echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" + + if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then + error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + if [[ "$error_line" != "" ]]; then + echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" + echo -e "${WORNING} ${CYAN}$error_line${NC}" + echo + exit + fi + fi + + + if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then + + echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" + echo -n "" - fi + else + + echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" + echo -n "" + exit + fi - fi + + fi } #TODO: RESEARCH, This defaults to mongodb 5.0 in install_pro, why not here? From 97e713f2142bb23aa38fa2743c88e7b772310e79 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 10 Aug 2022 23:32:59 -0500 Subject: [PATCH 0539/1176] Moving pm2_install into flux_common --- flux_common.sh | 30 +++++++++++++++++++++++++++++- install_pro_testnet.sh | 2 +- multitoolbox.sh | 29 ----------------------------- multitoolbox_testnet.sh | 28 ---------------------------- 4 files changed, 30 insertions(+), 59 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index aa7f7b7d..2a6d215a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -534,7 +534,7 @@ function create_oldnode_service_scripts() { #color codes RED='\033[1;31m' CYAN='\033[1;36m' -NC='\033[0m' +NC='\033[0m'then #emoji codes BOOK="${RED}\xF0\x9F\x93\x8B${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" @@ -1140,6 +1140,34 @@ function kda_bootstrap() { echo -e "" } +function pm2_install(){ + tmux kill-server > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}PM2 installing...${NC}" + npm install pm2@latest -g > /dev/null 2>&1 + + if pm2 -v > /dev/null 2>&1; then + rm restart_zelflux.sh > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Configuring PM2...${NC}" + pm2 startup systemd -u $USER > /dev/null 2>&1 + sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 + pm2 start ~/$FLUX_DIR/start.sh --name flux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + pm2 install pm2-logrotate > /dev/null 2>&1 + pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 + pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 + pm2 set pm2-logrotate:compress true > /dev/null 2>&1 + pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 + pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 + source ~/.bashrc + #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" + string_limit_check_mark "PM2 v$(pm2 -v) installed....................................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed....................................................." + PM2_INSTALL="1" + else + string_limit_x_mark "PM2 was not installed....................................................." + echo + fi +} + function mongodb_bootstrap() { echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" echo -e "${YELLOW}================================================================${NC}" diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 1ed9174d..eb53b905 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1049,7 +1049,7 @@ function start_daemon() { string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." #echo -e "${ARROW} ${CYAN}Zelbench version: ${GREEN}v$zelbench_version${CYAN} installed${NC}" echo - pm2_install() + pm2_install #zelbench-cli stop > /dev/null 2>&1 && sleep 2 else echo diff --git a/multitoolbox.sh b/multitoolbox.sh index 2f07d10b..42d9d677 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -65,35 +65,6 @@ function config_veryfity(){ } -function pm2_install(){ - tmux kill-server > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}PM2 installing...${NC}" - npm install pm2@latest -g > /dev/null 2>&1 - - if pm2 -v > /dev/null 2>&1 - then - rm restart_zelflux.sh > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Configuring PM2...${NC}" - pm2 startup systemd -u $USER > /dev/null 2>&1 - sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 - pm2 start ~/$FLUX_DIR/start.sh --name flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - pm2 install pm2-logrotate > /dev/null 2>&1 - pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 - pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 - pm2 set pm2-logrotate:compress true > /dev/null 2>&1 - pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 - pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 - source ~/.bashrc - #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" - string_limit_check_mark "PM2 v$(pm2 -v) installed....................................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed....................................................." - PM2_INSTALL="1" - else - string_limit_x_mark "PM2 was not installed....................................................." - echo - fi -} - function config_file() { diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 30b28c9f..00d92122 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -117,34 +117,6 @@ fi fi } -function pm2_install(){ - tmux kill-server > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}PM2 installing...${NC}" - npm install pm2@latest -g > /dev/null 2>&1 - - if pm2 -v > /dev/null 2>&1; then - rm restart_zelflux.sh > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Configuring PM2...${NC}" - pm2 startup systemd -u $USER > /dev/null 2>&1 - sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 - pm2 start ~/$FLUX_DIR/start.sh --name flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - pm2 install pm2-logrotate > /dev/null 2>&1 - pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 - pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 - pm2 set pm2-logrotate:compress true > /dev/null 2>&1 - pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 - pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 - source ~/.bashrc - #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" - string_limit_check_mark "PM2 v$(pm2 -v) installed....................................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed....................................................." - PM2_INSTALL="1" - else - string_limit_x_mark "PM2 was not installed....................................................." - echo - fi -} - function install_flux() { From a423cfde2f7bd78c3b5db0d295a0030dea9d446a Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Thu, 11 Aug 2022 00:07:55 -0500 Subject: [PATCH 0540/1176] multitoolbox alias should always point to master --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 42d9d677..68871e49 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1610,7 +1610,7 @@ sudo apt-get install -y whiptail > /dev/null 2>&1 fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then -echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc +echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc source /etc/bash.bashrc fi From f6e2b6d67c016616accecf237f800b607e123c25 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Thu, 11 Aug 2022 16:41:45 -0500 Subject: [PATCH 0541/1176] adding fluxos_reconfigure and helpers. --- multitoolbox.sh | 102 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 68871e49..b907a9ca 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1509,6 +1509,108 @@ EOF sudo chown root:root /etc/systemd/system/zelcash.service } +function replace_kadena { + + while true + do + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + kda_address="kadena:$KDA_A?chainid=0" + if [[ "$KDA_A" == "" ]]; then + echo -e "${WORNING} ${CYAN}Kadena address can't be empty string, operation aborted...${NC}" + echo -e "" + exit + fi + break + done + + +if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then + + sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js + + if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Kadena address replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + fi + +else + + insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "kadena: '$kda_address'," + echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" + +fi + + +} + + +function replace_zelid() { + +while true + do + + new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + + if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + + done + + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js + + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + +} + + +function fluxos_reconfiguration { + + echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" + echo -e "${YELLOW}================================================================${NC}" + + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + + if ! [[ -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}FluxOS userconfig.js not exist, operation aborted${NC}" + echo -e "" + exit + fi + + + CHOICE=$( + whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ + "1)" "Replace ZELID" \ + "2)" "Add/Replace kadena address" 3>&2 2>&1 1>&3 + ) + + +case $CHOICE in + "1)") + replace_zelid + ;; + "2)") + replace_kadena + ;; +esac + +} + function install_watchtower(){ From 1479bba5f3234532c3f391e29c6fac5be165ffed Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Fri, 12 Aug 2022 07:53:59 -0500 Subject: [PATCH 0542/1176] adding branch-setting logic --- apps_info.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps_info.sh b/apps_info.sh index 2257d2bc..bbb35361 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -1,5 +1,18 @@ #!/bin/bash +if ! [[ -z $1 ]]; then + if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then + export ROOT_BRANCH="$1" + export BRANCH_ALREADY_REFERENCED='1' + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCED + exit + fi +else + export ROOT_BRANCH='master' +fi + source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" @@ -39,3 +52,6 @@ do fi done + +unset ROOT_BRANCH +unset BRANCH_ALREADY_REFERENCED \ No newline at end of file From 2f56668bfb1d3ab864f2051397f094d21e8880db Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Fri, 12 Aug 2022 08:05:39 -0500 Subject: [PATCH 0543/1176] fixing script reference. --- apps_info.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps_info.sh b/apps_info.sh index bbb35361..5bdccb86 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -4,7 +4,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/apps_info.sh) $ROOT_BRANCH unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED exit From ee10e4c46d1a3ad68caf8ac548555425dbde34b6 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Mon, 15 Aug 2022 21:07:48 -0500 Subject: [PATCH 0544/1176] Supressing docker error and adding testnet alias. --- multitoolbox.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index b907a9ca..d13b14e0 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -160,8 +160,8 @@ fi if [[ $docker_check != 0 ]]; then echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 echo -e "${ARROW} ${CYAN}Removing containers...${NC}" -sudo aa-remove-unknown && sudo service docker restart > /dev/null 2>&1 && sleep 2 -sleep 5 +sudo aa-remove-unknown > /dev/null 2>&1 && sudo service docker restart > /dev/null 2>&1 && sleep 2 + #docker ps | grep -Eo "^[0-9a-z]{8,}\b" | docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | while read line; do @@ -1713,6 +1713,7 @@ fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc +echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc source /etc/bash.bashrc fi From 022746faa60569ac8656604241e756310e9404aa Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 04:01:40 +0200 Subject: [PATCH 0545/1176] fix problem with cloudflare --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index cdd1db58..e8e29c09 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -942,10 +942,10 @@ fi index_from_file="$index" tx_from_file="$outpoint" - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -L -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -L -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') fi if [[ $stak_info == ?(-)+([0-9]) ]]; then From 2a239b1ffa8bd3769579c717b849e458e17b69b1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 04:04:34 +0200 Subject: [PATCH 0546/1176] removed runonflux explorer --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e8e29c09..15f52f0e 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -942,10 +942,10 @@ fi index_from_file="$index" tx_from_file="$outpoint" - stak_info=$(curl -L -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -L -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') fi if [[ $stak_info == ?(-)+([0-9]) ]]; then From 95b430d13c0020428959565428d718d42d8f0e3f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 04:39:03 +0200 Subject: [PATCH 0547/1176] stak_info correction --- multitoolbox.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 15f52f0e..75ead1b7 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -942,10 +942,10 @@ fi index_from_file="$index" tx_from_file="$outpoint" - stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '10000|25000|100000|1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '10000|25000|100000|1000|12500|40000') fi if [[ $stak_info == ?(-)+([0-9]) ]]; then @@ -1234,10 +1234,10 @@ fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '10000|25000|100000|1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '10000|25000|100000|1000|12500|40000') fi fi From 328797b231dd481282485ed0916803a898960ecf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 04:46:05 +0200 Subject: [PATCH 0548/1176] update stak_info --- multitoolbox.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 75ead1b7..6167ee10 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -942,18 +942,15 @@ fi index_from_file="$index" tx_from_file="$outpoint" - stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '1000|12500|40000') fi if [[ $stak_info == ?(-)+([0-9]) ]]; then case $stak_info in - "10000") eps_limit=90 ;; - "25000") eps_limit=180 ;; - "100000") eps_limit=300 ;; "1000") eps_limit=90 ;; "12500") eps_limit=180 ;; "40000") eps_limit=300 ;; @@ -1234,19 +1231,16 @@ fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '1000|12500|40000') fi fi if [[ $stak_info == ?(-)+([0-9]) ]]; then case $stak_info in - "10000") eps_limit=90 ;; - "25000") eps_limit=180 ;; - "100000") eps_limit=300 ;; "1000") eps_limit=90 ;; "12500") eps_limit=180 ;; "40000") eps_limit=300 ;; From fc633d970a2239c8816f94d0e77974d2f4987288 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 09:11:41 +0200 Subject: [PATCH 0549/1176] removed function duplication --- multinode.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/multinode.sh b/multinode.sh index 064f3b84..e4ac65ce 100644 --- a/multinode.sh +++ b/multinode.sh @@ -2,13 +2,6 @@ source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" - function insertAfter -{ - local file="$1" line="$2" newText="$3" - sudo sed -i -e "/$line/a"$'\\\n'"$newText"$'\n' "$file" -} - - function upnp_enable() { try="0" From 45842781c903d72c2ce132639a7878a1aa46e95c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 09:17:35 +0200 Subject: [PATCH 0550/1176] removed mongod bootstrap --- install_pro.sh | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index ec006096..65acaff0 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2,12 +2,8 @@ source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" - # Bootstrap settings -#BOOTSTRAP_ZIP='https://runonflux.zelcore.workers.dev/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz' BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' -BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' -BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' #wallet information COIN_NAME='flux' @@ -606,52 +602,6 @@ string_limit_x_mark "Watchdog was not installed................................. fi } -function mongodb_bootstrap(){ - - echo -e "" - echo -e "${ARROW} ${YELLOW}Restore mongodb datatable from bootstrap${NC}" - - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') - fi - - #BLOCKHIGHT=$(curl -s -m 6 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') - echo -e "${ARROW} ${CYAN}Bootstrap block height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" - wget --tries=5 $BOOTSTRAP_URL_MONGOD -q --show-progress - - if [[ -f /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD ]]; then - - echo -e "${ARROW} ${CYAN}Unpacking...${NC}" - tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" - mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 - sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 - - - BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) - echo -e ${ARROW} ${CYAN}Node block height after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC} - - else - - echo -e "${ARROW} ${RED}MongoDB bootstrap server offline...try again later use option 5${NC}" - fi - - echo -e "" - - #if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then - #echo -e "${ARROW} ${CYAN}Mongo bootstrap installed successful.${NC}" - #echo -e "" - # else - # echo -e "${ARROW} ${CYAN}Mongo bootstrap installation failed.${NC}" - # echo -e "" - # fi - -} - function wipe_clean() { echo -e "${ARROW} ${YELLOW}Removing any instances of FluxNode${NC}" apt_number=$(ps aux | grep 'apt' | wc -l) From 11b47e98e24df6fffc5425d50595967e616166dc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 09:20:09 +0200 Subject: [PATCH 0551/1176] removed function tier --- install_pro.sh | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 65acaff0..26902768 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -65,34 +65,6 @@ function config_veryfity(){ } -function tier(){ - -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') - - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') - fi - - - if [[ $stak_info == ?(-)+([0-9]) ]]; then - - case $stak_info in - "25000") kadena_possible=1 ;; - "100000") kadena_possible=1 ;; - "12500") kadena_possible=1 ;; - "40000") kadena_possible=1 ;; - esac - - else - kadena_possible=0 - fi - -fi - -} function pm2_install(){ echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" From 19684a7bd56ada2cc5e0c1a33c4edd3e287b4be7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 09:31:34 +0200 Subject: [PATCH 0552/1176] Update nodeanalizerandfixer.sh --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 32d6366d..d0b09f20 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -507,7 +507,7 @@ echo -e "${PIN} ${CYAN}Protocolversion: ${SEA}$protocolversion${NC}" echo -e "${PIN} ${CYAN}Connections: ${SEA}$connections${NC}" echo -e "${PIN} ${CYAN}Blocks: ${SEA}$blocks_hight${NC}" -network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) +network_height_01=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) #network_height_02=$(curl -sk -m 5 https://explorer.flux.zelcore.io/api/status?q=getInfo | jq '.info.blocks') network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) From 634fea3c9878325486017f60b6ac81ddef5b7a01 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 09:48:44 +0200 Subject: [PATCH 0553/1176] Update nodeanalizerandfixer.sh --- nodeanalizerandfixer.sh | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index d0b09f20..48df13b5 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -591,10 +591,10 @@ stak_info="" if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') #collateral_index=$(awk '{print $1}' <<< "$stak_info") - stak_info=$(curl -s -m 10 https://explorer.runonflux.io/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep '1000|12500|40000') fi fi @@ -631,9 +631,6 @@ fi if [[ $type == ?(-)+([0-9]) ]]; then case $type in - "10000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}CUMULUS${NC}" ;; - "25000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}NIMBUS${NC}";; - "100000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}STRATUS${NC}";; "1000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}CUMULUS${NC}" ;; "12500") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}NIMBUS${NC}";; "40000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}STRATUS${NC}";; @@ -655,9 +652,6 @@ fi if [[ "$bench_benchmark_value" -ge "$type" ]]; then case $type in - "10000") bench_benchmark_value_name="CUMULUS" ;; - "25000") bench_benchmark_value_name="NIMBUS" ;; - "100000") bench_benchmark_value_name="STRATUS" ;; "1000") bench_benchmark_value_name="CUMULUS" ;; "12500") bench_benchmark_value_name="NIMBUS" ;; "40000") bench_benchmark_value_name="STRATUS" ;; @@ -667,9 +661,6 @@ fi else case $type in - "10000") bench_benchmark_value_name="CUMULUS" ;; - "25000") bench_benchmark_value_name="NIMBUS" ;; - "100000") bench_benchmark_value_name="STRATUS" ;; "1000") bench_benchmark_value_name="CUMULUS" ;; "12500") bench_benchmark_value_name="NIMBUS" ;; "40000") bench_benchmark_value_name="STRATUS" ;; From aef9c47c697417eb93669cd3d302ea04867a9afa Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 09:58:50 +0200 Subject: [PATCH 0554/1176] fix missing grep --- multitoolbox.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a7ee47f3..678ae01c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -582,10 +582,10 @@ fi index_from_file="$index" tx_from_file="$outpoint" - stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi if [[ $stak_info == ?(-)+([0-9]) ]]; then @@ -871,10 +871,10 @@ fi if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '1000|12500|40000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep -o '1000|12500|40000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi fi From 386e57794405cf705297e49a4b130709cacae40b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 10:01:12 +0200 Subject: [PATCH 0555/1176] fix missing grep --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 48df13b5..6d0a24ad 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -591,10 +591,10 @@ stak_info="" if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') #collateral_index=$(awk '{print $1}' <<< "$stak_info") - stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep '1000|12500|40000') + stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | egrep '1000|12500|40000') + stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi fi From 21b1ac279130165f44ea2600ad46ea41ec51ff9f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 10:34:09 +0200 Subject: [PATCH 0556/1176] removed variable --- multitoolbox.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 678ae01c..7a7c9c5b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -15,11 +15,6 @@ fi source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" -BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' -BOOTSTRAP_URL_MONGOD='https://fluxnodeservice.com/mongod_bootstrap.tar.gz' -BOOTSTRAP_ZIPFILE_MONGOD='mongod_bootstrap.tar.gz' -KDA_BOOTSTRAP_ZIPFILE='kda_bootstrap.tar.gz' -KDA_BOOTSTRAP_ZIP='http://38.242.202.86:16127/apps/fluxshare/getfile/kda_bootstrap.tar.gz?token=8ba005f55511d806f9d4ec5f56bf5c14ae02a50bfb80f5bdb08a1ded22f7b159' if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' From 7ee3cc5ebdde26e0b67717b47835f6e697223009 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 10:35:00 +0200 Subject: [PATCH 0557/1176] added BOOTSTRAP_ZIPFILE --- flux_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 2a6d215a..7b51bb9d 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -21,6 +21,8 @@ BOOK="${RED}\xF0\x9F\x93\x8B${NC}" HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" +BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' + #dialog color export NEWT_COLORS=' title=black, From 3b2ae5c143442237e01d5d211187eb4b145cff1e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 10:35:33 +0200 Subject: [PATCH 0558/1176] added comment --- flux_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/flux_common.sh b/flux_common.sh index 7b51bb9d..b55a83b7 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -21,6 +21,7 @@ BOOK="${RED}\xF0\x9F\x93\x8B${NC}" HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" +#bootstrap settings BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' #dialog color From 10652d4694fb76a01e084cebede96ec497e14c3a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 10:37:27 +0200 Subject: [PATCH 0559/1176] removed variable --- install_pro.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 26902768..419c6872 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -2,14 +2,10 @@ source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" -# Bootstrap settings -BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' - #wallet information COIN_NAME='flux' CONFIG_DIR='.flux' CONFIG_FILE='flux.conf' -kadena_possible="0" BENCH_NAME='fluxbench' BENCH_CLI='fluxbench-cli' From fd5ebe89ac09337a7c152eb29fd537252b8ad3ef Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 10:43:25 +0200 Subject: [PATCH 0560/1176] Minor edit --- flux_common.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index b55a83b7..60f86d2a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -847,10 +847,6 @@ function display_banner() { function start_install() { start_install=`date +%s` sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo - echo -e "${CYAN}February 2021, created by dk808 improved by XK4MiLX from Flux's team." - echo -e "Special thanks to Goose-Tech, Skyslayer, & Packetflow." - echo -e "FluxNode setup starting, press [CTRL+C] to cancel.${NC}" - sleep 2 if jq --version > /dev/null 2>&1; then echo -e "" From 8923914a0907df185983feb2b6955fdd82fc4991 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 10:49:25 +0200 Subject: [PATCH 0561/1176] removed bootstrap_server duplication - function is in bootstrap_geolocation --- install_pro.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 419c6872..100a378a 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1104,7 +1104,6 @@ function bootstrap() { fi bootstrap_geolocation - bootstrap_server $continent if [[ "$Server_offline" == "1" ]]; then echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 From 1cbb874d146f23086dc752b25b58ce218e32dee8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:14:20 +0200 Subject: [PATCH 0562/1176] removed kda_bootstrap function --- flux_common.sh | 88 -------------------------------------------------- 1 file changed, 88 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 60f86d2a..932b3db6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1051,94 +1051,6 @@ function ip_confirm() { } -function kda_bootstrap() { - echo -e "${GREEN}Module: Restore Kadena node blockchain from bootstrap${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "${NC}" - sudo chown -R $USER:$USER /home/$USER/$FLUX_DIR - echo -e "${ARROW} ${CYAN}Stopping Kadena Node...${NC}" - - docker stop zelKadenaChainWebNode > /dev/null 2>&1 && sleep 10 - - if [[ -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db - fi - - mkdir -p /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 - - if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then - echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" - if whiptail --yesno "Do u want check vailidation of archive file before unpack?" 8 60 3>&1 1>&2 2>&3; then - check_tar "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" - else - echo -e "${ARROW} ${CYAN}Vailidation of archive file skipped..${NC}" - fi - fi - - if [ -f "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" ]; then - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - sleep 2 - #unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode > /dev/null 2>&1 - else - echo -e "${ARROW} ${CYAN}Bootstrap file downloading...${NC}" && sleep 2 - CHOICE=$( - whiptail --title "Bootstrap installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) - case $CHOICE in - "1)") - DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 15 https://fluxnodeservice.com/kda_bootstrap.json | jq -r '.block_height') - fi - echo -e "${ARROW} ${CYAN}KDA Bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" - wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - sleep 2 - ;; - "2)") - KDA_BOOTSTRAP_ZIP="$(whiptail --title "Kadena node bootstrap source (*.tar.gz, *.zip file supported)" --inputbox "Enter your URL" 8 72 3>&1 1>&2 2>&3)" - KDA_BOOTSTRAP_ZIPFILE="${KDA_BOOTSTRAP_ZIP##*/}" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$KDA_BOOTSTRAP_ZIP ${NC}" - wget -O $KDA_BOOTSTRAP_ZIPFILE $KDA_BOOTSTRAP_ZIP -q --show-progress - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $KDA_BOOTSTRAP_ZIPFILE -d /home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0 > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$KDA_BOOTSTRAP_ZIPFILE" "/home/$USER/$FLUX_DIR/$FLUX_APPS_DIR/zelKadenaChainWebNode/chainweb-db/0" - fi - sleep 2 - ;; - esac - fi - - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - rm -rf $KDA_BOOTSTRAP_ZIPFILE - fi - - docker start zelKadenaChainWebNode > /dev/null 2>&1 - NUM='15' - MSG1='Starting Kadena Node...' - MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo -e "" - echo -e "${ARROW} ${CYAN}Kadena Node initial process can take about ~15min. ${NC}" - echo -e "" -} - function pm2_install(){ tmux kill-server > /dev/null 2>&1 && sleep 1 echo -e "${ARROW} ${CYAN}PM2 installing...${NC}" From 2a5009cdb6463907c8c010ff3bc9037720db26da Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:37:37 +0200 Subject: [PATCH 0563/1176] removed function and procedure duplication --- flux_common.sh | 137 ------------------------------------------------- 1 file changed, 137 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 932b3db6..39e97c4a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1079,137 +1079,6 @@ function pm2_install(){ fi } -function mongodb_bootstrap() { - echo -e "${GREEN}Module: Restore Flux MongoDB datatable from bootstrap (explorer only)${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${ARROW} ${CYAN}Module disabled...${NC}" - echo -e "" - exit - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - sudo rm /home/$USER/fluxdb_dump.tar.gz > /dev/null 2>&1 - sudo rm /home/$USER/$BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 - - if ! pm2 -v > /dev/null 2>&1; then - pm2_install - if [[ "$PM2_INSTALL" == "0" ]]; then - exit - fi - fi - - WANIP=$(wget http://ipecho.net/plain -O - -q) - - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -s -m 10 https://fluxnodeservice.com/mongodb_bootstrap.json | jq -r '.block_height') - fi - - BLOCKHIGHT=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') - FORCE_BOOTSTRAP=0 - - if [[ "$DB_HIGHT" == "" ]]; then - echo -e "${ARROW} ${CYAN}MongoDB bootstrap server offline...${NC}" - string_limit_x_mark "Operation aborted....................." - exit - fi - - - if [[ "$BLOCKHIGHT" == "" || "$BLOCKHIGHT" == "null" ]]; then - if whiptail --yesno "Local Explorer not respondin...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - string_limit_x_mark "Local Explorer not responding........." - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - fi - if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - if [[ "$BLOCKHIGHT" == "null" ]]; then - message=$(curl -s -m 5 http://"$WANIP":16127/explorer/scannedheight | jq -r .data.message) - if whiptail --yesno "Flux explorer error noticed...Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Flux explorer error: ${RED}$message${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - fi - fi - - if [[ "$BLOCKHIGHT" != "" && "$BLOCKHIGHT" != "null" ]]; then - if [[ "$BLOCKHIGHT" -gt "$DB_HIGHT" ]]; then - if whiptail --yesno "Datatable is out of date....Would you like force bootstrap installation?" 8 60; then - FORCE_BOOTSTRAP=1 - else - echo -e "${ARROW} ${CYAN}Current Node block hight ${RED}$BLOCKHIGHT${CYAN} > Bootstrap block hight ${RED}$DB_HIGHT${CYAN}. Datatable is out of date.${NC}" - string_limit_x_mark "Operation aborted....................." - echo -e "" - exit - fi - fi - fi - - - echo -e "${ARROW} ${CYAN}IP: ${RED}$WANIP${NC}" - - if [[ "$FORCE_BOOTSTRAP" != "1" ]]; then - echo -e "${ARROW} ${CYAN}Node block hight: ${GREEN}$BLOCKHIGHT${NC}" - fi - - echo -e "${ARROW} ${CYAN}Bootstrap block hight: ${GREEN}$DB_HIGHT${NC}" - echo -e "" - - - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$BOOTSTRAP_URL_MONGOD${NC}" - wget $BOOTSTRAP_URL_MONGOD -q --show-progress - echo -e "${ARROW} ${CYAN}Unpacking...${NC}" - tar xvf $BOOTSTRAP_ZIPFILE_MONGOD -C /home/$USER > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Stoping Flux...${NC}" - pm2 stop flux > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Importing mongodb datatable...${NC}" - mongorestore --port 27017 --db zelcashdata /home/$USER/dump/zelcashdata --drop > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - sudo rm -rf /home/$USER/dump > /dev/null 2>&1 && sleep 1 - sudo rm -rf $BOOTSTRAP_ZIPFILE_MONGOD > /dev/null 2>&1 && sleep 1 - pm2 start flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - - NUM='120' - MSG1='Flux starting...' - MSG2="${CYAN}.....................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo - - #BLOCKHIGHT_AFTER_BOOTSTRAP=$(curl -s -m 3 http://"$WANIP":16127/explorer/scannedheight | jq '.data.generalScannedHeight') - BLOCKHIGHT_AFTER_BOOTSTRAP=$(mongoexport -d zelcashdata -c scannedheight --jsonArray --pretty --quiet | jq -r .[].generalScannedHeight) - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "" && "$BLOCKHIGHT_AFTER_BOOTSTRAP" != "null" ]]; then - echo -e "${ARROW} ${CYAN}Node block hight after restored: ${GREEN}$BLOCKHIGHT_AFTER_BOOTSTRAP${NC}" - if [[ "$BLOCKHIGHT_AFTER_BOOTSTRAP" -ge "$DB_HIGHT" ]]; then - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - if [[ "$FORCE_BOOTSTRAP" == "1" ]]; then - string_limit_check_mark "MongoDB bootstrap installed successful.................................." - echo -e "" - else - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - fi - fi - else - string_limit_x_mark "MongoDB bootstrap installation failed.................................." - echo -e "" - fi -} function install_kernel(){ echo -e "${GREEN}Module: Install Linux Kernel 5.X for Ubuntu 18.04${NC}" @@ -1339,14 +1208,8 @@ fi exit EOF - echo -e "${ARROW} ${CYAN}Setting scripts permissions...${NC}" && sleep 1 sudo chmod +x /home/$USER/stop_daemon_service.sh sudo chmod +x /home/$USER/start_daemon_service.sh - echo -e "${ARROW} ${CYAN}Reloading service config...${NC}" && sleep 1 - sudo systemctl daemon-reload > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting Flux daemon....${NC}" && sleep 1 - sudo systemctl start zelcash > /dev/null 2>&1 - echo -e "" } function create_oldnode_service() { From 2edade973a49523ff77f08cebb51580990c03e6f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:39:48 +0200 Subject: [PATCH 0564/1176] removed zelid old function --- flux_common.sh | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 39e97c4a..c568290f 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1315,42 +1315,4 @@ function analyzer_and_fixer(){ } -function replace_zelid() { - - echo -e "${GREEN}Module: Replace Zel ID${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - while true - do - new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then - string_limit_check_mark "Zel ID is valid..........................................." - break - else - string_limit_x_mark "Zel ID is not valid try again..........................................." - sleep 2 - fi - done - - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped........................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - -} - - - From 68f4599f024a8267c881a953adbb6123c54bd458 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:47:16 +0200 Subject: [PATCH 0565/1176] added argument for display_banner --- flux_common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index c568290f..358bd354 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -814,10 +814,10 @@ function display_banner() { echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" echo echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" - echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} -testnet getinfo${NC}" - echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} -testnet getbenchmarks${NC}" - echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} -testnet restartnodebenchmarks${NC}" - echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} -testnet stop${NC}" + echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} $1 getinfo${NC}" + echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} $1 getbenchmarks${NC}" + echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} $1 restartnodebenchmarks${NC}" + echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} $1 stop${NC}" echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" echo echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" From aa17390f00d56096a79bf7c1b7b9617efb185e85 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:48:38 +0200 Subject: [PATCH 0566/1176] added -testnet for display_banner --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index eb53b905..ef253626 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1382,7 +1382,7 @@ else # fi check - display_banner + display_banner "-testnet" } From 9d4165c8cc22f22a65390e0bdd029aeca879f543 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:58:45 +0200 Subject: [PATCH 0567/1176] disable info about importing --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 358bd354..3af5d1bc 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -29,7 +29,7 @@ export NEWT_COLORS=' title=black, ' -echo -e "${ARROW} ${CYAN}Importing Common Multitoolbox Resources..." +#echo -e "${ARROW} ${CYAN}Importing Common Multitoolbox Resources..." function round() { From 1061d6df2c99a7d13b99e8dc0df66dad08ce6e55 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 12:10:37 +0200 Subject: [PATCH 0568/1176] changed color --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 3af5d1bc..436537ca 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1138,7 +1138,7 @@ function multinode(){ } function create_service_scripts() { - echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 + echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 sudo touch /home/$USER/start_daemon_service.sh sudo chown $USER:$USER /home/$USER/start_daemon_service.sh From 9f93f5f4a156c7f77c4800c0271df6b9f1ed4acd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 12:14:30 +0200 Subject: [PATCH 0569/1176] Minor edit --- flux_common.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 436537ca..cdd1bfc7 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -378,8 +378,7 @@ EOF (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" - else - echo -e "${ARROW} ${CYAN}Cron jobs already added! ${NC}" + else echo -e "${ARROW} ${CYAN}Script installed! ${NC}" fi echo -e "" From af3f50585bcc7f371e7ff227b4f162a485f5c223 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 13:21:00 +0200 Subject: [PATCH 0570/1176] removed docker snap --- nodeanalizerandfixer.sh | 45 +++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 6d0a24ad..dfb86243 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -707,8 +707,8 @@ echo -e "" echo -e "${BOOK} ${YELLOW}Checking service:${NC}" docker_working=0 -snap_docker_running=$(sudo systemctl status snap.docker.dockerd.service 2> /dev/null | grep 'running' | grep -o 'since.*') -snap_docker_inactive=$(sudo systemctl status snap.docker.dockerd.service 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') +#snap_docker_running=$(sudo systemctl status snap.docker.dockerd.service 2> /dev/null | grep 'running' | grep -o 'since.*') +#snap_docker_inactive=$(sudo systemctl status snap.docker.dockerd.service 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') docker_running=$(sudo systemctl status docker 2> /dev/null | grep 'running' | grep -o 'since.*') docker_inactive=$(sudo systemctl status docker 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') @@ -719,29 +719,26 @@ mongod_inactive=$(sudo systemctl status mongod 2> /dev/null | egrep 'inactive|fa daemon_running=$(sudo systemctl status zelcash 2> /dev/null | grep 'running' | grep -o 'since.*') daemon_inactive=$(sudo systemctl status zelcash 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') -if sudo systemctl list-units | grep snap.docker.dockerd.service | egrep -wi 'running' > /dev/null 2>&1; then -echo -e "${ARROW} ${CYAN}Docker(SNAP) service running ${SEA}$snap_docker_running${NC}" -docker_working=1 -else - -if [ "$snap_docker_inactive" != "" ]; then -echo -e "${ARROW} ${CYAN}Docker(SNAP) service not running ${RED}$snap_docker_inactive${NC}" -else -echo -e "${ARROW} ${CYAN}Docker(SNAP) is not installed${NC}" -fi - -fi - -if sudo systemctl list-units | grep docker.service | egrep -wi 'running' > /dev/null 2>&1; then -echo -e "${ARROW} ${CYAN}Docker service running ${SEA}$docker_running${NC}" -docker_working=1 -else -if [[ "$docker_inactive" != "" ]]; then -echo -e "${ARROW} ${CYAN}Docker service not running ${RED}$docker_inactive${NC}" -else -echo -e "${ARROW} ${CYAN}Docker is not installed${NC}" -fi +#if sudo systemctl list-units | grep snap.docker.dockerd.service | egrep -wi 'running' > /dev/null 2>&1; then +#echo -e "${ARROW} ${CYAN}Docker(SNAP) service running ${SEA}$snap_docker_running${NC}" +#docker_working=1 +#else +#if [ "$snap_docker_inactive" != "" ]; then +#echo -e "${ARROW} ${CYAN}Docker(SNAP) service not running ${RED}$snap_docker_inactive${NC}" +#else +#echo -e "${ARROW} ${CYAN}Docker(SNAP) is not installed${NC}" +#fi +#fi + if sudo systemctl list-units | grep docker.service | egrep -wi 'running' > /dev/null 2>&1; then + echo -e "${ARROW} ${CYAN}Docker service running ${SEA}$docker_running${NC}" + docker_working=1 + else + if [[ "$docker_inactive" != "" ]]; then + echo -e "${ARROW} ${CYAN}Docker service not running ${RED}$docker_inactive${NC}" + else + echo -e "${ARROW} ${CYAN}Docker is not installed${NC}" + fi fi if [[ "$docker_working" == "1" ]]; then From 0f29fcd5f5f64a76201524d024a86d2c68e56caa Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 13:22:47 +0200 Subject: [PATCH 0571/1176] cleanup --- nodeanalizerandfixer.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index dfb86243..ca13a7e7 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -732,7 +732,7 @@ daemon_inactive=$(sudo systemctl status zelcash 2> /dev/null | egrep 'inactive|f if sudo systemctl list-units | grep docker.service | egrep -wi 'running' > /dev/null 2>&1; then echo -e "${ARROW} ${CYAN}Docker service running ${SEA}$docker_running${NC}" - docker_working=1 + #docker_working=1 else if [[ "$docker_inactive" != "" ]]; then echo -e "${ARROW} ${CYAN}Docker service not running ${RED}$docker_inactive${NC}" @@ -741,11 +741,11 @@ daemon_inactive=$(sudo systemctl status zelcash 2> /dev/null | egrep 'inactive|f fi fi -if [[ "$docker_working" == "1" ]]; then -echo -e "${CHECK_MARK} ${CYAN} Docker is working correct${NC}" -else -echo -e "${X_MARK} ${CYAN} Docker is not working${NC}" -fi +#if [[ "$docker_working" == "1" ]]; then +#echo -e "${CHECK_MARK} ${CYAN} Docker is working correct${NC}" +#else +#echo -e "${X_MARK} ${CYAN} Docker is not working${NC}" +#fi #if systemctl list-units | grep docker.socket | egrep -wi 'running' > /dev/null 2>&1; then #echo -e "${CHECK_MARK} ${CYAN} Docker Socket for the API running ${SEA}$docker_socket_running${NC}" From 213526182ba7c6c3726ef0cb326ecd8278811cf2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 13:26:00 +0200 Subject: [PATCH 0572/1176] Minor edits --- nodeanalizerandfixer.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index ca13a7e7..87ea91b0 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -731,13 +731,13 @@ daemon_inactive=$(sudo systemctl status zelcash 2> /dev/null | egrep 'inactive|f #fi if sudo systemctl list-units | grep docker.service | egrep -wi 'running' > /dev/null 2>&1; then - echo -e "${ARROW} ${CYAN}Docker service running ${SEA}$docker_running${NC}" + echo -e "${CHECK_MARK} ${CYAN}Docker service running ${SEA}$docker_running${NC}" #docker_working=1 else if [[ "$docker_inactive" != "" ]]; then - echo -e "${ARROW} ${CYAN}Docker service not running ${RED}$docker_inactive${NC}" + echo -e "${X_MARK} ${CYAN}Docker service not running ${RED}$docker_inactive${NC}" else - echo -e "${ARROW} ${CYAN}Docker is not installed${NC}" + echo -e "${X_MARK} ${CYAN}Docker is not installed${NC}" fi fi From fd8c887d7c008c72c1a1aac4dd50430133e443a1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 13:31:10 +0200 Subject: [PATCH 0573/1176] Minor edit --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 87ea91b0..d8c058d3 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -819,7 +819,7 @@ if [[ "$verifity_mongod" != "0" ]]; then fi -echo -e "${BOOK} ${YELLOW}Checking Flux:${NC}" +echo -e "${BOOK} ${YELLOW}Checking FluxOS:${NC}" if pm2 -v > /dev/null 2>&1; then pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) From d0f0ec5835f4de7326db9d0be064c0786f016873 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 13:34:56 +0200 Subject: [PATCH 0574/1176] renamed Flux to FluxOS --- nodeanalizerandfixer.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index d8c058d3..57170189 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -826,10 +826,10 @@ pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi if [[ "$pm2_flux_status" == "online" ]]; then pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) -echo -e "${CHECK_MARK} ${CYAN} Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" +echo -e "${CHECK_MARK} ${CYAN} Pm2 FluxOS info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" else if [[ "$pm2_flux_status" != "" ]]; then -echo -e "${X_MARK} ${CYAN} Pm2 Flux status: ${RED}$pm2_flux_status ${NC}" +echo -e "${X_MARK} ${CYAN} Pm2 FluxOS status: ${RED}$pm2_flux_status ${NC}" fi fi @@ -840,7 +840,7 @@ pm2_flux_restarts=$(pm2 info zelflux | grep 'restarts' | sed -r 's/│//gi' | xa echo -e "${CHECK_MARK} ${CYAN} Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" else if [[ "$pm2_flux_status" != "" ]]; then -echo -e "${X_MARK} ${CYAN} Pm2 Flux status: ${RED}$pm2_flux_status ${NC}" +echo -e "${X_MARK} ${CYAN} Pm2 FluxOS status: ${RED}$pm2_flux_status ${NC}" fi fi @@ -850,9 +850,9 @@ fi if [[ $(curl -s -m 5 --head "$WANIP:$FluxUI" | head -n 1 | grep "200 OK") ]] then -echo -e "${CHECK_MARK} ${CYAN} Flux front is working${NC}" +echo -e "${CHECK_MARK} ${CYAN} FluxOS front is working${NC}" else -echo -e "${X_MARK} ${CYAN} Flux front is not working${NC}" +echo -e "${X_MARK} ${CYAN} FluxOS front is not working${NC}" fi if [ -d /home/$USER/$FLUX_DIR ] @@ -866,14 +866,14 @@ then if [[ "$required_ver" != "" ]]; then if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then - echo -e "${CHECK_MARK} ${CYAN} You have the current version of Flux ${GREEN}(v$required_ver)${NC}" + echo -e "${CHECK_MARK} ${CYAN} You have the current version of FluxOS ${GREEN}(v$required_ver)${NC}" else - echo -e "${HOT} ${CYAN}New version of Flux available ${SEA}$required_ver${NC}" + echo -e "${HOT} ${CYAN}New version of FluxOS available ${SEA}$required_ver${NC}" FLUX_UPDATE="1" fi fi -echo -e "${CHECK_MARK} ${CYAN} Flux config ~/$FLUX_DIR/config/userconfig.js exists${NC}" +echo -e "${CHECK_MARK} ${CYAN} FluxOS config ~/$FLUX_DIR/config/userconfig.js exists${NC}" ZELIDLG=`echo -n $(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e "s/'//g" | sed -e "s/,//g" | sed -e "s/.*zelid://g") | wc -m` if [[ "$ZELIDLG" -eq "35" || "$ZELIDLG" -eq "34" || "$ZELIDLG" -eq "33" ]]; then From 7f527faa596fd74647f5336f1407aa3edd0140e0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 13:43:45 +0200 Subject: [PATCH 0575/1176] rename sections and other improvement --- nodeanalizerandfixer.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 57170189..a931002d 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -637,9 +637,9 @@ fi esac case $bench_benchmark in - "CUMULUS") bench_benchmark_value=10000 ;; - "NIMBUS") bench_benchmark_value=25000 ;; - "STRATUS") bench_benchmark_value=100000 ;; + "CUMULUS") bench_benchmark_value=1000 ;; + "NIMBUS") bench_benchmark_value=12500 ;; + "STRATUS") bench_benchmark_value=40000 ;; esac #echo -e "$zelbench_benchmark_value" -> 10000 BASIC @@ -698,7 +698,7 @@ echo -e "${NC}" echo -e "${BOOK} ${YELLOW}Checking listen ports:${NC}" check_listen_ports echo -e "${NC}" -echo -e "${BOOK} ${YELLOW}File integration checking:${NC}" +echo -e "${BOOK} ${YELLOW}Daemon files integrity checking:${NC}" integration echo -e "" #if ! whiptail --yesno "Detected IP address is $WANIP is this correct?" 8 60; then @@ -887,7 +887,7 @@ fi if [ -f ~/$FLUX_DIR/error.log ] then echo -echo -e "${BOOK} ${YELLOW}Flux error.log file detected, check ~/zelflux/error.log" +echo -e "${BOOK} ${YELLOW}FluxOS error.log file detected, check ~/zelflux/error.log" echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(wc -l < /home/$USER/$FLUX_DIR/error.log)${CYAN} error events${NC}" error_line=$(cat /home/$USER/$FLUX_DIR/error.log | grep 'Error' | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{3\}Z//' | xargs) echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" From 10b93db785fcb5f5d53df6ea3496ee498cc263f3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 15:37:05 +0200 Subject: [PATCH 0576/1176] initial --- cdn-speedtest.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 cdn-speedtest.sh diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh new file mode 100644 index 00000000..263188d0 --- /dev/null +++ b/cdn-speedtest.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +#color codes +RED='\033[1;31m' +YELLOW='\033[1;33m' +BLUE="\\033[38;5;27m" +SEA="\\033[38;5;49m" +GREEN='\033[1;32m' +CYAN='\033[1;36m' +NC='\033[0m' + +#emoji codes +CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" +X_MARK="${RED}\xE2\x9C\x96${NC}" +PIN="${RED}\xF0\x9F\x93\x8C${NC}" +CLOCK="${GREEN}\xE2\x8C\x9B${NC}" +ARROW="${SEA}\xE2\x96\xB6${NC}" +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + +rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") +size_list=() +i=0 +len=${#rand_by_domain[@]} +echo -e "" +echo -e "${YELLOW}Running quick download speed test for flux_explorer_bootstrap...${NC}" +while [ $i -lt $len ]; +do + testing=$(curl -m 4 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz --output testspeed -fail --silent --show-error 2>&1) + testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') + echo -e " ${PIN} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC}" + size_list+=($testing_size) + i=$(($i+1)) +done + + +arr_max=$(printf '%s\n' "${size_list[@]}" | sort -n | tail -1) +for i in "${!size_list[@]}"; do + [[ "${size_list[i]}" == "$arr_max" ]] && + max_indexes+=($i) +done + +# Print the results +echo -e "" +echo -e "${YELLOW}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]}${NC}" +echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}http://cdn-${rand_by_domain[${max_indexes[@]}]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz${NC}" +echo -e "" From 81ebc6888f0511079103bb1d08b553917a23f101 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 15:46:32 +0200 Subject: [PATCH 0577/1176] minor edit --- cdn-speedtest.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index 263188d0..a7d63850 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -25,6 +25,7 @@ i=0 len=${#rand_by_domain[@]} echo -e "" echo -e "${YELLOW}Running quick download speed test for flux_explorer_bootstrap...${NC}" +echo -e "" while [ $i -lt $len ]; do testing=$(curl -m 4 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz --output testspeed -fail --silent --show-error 2>&1) From 1d7074cdc1ff0a7281b9f2f7fd77b6a4d1eeb127 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:49:31 +0200 Subject: [PATCH 0578/1176] added Average speed --- cdn-speedtest.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index a7d63850..2fddc635 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -30,7 +30,8 @@ while [ $i -lt $len ]; do testing=$(curl -m 4 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz --output testspeed -fail --silent --show-error 2>&1) testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') - echo -e " ${PIN} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC}" + mb=$(bc <<<"scale=2; $testing_size / 1048576 / 4" | awk '{printf "%2.2f\n", $1}') + echo -e " ${PIN} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" size_list+=($testing_size) i=$(($i+1)) done @@ -43,7 +44,8 @@ for i in "${!size_list[@]}"; do done # Print the results +mb=$(bc <<<"scale=2; $arr_max / 1048576 / 4" | awk '{printf "%2.2f\n", $1}') echo -e "" -echo -e "${YELLOW}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]}${NC}" +echo -e "${YELLOW}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}http://cdn-${rand_by_domain[${max_indexes[@]}]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz${NC}" echo -e "" From 181fa5456d0206c40a0e5fc7b289e26fd92f901c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:02:37 +0200 Subject: [PATCH 0579/1176] added rm --- cdn-speedtest.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index 2fddc635..99731503 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -36,6 +36,7 @@ do i=$(($i+1)) done +sudo rm -rf testspeed > /dev/null 2>&1 arr_max=$(printf '%s\n' "${size_list[@]}" | sort -n | tail -1) for i in "${!size_list[@]}"; do From 56ab255bf1c074a3254c333cfad26bbd58b63d4d Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Wed, 17 Aug 2022 10:51:42 -0500 Subject: [PATCH 0580/1176] Adding right_angle character for listing results. --- cdn-speedtest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index 99731503..d1f3869c 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -18,6 +18,7 @@ ARROW="${SEA}\xE2\x96\xB6${NC}" BOOK="${RED}\xF0\x9F\x93\x8B${NC}" HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" +RIGHT_ANGLE="${GREEN}\xE2\x88\x9F${NC}" rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") size_list=() @@ -25,13 +26,12 @@ i=0 len=${#rand_by_domain[@]} echo -e "" echo -e "${YELLOW}Running quick download speed test for flux_explorer_bootstrap...${NC}" -echo -e "" while [ $i -lt $len ]; do testing=$(curl -m 4 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz --output testspeed -fail --silent --show-error 2>&1) testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') mb=$(bc <<<"scale=2; $testing_size / 1048576 / 4" | awk '{printf "%2.2f\n", $1}') - echo -e " ${PIN} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + echo -e " ${RIGHT_ANGLE} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" size_list+=($testing_size) i=$(($i+1)) done From be2d7cc0bd9240b1f509678633ef9a76dc1ec544 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 00:09:45 +0200 Subject: [PATCH 0581/1176] bootstrap improvement - removed geolocation - added speed test via curl - re-write bootstrap logic --- flux_common.sh | 418 +++++++++++++++++++++++++++++-------------------- 1 file changed, 248 insertions(+), 170 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index cdd1bfc7..b2ac1eb3 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -20,18 +20,17 @@ ARROW="${SEA}\xE2\x96\xB6${NC}" BOOK="${RED}\xF0\x9F\x93\x8B${NC}" HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" +RIGHT_ANGLE="${GREEN}\xE2\x88\x9F${NC}" -#bootstrap settings -BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' +#bootstrap variable +server_offline="0" +failed_counter="0" #dialog color export NEWT_COLORS=' title=black, ' -#echo -e "${ARROW} ${CYAN}Importing Common Multitoolbox Resources..." - - function round() { printf "%.${2}f" "${1}" } @@ -129,186 +128,286 @@ function spinning_timer() { echo -ne "${MSG2}" } -function bootstrap_server(){ - rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") - richable=() - richable_eu=() - richable_us=() - richable_as=() +function tar_file_unpack() { + echo -e "${ARROW} ${CYAN}Unpacking bootstrap archive file...${NC}" + pv $1 | tar -zx -C $2 +} + + +function check_tar() { + echo -e "${ARROW} ${CYAN}Checking file integrity...${NC}" + if gzip -t "$1" &>/dev/null; then + echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $1 + fi +} + +function tar_file_pack() { + echo -e "${ARROW} ${CYAN}Creating bootstrap archive file...${NC}" + tar -czf - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 +} + +function get_ip(){ + WANIP=$(curl -SsL -m 5 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl -SsL -m 5 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') + fi + + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl -SsL -m 5 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') + fi +} + +###### Bootstrap Section ########################################################################## +function cdn_speedtest() { + + if [[ -z $1 || "$1" == "0" ]]; then + BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" + else + BOOTSTRAP_FILE="$1" + fi + if [[ -z $2 ]]; then + dTime="5" + else + dTime="$2" + fi + + if [[ -z $3 ]]; then + rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") + else + msg="$3" + shift + shift + rand_by_domain=("$@") + custom_url="1" + fi + + size_list=() i=0 len=${#rand_by_domain[@]} - echo -e "${ARROW} ${CYAN}Checking servers availability... ${NC}" + echo -e "${ARROW} ${CYAN}Running quick download speed test for ${BOOTSTRAP_FILE}, Servers: ${GREEN}$len${NC}" while [ $i -lt $len ]; do - bootstrap_check=$(curl -sSL -m 10 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json 2>/dev/null | jq -r '.block_height' 2>/dev/null) - if [[ "$bootstrap_check" != "" ]]; then - - if [[ "${rand_by_domain[$i]}" -ge "8" && "${rand_by_domain[$i]}" -le "11" ]]; then - richable_eu+=( ${rand_by_domain[$i]} ) - fi + if [[ "$custom_url" == "1" ]]; then + testing=$(curl -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + else + testing=$(curl -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + fi + testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') + mb=$(bc <<<"scale=2; $testing_size / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') - if [[ "${rand_by_domain[$i]}" -gt "4" && "${rand_by_domain[$i]}" -le "7" ]]; then - richable_us+=( ${rand_by_domain[$i]} ) - fi + if [[ "$custom_url" == "1" ]]; then + domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${rand_by_domain[$i]}) + echo -e " ${RIGHT_ANGLE} ${GREEN}URL - ${YELLOW}${domain}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + else + echo -e " ${RIGHT_ANGLE} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + fi + size_list+=($testing_size) + if [[ "$testing_size" == "0" ]]; then + failed_counter=$(($failed_counter+1)) + fi + i=$(($i+1)) + done - if [[ "${rand_by_domain[$i]}" -ge "12" ]]; then - richable_as+=( ${rand_by_domain[$i]} ) - fi + rServerList=$((${#size_list[@]}-$failed_counter)) + echo -e "${ARROW} ${CYAN}Valid servers: ${GREEN}${rServerList}${NC}" + sudo rm -rf testspeed > /dev/null 2>&1 - richable+=( ${rand_by_domain[$i]} ) - fi + if [[ "$rServerList" == "0" ]]; then + server_offline="1" + return 1 + fi - i=$(($i+1)) + arr_max=$(printf '%s\n' "${size_list[@]}" | sort -n | tail -1) + for i in "${!size_list[@]}"; do + [[ "${size_list[i]}" == "$arr_max" ]] && + max_indexes+=($i) done - server_found="1" - if [[ "$continent" == "EU" ]]; then - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" + server_index=${rand_by_domain[${max_indexes[0]}]} + if [[ "$custom_url" == "1" ]]; then + BOOTSTRAP_URL="$server_index" + else + BOOTSTRAP_URL="http://cdn-${server_index}.runonflux.io/apps/fluxshare/getfile/" + fi + DOWNLOAD_URL="${BOOTSTRAP_URL}${BOOTSTRAP_FILE}" + + # Print the results + mb=$(bc <<<"scale=2; $arr_max / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') + if [[ "$custom_url" == "1" ]]; then + domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${server_index}) + echo -e "${ARROW} ${CYAN}Best server is: ${YELLOW}${domain} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + else + echo -e "${ARROW} ${CYAN}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + fi + #echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}$DOWNLOAD_URL${NC}" +} + +function bootstrap() { + echo -e "" + echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" + + if ! wget --version > /dev/null 2>&1 ; then + sudo apt install -y wget > /dev/null 2>&1 && sleep 2 + fi + + if ! wget --version > /dev/null 2>&1 ; then + echo -e "${WORNING} ${CYAN}Wget not installed, operation aborted.. ${NC}" && sleep 1 + echo -e "" + return 1 + fi + + Mode="$1" + bootstrap_local + if [[ -f "$FILE_PATH" ]]; then + if [[ "$Mode" != "install" ]]; then + start_service + if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + sudo rm -rf $FILE_PATH > /dev/null 2>&1 && sleep 2 fi fi - elif [[ "$continent" == "US" ]]; then - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" + return 1 + else + if [[ -z $bootstrap_url ]]; then + bootstrap_manual + if [[ "$Mode" != "install" && "$Server_offline" == "0" ]]; then + start_service + if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + sudo rm -rf $FILE_PATH /dev/null 2>&1 && sleep 2 fi fi - fi - elif [[ "$continent" == "AS" ]]; then - len_as=${#richable_as[@]} - if [[ "$len_as" -gt "0" ]]; then - richable=( ${richable_as[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_as" == "0" ]]; then - continent="AS" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_us=${#richable_us[@]} - if [[ "$len_us" -gt "0" ]]; then - richable=( ${richable_us[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_us" == "0" ]]; then - continent="US" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - len_eu=${#richable_eu[@]} - if [[ "$len_eu" -gt "0" ]]; then - richable=( ${richable_eu[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - if [[ "$len_eu" == "0" ]]; then - continent="EU" - echo -e "${WORNING} ${CYAN}All Bootstrap in $continent are offline, checking other location...${NC}" && sleep 1 - server_found="0" - fi - fi - fi - else - len=${#richable[@]} - if [[ "$len" -gt "0" ]]; then - richable=( ${richable[*]} ) - echo -e "${ARROW} ${CYAN}Reachable servers: ${richable[*]}${NC}" - fi - - if [[ "$len" == "0" ]]; then - Server_offline=1 return 1 - fi + fi fi - if [[ "$server_found" == "0" ]]; then - len=${#richable[@]} - if [[ "$len" == "0" ]]; then - Server_offline=1 + if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then + cdn_speedtest "0" "6" + if [[ "$server_offline" == "1" ]]; then + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 + echo -e "" return 1 fi + echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" + wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" + tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + else + DOWNLOAD_URL="$bootstrap_url" + echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" + wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" + tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" fi - Server_offline=0 + if [[ -z "$bootstrap_zip_del" ]]; then + rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 + else + if [[ "$bootstrap_zip_del" == "1" ]]; then + rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 + fi + fi } -function bootstrap_geolocation(){ - IP=$WANIP - ip_output=$(curl -s -m 10 http://ip-api.com/json/$1?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) - ip_status=$( jq -r .status 2>/dev/null <<< "$ip_output") +function bootstrap_manual() { - if [[ "$ip_status" == "success" ]]; then - country=$(jq -r .country <<< "$ip_output") - org=$(jq -r .org <<< "$ip_output") - continent=$(jq -r .timezone <<< "$ip_output") - else - country="UKNOW" - continent="UKNOW" - fi + CHOICE=$( + whiptail --title "FluxNode Installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ + "1)" "Download from source build in script" \ + "2)" "Download from own source" 3>&2 2>&1 1>&3 + ) - continent=$(cut -f1 -d"/" <<< "$continent" ) + case $CHOICE in + "1)") - if [[ "$continent" =~ "Europe" ]]; then - continent="EU" - elif [[ "$continent" =~ "America" ]]; then - continent="US" - elif [[ "$continent" =~ "Asia" ]]; then - continent="AS" - else - continent="ALL" - fi + #server_list=("http://cdn-11.runonflux.io/apps/fluxshare/getfile/" "http://cdn-12.runonflux.io/apps/fluxshare/getfile/" "http://cdn-13.runonflux.io/apps/fluxshare/getfile/" "http://cdn-10.runonflux.io/apps/fluxshare/getfile/") + #cdn_speedtest "0" "8" "${server_list[@]}" + cdn_speedtest "0" "6" + if [[ "$server_offline" == "1" ]]; then + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 + echo -e "" + return 1 + fi + DB_HIGHT=$(curl -sSL -m 10 "${BOOTSTRAP_URL}flux_explorer_bootstrap.json" | jq -r '.block_height' 2>/dev/null) + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -sSL -m 10 "${BOOTSTRAP_URL}flux_explorer_bootstrap.json" | jq -r '.block_height' 2>/dev/null) + fi + if [[ "$DB_HIGHT" != "" ]]; then + echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" + fi - echo -e "${ARROW} ${CYAN}Selecting bootstrap server....${NC}" - echo -e "${ARROW} ${CYAN}Node Location -> IP:$IP, Country: $country, Continent: $continent ${NC}" - echo -e "${ARROW} ${CYAN}Searching in $continent....${NC}" - bootstrap_server $continent + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" + wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + if [[ "$Mode" != "install" ]]; then + stop_service + fi + tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + sleep 1 + ;; + "2)") + DOWNLOAD_URL="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" + BOOTSTRAP_FILE="${DOWNLOAD_URL##*/}" + wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + if [[ "$Mode" != "install" ]]; then + stop_service + fi + if [[ "$BOOTSTRAP_FILE" == *".zip"* ]]; then + echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_FILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + sleep 1 + fi + ;; + esac } -function get_ip(){ - WANIP=$(curl -SsL -m 5 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') +function bootstrap_local() { - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl -SsL -m 5 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') + BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" + FILE_PATH="/home/$USER/$BOOTSTRAP_FILE" + + if [ -f "$FILE_PATH" ]; then + echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" + check_tar "$FILE_PATH" + if [ -f "$FILE_PATH" ]; then + stop_service + tar_file_unpack "$FILE_PATH" "/home/$USER/$CONFIG_DIR" + fi fi +} - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl -SsL -m 5 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') +function flux_chain_date_wipe() { + if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then + echo -e "${ARROW} ${CYAN}Removing blocks, chainstate, determ_zelnodes directories...${NC}" + rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes > /dev/null 2>&1 fi } +function stop_service() { + pm2 stop watchdog > /dev/null 2>&1 && sleep 2 + echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + flux_chain_date_wipe +} + +function start_service() { + sudo systemctl start zelcash > /dev/null 2>&1 && sleep 2 + NUM='35' + MSG1='Starting Flux daemon service...' + MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo -e "" && echo -e "" + pm2 restart flux > /dev/null 2>&1 && sleep 2 + pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 +} +################################################################################################### + function selfhosting() { echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" @@ -491,27 +590,6 @@ function check_benchmarks() { fi } -function tar_file_unpack() { - echo -e "${ARROW} ${YELLOW}Unpacking bootstrap archive file...${NC}" - pv $1 | tar -zx -C $2 -} - - -function check_tar() { - echo -e "${ARROW} ${YELLOW}Checking bootstrap file integration...${NC}" - if gzip -t "$1" &>/dev/null; then - echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $1 - fi -} - -function tar_file_pack() { - echo -e "${ARROW} ${YELLOW}Creating bootstrap archive file...${NC}" - tar -czf - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 -} - function flux_package() { sudo apt-get update -y > /dev/null 2>&1 && sleep 2 echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" From cd76f44dda6b1994b78926633a0f44c2f4847e0e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 00:13:13 +0200 Subject: [PATCH 0582/1176] removed bootstrap function --- install_pro.sh | 233 ------------------------------------------------- 1 file changed, 233 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 100a378a..a57c0a2c 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1089,239 +1089,6 @@ fi } - -function bootstrap() { - - - if ! wget --version > /dev/null 2>&1 ; then - sudo apt install -y wget > /dev/null 2>&1 && sleep 2 - fi - - if ! wget --version > /dev/null 2>&1 ; then - echo -e "${WORNING} ${CYAN}Wget not installed, operation aborted.. ${NC}" && sleep 1 - echo -e "" - return 1 - fi - - bootstrap_geolocation - - if [[ "$Server_offline" == "1" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 - echo -e "" - return 1 - fi - - bootstrap_index=$((${#richable[@]}-1)) - r=$(shuf -i 0-$bootstrap_index -n 1) - indexb=${richable[$r]} - - BOOTSTRAP_ZIP="http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" - BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" - - echo -e "" - echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" - - if [[ -z "$bootstrap_url" ]]; then - - - if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes - - fi - - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - - echo -e "${ARROW} ${YELLOW}Local bootstrap file detected...${NC}" - echo -e "${ARROW} ${YELLOW}Checking if zip file is corrupted...${NC}" - if unzip -t $BOOTSTRAP_ZIPFILE | grep 'No errors' > /dev/null 2>&1 - then - echo -e "${ARROW} ${CYAN}Bootstrap zip file is valid.............[${CHECK_MARK}${CYAN}]${NC}" - else - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $BOOTSTRAP_ZIPFILE - fi - - else - check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" - fi - - fi - - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - fi - - else - - - CHOICE=$( - whiptail --title "FLUXNODE INSTALLATION" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) - - - case $CHOICE in - "1)") - - DB_HIGHT=$(curl -sSL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -sSL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) - fi - - - - - echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - #unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - - - ;; - "2)") - BOOTSTRAP_ZIP="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" - echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" - wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - fi - #echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - #unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - ;; - esac - - fi - - else - - if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes - fi - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - - echo -e "${ARROW} ${YELLOW}Local bootstrap file detected...${NC}" - echo -e "${ARROW} ${YELLOW}Checking if zip file is corrupted...${NC}" - if unzip -t $BOOTSTRAP_ZIPFILE | grep 'No errors' > /dev/null 2>&1 - then - echo -e "${ARROW} ${CYAN}Bootstrap zip file is valid.............[${CHECK_MARK}${CYAN}]${NC}" - else - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $BOOTSTRAP_ZIPFILE - fi - - else - check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" - fi - - fi - - - if [[ "$bootstrap_url" == "0" ]]; then - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - fi - - else - - DB_HIGHT=$(curl -sSL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -sSL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height' 2>/dev/null) - fi - - - echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - - fi - - else - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - else - BOOTSTRAP_ZIP="$bootstrap_url" - echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" - wget --tries 5 -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - fi - - fi - fi - fi - - if [[ -z "$bootstrap_zip_del" ]]; then - # if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - rm -rf $BOOTSTRAP_ZIPFILE - # fi - else - - if [[ "$bootstrap_zip_del" == "1" ]]; then - rm -rf $BOOTSTRAP_ZIPFILE - fi - - fi - - - - -} - - function basic_security() { echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" #sudo ufw allow 16124/tcp > /dev/null 2>&1 From 72185ca381215391cf3b4178c17c73bfcebd367a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 00:14:25 +0200 Subject: [PATCH 0583/1176] added bootstrap arg --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 100a378a..bed5d5b5 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1757,7 +1757,7 @@ else install_daemon zk_params if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then - bootstrap + bootstrap "install" fi create_service_scripts create_service From f9c9f6d4f503ee3f24f7d209c783e9efcb62a7bb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 00:29:19 +0200 Subject: [PATCH 0584/1176] added bootstrap arg --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index a57c0a2c..b5d86016 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1524,7 +1524,7 @@ else install_daemon zk_params if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then - bootstrap + bootstrap "install" fi create_service_scripts create_service From 3b7a20336ff8f2970b3821688d8e497923d01c7d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 00:29:55 +0200 Subject: [PATCH 0585/1176] revert commit --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index bed5d5b5..100a378a 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1757,7 +1757,7 @@ else install_daemon zk_params if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then - bootstrap "install" + bootstrap fi create_service_scripts create_service From 2eaa1632e43964516d68f92d94d19ba40e06dbdd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 00:40:36 +0200 Subject: [PATCH 0586/1176] Minor edits --- install_pro.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index b5d86016..3e097f4d 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -287,13 +287,13 @@ echo -e "${ARROW} ${YELLOW}Install watchdog for FluxNode${NC}" if pm2 -v > /dev/null 2>&1 then WATCHDOG_INSTALL="1" -echo -e "${ARROW} ${YELLOW}Downloading...${NC}" +echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 -echo -e "${ARROW} ${YELLOW}Installing git hooks....${NC}" +echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge -echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" +echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" cd watchdog && npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating config file....${NC}" fix_action='1' @@ -510,10 +510,10 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '10000|25000|100000|1000|12500|40000') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi fi @@ -521,9 +521,6 @@ fi if [[ $stak_info == ?(-)+([0-9]) ]]; then case $stak_info in - "10000") eps_limit=90 ;; - "25000") eps_limit=180 ;; - "100000") eps_limit=300 ;; "1000") eps_limit=90 ;; "12500") eps_limit=180 ;; "40000") eps_limit=300 ;; @@ -552,7 +549,7 @@ module.exports = { } EOF -#echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" +#echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 if [[ -f /home/$USER/watchdog/watchdog.js ]] From 984c6d9dd9a99bba164227c5b30d20834f1eba87 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 00:47:30 +0200 Subject: [PATCH 0587/1176] implemented new bootstrap system --- multitoolbox.sh | 130 +----------------------------------------------- 1 file changed, 1 insertion(+), 129 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7a7c9c5b..a14ed9a3 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -937,136 +937,8 @@ function flux_daemon_bootstrap() { cd echo -e "${NC}" - config_veryfity - get_ip - bootstrap_geolocation - bootstrap_server $continent - - - if [[ "$Server_offline" == "1" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 - echo -e "" - exit - fi - - bootstrap_index=$((${#richable[@]}-1)) - r=$(shuf -i 0-$bootstrap_index -n 1) - indexb=${richable[$r]} - BOOTSTRAP_ZIP="http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" - BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" - - pm2 stop watchdog > /dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" - sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 - sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 - - if [[ -e /home/$USER/$CONFIG_DIR/blocks ]] && [[ -e /home/$USER/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - rm -rf /home/$USER/$CONFIG_DIR/blocks /home/$USER/$CONFIG_DIR/chainstate /home/$USER/$CONFIG_DIR/determ_zelnodes - fi - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - echo -e "${ARROW} ${YELLOW}Local bootstrap file detected...${NC}" - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - - echo -e "${ARROW} ${YELLOW}Checking if zip file is corrupted...${NC}" - - if unzip -t $BOOTSTRAP_ZIPFILE | grep 'No errors' > /dev/null 2>&1 - then - echo -e "${ARROW} ${CYAN}Bootstrap zip file is valid.............[${CHECK_MARK}${CYAN}]${NC}" - else - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - printf '\e[A\e[K' - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $BOOTSTRAP_ZIPFILE - fi - - else - check_tar "/home/$USER/$BOOTSTRAP_ZIPFILE" - fi - - fi - - - if [ -f "/home/$USER/$BOOTSTRAP_ZIPFILE" ]; then - - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - fi - - else - - CHOICE=$( - whiptail --title "FLUXNODE INSTALLATION" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) - - - case $CHOICE in - "1)") - - DB_HIGHT=$(curl -SsL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -SsL -m 10 http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.json | jq -r '.block_height') - fi - echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" - echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - wget -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - - - - ;; - "2)") - BOOTSTRAP_ZIP="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" - echo -e "${ARROW} ${YELLOW}Downloading File: ${GREEN}$BOOTSTRAP_ZIP ${NC}" - BOOTSTRAP_ZIPFILE="${BOOTSTRAP_ZIP##*/}" - - if [[ "$BOOTSTRAP_ZIPFILE" != *".zip"* ]]; then - BOOTSTRAP_ZIPFILE='flux_explorer_bootstrap.tar.gz' - fi - - wget -O $BOOTSTRAP_ZIPFILE $BOOTSTRAP_ZIP -q --show-progress - - if [[ "$BOOTSTRAP_ZIPFILE" == *".zip"* ]]; then - echo -e "${ARROW} ${YELLOW}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_ZIPFILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_ZIPFILE" "/home/$USER/$CONFIG_DIR" - sleep 2 - fi - ;; - esac - - fi - - - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - rm -rf $BOOTSTRAP_ZIPFILE - fi - - sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 - NUM='35' - MSG1='Starting Flux daemon service...' - MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo -e "" && echo -e "" - pm2 restart flux > /dev/null 2>&1 && sleep 2 - pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 + bootstrap } From 49815e67376e5b822e72def57d87e7acdb1e3192 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 01:06:04 +0200 Subject: [PATCH 0588/1176] added duration for speed test --- flux_common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index b2ac1eb3..31f9c187 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -190,6 +190,7 @@ function cdn_speedtest() { i=0 len=${#rand_by_domain[@]} echo -e "${ARROW} ${CYAN}Running quick download speed test for ${BOOTSTRAP_FILE}, Servers: ${GREEN}$len${NC}" + start_test=`date +%s` while [ $i -lt $len ]; do if [[ "$custom_url" == "1" ]]; then @@ -214,7 +215,7 @@ function cdn_speedtest() { done rServerList=$((${#size_list[@]}-$failed_counter)) - echo -e "${ARROW} ${CYAN}Valid servers: ${GREEN}${rServerList}${NC}" + echo -e "${ARROW} ${CYAN}Valid servers: ${GREEN}${rServerList} ${CYAN}- Duration: ${GREEN}$((($(date +%s)-$start_test)/60)) min. $((($(date +%s)-$start_test) % 60)) sec.${NC}" sudo rm -rf testspeed > /dev/null 2>&1 if [[ "$rServerList" == "0" ]]; then From a11ef4c13769f631c4ef2d34bde32011ab9c555f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 01:09:29 +0200 Subject: [PATCH 0589/1176] Minor edit --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 3e097f4d..9f4dcae3 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -360,7 +360,7 @@ EOF if [[ -f /home/$USER/watchdog/watchdog.js ]]; then current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." - echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" + echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 else From 2e7af9b05a4453d9cb850ba23e82b1f4b94b7d6e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 01:18:57 +0200 Subject: [PATCH 0590/1176] fix automation conditional --- flux_common.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 31f9c187..4588ecd8 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -273,7 +273,7 @@ function bootstrap() { fi return 1 else - if [[ -z $bootstrap_url ]]; then + if [[ ! -f /home/$USER/install_conf.json ]]; then bootstrap_manual if [[ "$Mode" != "install" && "$Server_offline" == "0" ]]; then start_service @@ -376,7 +376,9 @@ function bootstrap_local() { echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" check_tar "$FILE_PATH" if [ -f "$FILE_PATH" ]; then - stop_service + if [[ "$Mode" != "install" ]]; then + stop_service + fi tar_file_unpack "$FILE_PATH" "/home/$USER/$CONFIG_DIR" fi fi From ebb9cd8ea0f5bd3b096e8021ae596bd1d427af6e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:37:19 +0200 Subject: [PATCH 0591/1176] improvement and formatting import_date --- install_pro.sh | 334 +++++++++++++++++++++++-------------------------- 1 file changed, 160 insertions(+), 174 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 9f4dcae3..9f3ab199 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -94,193 +94,179 @@ function pm2_install(){ function import_date() { -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then + if [[ -z "$import_settings" ]]; then + if whiptail --yesno "Would you like to import data from Flux config files Y/N?" 8 60; then + OLD_CONFIG=0 + if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + OLD_CONFIG=1 + fi + IMPORT_ZELCONF="1" + echo + echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" + + if [[ "$OLD_CONFIG" == "1" ]]; then + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' + fi - if [[ -z "$import_settings" ]]; then + if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + + ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" + IMPORT_ZELID="1" + fi + + KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" + fi + + if [[ -f /home/$USER/watchdog/config.js ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" + fi + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" + fi + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" + fi + fi + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" + fi + + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" + fi + + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" + fi + + fi + fi + fi + fi + else - if whiptail --yesno "Would you like to import data from Flux config files Y/N?" 8 60; then - - OLD_CONFIG=0 - - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - OLD_CONFIG=1 - fi - + if [[ "$import_settings" == "1" ]]; then + + OLD_CONFIG=0 + + if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + OLD_CONFIG=1 + fi IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 - - if [[ "$OLD_CONFIG" == "1" ]]; then - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' - fi - - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - - ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 - IMPORT_ZELID="1" - fi - - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi - - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 - fi - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 - fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then - - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 - fi - - fi - - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 - fi - - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 - fi - - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 - fi - - fi - fi + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" + if [[ "$OLD_CONFIG" == "1" ]]; then + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' + fi + + if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + + ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" + IMPORT_ZELID="1" + fi + KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" + fi + fi -else + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - if [[ "$import_settings" == "1" ]]; then - - OLD_CONFIG=0 - - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - OLD_CONFIG=1 - fi - - IMPORT_ZELCONF="1" - echo - echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 - - if [[ "$OLD_CONFIG" == "1" ]]; then - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' - fi - + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" + fi - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - - ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 - IMPORT_ZELID="1" - fi - - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi - - fi - - - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 - fi - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 - fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then - - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 - fi - - fi - - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 - fi - - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 - fi - - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 - fi - - fi + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - fi -fi -sleep 1 -echo -} + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" + fi + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" + fi + fi + + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" + fi + + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" + fi + + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" + fi + fi + fi + + fi + sleep 3 + echo - e "" +} function install_watchdog() { echo -e "${ARROW} ${YELLOW}Install watchdog for FluxNode${NC}" From 5d701fbf4280a51a25a7d905bb4efd262c1b457e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:48:02 +0200 Subject: [PATCH 0592/1176] Minor edit --- install_pro.sh | 90 ++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 47 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 9f3ab199..ce2f7d6f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -172,17 +172,14 @@ function import_date() { if [[ "$telegram_alert" == "1" ]]; then echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" fi - fi fi fi fi else - if [[ "$import_settings" == "1" ]]; then - + OLD_CONFIG=0 - if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' CONFIG_FILE='zelcash.conf' @@ -208,61 +205,60 @@ function import_date() { if [[ "$ZELID" != "" ]]; then echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" IMPORT_ZELID="1" - fi - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + fi + + KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" fi - fi + fi - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" - fi + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" + fi - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" - fi + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" + fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" - fi - fi - - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" - fi - - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" fi - - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" - fi fi + + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" + fi + + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" + fi + + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" + fi fi - fi sleep 3 echo - e "" From ad5420e6ab8c2dad8f0921aeb9655e1cd4a7080e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:49:42 +0200 Subject: [PATCH 0593/1176] echo fix --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index ce2f7d6f..353ed8ba 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -261,7 +261,7 @@ function import_date() { fi fi sleep 3 - echo - e "" + echo -e "" } function install_watchdog() { From b1ec01e6958f2c99866baadef95f6e5a01240f5f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:55:43 +0200 Subject: [PATCH 0594/1176] fix missing eps_limit conditional --- install_pro.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 353ed8ba..b93cae7d 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -133,15 +133,20 @@ function import_date() { if [[ -f /home/$USER/watchdog/config.js ]]; then echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') if [[ "$node_label" != "" && "$node_label" != "0" ]]; then echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" else echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" fi + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + fi + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') if [[ "$discord" != "" && "$discord" != "0" ]]; then echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" From dbf4d17679d035e323f4cf683e54c84c1565f637 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 11:17:02 +0200 Subject: [PATCH 0595/1176] status loop improvement and cleanup --- install_pro.sh | 198 ++++++++++++++++--------------------------------- 1 file changed, 63 insertions(+), 135 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index b93cae7d..a7d0b335 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1360,139 +1360,77 @@ fi function status_loop() { -network_height_01=$(curl -sk -m 10 https://explorer.runonflux.io/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) -network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_01=$(curl -sk -m 10 https://blockbook.zel.network/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") -EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks' 2> /dev/null) ]]; then + echo -e "" + echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + NUM='2' + MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN}" + MSG2="${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo -if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks' 2> /dev/null) ]]; then -echo -echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" - - -LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) -CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) -LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - -NUM='2' -MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN}" -MSG2="${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo && echo - -else + else - echo - echo -e "${CLOCK}${GREEN}FLUX DAEMON SYNCING...${NC}" - - f=0 - start_sync=`date +%s` + echo -e "" + echo -e "${CLOCK}${GREEN}FLUX DAEMON SYNCING...${NC}" + f=0 + start_sync=`date +%s` - - while true - do + while true + do - network_height_01=$(curl -sk -m 10 https://explorer.runonflux.io/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") - - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) - LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - - if [[ "$LEFT" == "0" ]]; then - time_break='5' - else - time_break='20' - fi - - #if [[ "$CONNECTIONS" == "0" ]]; then - # c=$((c+1)) - # if [[ "$c" > 3 ]]; then - # c=0; - #LOCAL_BLOCK_HIGHT="" - # fi - - #fi - # - if [[ $LOCAL_BLOCK_HIGHT == "" ]]; then - - f=$((f+1)) - LOCAL_BLOCK_HIGHT="N/A" - LEFT="N/A" - CONNECTIONS="N/A" - sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 - sudo systemctl start zelcash > /dev/null 2>&1 - - NUM='60' - MSG1="Syncing progress => Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" - MSG2='' - spinning_timer - - network_height_01=$(curl -sk -m 10 https://explorer.runonflux.io/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") - - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') - LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - - fi + network_height_01=$(curl -sk -m 10 https://blockbook.zel.network/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - NUM="$time_break" - MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" - MSG2='' - spinning_timer + if [[ "$LEFT" == "0" ]]; then + time_break='5' + else + time_break='20' + fi - if [[ "$EXPLORER_BLOCK_HIGHT" == "$LOCAL_BLOCK_HIGHT" ]]; then - echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" - break - fi - done - - fi - - - #pm2 start ~/$FLUX_DIR/start.sh --name flux --time > /dev/null 2>&1 + if [[ $LOCAL_BLOCK_HIGHT == "" ]]; then + f=$((f+1)) + LOCAL_BLOCK_HIGHT="N/A" + LEFT="N/A" + CONNECTIONS="N/A" + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo systemctl start zelcash > /dev/null 2>&1 + NUM='60' + MSG1="Syncing progress => Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer + network_height_01=$(curl -sk -m 10 https://blockbook.zel.network/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + fi - - # if [[ -z "$mongo_bootstrap" ]]; then - - # if whiptail --yesno "Would you like to restore Mongodb datatable from bootstrap?" 8 60; then - # mongodb_bootstrap - # else - # echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" - # fi - # - # else - - # if [[ "$mongo_bootstrap" == "1" ]]; then - # mongodb_bootstrap - # else - # echo -e "${ARROW} ${YELLOW}Restore Mongodb datatable skipped...${NC}" - # fi - - # fi - - #if [[ -z "$watchdog" ]]; then - #if whiptail --yesno "Would you like to install watchdog for FluxNode?" 8 60; then - install_watchdog - # else - # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" - # fi - # else - - # if [[ "$watchdog" == "1" ]]; then - # install_watchdog - # else - # echo -e "${ARROW} ${YELLOW}Watchdog installation skipped...${NC}" - # fi - - # fi + NUM="$time_break" + MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer + if [[ "$EXPLORER_BLOCK_HIGHT" == "$LOCAL_BLOCK_HIGHT" ]]; then + echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + break + fi + done + fi + install_watchdog check display_banner } @@ -1508,21 +1446,11 @@ else install_daemon zk_params if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then - bootstrap "install" + bootstrap "install" fi create_service_scripts create_service - - # if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then - # echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" - # else - # if whiptail --yesno "Would you like to install cron service for rotate ip (required for dynamic ip)?" 8 60; then - selfhosting - ## else - #echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" - ### fi - ## fi - + selfhosting install_process start_daemon log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" From 8c430c8db7047f1231f736c48f24a52783950296 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 12:08:33 +0200 Subject: [PATCH 0596/1176] improvement - supporting custom test time via argument - supporting custom file_name via argument - supporting custom url list via argument ( array ) - added duration , servers counter , valid servers counter --- cdn-speedtest.sh | 89 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 67 insertions(+), 22 deletions(-) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index d1f3869c..23a492cc 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -1,52 +1,97 @@ #!/bin/bash #color codes -RED='\033[1;31m' YELLOW='\033[1;33m' -BLUE="\\033[38;5;27m" -SEA="\\033[38;5;49m" GREEN='\033[1;32m' CYAN='\033[1;36m' NC='\033[0m' #emoji codes -CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" -X_MARK="${RED}\xE2\x9C\x96${NC}" -PIN="${RED}\xF0\x9F\x93\x8C${NC}" -CLOCK="${GREEN}\xE2\x8C\x9B${NC}" ARROW="${SEA}\xE2\x96\xB6${NC}" -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" RIGHT_ANGLE="${GREEN}\xE2\x88\x9F${NC}" -rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") +#global variable +server_offline="0" +failed_counter"0" + + +if [[ -z $1 || "$1" == "0" ]]; then + BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" +else + BOOTSTRAP_FILE="$1" +fi + +if [[ -z $2 ]]; then + dTime="5" +else + dTime="$2" +fi + +if [[ -z $3 ]]; then + rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") +else + msg="$3" + shift + shift + rand_by_domain=("$@") + custom_url="1" +fi + size_list=() i=0 len=${#rand_by_domain[@]} -echo -e "" -echo -e "${YELLOW}Running quick download speed test for flux_explorer_bootstrap...${NC}" +echo -e "${ARROW} ${CYAN}Running quick download speed test for ${BOOTSTRAP_FILE}, Servers: ${GREEN}$len${NC}" +start_test=`date +%s` while [ $i -lt $len ]; do - testing=$(curl -m 4 http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz --output testspeed -fail --silent --show-error 2>&1) + if [[ "$custom_url" == "1" ]]; then + testing=$(curl -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + else + testing=$(curl -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + fi testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') - mb=$(bc <<<"scale=2; $testing_size / 1048576 / 4" | awk '{printf "%2.2f\n", $1}') - echo -e " ${RIGHT_ANGLE} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + mb=$(bc <<<"scale=2; $testing_size / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') + + if [[ "$custom_url" == "1" ]]; then + domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${rand_by_domain[$i]}) + echo -e " ${RIGHT_ANGLE} ${GREEN}URL - ${YELLOW}${domain}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + else + echo -e " ${RIGHT_ANGLE} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + fi size_list+=($testing_size) + if [[ "$testing_size" == "0" ]]; then + failed_counter=$(($failed_counter+1)) + fi i=$(($i+1)) done +rServerList=$((${#size_list[@]}-$failed_counter)) +echo -e "${ARROW} ${CYAN}Valid servers: ${GREEN}${rServerList} ${CYAN}- Duration: ${GREEN}$((($(date +%s)-$start_test)/60)) min. $((($(date +%s)-$start_test) % 60)) sec.${NC}" sudo rm -rf testspeed > /dev/null 2>&1 +if [[ "$rServerList" == "0" ]]; then + server_offline="1" + return 1 +fi + arr_max=$(printf '%s\n' "${size_list[@]}" | sort -n | tail -1) for i in "${!size_list[@]}"; do [[ "${size_list[i]}" == "$arr_max" ]] && max_indexes+=($i) done -# Print the results -mb=$(bc <<<"scale=2; $arr_max / 1048576 / 4" | awk '{printf "%2.2f\n", $1}') -echo -e "" -echo -e "${YELLOW}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" -echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}http://cdn-${rand_by_domain[${max_indexes[@]}]}.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz${NC}" -echo -e "" +server_index=${rand_by_domain[${max_indexes[0]}]} +if [[ "$custom_url" == "1" ]]; then + BOOTSTRAP_URL="$server_index" +else + BOOTSTRAP_URL="http://cdn-${server_index}.runonflux.io/apps/fluxshare/getfile/" +fi +DOWNLOAD_URL="${BOOTSTRAP_URL}${BOOTSTRAP_FILE}" + +mb=$(bc <<<"scale=2; $arr_max / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') +if [[ "$custom_url" == "1" ]]; then + domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${server_index}) + echo -e "${ARROW} ${CYAN}Best server is: ${YELLOW}${domain} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" +else + echo -e "${ARROW} ${CYAN}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" +fi From 560d92352ee53b9624c63e2bc3c39285cf753c3e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 12:18:46 +0200 Subject: [PATCH 0597/1176] variable fix --- cdn-speedtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index 23a492cc..b05bad69 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -12,7 +12,7 @@ RIGHT_ANGLE="${GREEN}\xE2\x88\x9F${NC}" #global variable server_offline="0" -failed_counter"0" +failed_counter="0" if [[ -z $1 || "$1" == "0" ]]; then From 06edf7a8da978239dd6280ebce4e7c6f2007a2bf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 12:29:08 +0200 Subject: [PATCH 0598/1176] replaced return with exit --- cdn-speedtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index b05bad69..7ffabe18 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -71,7 +71,7 @@ sudo rm -rf testspeed > /dev/null 2>&1 if [[ "$rServerList" == "0" ]]; then server_offline="1" - return 1 + exit fi arr_max=$(printf '%s\n' "${size_list[@]}" | sort -n | tail -1) From 152dc1015903572fe3e1b646cc44887fe10e9efd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 13:15:25 +0200 Subject: [PATCH 0599/1176] added usage and example information --- cdn-speedtest.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index 7ffabe18..cdc0ee66 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -1,5 +1,16 @@ #!/bin/bash +################################################################################################################################ +# +# Usage: +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "<file_name>" "<test_time_in_s>" "<array_url_list_via_export>" +# +# Example: +# export list=("http://cdn-11.runonflux.io/apps/fluxshare/getfile/" "http://cdn-11.runonflux.io/apps/fluxshare/getfile/") +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "0" "6" "${list[@]}" +# +################################################################################################################################ + #color codes YELLOW='\033[1;33m' GREEN='\033[1;32m' From 8c39de1a2eea64968db2c3a8469e96e5f27aac17 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 13:24:28 +0200 Subject: [PATCH 0600/1176] updated usage example --- cdn-speedtest.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index cdc0ee66..bd61b93b 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -1,14 +1,18 @@ #!/bin/bash ################################################################################################################################ -# # Usage: # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "<file_name>" "<test_time_in_s>" "<array_url_list_via_export>" # -# Example: +# Example 1 ( for testing custom servers ): # export list=("http://cdn-11.runonflux.io/apps/fluxshare/getfile/" "http://cdn-11.runonflux.io/apps/fluxshare/getfile/") -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "0" "6" "${list[@]}" +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "flux_explorer_bootstrap.tar.gz" "6" "${list[@]}" +# +# Example 2 ( for testing cdn with 6s download test of each server ) +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "0" "6" # +# Example 3 ( for testing cdn with default setting ) +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) ################################################################################################################################ #color codes From 4747e6bc32e75b68d6e47b28993299b0ffc2d88e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 13:25:15 +0200 Subject: [PATCH 0601/1176] Minor edit --- cdn-speedtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index bd61b93b..ed0b2217 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -11,7 +11,7 @@ # Example 2 ( for testing cdn with 6s download test of each server ) # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "0" "6" # -# Example 3 ( for testing cdn with default setting ) +# Example 3 ( for testing cdn with default settings ) # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) ################################################################################################################################ From 54d5e0cc1cdc636e67994a1e83e78515355816fa Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 14:48:53 +0200 Subject: [PATCH 0602/1176] added DOWNLOAD_URL display --- cdn-speedtest.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index ed0b2217..40b9359a 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -24,6 +24,7 @@ NC='\033[0m' #emoji codes ARROW="${SEA}\xE2\x96\xB6${NC}" RIGHT_ANGLE="${GREEN}\xE2\x88\x9F${NC}" +CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" #global variable server_offline="0" @@ -110,3 +111,4 @@ if [[ "$custom_url" == "1" ]]; then else echo -e "${ARROW} ${CYAN}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" fi +echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}${DOWNLOAD_URL}${NC}" From 29763a45042e28e3dd6e49031d9f5fb56ca5b938 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 19 Aug 2022 23:53:05 +0200 Subject: [PATCH 0603/1176] arguments reorg --- cdn-speedtest.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index 40b9359a..84cde8da 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -2,14 +2,14 @@ ################################################################################################################################ # Usage: -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "<file_name>" "<test_time_in_s>" "<array_url_list_via_export>" +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "<test_time_in_s>" "<file_name>" "<array_url_list_via_export>" # # Example 1 ( for testing custom servers ): # export list=("http://cdn-11.runonflux.io/apps/fluxshare/getfile/" "http://cdn-11.runonflux.io/apps/fluxshare/getfile/") -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "flux_explorer_bootstrap.tar.gz" "6" "${list[@]}" +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "6" "flux_explorer_bootstrap.tar.gz" "${list[@]}" # # Example 2 ( for testing cdn with 6s download test of each server ) -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "0" "6" +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "6" # # Example 3 ( for testing cdn with default settings ) # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) @@ -30,17 +30,16 @@ CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" server_offline="0" failed_counter="0" - -if [[ -z $1 || "$1" == "0" ]]; then - BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" +if [[ -z $1 ]]; then + dTime="5" else - BOOTSTRAP_FILE="$1" + dTime="$1" fi -if [[ -z $2 ]]; then - dTime="5" +if [[ -z $2 || "$2" == "0" ]]; then + BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" else - dTime="$2" + BOOTSTRAP_FILE="$2" fi if [[ -z $3 ]]; then From 28d8d0370ae67c26db5ff747f78c03d44e9bc416 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 20 Aug 2022 02:48:53 +0200 Subject: [PATCH 0604/1176] added install bc --- cdn-speedtest.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index 84cde8da..7d36dd39 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -30,6 +30,10 @@ CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" server_offline="0" failed_counter="0" +if ! bc -v > /dev/null 2>&1 ; then + sudo apt install -y bc > /dev/null 2>&1 && sleep 1 +fi + if [[ -z $1 ]]; then dTime="5" else From 3b9583957401de3b63bfed87849d84ddc3f4db68 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 22 Aug 2022 09:46:23 +0200 Subject: [PATCH 0605/1176] developmet_v2 - formatting - improvement - fix minor bug --- install_pro.sh | 1529 +++++++++++++++++++----------------------------- 1 file changed, 593 insertions(+), 936 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index a7d0b335..211d9744 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,23 +1,18 @@ #!/bin/bash - source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" #wallet information COIN_NAME='flux' CONFIG_DIR='.flux' CONFIG_FILE='flux.conf' - BENCH_NAME='fluxbench' BENCH_CLI='fluxbench-cli' BENCH_DIR_LOG='.fluxbenchmark' - COIN_DAEMON='fluxd' COIN_CLI='flux-cli' COIN_PATH='/usr/local/bin' - USERNAME="$(whoami)" FLUX_DIR='zelflux' - #Install variable IMPORT_ZELCONF="0" IMPORT_ZELID="0" @@ -25,8 +20,6 @@ CORRUPTED="0" BOOTSTRAP_SKIP="0" WATCHDOG_INSTALL="0" SKIP_OLD_CHAIN="0" -Server_offline=0 - #Zelflux ports ZELFRONTPORT=16126 LOCPORT=16127 @@ -37,61 +30,43 @@ PORT=16125 function config_veryfity(){ - - if [[ -f /home/$USER/.flux/flux.conf ]]; then - - echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" - insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) - - if [[ "$insightexplorer" == "1" ]]; then - - echo -e "${ARROW} ${CYAN}Insightexplorer enabled.............[${CHECK_MARK}${CYAN}]${NC}" - - else - - echo -e "${ARROW} ${CYAN}Insightexplorer enabled.............[${X_MARK}${CYAN}]${NC}" - echo -e "${ARROW} ${CYAN}Removing wallet.dat...${NC}" - echo -e "${ARROW} ${CYAN}Use old chain will be skipped...${NC}" - sudo rm -rf /home/$USER/$CONFIG_DIR/wallet.dat && sleep 1 - SKIP_OLD_CHAIN="1" - + if [[ -f /home/$USER/.flux/flux.conf ]]; then + echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" + insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) + if [[ "$insightexplorer" == "1" ]]; then + echo -e "${ARROW} ${CYAN}Insightexplorer enabled.............[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW} ${CYAN}Insightexplorer enabled.............[${X_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Removing wallet.dat...${NC}" + echo -e "${ARROW} ${CYAN}Use old chain will be skipped...${NC}" + sudo rm -rf /home/$USER/$CONFIG_DIR/wallet.dat && sleep 1 + SKIP_OLD_CHAIN="1" + fi fi - - fi - } - function pm2_install(){ - echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" - npm install pm2@latest -g > /dev/null 2>&1 - - if pm2 -v > /dev/null 2>&1; then - echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" - pm2 startup systemd -u $USER > /dev/null 2>&1 - sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 - - #pm2 start ~/zelflux/start.sh --name zelflux > /dev/null 2>&1 - #pm2 save > /dev/null 2>&1 - - pm2 install pm2-logrotate > /dev/null 2>&1 - pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 - pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 - pm2 set pm2-logrotate:compress true > /dev/null 2>&1 - pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 - pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 - - source ~/.bashrc - #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" - string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." - echo - else - string_limit_x_mark "PM2 was not installed................................." - echo - fi + echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" + npm install pm2@latest -g > /dev/null 2>&1 + if pm2 -v > /dev/null 2>&1; then + echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" + pm2 startup systemd -u $USER > /dev/null 2>&1 + sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 + pm2 install pm2-logrotate > /dev/null 2>&1 + pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 + pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 + pm2 set pm2-logrotate:compress true > /dev/null 2>&1 + pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 + pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 + source ~/.bashrc + string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." + echo -e "" + else + string_limit_x_mark "PM2 was not installed................................." + echo -e "" + fi } - function import_date() { if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then @@ -191,7 +166,7 @@ function import_date() { OLD_CONFIG=1 fi IMPORT_ZELCONF="1" - echo + echo -e "" echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" @@ -203,41 +178,33 @@ function import_date() { CONFIG_DIR='.flux' CONFIG_FILE='flux.conf' fi - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') if [[ "$ZELID" != "" ]]; then echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" IMPORT_ZELID="1" fi - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" - fi + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" + fi fi - echo -e "" echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') if [[ "$node_label" != "" && "$node_label" != "0" ]]; then echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" else echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" fi - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') if [[ "$discord" != "" && "$discord" != "0" ]]; then echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" else echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') if [[ "$ping" != "" && "$ping" != "0" ]]; then if [[ "$discord" != "" && "$discord" != "0" ]]; then @@ -246,19 +213,16 @@ function import_date() { echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" fi fi - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" else echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" fi - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') if [[ "$telegram_alert" == "1" ]]; then echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" fi - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') if [[ "$telegram_alert" == "1" ]]; then echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" @@ -270,26 +234,23 @@ function import_date() { } function install_watchdog() { -echo -e "${ARROW} ${YELLOW}Install watchdog for FluxNode${NC}" -if pm2 -v > /dev/null 2>&1 -then -WATCHDOG_INSTALL="1" -echo -e "${ARROW} ${CYAN}Downloading...${NC}" -cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 -mv post-merge /home/$USER/watchdog/.git/hooks/post-merge -sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge -echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" -cd watchdog && npm install > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Creating config file....${NC}" -fix_action='1' - -if [[ "$import_settings" == "0" && -f /home/$USER/install_conf.json ]]; then - -sudo touch /home/$USER/watchdog/config.js -sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat << EOF > /home/$USER/watchdog/config.js + echo -e "${ARROW} ${YELLOW}Install watchdog for FluxNode${NC}" + if pm2 -v > /dev/null 2>&1; then + WATCHDOG_INSTALL="1" + echo -e "${ARROW} ${CYAN}Downloading...${NC}" + cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" + wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 + mv post-merge /home/$USER/watchdog/.git/hooks/post-merge + sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge + echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" + cd watchdog && npm install > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Creating config file....${NC}" + fix_action='1' + if [[ "$import_settings" == "0" && -f /home/$USER/install_conf.json ]]; then + sudo touch /home/$USER/watchdog/config.js + sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js module.exports = { label: '${node_label}', tier_eps_min: '${eps_limit}', @@ -304,29 +265,20 @@ module.exports = { telegram_chat_id: '${telegram_chat_id}' } EOF - - - - if [[ -f /home/$USER/watchdog/watchdog.js ]]; then - current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) - string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." - #echo -e "${ARROW} ${YELLOW}Starting watchdog...${NC}" - pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - else - string_limit_x_mark "Watchdog was not installed................................." - fi - - return 1 - -fi - - -if [[ "$IMPORT_ZELCONF" == "1" ]]; then - -sudo touch /home/$USER/watchdog/config.js -sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat << EOF > /home/$USER/watchdog/config.js + if [[ -f /home/$USER/watchdog/watchdog.js ]]; then + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + else + string_limit_x_mark "Watchdog was not installed................................." + fi + return + fi + if [[ "$IMPORT_ZELCONF" == "1" ]]; then + sudo touch /home/$USER/watchdog/config.js + sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js module.exports = { label: '${node_label}', tier_eps_min: '${eps_limit}', @@ -341,186 +293,147 @@ module.exports = { telegram_chat_id: '${telegram_chat_id}' } EOF - - - - if [[ -f /home/$USER/watchdog/watchdog.js ]]; then - current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) - string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." - echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" - pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - else - string_limit_x_mark "Watchdog was not installed................................." - fi - - return 1 - -fi - - -if whiptail --yesno "Would you like enable autoupdate?" 8 60; then - flux_update='1' - daemon_update='1' - bench_update='1' -else - flux_update='0' - daemon_update='0' - bench_update='0' -fi - - -discord='0' -if whiptail --yesno "Would you like enable alert notification?" 8 60; then - -sleep 1 -whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 -sleep 1 - -CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ - "1" "Discord notification " ON \ - "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) - -if [ -z "$CHOICES" ]; then - - echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" - sleep 1 - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - node_label="0" - -else - for CHOICE in $CHOICES; do - case "$CHOICE" in - "1") - - discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) - sleep 1 - - if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - - while true - do - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) - if [[ $ping == ?(-)+([0-9]) ]]; then - string_limit_check_mark "UserID is valid..........................................." - break - else - string_limit_x_mark "UserID is not valid try again............................." - sleep 1 - fi - done - - sleep 1 - - else - ping=0; - sleep 1 - fi - - ;; - "2") - - telegram_alert="1" - - while true - do - telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) - if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then - string_limit_check_mark "Bot token is valid..........................................." - break - else - string_limit_x_mark "Bot token is not valid try again............................." - sleep 1 + if [[ -f /home/$USER/watchdog/watchdog.js ]]; then + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." + echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + else + string_limit_x_mark "Watchdog was not installed................................." + fi + return fi - done - - sleep 1 - - while true - do - telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) - if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then - string_limit_check_mark "Chat ID is valid..........................................." - break - else - string_limit_x_mark "Chat ID is not valid try again............................." - sleep 1 + if whiptail --yesno "Would you like enable autoupdate?" 8 60; then + flux_update='1' + daemon_update='1' + bench_update='1' + else + flux_update='0' + daemon_update='0' + bench_update='0' fi - done - - sleep 1 - - ;; - esac - done -fi - - while true - do - node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - string_limit_check_mark "Node name is valid..........................................." - break - else - string_limit_x_mark "Node name is not valid try again............................." - sleep 1 + discord='0' + if whiptail --yesno "Would you like enable alert notification?" 8 60; then + sleep 1 + whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 + sleep 1 + CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + if [ -z "$CHOICES" ]; then + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" + sleep 1 + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" + else + for CHOICE in $CHOICES; + do + case "$CHOICE" in + "1") + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + else + ping=0; + sleep 1 + fi + ;; + "2") + telegram_alert="1" + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + sleep 1 + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + ;; + esac + done + fi + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + else + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" + sleep 1 fi - done - -else - - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - node_label="0" - sleep 1 -fi - - -if [[ "$discord" == 0 ]]; then - ping="0"; -fi - - -if [[ "$telegram_alert" == 0 ]]; then - telegram_bot_token="0"; - telegram_chat_id="0"; -fi - -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - - index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - fi - -fi - -if [[ $stak_info == ?(-)+([0-9]) ]]; then - - case $stak_info in - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; - esac - -else -eps_limit=0; -fi - + if [[ "$discord" == 0 ]]; then + ping="0"; + fi + if [[ "$telegram_alert" == 0 ]]; then + telegram_bot_token="0"; + telegram_chat_id="0"; + fi + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + fi + fi + if [[ $stak_info == ?(-)+([0-9]) ]]; then -sudo touch /home/$USER/watchdog/config.js -sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat << EOF > /home/$USER/watchdog/config.js + case $stak_info in + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; + esac + else + eps_limit=0; + fi + sudo touch /home/$USER/watchdog/config.js + sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js module.exports = { label: '${node_label}', tier_eps_min: '${eps_limit}', @@ -535,41 +448,28 @@ module.exports = { telegram_chat_id: '${telegram_chat_id}' } EOF - -#echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" -pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 -if [[ -f /home/$USER/watchdog/watchdog.js ]] -then -current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) -#echo -e "${ARROW} ${CYAN}Watchdog ${GREEN}v$current_ver${CYAN} installed successful.${NC}" -string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." -else -#echo -e "${ARROW} ${CYAN}Watchdog installion failed.${NC}" -string_limit_x_mark "Watchdog was not installed................................." -fi -else -#echo -e "${ARROW} ${CYAN}Watchdog installion failed.${NC}" -string_limit_x_mark "Watchdog was not installed................................." -fi + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + if [[ -f /home/$USER/watchdog/watchdog.js ]]; then + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." + else + string_limit_x_mark "Watchdog was not installed................................." + fi + else + string_limit_x_mark "Watchdog was not installed................................." + fi } function wipe_clean() { echo -e "${ARROW} ${YELLOW}Removing any instances of FluxNode${NC}" apt_number=$(ps aux | grep 'apt' | wc -l) - if [[ "$apt_number" > 1 ]]; then - sudo killall apt > /dev/null 2>&1 sudo killall apt-get > /dev/null 2>&1 - sudo dpkg --configure -a > /dev/null 2>&1 - + sudo dpkg --configure -a > /dev/null 2>&1 fi - echo -e "${ARROW} ${CYAN}Stopping all services and running processes...${NC}" - - # NEW CLEAN_UP - sudo killall nano > /dev/null 2>&1 $COIN_CLI stop > /dev/null 2>&1 && sleep 2 sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 @@ -579,14 +479,12 @@ function wipe_clean() { sudo fuser -k 16127/tcp > /dev/null 2>&1 && sleep 1 sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 sudo rm -rf /usr/bin/flux* > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Removing daemon && benchmark...${NC}" sudo apt-get remove $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 sudo apt-get purge $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 sudo rm -rf /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 tmux kill-server > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Removing PM2...${NC}" pm2 del zelflux > /dev/null 2>&1 && sleep 1 pm2 del flux > /dev/null 2>&1 && sleep 1 @@ -597,12 +495,9 @@ function wipe_clean() { pm2 save > /dev/null 2>&1 && sleep 1 pm2 kill > /dev/null 2>&1 && sleep 1 npm remove pm2 -g > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Removing others files and scripts...${NC}" sudo rm -rf watchgod > /dev/null 2>&1 && sleep 1 sudo rm -rf $BENCH_DIR_LOG && sleep 1 - - #FILE OF OLD ZEL NODE sudo rm -rf /etc/logrotate.d/mongolog > /dev/null 2>&1 sudo rm -rf /etc/logrotate.d/zeldebuglog > /dev/null 2>&1 rm update.sh > /dev/null 2>&1 @@ -620,117 +515,75 @@ function wipe_clean() { sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 sudo rm -rf zelflux > /dev/null 2>&1 && sleep 1 - #sudo rm -rf ~/.zelcash/determ_zelnodes ~/.zelcash/sporks ~/$CONFIG_DIR/database ~/.zelcash/blocks ~/.zelcashchainstate > /dev/null 2>&1 && sleep 1 - #sudo rm -rf ~/.zelcash > /dev/null 2>&1 && sleep 1 sudo rm -rf .zelbenchmark > /dev/null 2>&1 && sleep 1 sudo rm -rf .fluxbenchmark > /dev/null 2>&1 && sleep 1 sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 - if [[ -d /home/$USER/.zelcash ]]; then - - echo -e "${ARROW} ${CYAN}Moving ~/.zelcash to ~/.flux${NC}" - #echo -e "${ARROW} ${CYAN}Renaming zelcash.conf to flux.conf${NC}" - sudo mv /home/$USER/.zelcash /home/$USER/.flux > /dev/null 2>&1 && sleep 1 - sudo mv /home/$USER/.flux/zelcash.conf /home/$USER/.flux/flux.conf > /dev/null 2>&1 && sleep 1 - + echo -e "${ARROW} ${CYAN}Moving ~/.zelcash to ~/.flux${NC}" + sudo mv /home/$USER/.zelcash /home/$USER/.flux > /dev/null 2>&1 && sleep 1 + sudo mv /home/$USER/.flux/zelcash.conf /home/$USER/.flux/flux.conf > /dev/null 2>&1 && sleep 1 fi - - - if [[ -d /home/$USER/$CONFIG_DIR ]]; then - - config_veryfity - - if [[ -z "$use_old_chain" ]]; then + if [[ -d /home/$USER/$CONFIG_DIR ]]; then + config_veryfity + if [[ -z "$use_old_chain" ]]; then - if [[ "$SKIP_OLD_CHAIN" == "0" ]]; then - - if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then - echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 - sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 + if [[ "$SKIP_OLD_CHAIN" == "0" ]]; then + if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf /home/$USERNAME/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate > /dev/null 2>&1 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + BOOTSTRAP_SKIP="1" + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/database + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks + fi + else + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf /home/$USER/$CONFIG_DIR/determ_zelnodes /home/$USER/$CONFIG_DIR/sporks /home/$USER/$CONFIG_DIR/database /home/$USER/$CONFIG_DIR/blocks /home/$USER/$CONFIG_DIR/chainstate > /dev/null 2>&1 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + fi else - - BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 - fi - - else - - echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 - sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 - - fi - - - else - - if [[ "$use_old_chain" == "1" ]]; then - - BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/database && sleep 1 - sudo rm -rf /home/$USER/$CONFIG_DIR/sporks && sleep 1 - - else - - echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf ~/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate && sleep 2 - sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 && sleep 2 - - - fi + if [[ "$use_old_chain" == "1" ]]; then + BOOTSTRAP_SKIP="1" + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/database + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks + else + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf /home/$USER/$CONFIG_DIR/determ_zelnodes /home/$USER/$CONFIG_DIR/sporks /home/$USER/$CONFIG_DIR/database /home/$USER/$CONFIG_DIR/blocks /home/$USER/$CONFIG_DIR/chainstate > /dev/null 2>&1 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + fi + fi fi -fi - sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 echo -e "" - - echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 -if [[ $(sudo ufw status | grep "Status: active") ]]; then - # then - # if [[ -z "$firewall_disable" ]]; then - # if whiptail --yesno "Firewall is active and enabled. Do you want disable it during install process?<Yes>(Recommended)" 8 60; then - sudo ufw disable > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - # else - # echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" - # fi - # else - - # if [[ "$firewall_disable" == "1" ]]; then - ### sudo ufw disable > /dev/null 2>&1 - # echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - # else - #echo -e "${ARROW} ${CYAN}Firewall status: ${GREEN}Enabled${NC}" - # fi - # fi - - else + echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 + if [[ $(sudo ufw status | grep "Status: active") ]]; then + sudo ufw disable > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - fi - + else + echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + fi } function spinning_timer() { @@ -740,67 +593,31 @@ function spinning_timer() { do for i in "${animation[@]}"; do - echo -e "" + echo -e "" echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" sleep 0.1 - done done echo -ne "${MSG2}" } - -function ssh_port() { - +function ssh_port() { if [[ -z "$ssh_port" ]]; then - - SSHPORT=$(grep -w Port /etc/ssh/sshd_config | sed -e 's/.*Port //') - # if ! whiptail --yesno "Detected you are using $SSHPORT for SSH is this correct?" 8 56; then - # SSHPORT=$(whiptail --inputbox "Please enter port you are using for SSH" 8 43 3>&1 1>&2 2>&3) - # echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 - # else + SSHPORT=$(grep -w Port /etc/ssh/sshd_config | sed -e 's/.*Port //') echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 - # fi - else - pettern='^[0-9]+$' - if [[ $ssh_port =~ $pettern ]] ; then - SSHPORT="$ssh_port" - echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 - else - echo -e "${ARROW} ${CYAN}SSH port must be integer................[${X_MARK}${CYAN}]${NC}}" - echo - exit - fi + pettern='^[0-9]+$' + if [[ $ssh_port =~ $pettern ]] ; then + SSHPORT="$ssh_port" + echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 + else + echo -e "${ARROW} ${CYAN}SSH port must be integer................[${X_MARK}${CYAN}]${NC}}" + echo + exit + fi fi } -function ip_confirm() { - echo -e "${ARROW} ${YELLOW}Detecting IP address...${NC}" - - WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') - fi - - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" - echo - exit - fi - - - string_limit_check_mark "Detected IP: $WANIP ................................." "Detected IP: ${GREEN}$WANIP${CYAN} ................................." - -} - - function create_conf() { echo -e "${ARROW} ${YELLOW}Creating Flux daemon config file...${NC}" @@ -808,292 +625,235 @@ function create_conf() { echo -e "${ARROW} ${CYAN}Existing conf file found backing up to $COIN_NAME.old ...${NC}" mv ~/$CONFIG_DIR/$CONFIG_FILE ~/$CONFIG_DIR/$COIN_NAME.old; fi - RPCUSER=$(pwgen -1 8 -n) PASSWORD=$(pwgen -1 20 -n) - - if [[ "$IMPORT_ZELCONF" == "0" ]] - then - zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) - zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) - zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) + if [[ "$IMPORT_ZELCONF" == "0" ]]; then + zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) + zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) + zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) fi - - if [ "x$PASSWORD" = "x" ]; then PASSWORD=${WANIP}-$(date +%s) fi mkdir ~/$CONFIG_DIR > /dev/null 2>&1 touch ~/$CONFIG_DIR/$CONFIG_FILE cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE -rpcuser=$RPCUSER -rpcpassword=$PASSWORD -rpcallowip=127.0.0.1 -rpcallowip=172.18.0.1 -rpcport=$RPCPORT -port=$PORT -zelnode=1 -zelnodeprivkey=$zelnodeprivkey -zelnodeoutpoint=$zelnodeoutpoint -zelnodeindex=$zelnodeindex -server=1 -daemon=1 -txindex=1 -addressindex=1 -timestampindex=1 -spentindex=1 -insightexplorer=1 -experimentalfeatures=1 -listen=1 -externalip=$WANIP -bind=0.0.0.0 -addnode=80.211.207.17 -addnode=95.217.12.176 -addnode=89.58.3.209 -addnode=161.97.85.103 -addnode=194.163.176.185 -addnode=explorer.flux.zelcore.io -addnode=explorer.runonflux.io -addnode=explorer.zelcash.online -addnode=blockbook.runonflux.io -addnode=202.61.202.21 -addnode=89.58.40.172 -addnode=37.120.176.206 -addnode=66.119.15.83 -addnode=66.94.118.208 -addnode=99.48.162.169 -addnode=97.120.40.143 -addnode=99.48.162.167 -addnode=108.30.50.162 -addnode=154.12.242.89 -addnode=67.43.96.139 -addnode=66.94.107.219 -addnode=66.94.110.117 -addnode=154.12.225.203 -addnode=176.9.72.41 -addnode=65.108.198.119 -addnode=65.108.200.110 -addnode=46.38.251.110 -addnode=95.214.55.47 -addnode=202.61.236.202 -addnode=65.108.141.153 -addnode=178.170.46.91 -addnode=66.119.15.64 -addnode=65.108.46.178 -addnode=94.130.220.41 -addnode=178.170.48.110 -addnode=78.35.147.57 -addnode=66.119.15.101 -addnode=66.119.15.96 -addnode=38.88.125.25 -addnode=66.119.15.110 -addnode=103.13.31.149 -addnode=212.80.212.238 -addnode=212.80.213.172 -addnode=212.80.212.228 -addnode=121.112.224.186 -addnode=114.181.141.16 -addnode=167.179.115.100 -addnode=153.226.219.80 -addnode=24.79.73.50 -addnode=76.68.219.102 -addnode=70.52.20.8 -addnode=184.145.181.147 -addnode=68.150.72.135 -addnode=198.27.83.181 -addnode=167.114.82.63 -addnode=24.76.166.6 -addnode=173.33.170.150 -addnode=99.231.229.245 -addnode=70.82.102.140 -addnode=192.95.30.188 -addnode=75.158.245.77 -addnode=142.113.239.49 -addnode=66.70.176.241 -addnode=174.93.146.224 -addnode=216.232.124.38 -addnode=207.34.248.197 -addnode=76.68.219.102 -addnode=149.56.25.82 -addnode=74.57.74.166 -addnode=142.169.180.47 -addnode=70.67.210.148 -addnode=86.5.78.14 -addnode=87.244.105.94 -addnode=86.132.192.193 -addnode=86.27.168.85 -addnode=86.31.168.107 -addnode=84.71.79.220 -addnode=154.57.235.104 -addnode=86.13.102.145 -addnode=86.31.168.107 -addnode=86.13.68.100 -addnode=151.225.136.163 -addnode=5.45.110.123 -addnode=45.142.178.251 -addnode=89.58.5.234 -addnode=45.136.30.81 -addnode=202.61.255.238 -addnode=89.58.7.2 -addnode=89.58.36.46 -addnode=89.58.32.76 -addnode=89.58.39.81 -addnode=89.58.39.153 -addnode=202.61.244.71 -addnode=89.58.37.172 -addnode=89.58.36.118 -addnode=31.145.161.44 -addnode=217.131.61.221 -addnode=80.28.72.254 -addnode=85.49.210.36 -addnode=84.77.69.203 -addnode=51.38.1.195 -addnode=51.38.1.194 -maxconnections=256 + rpcuser=$RPCUSER + rpcpassword=$PASSWORD + rpcallowip=127.0.0.1 + rpcallowip=172.18.0.1 + rpcport=$RPCPORT + port=$PORT + zelnode=1 + zelnodeprivkey=$zelnodeprivkey + zelnodeoutpoint=$zelnodeoutpoint + zelnodeindex=$zelnodeindex + server=1 + daemon=1 + txindex=1 + addressindex=1 + timestampindex=1 + spentindex=1 + insightexplorer=1 + experimentalfeatures=1 + listen=1 + externalip=$WANIP + bind=0.0.0.0 + addnode=80.211.207.17 + addnode=95.217.12.176 + addnode=89.58.3.209 + addnode=161.97.85.103 + addnode=194.163.176.185 + addnode=explorer.flux.zelcore.io + addnode=explorer.runonflux.io + addnode=explorer.zelcash.online + addnode=blockbook.runonflux.io + addnode=202.61.202.21 + addnode=89.58.40.172 + addnode=37.120.176.206 + addnode=66.119.15.83 + addnode=66.94.118.208 + addnode=99.48.162.169 + addnode=97.120.40.143 + addnode=99.48.162.167 + addnode=108.30.50.162 + addnode=154.12.242.89 + addnode=67.43.96.139 + addnode=66.94.107.219 + addnode=66.94.110.117 + addnode=154.12.225.203 + addnode=176.9.72.41 + addnode=65.108.198.119 + addnode=65.108.200.110 + addnode=46.38.251.110 + addnode=95.214.55.47 + addnode=202.61.236.202 + addnode=65.108.141.153 + addnode=178.170.46.91 + addnode=66.119.15.64 + addnode=65.108.46.178 + addnode=94.130.220.41 + addnode=178.170.48.110 + addnode=78.35.147.57 + addnode=66.119.15.101 + addnode=66.119.15.96 + addnode=38.88.125.25 + addnode=66.119.15.110 + addnode=103.13.31.149 + addnode=212.80.212.238 + addnode=212.80.213.172 + addnode=212.80.212.228 + addnode=121.112.224.186 + addnode=114.181.141.16 + addnode=167.179.115.100 + addnode=153.226.219.80 + addnode=24.79.73.50 + addnode=76.68.219.102 + addnode=70.52.20.8 + addnode=184.145.181.147 + addnode=68.150.72.135 + addnode=198.27.83.181 + addnode=167.114.82.63 + addnode=24.76.166.6 + addnode=173.33.170.150 + addnode=99.231.229.245 + addnode=70.82.102.140 + addnode=192.95.30.188 + addnode=75.158.245.77 + addnode=142.113.239.49 + addnode=66.70.176.241 + addnode=174.93.146.224 + addnode=216.232.124.38 + addnode=207.34.248.197 + addnode=76.68.219.102 + addnode=149.56.25.82 + addnode=74.57.74.166 + addnode=142.169.180.47 + addnode=70.67.210.148 + addnode=86.5.78.14 + addnode=87.244.105.94 + addnode=86.132.192.193 + addnode=86.27.168.85 + addnode=86.31.168.107 + addnode=84.71.79.220 + addnode=154.57.235.104 + addnode=86.13.102.145 + addnode=86.31.168.107 + addnode=86.13.68.100 + addnode=151.225.136.163 + addnode=5.45.110.123 + addnode=45.142.178.251 + addnode=89.58.5.234 + addnode=45.136.30.81 + addnode=202.61.255.238 + addnode=89.58.7.2 + addnode=89.58.36.46 + addnode=89.58.32.76 + addnode=89.58.39.81 + addnode=89.58.39.153 + addnode=202.61.244.71 + addnode=89.58.37.172 + addnode=89.58.36.118 + addnode=31.145.161.44 + addnode=217.131.61.221 + addnode=80.28.72.254 + addnode=85.49.210.36 + addnode=84.77.69.203 + addnode=51.38.1.195 + addnode=51.38.1.194 + maxconnections=256 EOF - sleep 2 - - if [[ "$IMPORT_ZELID" == "0" ]]; then - + if [[ "$IMPORT_ZELID" == "0" ]]; then while true do - ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) - if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then + ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) + if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" break - else + else echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" sleep 4 - fi + fi done - - # if whiptail --yesno "Are you planning to run Kadena node? Please note that only Nimbus/Stratus nodes are allowed to run it. ( to get reward you still NEED INSTALL KadenaChainWebNode under Apps -> Local Apps section via FluxOS Web UI )" 10 90 3>&1 1>&2 2>&3; then - - #tier - #if [[ "$kadena_possible" == "1" ]]; then - - while true - do - - KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* ]]; then - - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=0" - sleep 2 - break - + while true + do + KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=0" + sleep 2 + break else echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 + sleep 2 fi - done - - #fi - - fi - + done + fi } - function install_daemon() { - sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 sudo rm /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 - -if [[ "$(lsb_release -cs)" == "xenial" ]]; then - - echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - - flux_package && sleep 2 -else - - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - - # cleaning - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - - if [[ "$(lsb_release -cs)" == "impish" ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - fi - - - # downloading key && save it as keyring - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" - sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - - - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - - - if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - - flux_package && sleep 2 - - else - - echo - echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - - fi - -fi - - + if [[ "$(lsb_release -cs)" == "xenial" ]]; then + echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + flux_package && sleep 2 + else + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + if [[ "$(lsb_release -cs)" == "impish" ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + fi + # downloading key && save it as keyring + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" + sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi + if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + flux_package && sleep 2 + else + echo -e "" + echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo -e "" + exit + fi + fi } function basic_security() { echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" - #sudo ufw allow 16124/tcp > /dev/null 2>&1 sudo ufw allow "$SSHPORT"/tcp > /dev/null 2>&1 - #sudo ufw allow "$PORT"/tcp > /dev/null 2>&1 sudo ufw logging on > /dev/null 2>&1 sudo ufw default deny incoming > /dev/null 2>&1 - sudo ufw allow out from any to any port 123 > /dev/null 2>&1 sudo ufw allow out to any port 80 > /dev/null 2>&1 sudo ufw allow out to any port 443 > /dev/null 2>&1 sudo ufw allow out to any port 53 > /dev/null 2>&1 - #sudo ufw allow out to any port 16124 > /dev/null 2>&1 - #sudo ufw allow out to any port 16125 > /dev/null 2>&1 - #sudo ufw allow out to any port 16127 > /dev/null 2>&1 - #sudo ufw allow from any to any port 16127 > /dev/null 2>&1 - #FluxOS communication sudo ufw allow 16100:16199/tcp > /dev/null 2>&1 - ## - sudo ufw default deny outgoing > /dev/null 2>&1 sudo ufw limit OpenSSH > /dev/null 2>&1 echo "y" | sudo ufw enable > /dev/null 2>&1 @@ -1103,269 +863,175 @@ function basic_security() { } function start_daemon() { - sudo systemctl enable zelcash.service > /dev/null 2>&1 sudo systemctl start zelcash > /dev/null 2>&1 - - #NUM='300' - #MSG1='Starting daemon & syncing with chain please be patient this will take about 5 min...' - #MSG2='' - #spinning_timer - - - x=1 while [ $x -le 6 ] - do - - NUM='300' - MSG1='Starting daemon & syncing with chain please be patient this will take about 5 min...' - MSG2='' - spinning_timer - - chain_check=$($COIN_CLI getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) - if [[ "$chain_check" == "1" ]]; then - echo -e "" - echo -e "${ARROW} ${CYAN}Activating best chain detected....Awaiting increased for next 5min${NC}" - fi - - if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then - break - fi - - if [[ "$x" -gt 6 ]]; then - echo -e "${ARROW} ${CYAN}Maximum timeout exceeded...${NC}" - break - fi - - x=$(( $x + 1 )) - - done - - - - - if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then - # if $COIN_DAEMON > /dev/null 2>&1; then - + do + NUM='300' + MSG1='Starting daemon & syncing with chain please be patient this will take about 5 min...' + MSG2='' + spinning_timer + chain_check=$($COIN_CLI getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) + if [[ "$chain_check" == "1" ]]; then + echo -e "" + echo -e "${ARROW} ${CYAN}Activating best chain detected....Awaiting increased for next 5min${NC}" + fi + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + break + fi + if [[ "$x" -gt 6 ]]; then + echo -e "${ARROW} ${CYAN}Maximum timeout exceeded...${NC}" + break + fi + x=$(( $x + 1 )) + done + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then NUM='2' MSG1='Getting info...' MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" spinning_timer echo && echo - - - daemon_version=$($COIN_CLI getinfo | jq -r '.version') - string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." - #echo -e "Zelcash version: ${GREEN}v$zelcash_version${CYAN} installed................................." - bench_version=$($BENCH_CLI getinfo | jq -r '.version') - string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." - #echo -e "${ARROW} ${CYAN}Zelbench version: ${GREEN}v$zelbench_version${CYAN} installed${NC}" - echo - pm2_install - #zelbench-cli stop > /dev/null 2>&1 && sleep 2 - else + daemon_version=$($COIN_CLI getinfo | jq -r '.version') + string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." + bench_version=$($BENCH_CLI getinfo | jq -r '.version') + string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." echo + pm2_install + else + echo -e "" echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" - - if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then - error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') - if [[ "$error_line" != "" ]]; then - echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" - echo -e "${WORNING} ${CYAN}$error_line${NC}" - echo - exit - fi + if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then + error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + if [[ "$error_line" != "" ]]; then + echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" + echo -e "${WORNING} ${CYAN}$error_line${NC}" + echo -e "" + exit + fi fi - - - if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then - - echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" - echo -n "" - - else - - echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" - echo -n "" - exit - - fi - - + if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then + echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" + echo -n "" + else + echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" + echo -n "" + exit + fi fi } -#TODO: RESEARCH, This defaults to mongodb 5.0 in install_pro, why not in testnet? function install_process() { - echo -e "${ARROW} ${YELLOW}Configuring firewall...${NC}" sudo ufw allow $ZELFRONTPORT/tcp > /dev/null 2>&1 sudo ufw allow $LOCPORT/tcp > /dev/null 2>&1 sudo ufw allow $ZELNODEPORT/tcp > /dev/null 2>&1 - #sudo ufw allow $MDBPORT/tcp > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" - sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - if [[ $(lsb_release -cs) = *jammy* ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 else curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 fi - if [[ $(lsb_release -d) = *Debian* ]]; then - - if [[ $(lsb_release -cs) = *stretch* || $(lsb_release -cs) = *buster* ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 fi - - elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - - if [[ $(lsb_release -cs) = *focal* || $(lsb_release -cs) = *bionic* || $(lsb_release -cs) = *xenial* ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 elif [[ $(lsb_release -cs) = *jammy* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 fi - else - echo -e "${WORNING} ${RED}OS type not supported..${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit - fi - - if ! sysbench --version > /dev/null 2>&1; then - - echo + echo -e "" echo -e "${ARROW} ${YELLOW}Sysbench installing...${NC}" curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh 2> /dev/null | sudo bash > /dev/null 2>&1 sudo apt -y install sysbench > /dev/null 2>&1 - if sysbench --version > /dev/null 2>&1; then - - string_limit_check_mark "Sysbench $(sysbench --version | awk '{print $2}') installed................................." "Sysbench ${GREEN}$(sysbench --version | awk '{print $2}')${CYAN} installed................................." - + string_limit_check_mark "Sysbench $(sysbench --version | awk '{print $2}') installed................................." "Sysbench ${GREEN}$(sysbench --version | awk '{print $2}')${CYAN} installed................................." fi fi - install_mongod install_nodejs install_flux sleep 2 } - function install_flux() { - - docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) - resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) - mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) - -if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then - -echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 -echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 -echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 - -fi - -if [[ $docker_check != 0 ]]; then -echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 -echo -e "${ARROW} ${CYAN}Removing containers...${NC}" - -sudo service docker restart > /dev/null 2>&1 && sleep 5 - -docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | -while read line; do -sudo docker stop $line > /dev/null 2>&1 && sleep 2 -sudo docker rm $line > /dev/null 2>&1 && sleep 2 -done -fi + docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) + resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) + mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) + + if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then + echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 + echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 + fi -if [[ $resource_check != 0 ]]; then -echo -e "${ARROW} ${YELLOW}Detected locked resource${NC}" && sleep 1 -echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" && sleep 1 -df | egrep 'flux' | awk '{ print $1}' | -while read line; do -sudo umount -l $line && sleep 1 -done -fi - + if [[ $docker_check != 0 ]]; then + echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Removing containers...${NC}" + sudo service docker restart > /dev/null 2>&1 && sleep 2 + docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | + while read line; do + sudo docker stop $line > /dev/null 2>&1 && sleep 2 + sudo docker rm $line > /dev/null 2>&1 && sleep 2 + done + fi + if [[ $resource_check != 0 ]]; then + echo -e "${ARROW} ${YELLOW}Detected locked resource${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" && sleep 1 + df | egrep 'flux' | awk '{ print $1}' | + while read line; do + sudo umount -l $line && sleep 1 + done + fi if [ -d "./$FLUX_DIR" ]; then - echo -e "${ARROW} ${YELLOW}Removing any instances of Flux${NC}" - sudo rm -rf $FLUX_DIR + echo -e "${ARROW} ${YELLOW}Removing any instances of Flux${NC}" + sudo rm -rf $FLUX_DIR fi - - echo -e "${ARROW} ${YELLOW}Flux installing...${NC}" git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" - - -if [[ "$KDA_A" != "" ]]; then - touch ~/$FLUX_DIR/config/userconfig.js - cat << EOF > ~/$FLUX_DIR/config/userconfig.js -module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - kadena: '${KDA_A}', - testnet: false - } - } -EOF -else touch ~/$FLUX_DIR/config/userconfig.js cat << EOF > ~/$FLUX_DIR/config/userconfig.js -module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - testnet: false - } + module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${ZELID}', + kadena: '${KDA_A}', + testnet: false + } } EOF -fi - -if [ -d ~/$FLUX_DIR ] -then -current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - -string_limit_check_mark "Flux v$current_ver installed................................." "Flux ${GREEN}v$current_ver${CYAN} installed................................." -#echo -e "${ARROW} ${CYAN}Zelflux version: ${GREEN}v$current_ver${CYAN} installed${NC}" - -echo -else -string_limit_x_mark "Flux was not installed................................." -#echo -e "${ARROW} ${CYAN}Zelflux was not installed${NC}" -echo -fi - + if [ -d ~/$FLUX_DIR ]; then + current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) + string_limit_check_mark "Flux v$current_ver installed................................." "Flux ${GREEN}v$current_ver${CYAN} installed................................." + echo -e "" + else + string_limit_x_mark "Flux was not installed................................." + echo -e "" + fi } - function status_loop() { - network_height_01=$(curl -sk -m 10 https://blockbook.zel.network/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") - + network_height_02=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks' 2> /dev/null) ]]; then - echo -e "" echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) @@ -1376,30 +1042,24 @@ function status_loop() { MSG2="${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" spinning_timer echo && echo - else - echo -e "" echo -e "${CLOCK}${GREEN}FLUX DAEMON SYNCING...${NC}" f=0 start_sync=`date +%s` - while true do - network_height_01=$(curl -sk -m 10 https://blockbook.zel.network/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + network_height_02=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - if [[ "$LEFT" == "0" ]]; then time_break='5' else time_break='20' fi - if [[ $LOCAL_BLOCK_HIGHT == "" ]]; then f=$((f+1)) LOCAL_BLOCK_HIGHT="N/A" @@ -1412,20 +1072,18 @@ function status_loop() { MSG2='' spinning_timer network_height_01=$(curl -sk -m 10 https://blockbook.zel.network/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_03") + network_height_02=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) fi - - NUM="$time_break" - MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" - MSG2='' - spinning_timer - + NUM="$time_break" + MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer if [[ "$EXPLORER_BLOCK_HIGHT" == "$LOCAL_BLOCK_HIGHT" ]]; then - echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" break fi done @@ -1436,26 +1094,25 @@ function status_loop() { } #end of functions - start_install - wipe_clean - ssh_port - ip_confirm - create_swap - install_packages - create_conf - install_daemon - zk_params - if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then - bootstrap "install" - fi - create_service_scripts - create_service - selfhosting - install_process - start_daemon - log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" - log_rotate "Flux daemon" "daemon_debug_log" "/home/$USER/$CONFIG_DIR/debug.log" "daily" "7" - log_rotate "MongoDB" "mongod_debug_log" "/var/log/mongodb/*.log" "daily" "14" - log_rotate "Docker" "docker_debug_log" "/var/lib/docker/containers/*/*.log" "daily" "7" - basic_security - status_loop +start_install +wipe_clean +ssh_port +get_ip "install" +create_swap +install_packages +create_conf +install_daemon +zk_params +if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then + bootstrap "install" +fi +create_service +selfhosting +install_process +start_daemon +log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" +log_rotate "Flux daemon" "daemon_debug_log" "/home/$USER/$CONFIG_DIR/debug.log" "daily" "7" +log_rotate "MongoDB" "mongod_debug_log" "/var/log/mongodb/*.log" "daily" "14" +log_rotate "Docker" "docker_debug_log" "/var/lib/docker/containers/*/*.log" "daily" "7" +basic_security +status_loop From e014e6ffb0e686be0a266e7db091ed91700133d1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 22 Aug 2022 09:48:28 +0200 Subject: [PATCH 0606/1176] improvement and formatting - formatting - function reduction - other improvement --- flux_common.sh | 2290 +++++++++++++++++++++--------------------------- 1 file changed, 997 insertions(+), 1293 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 4588ecd8..22f53344 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1,7 +1,5 @@ #!/bin/bash - # Collection of common vars and functions used throughout multitoolbox. - #color codes RED='\033[1;31m' YELLOW='\033[1;33m' @@ -10,7 +8,6 @@ SEA="\\033[38;5;49m" GREEN='\033[1;32m' CYAN='\033[1;36m' NC='\033[0m' - #emoji codes CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" X_MARK="${RED}\xE2\x9C\x96${NC}" @@ -21,1378 +18,1085 @@ BOOK="${RED}\xF0\x9F\x93\x8B${NC}" HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" RIGHT_ANGLE="${GREEN}\xE2\x88\x9F${NC}" - #bootstrap variable server_offline="0" failed_counter="0" - #dialog color export NEWT_COLORS=' title=black, ' function round() { - printf "%.${2}f" "${1}" + printf "%.${2}f" "${1}" } - function insertAfter() { - local file="$1" line="$2" newText="$3" - sudo sed -i -e "/$line/a"$'\\\n'"$newText"$'\n' "$file" + local file="$1" line="$2" newText="$3" + sudo sed -i -e "/$line/a"$'\\\n'"$newText"$'\n' "$file" } - function max(){ - m="0" - for n in "$@" - do - if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then - [ "$n" -gt "$m" ] && m="$n" - fi - done - echo "$m" + m="0" + for n in "$@" + do + if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then + [ "$n" -gt "$m" ] && m="$n" + fi + done + echo "$m" } - function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - - done - done - echo -ne "${MSG2}" + animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) + end=$((SECONDS+NUM)) + while [ $SECONDS -lt $end ]; + do + for i in "${animation[@]}"; + do + echo -e "" + echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" + sleep 0.1 + + done + done + echo -ne "${MSG2}" } - function string_limit_x_mark() { - if [[ -z "$2" ]]; then - string="$1" - string=${string::50} - else - string=$1 - string_color=$2 - string_leght=${#string} - string_leght_color=${#string_color} - string_diff=$((string_leght_color-string_leght)) - string=${string_color::50+string_diff} - fi - echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" + if [[ -z "$2" ]]; then + string="$1" + string=${string::50} + else + string=$1 + string_color=$2 + string_leght=${#string} + string_leght_color=${#string_color} + string_diff=$((string_leght_color-string_leght)) + string=${string_color::50+string_diff} + fi + echo -e "${ARROW} ${CYAN}$string[${X_MARK}${CYAN}]${NC}" } - function string_limit_check_mark_port() { - if [[ -z "$2" ]]; then - string="$1" - string=${string::65} - else - string=$1 - string_color=$2 - string_leght=${#string} - string_leght_color=${#string_color} - string_diff=$((string_leght_color-string_leght)) - string=${string_color::65+string_diff} - fi - echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" + if [[ -z "$2" ]]; then + string="$1" + string=${string::65} + else + string=$1 + string_color=$2 + string_leght=${#string} + string_leght_color=${#string_color} + string_diff=$((string_leght_color-string_leght)) + string=${string_color::65+string_diff} + fi + echo -e "${PIN}${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" } - function string_limit_check_mark() { - if [[ -z "$2" ]]; then - string="$1" - string=${string::40} - else - string=$1 - string_color=$2 - string_leght=${#string} - string_leght_color=${#string_color} - string_diff=$((string_leght_color-string_leght)) - string=${string_color::40+string_diff} - fi - echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" + if [[ -z "$2" ]]; then + string="$1" + string=${string::40} + else + string=$1 + string_color=$2 + string_leght=${#string} + string_leght_color=${#string_color} + string_diff=$((string_leght_color-string_leght)) + string=${string_color::40+string_diff} + fi + echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" } - function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - - done - done - echo -ne "${MSG2}" + animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) + end=$((SECONDS+NUM)) + while [ $SECONDS -lt $end ]; + do + for i in "${animation[@]}"; + do + echo -e "" + echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" + sleep 0.1 + done + done + echo -ne "${MSG2}" } - function tar_file_unpack() { - echo -e "${ARROW} ${CYAN}Unpacking bootstrap archive file...${NC}" - pv $1 | tar -zx -C $2 + echo -e "${ARROW} ${CYAN}Unpacking bootstrap archive file...${NC}" + pv $1 | tar -zx -C $2 } - - function check_tar() { - echo -e "${ARROW} ${CYAN}Checking file integrity...${NC}" - if gzip -t "$1" &>/dev/null; then - echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $1 - fi + echo -e "${ARROW} ${CYAN}Checking file integrity...${NC}" + if gzip -t "$1" &>/dev/null; then + echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" + rm -rf $1 + fi } - function tar_file_pack() { - echo -e "${ARROW} ${CYAN}Creating bootstrap archive file...${NC}" - tar -czf - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 + echo -e "${ARROW} ${CYAN}Creating bootstrap archive file...${NC}" + tar -czf - $1 | (pv -p --timer --rate --bytes > $2) 2>&1 } - -function get_ip(){ - WANIP=$(curl -SsL -m 5 https://api4.my-ip.io/ip 2>/dev/null | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl -SsL -m 5 https://checkip.amazonaws.com 2>/dev/null | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl -SsL -m 5 https://api.ipify.org 2>/dev/null | tr -dc '[:alnum:].') - fi -} - -###### Bootstrap Section ########################################################################## function cdn_speedtest() { - - if [[ -z $1 || "$1" == "0" ]]; then - BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" - else - BOOTSTRAP_FILE="$1" - fi - - if [[ -z $2 ]]; then - dTime="5" - else - dTime="$2" - fi - - if [[ -z $3 ]]; then - rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") - else - msg="$3" - shift - shift - rand_by_domain=("$@") - custom_url="1" - fi - - size_list=() - i=0 - len=${#rand_by_domain[@]} - echo -e "${ARROW} ${CYAN}Running quick download speed test for ${BOOTSTRAP_FILE}, Servers: ${GREEN}$len${NC}" - start_test=`date +%s` - while [ $i -lt $len ]; - do - if [[ "$custom_url" == "1" ]]; then - testing=$(curl -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) - else - testing=$(curl -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) - fi - testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') - mb=$(bc <<<"scale=2; $testing_size / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') - - if [[ "$custom_url" == "1" ]]; then - domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${rand_by_domain[$i]}) - echo -e " ${RIGHT_ANGLE} ${GREEN}URL - ${YELLOW}${domain}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" - else - echo -e " ${RIGHT_ANGLE} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" - fi - size_list+=($testing_size) - if [[ "$testing_size" == "0" ]]; then - failed_counter=$(($failed_counter+1)) - fi - i=$(($i+1)) - done - - rServerList=$((${#size_list[@]}-$failed_counter)) - echo -e "${ARROW} ${CYAN}Valid servers: ${GREEN}${rServerList} ${CYAN}- Duration: ${GREEN}$((($(date +%s)-$start_test)/60)) min. $((($(date +%s)-$start_test) % 60)) sec.${NC}" - sudo rm -rf testspeed > /dev/null 2>&1 - - if [[ "$rServerList" == "0" ]]; then - server_offline="1" - return 1 - fi - - arr_max=$(printf '%s\n' "${size_list[@]}" | sort -n | tail -1) - for i in "${!size_list[@]}"; do - [[ "${size_list[i]}" == "$arr_max" ]] && - max_indexes+=($i) - done - - server_index=${rand_by_domain[${max_indexes[0]}]} - if [[ "$custom_url" == "1" ]]; then - BOOTSTRAP_URL="$server_index" - else - BOOTSTRAP_URL="http://cdn-${server_index}.runonflux.io/apps/fluxshare/getfile/" - fi - DOWNLOAD_URL="${BOOTSTRAP_URL}${BOOTSTRAP_FILE}" - - # Print the results - mb=$(bc <<<"scale=2; $arr_max / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') - if [[ "$custom_url" == "1" ]]; then - domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${server_index}) - echo -e "${ARROW} ${CYAN}Best server is: ${YELLOW}${domain} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" - else - echo -e "${ARROW} ${CYAN}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" - fi - #echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}$DOWNLOAD_URL${NC}" + if [[ -z $1 || "$1" == "0" ]]; then + BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" + else + BOOTSTRAP_FILE="$1" + fi + if [[ -z $2 ]]; then + dTime="5" + else + dTime="$2" + fi + if [[ -z $3 ]]; then + rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") + else + msg="$3" + shift + shift + rand_by_domain=("$@") + custom_url="1" + fi + size_list=() + i=0 + len=${#rand_by_domain[@]} + echo -e "${ARROW} ${CYAN}Running quick download speed test for ${BOOTSTRAP_FILE}, Servers: ${GREEN}$len${NC}" + start_test=`date +%s` + while [ $i -lt $len ]; + do + if [[ "$custom_url" == "1" ]]; then + testing=$(curl -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + else + testing=$(curl -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + fi + testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') + mb=$(bc <<<"scale=2; $testing_size / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') + if [[ "$custom_url" == "1" ]]; then + domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${rand_by_domain[$i]}) + echo -e " ${RIGHT_ANGLE} ${GREEN}URL - ${YELLOW}${domain}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + else + echo -e " ${RIGHT_ANGLE} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + fi + size_list+=($testing_size) + if [[ "$testing_size" == "0" ]]; then + failed_counter=$(($failed_counter+1)) + fi + i=$(($i+1)) + done + rServerList=$((${#size_list[@]}-$failed_counter)) + echo -e "${ARROW} ${CYAN}Valid servers: ${GREEN}${rServerList} ${CYAN}- Duration: ${GREEN}$((($(date +%s)-$start_test)/60)) min. $((($(date +%s)-$start_test) % 60)) sec.${NC}" + sudo rm -rf testspeed > /dev/null 2>&1 + if [[ "$rServerList" == "0" ]]; then + server_offline="1" + return + fi + arr_max=$(printf '%s\n' "${size_list[@]}" | sort -n | tail -1) + for i in "${!size_list[@]}"; do + [[ "${size_list[i]}" == "$arr_max" ]] && + max_indexes+=($i) + done + server_index=${rand_by_domain[${max_indexes[0]}]} + if [[ "$custom_url" == "1" ]]; then + BOOTSTRAP_URL="$server_index" + else + BOOTSTRAP_URL="http://cdn-${server_index}.runonflux.io/apps/fluxshare/getfile/" + fi + DOWNLOAD_URL="${BOOTSTRAP_URL}${BOOTSTRAP_FILE}" + #Print the results + mb=$(bc <<<"scale=2; $arr_max / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') + if [[ "$custom_url" == "1" ]]; then + domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${server_index}) + echo -e "${ARROW} ${CYAN}Best server is: ${YELLOW}${domain} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + else + echo -e "${ARROW} ${CYAN}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + fi + #echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}$DOWNLOAD_URL${NC}" } - function bootstrap() { - echo -e "" - echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" - - if ! wget --version > /dev/null 2>&1 ; then - sudo apt install -y wget > /dev/null 2>&1 && sleep 2 - fi - - if ! wget --version > /dev/null 2>&1 ; then - echo -e "${WORNING} ${CYAN}Wget not installed, operation aborted.. ${NC}" && sleep 1 - echo -e "" - return 1 - fi - - Mode="$1" - bootstrap_local - if [[ -f "$FILE_PATH" ]]; then - if [[ "$Mode" != "install" ]]; then - start_service - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - sudo rm -rf $FILE_PATH > /dev/null 2>&1 && sleep 2 - fi - fi - return 1 - else - if [[ ! -f /home/$USER/install_conf.json ]]; then - bootstrap_manual - if [[ "$Mode" != "install" && "$Server_offline" == "0" ]]; then - start_service - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - sudo rm -rf $FILE_PATH /dev/null 2>&1 && sleep 2 - fi - fi - return 1 - fi - fi - - if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then - cdn_speedtest "0" "6" - if [[ "$server_offline" == "1" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 - echo -e "" - return 1 - fi - echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" - tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" - else - DOWNLOAD_URL="$bootstrap_url" - echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" - tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" - fi - - if [[ -z "$bootstrap_zip_del" ]]; then - rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 - else - if [[ "$bootstrap_zip_del" == "1" ]]; then - rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 - fi - fi + echo -e "" + echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" + if ! wget --version > /dev/null 2>&1 ; then + sudo apt install -y wget > /dev/null 2>&1 && sleep 2 + fi + if ! wget --version > /dev/null 2>&1 ; then + echo -e "${WORNING} ${CYAN}Wget not installed, operation aborted.. ${NC}" && sleep 1 + echo -e "" + return + fi + Mode="$1" + bootstrap_local + if [[ -f "$FILE_PATH" ]]; then + if [[ "$Mode" != "install" ]]; then + start_service + if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + sudo rm -rf $FILE_PATH > /dev/null 2>&1 && sleep 2 + fi + fi + return + else + if [[ ! -f /home/$USER/install_conf.json ]]; then + bootstrap_manual + if [[ "$Mode" != "install" && "$Server_offline" == "0" ]]; then + start_service + if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + sudo rm -rf $FILE_PATH /dev/null 2>&1 && sleep 2 + fi + fi + return + fi + fi + + if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then + cdn_speedtest "0" "6" + if [[ "$server_offline" == "1" ]]; then + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 + echo -e "" + return 1 + fi + echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" + wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" + tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + else + DOWNLOAD_URL="$bootstrap_url" + echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" + wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" + tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + fi + if [[ -z "$bootstrap_zip_del" ]]; then + rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 + else + if [[ "$bootstrap_zip_del" == "1" ]]; then + rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 + fi + fi } - function bootstrap_manual() { - - CHOICE=$( - whiptail --title "FluxNode Installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) - - case $CHOICE in - "1)") - - #server_list=("http://cdn-11.runonflux.io/apps/fluxshare/getfile/" "http://cdn-12.runonflux.io/apps/fluxshare/getfile/" "http://cdn-13.runonflux.io/apps/fluxshare/getfile/" "http://cdn-10.runonflux.io/apps/fluxshare/getfile/") - #cdn_speedtest "0" "8" "${server_list[@]}" - cdn_speedtest "0" "6" - if [[ "$server_offline" == "1" ]]; then - echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 - echo -e "" - return 1 - fi - DB_HIGHT=$(curl -sSL -m 10 "${BOOTSTRAP_URL}flux_explorer_bootstrap.json" | jq -r '.block_height' 2>/dev/null) - if [[ "$DB_HIGHT" == "" ]]; then - DB_HIGHT=$(curl -sSL -m 10 "${BOOTSTRAP_URL}flux_explorer_bootstrap.json" | jq -r '.block_height' 2>/dev/null) - fi - if [[ "$DB_HIGHT" != "" ]]; then - echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" - fi - - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - if [[ "$Mode" != "install" ]]; then - stop_service - fi - tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" - sleep 1 - ;; - "2)") - DOWNLOAD_URL="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - BOOTSTRAP_FILE="${DOWNLOAD_URL##*/}" - wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - if [[ "$Mode" != "install" ]]; then - stop_service - fi - if [[ "$BOOTSTRAP_FILE" == *".zip"* ]]; then - echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_FILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" - sleep 1 - fi - ;; - esac + CHOICE=$( + whiptail --title "FluxNode Installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ + "1)" "Download from source build in script" \ + "2)" "Download from own source" 3>&2 2>&1 1>&3 + ) + case $CHOICE in + "1)") + #server_list=("http://cdn-11.runonflux.io/apps/fluxshare/getfile/" "http://cdn-12.runonflux.io/apps/fluxshare/getfile/" "http://cdn-13.runonflux.io/apps/fluxshare/getfile/" "http://cdn-10.runonflux.io/apps/fluxshare/getfile/") + #cdn_speedtest "0" "8" "${server_list[@]}" + cdn_speedtest "0" "6" + if [[ "$server_offline" == "1" ]]; then + echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 + echo -e "" + return 1 + fi + DB_HIGHT=$(curl -sSL -m 10 "${BOOTSTRAP_URL}flux_explorer_bootstrap.json" | jq -r '.block_height' 2>/dev/null) + if [[ "$DB_HIGHT" == "" ]]; then + DB_HIGHT=$(curl -sSL -m 10 "${BOOTSTRAP_URL}flux_explorer_bootstrap.json" | jq -r '.block_height' 2>/dev/null) + fi + if [[ "$DB_HIGHT" != "" ]]; then + echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" + fi + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" + wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + if [[ "$Mode" != "install" ]]; then + stop_service + fi + tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + sleep 1 + ;; + "2)") + DOWNLOAD_URL="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" + BOOTSTRAP_FILE="${DOWNLOAD_URL##*/}" + wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + if [[ "$Mode" != "install" ]]; then + stop_service + fi + if [[ "$BOOTSTRAP_FILE" == *".zip"* ]]; then + echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" + unzip -o $BOOTSTRAP_FILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + sleep 1 + fi + ;; + esac } - function bootstrap_local() { - - BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" - FILE_PATH="/home/$USER/$BOOTSTRAP_FILE" - - if [ -f "$FILE_PATH" ]; then - echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" - check_tar "$FILE_PATH" - if [ -f "$FILE_PATH" ]; then - if [[ "$Mode" != "install" ]]; then - stop_service - fi - tar_file_unpack "$FILE_PATH" "/home/$USER/$CONFIG_DIR" - fi - fi + BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" + FILE_PATH="/home/$USER/$BOOTSTRAP_FILE" + if [ -f "$FILE_PATH" ]; then + echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" + check_tar "$FILE_PATH" + if [ -f "$FILE_PATH" ]; then + if [[ "$Mode" != "install" ]]; then + stop_service + fi + tar_file_unpack "$FILE_PATH" "/home/$USER/$CONFIG_DIR" + fi + fi } - function flux_chain_date_wipe() { - if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then - echo -e "${ARROW} ${CYAN}Removing blocks, chainstate, determ_zelnodes directories...${NC}" - rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes > /dev/null 2>&1 - fi + if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then + echo -e "${ARROW} ${CYAN}Removing blocks, chainstate, determ_zelnodes directories...${NC}" + rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes > /dev/null 2>&1 + fi } - function stop_service() { - pm2 stop watchdog > /dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" - sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 - sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 - flux_chain_date_wipe + pm2 stop watchdog > /dev/null 2>&1 && sleep 2 + echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + flux_chain_date_wipe } - function start_service() { - sudo systemctl start zelcash > /dev/null 2>&1 && sleep 2 - NUM='35' - MSG1='Starting Flux daemon service...' - MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo -e "" && echo -e "" - pm2 restart flux > /dev/null 2>&1 && sleep 2 - pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 + sudo systemctl start zelcash > /dev/null 2>&1 && sleep 2 + NUM='35' + MSG1='Starting Flux daemon service...' + MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo -e "" && echo -e "" + pm2 restart flux > /dev/null 2>&1 && sleep 2 + pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 } -################################################################################################### - -function selfhosting() { - - echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" - echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 - else - echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 - echo -e "" - return 1 - fi - - echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 - sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 - sudo touch /home/$USER/ip_check.sh - sudo chown $USER:$USER /home/$USER/ip_check.sh - cat <<'EOF' > /home/$USER/ip_check.sh -#!/bin/bash -function get_ip(){ - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi +function get_ip() { + WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + if [[ "$WANIP" == "" ]]; then + WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') + fi + if [[ "$1" == "install" ]]; then + if [[ "$WANIP" == "" ]]; then + echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" + echo + exit + fi + string_limit_check_mark "IP: $WANIP ..........................................." "IP: ${GREEN}$WANIP${CYAN} ..........................................." + fi } -if [[ $1 == "restart" ]]; then - # give 3min to connect with internet - sleep 180 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi -fi -if [[ $1 == "ip_check" ]]; then - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') - if [[ "$api_port" == "" ]]; then - api_port="16127" - fi - confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') - if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then - if [[ "$WANIP" != "$confirmed_ip" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - fi -fi -EOF - sudo chmod +x /home/$USER/ip_check.sh - echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 - - #crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) - sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 - - if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" - else - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" - fi - echo -e "" +function selfhosting() { + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" + echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 + if [[ "$1" != "install" ]]; then + get_ip + fi + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + else + echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 + echo -e "" + return 1 + fi + echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 + sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 + sudo touch /home/$USER/ip_check.sh + sudo chown $USER:$USER /home/$USER/ip_check.sh + cat <<-'EOF' > /home/$USER/ip_check.sh + #!/bin/bash + function get_ip(){ + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi + } + if [[ $1 == "restart" ]]; then + #give 3min to connect with internet + sleep 180 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + fi + if [[ $1 == "ip_check" ]]; then + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + if [[ "$api_port" == "" ]]; then + api_port="16127" + fi + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') + if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then + if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + fi + fi + EOF + sudo chmod +x /home/$USER/ip_check.sh + echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 + sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 + if [[ "$crontab_check" == "0" ]]; then + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + else + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + fi + echo -e "" } - - function integration_check() { - FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) - ELEMENTS=${#FILE_ARRAY[@]} - - for (( i=0;i<$ELEMENTS;i++)); do - string="${FILE_ARRAY[${i}]}................................." - string=${string::40} - - if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then - echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" - CORRUPTED="1" - fi - done - - if [[ "$CORRUPTED" == "1" ]]; then - echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" - echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" - echo - exit - fi - echo -e "" + FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) + ELEMENTS=${#FILE_ARRAY[@]} + for (( i=0;i<$ELEMENTS;i++)); do + string="${FILE_ARRAY[${i}]}......................................" + string=${string::40} + if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then + echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" + CORRUPTED="1" + fi + done + if [[ "$CORRUPTED" == "1" ]]; then + echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" + echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" + echo -e "" + exit + fi + echo -e "" } - - function config_file() { - if [[ -f /home/$USER/install_conf.json ]]; then - import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') - #ssh_port=$(cat /home/$USER/install_conf.json | jq -r '.ssh_port') - #firewall_disable=$(cat /home/$USER/install_conf.json | jq -r '.firewall_disable') - bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') - bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') - #swapon=$(cat /home/$USER/install_conf.json | jq -r '.swapon') - #mongo_bootstrap=$(cat /home/$USER/install_conf.json | jq -r '.mongo_bootstrap') - #watchdog=$(cat /home/$USER/install_conf.json | jq -r '.watchdog') - use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') - prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') - outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') - index=$(cat /home/$USER/install_conf.json | jq -r '.index') - ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') - KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') - fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') - flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') - daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') - bench_update=$(cat /home/$USER/install_conf.json | jq -r '.zelbench_update') - node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') - eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') - discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') - ping=$(cat /home/$USER/install_conf.json | jq -r '.ping') - telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') - telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') - telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') - - echo - echo -e "${ARROW} ${YELLOW}Install config:" - - if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then - echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - if [[ "$import_settings" == "1" ]]; then - echo -e "${PIN}${CYAN} Import settings from Flux........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi - - if [[ "$use_old_chain" == "1" ]]; then - echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - if [[ "$bootstrap_url" == "0" ]]; then - echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...........[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - - if [[ "$bootstrap_zip_del" == "1" ]]; then - echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi - - #if [[ "$swapon" == "1" ]]; then - #echo -e "${PIN}${CYAN} Create a file that will be used for swap.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - #fi - - #if [[ "$mongo_bootstrap" == "1" ]]; then - #echo -e "${PIN}${CYAN} Use Bootstrap for MongoDB........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - #fi - - if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then - echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi + if [[ -f /home/$USER/install_conf.json ]]; then + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') + bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') + use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') + prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') + outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') + index=$(cat /home/$USER/install_conf.json | jq -r '.index') + ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') + KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') + flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') + daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') + bench_update=$(cat /home/$USER/install_conf.json | jq -r '.zelbench_update') + node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') + eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') + discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') + ping=$(cat /home/$USER/install_conf.json | jq -r '.ping') + telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') + telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') + telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') + echo -e "" + echo -e "${ARROW} ${YELLOW}Install config:" + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then + echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + if [[ "$import_settings" == "1" ]]; then + echo -e "${PIN}${CYAN} Import settings from Flux........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi + if [[ "$use_old_chain" == "1" ]]; then + echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + if [[ "$bootstrap_url" == "0" ]]; then + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...........[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + if [[ "$bootstrap_zip_del" == "1" ]]; then + echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi + if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then + echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi } - function check_benchmarks() { - var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") - limit=$2 - if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]]; then - var_round=$(round "$var_benchmark" 2) - echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" - fi + var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") + limit=$2 + if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]]; then + var_round=$(round "$var_benchmark" 2) + echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" + fi } - function flux_package() { - sudo apt-get update -y > /dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" - sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 - sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 - integration_check + sudo apt-get update -y > /dev/null 2>&1 && sleep 2 + echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" + sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 + sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 + integration_check } - function zk_params() { - echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" - bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 - sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" + bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 + sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 } - -function create_oldnode_service_scripts() { - echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 - sudo touch /home/$USER/start_daemon_service.sh - sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - cat <<'EOF' > /home/$USER/start_daemon_service.sh -#!/bin/bash - -#color codes -RED='\033[1;31m' -CYAN='\033[1;36m' -NC='\033[0m'then -#emoji codes -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - -sleep 2 -echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" -echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" -bench_status_pind=$(pgrep fluxbenchd) -daemon_status_pind=$(pgrep fluxd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then - echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" - else -if [[ "$bench_status_pind" != "" ]]; then - echo -e "${WORNING} Running benchmark process detected${NC}" - echo -e "${WORNING} Killing benchmark...${NC}" - sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then - echo -e "${WORNING} Running daemon process detected${NC}" - echo -e "${WORNING} Killing daemon...${NC}" - sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 -fi - sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi - -bench_status_pind=$(pgrep zelbenchd) -daemon_status_pind=$(pgrep zelcashd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then - echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then - echo -e "${WORNING} Running benchmark process detected${NC}" - echo -e "${WORNING} Killing benchmark...${NC}" - sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then - echo -e "${WORNING} Running daemon process detected${NC}" - echo -e "${WORNING} Killing daemon...${NC}" - sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 -fi - sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi - -if [[ -f /usr/local/bin/fluxd ]]; then - bash -c "fluxd" - exit -else - bash -c "zelcashd" - exit -fi -EOF - - - sudo touch /home/$USER/stop_daemon_service.sh - sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh - cat <<'EOF' > /home/$USER/stop_daemon_service.sh -#!/bin/bash -if [[ -f /usr/local/bin/flux-cli ]]; then - bash -c "flux-cli stop" -else - bash -c "zelcash-cli stop" -fi -exit -EOF - - sudo chmod +x /home/$USER/stop_daemon_service.sh - sudo chmod +x /home/$USER/start_daemon_service.sh - -} - -function create_service() { - echo -e "${ARROW} ${YELLOW}Creating Flux daemon service...${NC}" && sleep 1 - sudo touch /etc/systemd/system/zelcash.service - sudo chown $USER:$USER /etc/systemd/system/zelcash.service - cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service - sudo systemctl daemon-reload -} - - function log_rotate() { - echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" - sleep 1 - if [ -f /etc/logrotate.d/$2 ]; then - sudo rm -rf /etc/logrotate.d/$2 - sleep 2 - fi - - sudo touch /etc/logrotate.d/$2 - sudo chown $USER:$USER /etc/logrotate.d/$2 - cat << EOF > /etc/logrotate.d/$2 -$3 { - compress - copytruncate - missingok - $4 - rotate $5 -} -EOF - sudo chown root:root /etc/logrotate.d/$2 + echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" + sleep 1 + if [ -f /etc/logrotate.d/$2 ]; then + sudo rm -rf /etc/logrotate.d/$2 + sleep 2 + fi + sudo touch /etc/logrotate.d/$2 + sudo chown $USER:$USER /etc/logrotate.d/$2 + cat <<-EOF > /etc/logrotate.d/$2 + $3 { + compress + copytruncate + missingok + $4 + rotate $5 + } + EOF + sudo chown root:root /etc/logrotate.d/$2 } - function install_mongod() { - echo - echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" - sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 - sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 - sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 - sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 - sudo systemctl enable mongod > /dev/null 2>&1 - sudo systemctl start mongod > /dev/null 2>&1 - if mongod --version > /dev/null 2>&1; then - #echo -e "${ARROW} ${CYAN}MongoDB version: ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed${NC}" - string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}MongoDB was not installed${NC}" - string_limit_x_mark "MongoDB was not installed................................." - echo - fi + echo -e "" + echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" + sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 + sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 + sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 + sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 + sudo systemctl enable mongod > /dev/null 2>&1 + sudo systemctl start mongod > /dev/null 2>&1 + if mongod --version > /dev/null 2>&1; then + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo + else + string_limit_x_mark "MongoDB was not installed................................." + echo + fi } - function install_nodejs() { - echo -e "${ARROW} ${YELLOW}Removing any instances of Nodejs...${NC}" - n-uninstall -y > /dev/null 2>&1 && sleep 1 - rm -rf ~/n - sudo apt-get remove nodejs npm nvm -y > /dev/null 2>&1 && sleep 1 - sudo apt-get purge nodejs nvm -y > /dev/null 2>&1 && sleep 1 - sudo rm -rf /usr/local/bin/npm - sudo rm -rf /usr/local/share/man/man1/node* - sudo rm -rf /usr/local/lib/dtrace/node.d - sudo rm -rf ~/.npm - sudo rm -rf ~/.nvm - sudo rm -rf ~/.pm2 - sudo rm -rf ~/.node-gyp - sudo rm -rf /opt/local/bin/node - sudo rm -rf opt/local/include/node - sudo rm -rf /opt/local/lib/node_modules - sudo rm -rf /usr/local/lib/node* - sudo rm -rf /usr/local/include/node* - sudo rm -rf /usr/local/bin/node* - echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" - #export NVM_DIR="$HOME/.nvm" && ( - # git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" > /dev/null 2>&1 - # cd "$NVM_DIR" - # git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` > /dev/null 2>&1 - #) && \. "$NVM_DIR/nvm.sh" - #cd - #curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 - curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 - . ~/.profile - . ~/.bashrc - sleep 1 - #nvm install v12.16.1 - nvm install 16 > /dev/null 2>&1 - if node -v > /dev/null 2>&1; then - #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" - string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" - string_limit_x_mark "Nodejs was not installed................................." - echo - fi + echo -e "${ARROW} ${YELLOW}Removing any instances of Nodejs...${NC}" + n-uninstall -y > /dev/null 2>&1 && sleep 1 + rm -rf ~/n + sudo apt-get remove nodejs npm nvm -y > /dev/null 2>&1 && sleep 1 + sudo apt-get purge nodejs nvm -y > /dev/null 2>&1 && sleep 1 + sudo rm -rf /usr/local/bin/npm + sudo rm -rf /usr/local/share/man/man1/node* + sudo rm -rf /usr/local/lib/dtrace/node.d + sudo rm -rf ~/.npm + sudo rm -rf ~/.nvm + sudo rm -rf ~/.pm2 + sudo rm -rf ~/.node-gyp + sudo rm -rf /opt/local/bin/node + sudo rm -rf opt/local/include/node + sudo rm -rf /opt/local/lib/node_modules + sudo rm -rf /usr/local/lib/node* + sudo rm -rf /usr/local/include/node* + sudo rm -rf /usr/local/bin/node* + echo -e "${ARROW} ${YELLOW}Nodejs installing...${NC}" + curl -SsL -m 10 https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1 + . ~/.profile + . ~/.bashrc + sleep 1 + nvm install 16 > /dev/null 2>&1 + if node -v > /dev/null 2>&1; then + string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." + echo + else + string_limit_x_mark "Nodejs was not installed................................." + echo + fi } - function check() { - cd - pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - #sleep 120 - #cd /home/$USER/zelflux - #pm2 stop flux - #npm install --legacy-peer-deps > /dev/null 2>&1 - #pm2 start flux - #cd - - NUM='400' - MSG1='Finalizing Flux installation please be patient this will take about ~5min...' - MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" - echo && spinning_timer - echo - - $BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 - - NUM='250' - MSG1='Restarting benchmark...' - MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo && echo - - echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" - echo -e "${YELLOW}======================${NC}" - bench_benchmarks=$($BENCH_CLI getbenchmarks) - - if [[ "bench_benchmarks" != "" ]]; then - bench_status=$(jq -r '.status' <<< "$bench_benchmarks") - if [[ "$bench_status" == "failed" ]]; then - echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" - check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" - check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" - else - echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" - bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") - echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" - bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") - bench_ram=$(round "$bench_ram" 2) - echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" - bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") - bench_ssd=$(round "$bench_ssd" 2) - echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" - bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") - bench_hdd=$(round "$bench_hdd" 2) - echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" - bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") - bench_ddwrite=$(round "$bench_ddwrite" 2) - echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" - bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") - bench_eps=$(round "$bench_eps" 2) - echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" - fi - else - echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" - fi + cd + pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + #sleep 120 + #cd /home/$USER/zelflux + #pm2 stop flux + #npm install --legacy-peer-deps > /dev/null 2>&1 + #pm2 start flux + #cd + NUM='300' + MSG1='Finalizing Flux installation please be patient this will take about ~5min...' + MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + echo && spinning_timer + echo + $BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 + NUM='300' + MSG1='Restarting benchmark...' + MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo + echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" + echo -e "${YELLOW}======================${NC}" + bench_benchmarks=$($BENCH_CLI getbenchmarks) + if [[ "bench_benchmarks" != "" ]]; then + bench_status=$(jq -r '.status' <<< "$bench_benchmarks") + if [[ "$bench_status" == "failed" ]]; then + echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" + check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" + check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" + else + echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" + bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") + echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" + bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") + bench_ram=$(round "$bench_ram" 2) + echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" + bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") + bench_ssd=$(round "$bench_ssd" 2) + echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" + bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") + bench_hdd=$(round "$bench_hdd" 2) + echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" + bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") + bench_ddwrite=$(round "$bench_ddwrite" 2) + echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" + bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") + bench_eps=$(round "$bench_eps" 2) + echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" + fi + else + echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" + fi } - function display_banner() { - echo -e "${BLUE}" - figlet -t -k "FLUXNODE" - figlet -t -k "INSTALLATION COMPLETED" - echo -e "${YELLOW}================================================================================================================================" - #echo -e "FLUXNODE INSTALATION COMPLITED${NC}" - #echo -e "${CYAN}COURTESY OF DK808/XK4MiLX${NC}" - echo - if pm2 -v > /dev/null 2>&1; then - pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) - if [[ "$pm2_flux_status" == "online" ]]; then - pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" - else - if [[ "$pm2_flux_status" != "" ]]; then - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" + echo -e "${BLUE}" + figlet -t -k "FLUXNODE" + figlet -t -k "INSTALLATION COMPLETED" + echo -e "${YELLOW}================================================================================================================================" + echo -e "" + if pm2 -v > /dev/null 2>&1; then + pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) + if [[ "$pm2_flux_status" == "online" ]]; then + pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" + else + if [[ "$pm2_flux_status" != "" ]]; then + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" + fi fi - fi - echo - fi - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" - echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" - echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" - echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" - echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} $1 getinfo${NC}" - echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} $1 getbenchmarks${NC}" - echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} $1 restartnodebenchmarks${NC}" - echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} $1 stop${NC}" - echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" - echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" - echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" - echo - if [[ "$WATCHDOG_INSTALL" == "1" ]]; then - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" - echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" - echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo - echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" - echo - fi - echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" - echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" - sleep 1 - cd $HOME - exec bash + echo -e "" + fi + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" + echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" + echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" + echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" + echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} $1 getinfo${NC}" + echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} $1 getbenchmarks${NC}" + echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} $1 restartnodebenchmarks${NC}" + echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} $1 stop${NC}" + echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" + echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" + echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" + echo -e "" + if [[ "$WATCHDOG_INSTALL" == "1" ]]; then + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" + echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" + echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo + echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" + echo -e "" + fi + echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" + echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" + sleep 1 + cd $HOME + exec bash } - function start_install() { - start_install=`date +%s` - sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo - - if jq --version > /dev/null 2>&1; then - echo -e "" - else - echo -e "" - echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" - sudo apt install jq -y > /dev/null 2>&1 - - if jq --version > /dev/null 2>&1; then - #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" - string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" - string_limit_x_mark "JQ was not installed................................." - echo - exit - fi - fi - if [ "$USER" = "root" ]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}root${CYAN}, please switch to the username you just created.${NC}" - sleep 4 - exit - fi - - start_dir=$(pwd) - correct_dir="/home/$USER" - echo -e "${ARROW} ${YELLOW}Checking directory....${NC}" - if [[ "$start_dir" == "$correct_dir" ]]; then - echo -e "${ARROW} ${CYAN}Correct directory ${GREEN}$(pwd)${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${ARROW} ${CYAN}Bad directory switching...${NC}" - cd - echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" - fi - sleep 1 - config_file - - if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then - import_date - else - - if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then - IMPORT_ZELCONF="1" - IMPORT_ZELID="1" - echo -e "" - echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" - zelnodeprivkey="$prvkey" - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 - zelnodeoutpoint="$outpoint" - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 - zelnodeindex="$index" - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 - - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 - fi - - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi - - echo -e "" - echo -e "${ARROW} ${YELLOW}Watchdog conf settings:${NC}" - - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 - fi - - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" && sleep 1 - - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 - fi - - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 - fi - fi - - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 - fi - - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 - fi - - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 - fi - echo -e "" - fi - fi + start_install=`date +%s` + sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo + if jq --version > /dev/null 2>&1; then + echo -e "" + else + echo -e "" + echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" + sudo apt install jq -y > /dev/null 2>&1 + if jq --version > /dev/null 2>&1; then + string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." + echo + else + string_limit_x_mark "JQ was not installed................................." + echo + exit + fi + fi + if [ "$USER" = "root" ]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}root${CYAN}, please switch to the username you just created.${NC}" + sleep 4 + exit + fi + start_dir=$(pwd) + correct_dir="/home/$USER" + echo -e "${ARROW} ${YELLOW}Checking directory....${NC}" + if [[ "$start_dir" == "$correct_dir" ]]; then + echo -e "${ARROW} ${CYAN}Correct directory ${GREEN}$(pwd)${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW} ${CYAN}Bad directory switching...${NC}" + cd + echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" + fi + sleep 1 + config_file + if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then + import_date + else + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" && "$ZELID" != "" ]]; then + IMPORT_ZELCONF="1" + IMPORT_ZELID="1" + echo -e "" + echo -e "${ARROW} ${YELLOW}Install conf settings:${NC}" + zelnodeprivkey="$prvkey" + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + zelnodeoutpoint="$outpoint" + echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + zelnodeindex="$index" + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 + fi + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 + fi + echo -e "" + echo -e "${ARROW} ${YELLOW}Watchdog conf settings:${NC}" + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 + fi + if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + fi + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 + fi + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 + fi + fi + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 + fi + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + fi + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 + fi + echo -e "" + fi + fi } - function create_swap() { - - if [[ -z "$swapon" ]]; then - #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi - else - if [[ "$swapon" == "1" ]]; then - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" - fi - fi - fi - sleep 2 + if [[ -z "$swapon" ]]; then + #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + else + echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" + fi + else + if [[ "$swapon" == "1" ]]; then + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + else + echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" + fi + fi + fi + sleep 2 } - function install_packages() { - echo - echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" - - if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then - sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 - fi - - if ! dirmngr --v > /dev/null 2>&1; then - sudo apt install dirmngr -y > /dev/null 2>&1 - fi - - sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get --with-new-pkgs upgrade -y > /dev/null 2>&1 - sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 - sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 - sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 - sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 - sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 - sudo apt-get remove sysbench -y > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" + echo -e "" + echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" + if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then + sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 + fi + if ! dirmngr --v > /dev/null 2>&1; then + sudo apt install dirmngr -y > /dev/null 2>&1 + fi + sudo apt-get install software-properties-common ca-certificates -y > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get --with-new-pkgs upgrade -y > /dev/null 2>&1 + sudo apt-get install nano htop pwgen ufw figlet tmux jq zip gzip pv unzip git -y > /dev/null 2>&1 + sudo apt-get install build-essential libtool pkg-config -y > /dev/null 2>&1 + sudo apt-get install libc6-dev m4 g++-multilib -y > /dev/null 2>&1 + sudo apt-get install autoconf ncurses-dev python python-zmq -y > /dev/null 2>&1 + sudo apt-get install wget curl bc bsdmainutils automake fail2ban -y > /dev/null 2>&1 + sudo apt-get remove sysbench -y > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Packages complete...${NC}" } - -function ip_confirm() { - WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') - fi - - if [[ "$WANIP" == "" ]]; then - echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" - echo - exit - fi - - string_limit_check_mark "IP: $WANIP ..........................................." "IP: ${GREEN}$WANIP${CYAN} ..........................................." -} - - function pm2_install(){ - tmux kill-server > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}PM2 installing...${NC}" - npm install pm2@latest -g > /dev/null 2>&1 - - if pm2 -v > /dev/null 2>&1; then - rm restart_zelflux.sh > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Configuring PM2...${NC}" - pm2 startup systemd -u $USER > /dev/null 2>&1 - sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 - pm2 start ~/$FLUX_DIR/start.sh --name flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - pm2 install pm2-logrotate > /dev/null 2>&1 - pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 - pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 - pm2 set pm2-logrotate:compress true > /dev/null 2>&1 - pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 - pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 - source ~/.bashrc - #echo -e "${ARROW} ${CYAN}PM2 version: ${GREEN}v$(pm2 -v)${CYAN} installed${NC}" - string_limit_check_mark "PM2 v$(pm2 -v) installed....................................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed....................................................." - PM2_INSTALL="1" - else - string_limit_x_mark "PM2 was not installed....................................................." - echo - fi -} - - -function install_kernel(){ - echo -e "${GREEN}Module: Install Linux Kernel 5.X for Ubuntu 18.04${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "${NC}" - echo -e "${YELLOW}Installing Linux Kernel 5.x${NC}" - sudo apt-get install --install-recommends linux-generic-hwe-18.04 -y - read -p "Would you like to reboot pc Y/N?" -n 1 -r - echo -e "${NC}" - if [[ $REPLY =~ ^[Yy]$ ]]; then - sudo reboot -n - fi + tmux kill-server > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}PM2 installing...${NC}" + npm install pm2@latest -g > /dev/null 2>&1 + if pm2 -v > /dev/null 2>&1; then + rm restart_zelflux.sh > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Configuring PM2...${NC}" + pm2 startup systemd -u $USER > /dev/null 2>&1 + sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 + pm2 start ~/$FLUX_DIR/start.sh --name flux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + pm2 install pm2-logrotate > /dev/null 2>&1 + pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 + pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 + pm2 set pm2-logrotate:compress true > /dev/null 2>&1 + pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 + pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 + source ~/.bashrc + string_limit_check_mark "PM2 v$(pm2 -v) installed....................................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed....................................................." + PM2_INSTALL="1" + else + string_limit_x_mark "PM2 was not installed....................................................." + echo + fi } - function multinode(){ - echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "" - echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" - echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" - echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" - echo -e "" - echo -e "${ARROW} ${RED}IMPORTANT:${NC}" - echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" - echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" - echo -e "" - echo -e "${YELLOW}================================================================${NC}" - echo -e "" - - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" - echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" - echo -e "" - exit - fi - - sleep 15 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) + echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + echo -e "" + echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" + echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" + echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" + echo -e "" + echo -e "${ARROW} ${RED}IMPORTANT:${NC}" + echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" + echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" + echo -e "" + echo -e "${YELLOW}================================================================${NC}" + echo -e "" + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" + echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" + echo -e "" + exit + fi + sleep 8 + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) } - function create_service_scripts() { - echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 - sudo touch /home/$USER/start_daemon_service.sh - sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - - cat <<'EOF' > /home/$USER/start_daemon_service.sh -#!/bin/bash -#color codes -RED='\033[1;31m' -CYAN='\033[1;36m' -NC='\033[0m' -#emoji codes -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -sleep 2 -echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" -echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" -bench_status_pind=$(pgrep fluxbenchd) -daemon_status_pind=$(pgrep fluxd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi -bench_status_pind=$(pgrep zelbenchd) -daemon_status_pind=$(pgrep zelcashd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi -if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd" -exit -else -bash -c "zelcashd" -exit -fi -EOF - sudo touch /home/$USER/stop_daemon_service.sh - sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh - cat <<'EOF' > /home/$USER/stop_daemon_service.sh -#!/bin/bash -if [[ -f /usr/local/bin/flux-cli ]]; then -bash -c "flux-cli stop" -else -bash -c "zelcash-cli stop" -fi -exit -EOF - - sudo chmod +x /home/$USER/stop_daemon_service.sh - sudo chmod +x /home/$USER/start_daemon_service.sh + echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 + sudo touch /home/$USER/start_daemon_service.sh + sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + cat <<-'EOF' > /home/$USER/start_daemon_service.sh + #!/bin/bash + #color codes + RED='\033[1;31m' + CYAN='\033[1;36m' + NC='\033[0m' + #emoji codes + BOOK="${RED}\xF0\x9F\x93\x8B${NC}" + WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + sleep 2 + echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" + echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" + bench_status_pind=$(pgrep fluxbenchd) + daemon_status_pind=$(pgrep fluxd) + if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then + echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" + else + if [[ "$bench_status_pind" != "" ]]; then + echo -e "${WORNING} Running benchmark process detected${NC}" + echo -e "${WORNING} Killing benchmark...${NC}" + sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 + fi + if [[ "$daemon_status_pind" != "" ]]; then + echo -e "${WORNING} Running daemon process detected${NC}" + echo -e "${WORNING} Killing daemon...${NC}" + sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 + fi + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + fi + bench_status_pind=$(pgrep zelbenchd) + daemon_status_pind=$(pgrep zelcashd) + if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then + echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" + else + if [[ "$bench_status_pind" != "" ]]; then + echo -e "${WORNING} Running benchmark process detected${NC}" + echo -e "${WORNING} Killing benchmark...${NC}" + sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 + fi + if [[ "$daemon_status_pind" != "" ]]; then + echo -e "${WORNING} Running daemon process detected${NC}" + echo -e "${WORNING} Killing daemon...${NC}" + sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 + fi + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + fi + if [[ -f /usr/local/bin/fluxd ]]; then + bash -c "fluxd" + exit + else + bash -c "zelcashd" + exit + fi + EOF + sudo touch /home/$USER/stop_daemon_service.sh + sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh + cat <<-'EOF' > /home/$USER/stop_daemon_service.sh + #!/bin/bash + if [[ -f /usr/local/bin/flux-cli ]]; then + bash -c "flux-cli stop" + else + bash -c "zelcash-cli stop" + fi + exit + EOF + sudo chmod +x /home/$USER/stop_daemon_service.sh + sudo chmod +x /home/$USER/start_daemon_service.sh } +function create_service() { -function create_oldnode_service() { - echo -e "${GREEN}Module: Flux Daemon service creator${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "" - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 - sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 - sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 - sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 - sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 - sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 - sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 - - echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 - sudo touch /etc/systemd/system/zelcash.service - sudo chown $USER:$USER /etc/systemd/system/zelcash.service - cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service + if [[ "$1" != "install" ]]; then + echo -e "${GREEN}Module: Flux Daemon service creator${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + echo -e "" + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 + sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 + fi + echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 + sudo touch /etc/systemd/system/zelcash.service + sudo chown $USER:$USER /etc/systemd/system/zelcash.service + cat <<-EOF > /etc/systemd/system/zelcash.service + [Unit] + Description=Flux daemon service + After=network.target + [Service] + Type=forking + User=$USER + Group=$USER + ExecStart=/home/$USER/start_daemon_service.sh + ExecStop=-/home/$USER/stop_daemon_service.sh + Restart=always + RestartSec=10 + PrivateTmp=true + TimeoutStopSec=60s + TimeoutStartSec=15s + StartLimitInterval=120s + StartLimitBurst=5 + [Install] + WantedBy=multi-user.target + EOF + sudo chown root:root /etc/systemd/system/zelcash.service + sudo systemctl daemon-reload } - function install_watchtower(){ - echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - echo -e "" - echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" - apps_check=$(docker ps | grep "flux_watchtower") - - if [[ "$apps_check" != "" ]]; then - echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" - docker stop flux_watchtower > /dev/null 2>&1 - sleep 2 - echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" - docker rm flux_watchtower > /dev/null 2>&1 - fi - - echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" - docker pull containrrr/watchtower:latest > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" - random=$(shuf -i 7500-35000 -n 1) - echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" - apps_id=$(docker run -d \ - --restart unless-stopped \ - --name flux_watchtower \ - -v /var/run/docker.sock:/var/run/docker.sock \ - containrrr/watchtower \ - --cleanup --interval $random 2> /dev/null) - if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then - echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" - else - echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" - fi + echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + echo -e "" + echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" + apps_check=$(docker ps | grep "flux_watchtower") + if [[ "$apps_check" != "" ]]; then + echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" + docker stop flux_watchtower > /dev/null 2>&1 + sleep 2 + echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" + docker rm flux_watchtower > /dev/null 2>&1 + fi + echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" + docker pull containrrr/watchtower:latest > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" + random=$(shuf -i 7500-35000 -n 1) + echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" + apps_id=$(docker run -d \ + --restart unless-stopped \ + --name flux_watchtower \ + -v /var/run/docker.sock:/var/run/docker.sock \ + containrrr/watchtower \ + --cleanup --interval $random 2> /dev/null) + if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then + echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" + else + echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" + fi } - function analyzer_and_fixer(){ - echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) + echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) } - - - From 11de45a82a01427a581a770b1e0fc01eddb604be Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 22 Aug 2022 10:07:20 +0200 Subject: [PATCH 0607/1176] added missing argument for create_service --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 211d9744..98fcb9e5 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1106,7 +1106,7 @@ zk_params if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then bootstrap "install" fi -create_service +create_service "install" selfhosting install_process start_daemon From a67a1988c92a1d5e75560c58c332e758bf2fad63 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 22 Aug 2022 10:15:52 +0200 Subject: [PATCH 0608/1176] Minor edit --- install_pro.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 98fcb9e5..1e2b98d0 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -971,18 +971,19 @@ function install_process() { } function install_flux() { + echo -e "${ARROW} ${YELLOW}FluxOS installing...${NC}" docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then - echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 + #echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 fi if [[ $docker_check != 0 ]]; then - echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 + #echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 echo -e "${ARROW} ${CYAN}Removing containers...${NC}" sudo service docker restart > /dev/null 2>&1 && sleep 2 docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | @@ -992,20 +993,20 @@ function install_flux() { done fi if [[ $resource_check != 0 ]]; then - echo -e "${ARROW} ${YELLOW}Detected locked resource${NC}" && sleep 1 - echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" && sleep 1 + #echo -e "${ARROW} ${YELLOW}Detected locked resource${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 df | egrep 'flux' | awk '{ print $1}' | while read line; do sudo umount -l $line && sleep 1 done fi if [ -d "./$FLUX_DIR" ]; then - echo -e "${ARROW} ${YELLOW}Removing any instances of Flux${NC}" + echo -e "${ARROW} ${YELLOW}Removing any instances of FluxOS${NC}" sudo rm -rf $FLUX_DIR fi - echo -e "${ARROW} ${YELLOW}Flux installing...${NC}" + git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Creating Flux configuration file...${NC}" + echo -e "${ARROW} ${YELLOW}Creating FluxOS configuration file...${NC}" touch ~/$FLUX_DIR/config/userconfig.js cat << EOF > ~/$FLUX_DIR/config/userconfig.js module.exports = { @@ -1019,10 +1020,10 @@ function install_flux() { EOF if [ -d ~/$FLUX_DIR ]; then current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - string_limit_check_mark "Flux v$current_ver installed................................." "Flux ${GREEN}v$current_ver${CYAN} installed................................." + string_limit_check_mark "FluxOS v$current_ver installed................................." "FluxOS ${GREEN}v$current_ver${CYAN} installed................................." echo -e "" else - string_limit_x_mark "Flux was not installed................................." + string_limit_x_mark "FluxOS was not installed................................." echo -e "" fi } From 7635532cc0ef34592ace44b23d2018ff9f5c79d9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 22 Aug 2022 10:22:34 +0200 Subject: [PATCH 0609/1176] added missing create_service_scripts --- install_pro.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_pro.sh b/install_pro.sh index 1e2b98d0..ff7f43d3 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1107,6 +1107,7 @@ zk_params if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then bootstrap "install" fi +create_service_scripts create_service "install" selfhosting install_process From 6437a9a01c13b05b1a4fd12c66c4d6fc4d702bb2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 22 Aug 2022 10:38:44 +0200 Subject: [PATCH 0610/1176] added removed space --- install_pro.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index ff7f43d3..6524572a 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -81,11 +81,11 @@ function import_date() { IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') + zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') | sed 's/ //g' echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') | sed 's/ //g' echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') | sed 's/ //g' echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" if [[ "$OLD_CONFIG" == "1" ]]; then From a92bfc7df16ceaa6618a5b0fdf1d181cb28f32cc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 22 Aug 2022 10:49:43 +0200 Subject: [PATCH 0611/1176] Fix import date --- install_pro.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 6524572a..7b10c287 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -81,11 +81,11 @@ function import_date() { IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') | sed 's/ //g' + zelnodeprivkey=$(grep -w zelnodeprivkey home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') | sed 's/ //g' + zelnodeoutpoint=$(grep -w zelnodeoutpoint home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') | sed 's/ //g' + zelnodeindex=$(grep -w zelnodeindex home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" if [[ "$OLD_CONFIG" == "1" ]]; then @@ -168,23 +168,23 @@ function import_date() { IMPORT_ZELCONF="1" echo -e "" echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" - zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" + zelnodeoutpoint=$(grep -w zelnodeoutpoint home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" + zelnodeindex=$(grep -w zelnodeindex home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" if [[ "$OLD_CONFIG" == "1" ]]; then CONFIG_DIR='.flux' CONFIG_FILE='flux.conf' fi if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + ZELID=$(grep -w zelid home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') if [[ "$ZELID" != "" ]]; then echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" IMPORT_ZELID="1" fi - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + KDA_A=$(grep -w kadena home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" fi From a14d55dba6f83b40dca608cb1cd42d9244504981 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 22 Aug 2022 10:52:06 +0200 Subject: [PATCH 0612/1176] fix path for import date --- install_pro.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 7b10c287..1313a51c 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -81,11 +81,11 @@ function import_date() { IMPORT_ZELCONF="1" echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') + zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - zelnodeoutpoint=$(grep -w zelnodeoutpoint home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') + zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - zelnodeindex=$(grep -w zelnodeindex home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') + zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" if [[ "$OLD_CONFIG" == "1" ]]; then @@ -95,13 +95,13 @@ function import_date() { if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') if [[ "$ZELID" != "" ]]; then echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" IMPORT_ZELID="1" fi - KDA_A=$(grep -w kadena ~/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" fi @@ -170,21 +170,21 @@ function import_date() { echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - zelnodeoutpoint=$(grep -w zelnodeoutpoint home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') + zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - zelnodeindex=$(grep -w zelnodeindex home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') + zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" if [[ "$OLD_CONFIG" == "1" ]]; then CONFIG_DIR='.flux' CONFIG_FILE='flux.conf' fi if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') if [[ "$ZELID" != "" ]]; then echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" IMPORT_ZELID="1" fi - KDA_A=$(grep -w kadena home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" fi From bc5b433580e995963b1e7daf0d23abad755f7d83 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 22 Aug 2022 23:43:50 +0200 Subject: [PATCH 0613/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 22f53344..6fd2f787 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1025,7 +1025,7 @@ function create_service() { sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 fi - echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 + echo -e "${ARROW} ${YELLOW}Creating Flux daemon service...${NC}" && sleep 1 sudo touch /etc/systemd/system/zelcash.service sudo chown $USER:$USER /etc/systemd/system/zelcash.service cat <<-EOF > /etc/systemd/system/zelcash.service From 0f2cb95baeffad38010ad6ad46077d71719557b9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 22 Aug 2022 23:48:45 +0200 Subject: [PATCH 0614/1176] Display correction and minor edits --- install_pro.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 1313a51c..121bb36e 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -296,7 +296,6 @@ EOF if [[ -f /home/$USER/watchdog/watchdog.js ]]; then current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." - echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 else @@ -306,7 +305,8 @@ EOF fi if whiptail --yesno "Would you like enable autoupdate?" 8 60; then flux_update='1' - daemon_update='1' + + daemon_update='1' bench_update='1' else flux_update='0' @@ -1001,12 +1001,12 @@ function install_flux() { done fi if [ -d "./$FLUX_DIR" ]; then - echo -e "${ARROW} ${YELLOW}Removing any instances of FluxOS${NC}" + echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS${NC}" sudo rm -rf $FLUX_DIR fi git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Creating FluxOS configuration file...${NC}" + echo -e "${ARROW} ${CYAN}Creating FluxOS configuration file...${NC}" touch ~/$FLUX_DIR/config/userconfig.js cat << EOF > ~/$FLUX_DIR/config/userconfig.js module.exports = { From 06e567883b9c7f259db6bb8e17f72a13892327d8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:10:19 +0200 Subject: [PATCH 0615/1176] Minor edit --- flux_common.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 6fd2f787..7d43e080 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -207,7 +207,6 @@ function cdn_speedtest() { #echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}$DOWNLOAD_URL${NC}" } function bootstrap() { - echo -e "" echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" if ! wget --version > /dev/null 2>&1 ; then sudo apt install -y wget > /dev/null 2>&1 && sleep 2 @@ -457,7 +456,7 @@ function integration_check() { echo -e "" exit fi - echo -e "" + } function config_file() { if [[ -f /home/$USER/install_conf.json ]]; then From e1f73dfba38ec792df5f6809958a240284da8d20 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 23 Aug 2022 01:42:41 +0200 Subject: [PATCH 0616/1176] added missing module info --- flux_common.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 7d43e080..5b7840f0 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -369,6 +369,17 @@ function get_ip() { fi } function selfhosting() { + if [[ "$1" != "install" ]]; then + echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + fi echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 if [[ "$1" != "install" ]]; then From 5a2e301700146e61e1d912f2c2fdb999c03f5afc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 23 Aug 2022 02:18:21 +0200 Subject: [PATCH 0617/1176] added arg for selfhosting --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 121bb36e..dd4136c6 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1109,7 +1109,7 @@ if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then fi create_service_scripts create_service "install" -selfhosting +selfhosting "install" install_process start_daemon log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" From 5b18d124cf8c736eeb7a5805960e28f6732dce3e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 23 Aug 2022 09:45:33 +0200 Subject: [PATCH 0618/1176] Minor edit --- install_pro.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index dd4136c6..460ced24 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -34,9 +34,9 @@ function config_veryfity(){ echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) if [[ "$insightexplorer" == "1" ]]; then - echo -e "${ARROW} ${CYAN}Insightexplorer enabled.............[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Insightexplorer enabled.................[${CHECK_MARK}${CYAN}]${NC}" else - echo -e "${ARROW} ${CYAN}Insightexplorer enabled.............[${X_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Insightexplorer enabled.................[${X_MARK}${CYAN}]${NC}" echo -e "${ARROW} ${CYAN}Removing wallet.dat...${NC}" echo -e "${ARROW} ${CYAN}Use old chain will be skipped...${NC}" sudo rm -rf /home/$USER/$CONFIG_DIR/wallet.dat && sleep 1 @@ -158,7 +158,6 @@ function import_date() { fi else if [[ "$import_settings" == "1" ]]; then - OLD_CONFIG=0 if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' From f19c4def148f0a966c9e885bd566260d59c43871 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 23 Aug 2022 10:08:30 +0200 Subject: [PATCH 0619/1176] Removed duplicate message --- flux_common.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 5b7840f0..4fe7ffca 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -115,7 +115,7 @@ function spinning_timer() { echo -ne "${MSG2}" } function tar_file_unpack() { - echo -e "${ARROW} ${CYAN}Unpacking bootstrap archive file...${NC}" + echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" pv $1 | tar -zx -C $2 } function check_tar() { @@ -248,13 +248,11 @@ function bootstrap() { fi echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" else DOWNLOAD_URL="$bootstrap_url" echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" fi if [[ -z "$bootstrap_zip_del" ]]; then From 1f4926b18a359fb4cf494e7db9abe7449e442ab2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 23 Aug 2022 10:30:04 +0200 Subject: [PATCH 0620/1176] Changed watchdog installation info --- install_pro.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 460ced24..8abfd856 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -233,16 +233,16 @@ function import_date() { } function install_watchdog() { - echo -e "${ARROW} ${YELLOW}Install watchdog for FluxNode${NC}" + echo -e "${ARROW} ${YELLOW}Watchdog installing...${NC}" if pm2 -v > /dev/null 2>&1; then WATCHDOG_INSTALL="1" - echo -e "${ARROW} ${CYAN}Downloading...${NC}" + #echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" + #echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge - echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" + #echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" cd watchdog && npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating config file....${NC}" fix_action='1' From 0e64267b97db5bc45d92baedcc5ee8836bcfd00d Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 11:32:22 +0200 Subject: [PATCH 0621/1176] cleanup and improvement - changed installation information - import date improvement - minor edits --- flux_common.sh | 20 ++++------ install_pro.sh | 102 ++++++++++++++++++++++++------------------------- 2 files changed, 58 insertions(+), 64 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 4fe7ffca..b1740e62 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -371,11 +371,11 @@ function selfhosting() { echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit fi fi echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" @@ -495,13 +495,14 @@ function config_file() { echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else if [[ "$import_settings" == "1" ]]; then - echo -e "${PIN}${CYAN} Import settings from Flux........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Import installation configurations........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi fi + if [[ "$use_old_chain" == "1" ]]; then echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else - if [[ "$bootstrap_url" == "0" ]]; then + if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...........[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -835,8 +836,6 @@ function create_swap() { sudo swapon /swapfile > /dev/null 2>&1 echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" fi else if [[ "$swapon" == "1" ]]; then @@ -858,15 +857,12 @@ function create_swap() { sudo swapon /swapfile > /dev/null 2>&1 echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - else - echo -e "${ARROW} ${YELLOW}Creating a swapfile skipped...${NC}" fi fi fi sleep 2 } function install_packages() { - echo -e "" echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" if [[ $(lsb_release -d) = *Debian* ]] && [[ $(lsb_release -d) = *9* ]]; then sudo apt-get install dirmngr apt-transport-https -y > /dev/null 2>&1 diff --git a/install_pro.sh b/install_pro.sh index 8abfd856..f28227a6 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -69,6 +69,8 @@ function pm2_install(){ function import_date() { + echo -e "$import_settings" + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then if [[ -z "$import_settings" ]]; then if whiptail --yesno "Would you like to import data from Flux config files Y/N?" 8 60; then @@ -87,73 +89,69 @@ function import_date() { echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" - if [[ "$OLD_CONFIG" == "1" ]]; then CONFIG_DIR='.flux' CONFIG_FILE='flux.conf' fi - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') if [[ "$ZELID" != "" ]]; then echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" IMPORT_ZELID="1" fi - KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" fi - - if [[ -f /home/$USER/watchdog/config.js ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" - fi - - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - fi - - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + fi + if [[ -f /home/$USER/watchdog/config.js ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" + fi + + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + fi + + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" + fi + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" - fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" - fi - fi - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" - fi - - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" - fi - - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" - fi - fi - fi + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" + fi + fi + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" + fi + + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" + fi + + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" + fi + fi + fi fi else @@ -228,7 +226,7 @@ function import_date() { fi fi fi - sleep 3 + sleep 2 echo -e "" } From 1ec6b514964b75dce3b84fab52a8287abbcddec5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 11:47:56 +0200 Subject: [PATCH 0622/1176] fix import date function --- install_pro.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index f28227a6..1a3578a4 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -152,11 +152,10 @@ function import_date() { fi fi - fi - fi - else - if [[ "$import_settings" == "1" ]]; then - OLD_CONFIG=0 + fi + else + if [[ "$import_settings" == "1" ]]; then + OLD_CONFIG=0 if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' CONFIG_FILE='zelcash.conf' From b49cc1bfbb60f38ea99ab390458cf1dfdca73da4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 11:54:13 +0200 Subject: [PATCH 0623/1176] import date improvement and fix --- install_pro.sh | 132 ++++++++++++++++++++++++------------------------- 1 file changed, 65 insertions(+), 67 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 1a3578a4..e032d523 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -68,9 +68,6 @@ function pm2_install(){ } function import_date() { - - echo -e "$import_settings" - if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then if [[ -z "$import_settings" ]]; then if whiptail --yesno "Would you like to import data from Flux config files Y/N?" 8 60; then @@ -151,81 +148,82 @@ function import_date() { echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" fi fi - fi else if [[ "$import_settings" == "1" ]]; then OLD_CONFIG=0 - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - OLD_CONFIG=1 - fi - IMPORT_ZELCONF="1" - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" - if [[ "$OLD_CONFIG" == "1" ]]; then - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' - fi - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" - IMPORT_ZELID="1" - fi - KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" - fi - fi - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" - fi - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + OLD_CONFIG=1 + fi + IMPORT_ZELCONF="1" + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" + zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" + zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" + if [[ "$OLD_CONFIG" == "1" ]]; then + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' + fi + if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" + IMPORT_ZELID="1" + fi + KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" + fi + fi + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" - fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" + fi + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + fi + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" + fi + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" + fi + fi + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" fi + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" + fi + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" + fi fi - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" - fi - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" - fi - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" - fi fi fi - sleep 2 echo -e "" } From 9be864b968d705077b54d15574183e078a54e48d Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 12:16:54 +0200 Subject: [PATCH 0624/1176] fix status of watchdog notification --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index b1740e62..9528b234 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -495,7 +495,7 @@ function config_file() { echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else if [[ "$import_settings" == "1" ]]; then - echo -e "${PIN}${CYAN} Import installation configurations........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Import installation configurations...............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi fi @@ -513,7 +513,7 @@ function config_file() { echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi fi - if [[ "$discord" != "" || "$telegram_alert" == '1' ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]] || [[ "$telegram_alert" == '1' ]]; then echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 From 1efacb30fcbc09d7b3c5670130f9ddb3fceafb31 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 12:19:01 +0200 Subject: [PATCH 0625/1176] display correction --- install_pro.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index e032d523..3022c07a 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -570,7 +570,6 @@ function wipe_clean() { sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 - echo -e "" echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 if [[ $(sudo ufw status | grep "Status: active") ]]; then sudo ufw disable > /dev/null 2>&1 From 15c318a84199def904c651943e5d18d2a59b8782 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 12:23:19 +0200 Subject: [PATCH 0626/1176] changed display color --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 3022c07a..922594ca 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -49,7 +49,7 @@ function pm2_install(){ echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" npm install pm2@latest -g > /dev/null 2>&1 if pm2 -v > /dev/null 2>&1; then - echo -e "${ARROW} ${YELLOW}Configuring PM2...${NC}" + echo -e "${ARROW} ${CYAN}Configuring PM2...${NC}" pm2 startup systemd -u $USER > /dev/null 2>&1 sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 pm2 install pm2-logrotate > /dev/null 2>&1 From ebc2b02d4b7c3529a885308ea30cecd2ec0697eb Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 12:36:32 +0200 Subject: [PATCH 0627/1176] fixed problem when get_ip return htmlheadtitle429TooManyRequeststitleheadbodyce --- flux_common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 9528b234..2a7b566c 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -351,14 +351,14 @@ function start_service() { } function get_ip() { WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - if [[ "$WANIP" == "" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *htmlhead* ]]; then WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') fi - if [[ "$WANIP" == "" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *htmlhead* ]]; then WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') fi if [[ "$1" == "install" ]]; then - if [[ "$WANIP" == "" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *htmlhead* ]]; then echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" echo exit From e4e542bbfcc1bef1da453d382d2c4fbde28b7a81 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 15:26:10 +0200 Subject: [PATCH 0628/1176] added check for watchdog config file --- install_pro.sh | 89 +++++++++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 51 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 922594ca..fd893e16 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,6 +1,5 @@ #!/bin/bash source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" - #wallet information COIN_NAME='flux' CONFIG_DIR='.flux' @@ -28,7 +27,6 @@ ZELNODEPORT=16128 RPCPORT=16124 PORT=16125 - function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" @@ -44,7 +42,6 @@ function config_veryfity(){ fi fi } - function pm2_install(){ echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" npm install pm2@latest -g > /dev/null 2>&1 @@ -66,7 +63,6 @@ function pm2_install(){ echo -e "" fi } - function import_date() { if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then if [[ -z "$import_settings" ]]; then @@ -181,52 +177,53 @@ function import_date() { echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" fi fi - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" - fi - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - fi - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + if [[ -f /home/$USER/watchdog/config.js ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" - fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" + fi + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + fi + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" + fi + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" + fi + fi + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" fi - fi - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" - fi - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" - fi - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" - fi + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" + fi + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" + fi + fi fi fi fi echo -e "" } - function install_watchdog() { echo -e "${ARROW} ${YELLOW}Watchdog installing...${NC}" if pm2 -v > /dev/null 2>&1; then @@ -454,7 +451,6 @@ EOF string_limit_x_mark "Watchdog was not installed................................." fi } - function wipe_clean() { echo -e "${ARROW} ${YELLOW}Removing any instances of FluxNode${NC}" apt_number=$(ps aux | grep 'apt' | wc -l) @@ -578,7 +574,6 @@ function wipe_clean() { echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" fi } - function spinning_timer() { animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) end=$((SECONDS+NUM)) @@ -593,7 +588,6 @@ function spinning_timer() { done echo -ne "${MSG2}" } - function ssh_port() { if [[ -z "$ssh_port" ]]; then SSHPORT=$(grep -w Port /etc/ssh/sshd_config | sed -e 's/.*Port //') @@ -610,7 +604,6 @@ function ssh_port() { fi fi } - function create_conf() { echo -e "${ARROW} ${YELLOW}Creating Flux daemon config file...${NC}" @@ -783,7 +776,6 @@ EOF done fi } - function install_daemon() { sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 sudo rm /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 @@ -835,7 +827,6 @@ function install_daemon() { fi fi } - function basic_security() { echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" sudo ufw allow "$SSHPORT"/tcp > /dev/null 2>&1 @@ -854,7 +845,6 @@ function basic_security() { sudo systemctl enable fail2ban > /dev/null 2>&1 sudo systemctl start fail2ban > /dev/null 2>&1 } - function start_daemon() { sudo systemctl enable zelcash.service > /dev/null 2>&1 sudo systemctl start zelcash > /dev/null 2>&1 @@ -913,7 +903,6 @@ function start_daemon() { fi fi } - function install_process() { echo -e "${ARROW} ${YELLOW}Configuring firewall...${NC}" sudo ufw allow $ZELFRONTPORT/tcp > /dev/null 2>&1 @@ -962,7 +951,6 @@ function install_process() { install_flux sleep 2 } - function install_flux() { echo -e "${ARROW} ${YELLOW}FluxOS installing...${NC}" docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) @@ -1020,7 +1008,6 @@ EOF echo -e "" fi } - function status_loop() { network_height_01=$(curl -sk -m 10 https://blockbook.zel.network/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) network_height_02=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) From 58c4fdb4322aa1edd52fcaa6a68978db094a1eeb Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 23:18:59 +0200 Subject: [PATCH 0629/1176] Minor edits --- flux_common.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 2a7b566c..bf27a3fe 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -222,7 +222,7 @@ function bootstrap() { if [[ "$Mode" != "install" ]]; then start_service if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - sudo rm -rf $FILE_PATH > /dev/null 2>&1 && sleep 2 + sudo rm -rf $FILE_PATH > /dev/null 2>&1 && sleep 2 fi fi return @@ -320,7 +320,7 @@ function bootstrap_local() { check_tar "$FILE_PATH" if [ -f "$FILE_PATH" ]; then if [[ "$Mode" != "install" ]]; then - stop_service + stop_service fi tar_file_unpack "$FILE_PATH" "/home/$USER/$CONFIG_DIR" fi @@ -503,11 +503,11 @@ function config_file() { echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then - echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in scripts...........[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in script............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi - if [[ "$bootstrap_zip_del" == "1" ]]; then + if [[ "$bootstrap_zip_del" == "1" || -z "$bootstrap_zip_del" ]]; then echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -1104,3 +1104,5 @@ function analyzer_and_fixer(){ fi bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) } + + From 4c34c4d3d3eea7ddd7606eba0054cb1c16875b51 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 23:19:25 +0200 Subject: [PATCH 0630/1176] formatting --- apps_info.sh | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/apps_info.sh b/apps_info.sh index 5bdccb86..e39a9ec1 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -1,5 +1,4 @@ #!/bin/bash - if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" @@ -12,46 +11,36 @@ if ! [[ -z $1 ]]; then else export ROOT_BRANCH='master' fi - source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" - - apps_info=$(curl -SsL -m 10 https://api.runonflux.io/apps/globalappsspecifications) name=($(jq -r .data[].name <<< "$apps_info")) height=($(jq -r .data[].height <<< "$apps_info")) - network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') explorer_network_hight=$(max "$network_height_01" "$network_height_03") - echo -e "" echo -e "Apps count: ${#name[@]}" echo -e "-------------------------------------" - for((i=0;i<${#name[@]};i++)); do - expire=$((${height[i]}+22000)) - block_diff=$((expire-explorer_network_hight)) - if [[ "$1" =~ '^[0-9]+$' ]]; then - block_limit="$1" - else - block_limit="1000" - fi - - - if [[ "$block_diff" -le "$block_limit" ]]; then - echo -e "Apps name: ${name[i]}" - echo -e "Registered height: ${height[i]}" - echo -e "Expire height: $expire" - if [[ "$block_diff" -gt "0" ]]; then - echo -e "Block till expire: $block_diff" - else - echo -e "Info: Apps expired!" - fi - echo -e "-------------------------------------" - fi - + expire=$((${height[i]}+22000)) + block_diff=$((expire-explorer_network_hight)) + if [[ "$1" =~ '^[0-9]+$' ]]; then + block_limit="$1" + else + block_limit="1000" + fi + if [[ "$block_diff" -le "$block_limit" ]]; then + echo -e "Apps name: ${name[i]}" + echo -e "Registered height: ${height[i]}" + echo -e "Expire height: $expire" + if [[ "$block_diff" -gt "0" ]]; then + echo -e "Block till expire: $block_diff" + else + echo -e "Info: Apps expired!" + fi + echo -e "-------------------------------------" + fi done - unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED \ No newline at end of file From 1e86a8951b2bae4456c6dd40483936cc8029b49f Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 23:19:45 +0200 Subject: [PATCH 0631/1176] formatting --- cdn-speedtest.sh | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index 7d36dd39..42546feb 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -1,6 +1,5 @@ #!/bin/bash -################################################################################################################################ # Usage: # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "<test_time_in_s>" "<file_name>" "<array_url_list_via_export>" # @@ -13,39 +12,32 @@ # # Example 3 ( for testing cdn with default settings ) # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) -################################################################################################################################ #color codes YELLOW='\033[1;33m' GREEN='\033[1;32m' CYAN='\033[1;36m' NC='\033[0m' - #emoji codes ARROW="${SEA}\xE2\x96\xB6${NC}" RIGHT_ANGLE="${GREEN}\xE2\x88\x9F${NC}" CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" - #global variable -server_offline="0" failed_counter="0" if ! bc -v > /dev/null 2>&1 ; then sudo apt install -y bc > /dev/null 2>&1 && sleep 1 fi - if [[ -z $1 ]]; then dTime="5" else dTime="$1" fi - if [[ -z $2 || "$2" == "0" ]]; then BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" else BOOTSTRAP_FILE="$2" fi - if [[ -z $3 ]]; then rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") else @@ -55,7 +47,6 @@ else rand_by_domain=("$@") custom_url="1" fi - size_list=() i=0 len=${#rand_by_domain[@]} @@ -64,13 +55,12 @@ start_test=`date +%s` while [ $i -lt $len ]; do if [[ "$custom_url" == "1" ]]; then - testing=$(curl -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + testing=$(curl -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) else - testing=$(curl -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + testing=$(curl -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) fi testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') mb=$(bc <<<"scale=2; $testing_size / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') - if [[ "$custom_url" == "1" ]]; then domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${rand_by_domain[$i]}) echo -e " ${RIGHT_ANGLE} ${GREEN}URL - ${YELLOW}${domain}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" @@ -83,22 +73,17 @@ do fi i=$(($i+1)) done - rServerList=$((${#size_list[@]}-$failed_counter)) echo -e "${ARROW} ${CYAN}Valid servers: ${GREEN}${rServerList} ${CYAN}- Duration: ${GREEN}$((($(date +%s)-$start_test)/60)) min. $((($(date +%s)-$start_test) % 60)) sec.${NC}" sudo rm -rf testspeed > /dev/null 2>&1 - if [[ "$rServerList" == "0" ]]; then - server_offline="1" exit fi - arr_max=$(printf '%s\n' "${size_list[@]}" | sort -n | tail -1) for i in "${!size_list[@]}"; do [[ "${size_list[i]}" == "$arr_max" ]] && max_indexes+=($i) done - server_index=${rand_by_domain[${max_indexes[0]}]} if [[ "$custom_url" == "1" ]]; then BOOTSTRAP_URL="$server_index" @@ -106,7 +91,6 @@ else BOOTSTRAP_URL="http://cdn-${server_index}.runonflux.io/apps/fluxshare/getfile/" fi DOWNLOAD_URL="${BOOTSTRAP_URL}${BOOTSTRAP_FILE}" - mb=$(bc <<<"scale=2; $arr_max / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') if [[ "$custom_url" == "1" ]]; then domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${server_index}) From 579021913a2551a0c5c99e1accc0edb331bf310b Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Tue, 23 Aug 2022 23:20:30 +0200 Subject: [PATCH 0632/1176] formatting --- multinode.sh | 101 ++++++++++++++++++--------------------------------- 1 file changed, 35 insertions(+), 66 deletions(-) diff --git a/multinode.sh b/multinode.sh index e4ac65ce..615aa3a8 100644 --- a/multinode.sh +++ b/multinode.sh @@ -4,17 +4,14 @@ source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/flu function upnp_enable() { -try="0" - - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + try="0" + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" echo -e "" exit - fi - - while true - do - + fi + while true + do echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" # Check if upnp_port is set if [[ -z "$upnp_port" ]]; then @@ -22,14 +19,10 @@ try="0" else FLUX_PORT=$(echo $upnp_port) fi - if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then - string_limit_check_mark "Port is valid..........................................." break - - else - + else string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." sleep 1 try=$(($try+1)) @@ -37,33 +30,24 @@ try="0" echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" echo -e "" exit - fi - + fi fi done - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then - - sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js - - if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" - fi - + sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + fi else - insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ -d /home/$USER/.fluxbenchmark ]]; then sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null else echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null fi - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" @@ -71,12 +55,9 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then sudo ufw allow $FLUX_PORT > /dev/null 2>&1 #HOME UI PORT sudo ufw allow $(($FLUX_PORT-1)) > /dev/null 2>&1 - - #if ! route -h > /dev/null 2>&1 ; then # sudo apt install net-tools > /dev/null 2>&1 #fi - #router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) if [[ -z "$gateway_ip" ]]; then router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) @@ -128,17 +109,14 @@ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then while true do - - router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) - - if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then - echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - string_limit_x_mark "IP $router_ip is not valid ..............................." - sleep 1 - fi - + router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) + if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then + echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + string_limit_x_mark "IP $router_ip is not valid ..............................." + sleep 1 + fi done sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 @@ -198,28 +176,22 @@ function upnp_disable() { } if [[ -f /home/$USER/install_conf.json ]]; then - # Import settings from upnp_conf.json - import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') - - if [[ "$import_settings" == "1" ]]; then + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + if [[ "$import_settings" == "1" ]]; then echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 0.5 - enable_upnp=$(cat /home/$USER/install_conf.json | jq -r '.enable_upnp') upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') - if [[ -n $enable_upnp && "$enable_upnp" != "" && "$enable_upnp" != "0" ]]; then - echo -e "${PIN}${CYAN} UPnP state = ${GREEN}Enable${NC}" && sleep 0.5 + echo -e "${PIN}${CYAN} UPnP state = ${GREEN}Enable${NC}" && sleep 0.5 else - echo -e "${PIN}${CYAN} UPnP state = ${RED}Disable${NC}" && sleep 0.5 + echo -e "${PIN}${CYAN} UPnP state = ${RED}Disable${NC}" && sleep 0.5 fi - if [[ -n $upnp_port && "$upnp_port" != "" && "$upnp_port" != "0" ]]; then - echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" && sleep 0.5 + echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" && sleep 0.5 else - echo -e "${PIN}${CYAN} UPnP port = ${RED}NULL${NC}" && sleep 0.5 + echo -e "${PIN}${CYAN} UPnP port = ${RED}NULL${NC}" && sleep 0.5 fi - if [[ -n $gateway_ip && "$gateway_ip" != "" && "$gateway_ip" != "0" ]]; then echo -e "${PIN}${CYAN} Gateway = ${GREEN}$gateway_ip${NC}" && sleep 0.5 else @@ -229,24 +201,21 @@ if [[ -f /home/$USER/install_conf.json ]]; then fi fi - if [[ -z $enable_upnp ]]; then - CHOICE=$( -whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ -"1)" "Enable UPnP Mode" \ -"2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 + CHOICE=$( + whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ + "1)" "Enable UPnP Mode" \ + "2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 ) else - # if enable_upnp is 1 then set choice to 1 else set choice to 2 - if [[ "$enable_upnp" == "1" ]]; then - CHOICE="1)" - else - CHOICE="2)" - fi + # if enable_upnp is 1 then set choice to 1 else set choice to 2 + if [[ "$enable_upnp" == "1" ]]; then + CHOICE="1)" + else + CHOICE="2)" + fi fi - - case $CHOICE in "1)") upnp_enable From f4dc836fe1f9653f5427dd98cb9bf484e421d4dd Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Wed, 24 Aug 2022 12:35:31 +0200 Subject: [PATCH 0633/1176] formatting and improvement --- install_pro.sh | 391 +++++++++++++++++++++++-------------------------- multinode.sh | 240 ++++++++++++++---------------- 2 files changed, 294 insertions(+), 337 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index fd893e16..9f7ab326 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -26,7 +26,173 @@ ZELNODEPORT=16128 #MDBPORT=27017 RPCPORT=16124 PORT=16125 - +#explorer networks +network_url_1="explorer.zelcash.online" +#network_url_2="explorer.runonflux.io" +network_url_3="blockbook.zel.network" +##### Config layout section ###################################### +function watchdog_conf(){ + sudo touch /home/$USER/watchdog/config.js + sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat << EOF > /home/$USER/watchdog/config.js + module.exports = { + label: '${node_label}', + tier_eps_min: '${eps_limit}', + zelflux_update: '${flux_update}', + zelcash_update: '${daemon_update}', + zelbench_update: '${bench_update}', + action: '${fix_action}', + ping: '${ping}', + web_hook_url: '${discord}', + telegram_alert: '${telegram_alert}', + telegram_bot_token: '${telegram_bot_token}', + telegram_chat_id: '${telegram_chat_id}' + } +EOF +} +function fluxOS_conf(){ + touch /home/$USER/$FLUX_DIR/config/userconfig.js + cat << EOF > /home/$USER/$FLUX_DIR/config/userconfig.js + module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${ZELID}', + kadena: '${KDA_A}', + testnet: false + } + } +EOF +} +function flux_daemon_conf() { + touch /home/$USER/$CONFIG_DIR/$CONFIG_FILE + cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE + rpcuser=$RPCUSER + rpcpassword=$PASSWORD + rpcallowip=127.0.0.1 + rpcallowip=172.18.0.1 + rpcport=$RPCPORT + port=$PORT + zelnode=1 + zelnodeprivkey=$zelnodeprivkey + zelnodeoutpoint=$zelnodeoutpoint + zelnodeindex=$zelnodeindex + server=1 + daemon=1 + txindex=1 + addressindex=1 + timestampindex=1 + spentindex=1 + insightexplorer=1 + experimentalfeatures=1 + listen=1 + externalip=$WANIP + bind=0.0.0.0 + addnode=80.211.207.17 + addnode=95.217.12.176 + addnode=89.58.3.209 + addnode=161.97.85.103 + addnode=194.163.176.185 + addnode=explorer.flux.zelcore.io + addnode=explorer.runonflux.io + addnode=explorer.zelcash.online + addnode=blockbook.runonflux.io + addnode=202.61.202.21 + addnode=89.58.40.172 + addnode=37.120.176.206 + addnode=66.119.15.83 + addnode=66.94.118.208 + addnode=99.48.162.169 + addnode=97.120.40.143 + addnode=99.48.162.167 + addnode=108.30.50.162 + addnode=154.12.242.89 + addnode=67.43.96.139 + addnode=66.94.107.219 + addnode=66.94.110.117 + addnode=154.12.225.203 + addnode=176.9.72.41 + addnode=65.108.198.119 + addnode=65.108.200.110 + addnode=46.38.251.110 + addnode=95.214.55.47 + addnode=202.61.236.202 + addnode=65.108.141.153 + addnode=178.170.46.91 + addnode=66.119.15.64 + addnode=65.108.46.178 + addnode=94.130.220.41 + addnode=178.170.48.110 + addnode=78.35.147.57 + addnode=66.119.15.101 + addnode=66.119.15.96 + addnode=38.88.125.25 + addnode=66.119.15.110 + addnode=103.13.31.149 + addnode=212.80.212.238 + addnode=212.80.213.172 + addnode=212.80.212.228 + addnode=121.112.224.186 + addnode=114.181.141.16 + addnode=167.179.115.100 + addnode=153.226.219.80 + addnode=24.79.73.50 + addnode=76.68.219.102 + addnode=70.52.20.8 + addnode=184.145.181.147 + addnode=68.150.72.135 + addnode=198.27.83.181 + addnode=167.114.82.63 + addnode=24.76.166.6 + addnode=173.33.170.150 + addnode=99.231.229.245 + addnode=70.82.102.140 + addnode=192.95.30.188 + addnode=75.158.245.77 + addnode=142.113.239.49 + addnode=66.70.176.241 + addnode=174.93.146.224 + addnode=216.232.124.38 + addnode=207.34.248.197 + addnode=76.68.219.102 + addnode=149.56.25.82 + addnode=74.57.74.166 + addnode=142.169.180.47 + addnode=70.67.210.148 + addnode=86.5.78.14 + addnode=87.244.105.94 + addnode=86.132.192.193 + addnode=86.27.168.85 + addnode=86.31.168.107 + addnode=84.71.79.220 + addnode=154.57.235.104 + addnode=86.13.102.145 + addnode=86.31.168.107 + addnode=86.13.68.100 + addnode=151.225.136.163 + addnode=5.45.110.123 + addnode=45.142.178.251 + addnode=89.58.5.234 + addnode=45.136.30.81 + addnode=202.61.255.238 + addnode=89.58.7.2 + addnode=89.58.36.46 + addnode=89.58.32.76 + addnode=89.58.39.81 + addnode=89.58.39.153 + addnode=202.61.244.71 + addnode=89.58.37.172 + addnode=89.58.36.118 + addnode=31.145.161.44 + addnode=217.131.61.221 + addnode=80.28.72.254 + addnode=85.49.210.36 + addnode=84.77.69.203 + addnode=51.38.1.195 + addnode=51.38.1.194 + maxconnections=256 +EOF +} +################################################################## function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" @@ -228,62 +394,27 @@ function install_watchdog() { echo -e "${ARROW} ${YELLOW}Watchdog installing...${NC}" if pm2 -v > /dev/null 2>&1; then WATCHDOG_INSTALL="1" - #echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 - #echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge - #echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" cd watchdog && npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating config file....${NC}" fix_action='1' if [[ "$import_settings" == "0" && -f /home/$USER/install_conf.json ]]; then - sudo touch /home/$USER/watchdog/config.js - sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat << EOF > /home/$USER/watchdog/config.js -module.exports = { - label: '${node_label}', - tier_eps_min: '${eps_limit}', - zelflux_update: '${flux_update}', - zelcash_update: '${daemon_update}', - zelbench_update: '${bench_update}', - action: '${fix_action}', - ping: '${ping}', - web_hook_url: '${discord}', - telegram_alert: '${telegram_alert}', - telegram_bot_token: '${telegram_bot_token}', - telegram_chat_id: '${telegram_chat_id}' -} -EOF + watchdog_conf if [[ -f /home/$USER/watchdog/watchdog.js ]]; then current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 else - string_limit_x_mark "Watchdog was not installed................................." + string_limit_x_mark "Watchdog was not installed................................." fi return fi if [[ "$IMPORT_ZELCONF" == "1" ]]; then - sudo touch /home/$USER/watchdog/config.js - sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat << EOF > /home/$USER/watchdog/config.js -module.exports = { - label: '${node_label}', - tier_eps_min: '${eps_limit}', - zelflux_update: '${flux_update}', - zelcash_update: '${daemon_update}', - zelbench_update: '${bench_update}', - action: '${fix_action}', - ping: '${ping}', - web_hook_url: '${discord}', - telegram_alert: '${telegram_alert}', - telegram_bot_token: '${telegram_bot_token}', - telegram_chat_id: '${telegram_chat_id}' -} -EOF + watchdog_conf if [[ -f /home/$USER/watchdog/watchdog.js ]]; then current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." @@ -296,8 +427,7 @@ EOF fi if whiptail --yesno "Would you like enable autoupdate?" 8 60; then flux_update='1' - - daemon_update='1' + daemon_update='1' bench_update='1' else flux_update='0' @@ -407,9 +537,9 @@ EOF if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -s -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -s -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi fi if [[ $stak_info == ?(-)+([0-9]) ]]; then @@ -422,23 +552,7 @@ EOF else eps_limit=0; fi - sudo touch /home/$USER/watchdog/config.js - sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat << EOF > /home/$USER/watchdog/config.js -module.exports = { - label: '${node_label}', - tier_eps_min: '${eps_limit}', - zelflux_update: '${flux_update}', - zelcash_update: '${daemon_update}', - zelbench_update: '${bench_update}', - action: '${fix_action}', - ping: '${ping}', - web_hook_url: '${discord}', - telegram_alert: '${telegram_alert}', - telegram_bot_token: '${telegram_bot_token}', - telegram_chat_id: '${telegram_chat_id}' -} -EOF + watchdog_conf pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 if [[ -f /home/$USER/watchdog/watchdog.js ]]; then @@ -621,134 +735,8 @@ function create_conf() { if [ "x$PASSWORD" = "x" ]; then PASSWORD=${WANIP}-$(date +%s) fi - mkdir ~/$CONFIG_DIR > /dev/null 2>&1 - touch ~/$CONFIG_DIR/$CONFIG_FILE - cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE - rpcuser=$RPCUSER - rpcpassword=$PASSWORD - rpcallowip=127.0.0.1 - rpcallowip=172.18.0.1 - rpcport=$RPCPORT - port=$PORT - zelnode=1 - zelnodeprivkey=$zelnodeprivkey - zelnodeoutpoint=$zelnodeoutpoint - zelnodeindex=$zelnodeindex - server=1 - daemon=1 - txindex=1 - addressindex=1 - timestampindex=1 - spentindex=1 - insightexplorer=1 - experimentalfeatures=1 - listen=1 - externalip=$WANIP - bind=0.0.0.0 - addnode=80.211.207.17 - addnode=95.217.12.176 - addnode=89.58.3.209 - addnode=161.97.85.103 - addnode=194.163.176.185 - addnode=explorer.flux.zelcore.io - addnode=explorer.runonflux.io - addnode=explorer.zelcash.online - addnode=blockbook.runonflux.io - addnode=202.61.202.21 - addnode=89.58.40.172 - addnode=37.120.176.206 - addnode=66.119.15.83 - addnode=66.94.118.208 - addnode=99.48.162.169 - addnode=97.120.40.143 - addnode=99.48.162.167 - addnode=108.30.50.162 - addnode=154.12.242.89 - addnode=67.43.96.139 - addnode=66.94.107.219 - addnode=66.94.110.117 - addnode=154.12.225.203 - addnode=176.9.72.41 - addnode=65.108.198.119 - addnode=65.108.200.110 - addnode=46.38.251.110 - addnode=95.214.55.47 - addnode=202.61.236.202 - addnode=65.108.141.153 - addnode=178.170.46.91 - addnode=66.119.15.64 - addnode=65.108.46.178 - addnode=94.130.220.41 - addnode=178.170.48.110 - addnode=78.35.147.57 - addnode=66.119.15.101 - addnode=66.119.15.96 - addnode=38.88.125.25 - addnode=66.119.15.110 - addnode=103.13.31.149 - addnode=212.80.212.238 - addnode=212.80.213.172 - addnode=212.80.212.228 - addnode=121.112.224.186 - addnode=114.181.141.16 - addnode=167.179.115.100 - addnode=153.226.219.80 - addnode=24.79.73.50 - addnode=76.68.219.102 - addnode=70.52.20.8 - addnode=184.145.181.147 - addnode=68.150.72.135 - addnode=198.27.83.181 - addnode=167.114.82.63 - addnode=24.76.166.6 - addnode=173.33.170.150 - addnode=99.231.229.245 - addnode=70.82.102.140 - addnode=192.95.30.188 - addnode=75.158.245.77 - addnode=142.113.239.49 - addnode=66.70.176.241 - addnode=174.93.146.224 - addnode=216.232.124.38 - addnode=207.34.248.197 - addnode=76.68.219.102 - addnode=149.56.25.82 - addnode=74.57.74.166 - addnode=142.169.180.47 - addnode=70.67.210.148 - addnode=86.5.78.14 - addnode=87.244.105.94 - addnode=86.132.192.193 - addnode=86.27.168.85 - addnode=86.31.168.107 - addnode=84.71.79.220 - addnode=154.57.235.104 - addnode=86.13.102.145 - addnode=86.31.168.107 - addnode=86.13.68.100 - addnode=151.225.136.163 - addnode=5.45.110.123 - addnode=45.142.178.251 - addnode=89.58.5.234 - addnode=45.136.30.81 - addnode=202.61.255.238 - addnode=89.58.7.2 - addnode=89.58.36.46 - addnode=89.58.32.76 - addnode=89.58.39.81 - addnode=89.58.39.153 - addnode=202.61.244.71 - addnode=89.58.37.172 - addnode=89.58.36.118 - addnode=31.145.161.44 - addnode=217.131.61.221 - addnode=80.28.72.254 - addnode=85.49.210.36 - addnode=84.77.69.203 - addnode=51.38.1.195 - addnode=51.38.1.194 - maxconnections=256 -EOF + mkdir /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + flux_daemon_conf if [[ "$IMPORT_ZELID" == "0" ]]; then while true do @@ -988,17 +976,7 @@ function install_flux() { git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating FluxOS configuration file...${NC}" - touch ~/$FLUX_DIR/config/userconfig.js - cat << EOF > ~/$FLUX_DIR/config/userconfig.js - module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - kadena: '${KDA_A}', - testnet: false - } - } -EOF + fluxOS_conf if [ -d ~/$FLUX_DIR ]; then current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) string_limit_check_mark "FluxOS v$current_ver installed................................." "FluxOS ${GREEN}v$current_ver${CYAN} installed................................." @@ -1009,8 +987,9 @@ EOF fi } function status_loop() { - network_height_01=$(curl -sk -m 10 https://blockbook.zel.network/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - network_height_02=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks' 2> /dev/null) ]]; then echo -e "" @@ -1030,8 +1009,8 @@ function status_loop() { start_sync=`date +%s` while true do - network_height_01=$(curl -sk -m 10 https://blockbook.zel.network/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - network_height_02=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) @@ -1052,8 +1031,8 @@ function status_loop() { MSG1="Syncing progress => Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" MSG2='' spinning_timer - network_height_01=$(curl -sk -m 10 https://blockbook.zel.network/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - network_height_02=$(curl -sk -m 10 https://explorer.zelcash.online/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') @@ -1069,11 +1048,11 @@ function status_loop() { fi done fi + echo -e "" install_watchdog check display_banner } - #end of functions start_install wipe_clean diff --git a/multinode.sh b/multinode.sh index 615aa3a8..60a49a28 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,139 +1,123 @@ #!/bin/bash - source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" function upnp_enable() { - - try="0" - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" - echo -e "" - exit + try="0" + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" + echo -e "" + exit + fi + while true + do + echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" + # Check if upnp_port is set + if [[ -z "$upnp_port" ]]; then + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) + else + FLUX_PORT=$(echo $upnp_port) fi - while true - do - echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" - # Check if upnp_port is set - if [[ -z "$upnp_port" ]]; then - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) - else - FLUX_PORT=$(echo $upnp_port) - fi - if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then - string_limit_check_mark "Port is valid..........................................." - break - else - string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." - sleep 1 - try=$(($try+1)) - if [[ "$try" -gt "3" ]]; then - echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" - echo -e "" - exit - fi - fi - done -if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then + string_limit_check_mark "Port is valid..........................................." + break + else + string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." + sleep 1 + try=$(($try+1)) + if [[ "$try" -gt "3" ]]; then + echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" + echo -e "" + exit + fi + fi + done + if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" fi -else - insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," - echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" -fi -if [[ -d /home/$USER/.fluxbenchmark ]]; then - sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null - echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null -else - echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null -fi -if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" - echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" - #API PORT - sudo ufw allow $FLUX_PORT > /dev/null 2>&1 - #HOME UI PORT - sudo ufw allow $(($FLUX_PORT-1)) > /dev/null 2>&1 - #if ! route -h > /dev/null 2>&1 ; then - # sudo apt install net-tools > /dev/null 2>&1 - #fi - #router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) - if [[ -z "$gateway_ip" ]]; then - router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) else - router_ip=$(echo $gateway_ip) + insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," + echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" fi - - if [[ "$router_ip" != "" ]]; then - + if [[ -d /home/$USER/.fluxbenchmark ]]; then + sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null + echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + else + echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + fi + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" + #API PORT + sudo ufw allow $FLUX_PORT > /dev/null 2>&1 + #HOME UI PORT + sudo ufw allow $(($FLUX_PORT-1)) > /dev/null 2>&1 + #if ! route -h > /dev/null 2>&1 ; then + # sudo apt install net-tools > /dev/null 2>&1 + #fi + #router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) if [[ -z "$gateway_ip" ]]; then - if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then - is_correct="0" - fi + router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) else - is_correct="0" + router_ip=$(echo $gateway_ip) fi - - if [[ "$is_correct" == "0" ]]; then - sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 - sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 - sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 - sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 - else - - + if [[ "$router_ip" != "" ]]; then + if [[ -z "$gateway_ip" ]]; then + if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then + is_correct="0" + fi + else + is_correct="0" + fi + if [[ "$is_correct" == "0" ]]; then + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + else while true do router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) - + if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then - echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" - break + echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" + break else string_limit_x_mark "IP $router_ip is not valid ..............................." sleep 1 fi done - - sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 - sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 - sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 - sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 - - fi - - else - - while true - do - router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) - if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + fi + else + while true + do + router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) + if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" break - else + else string_limit_x_mark "IP $router_ip is not valid ..............................." sleep 1 - fi - done - - sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 - sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 - sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 - sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 - + fi + done + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + fi fi - -fi - sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 sleep 200 echo -e "${ARROW}${YELLOW} Checking FluxOS logs... ${NC}" error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") - if [[ "$error_check" == "" ]]; then echo -e "" LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') @@ -143,17 +127,13 @@ fi echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" echo -e "" fi - } - function upnp_disable() { - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" - echo -e "" - exit + echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" + echo -e "" + exit fi - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${CYAN}Removing FluxOS UPnP configuration.....${NC}" sudo rm -rf /home/$USER/.fluxbenchmark/fluxbench.conf @@ -162,35 +142,32 @@ function upnp_disable() { echo -e "" exit fi - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep 'apiport' | wc -l) == "1" ]]; then cat /home/$USER/zelflux/config/userconfig.js | sed '/apiport/d' | sudo tee "/home/$USER/zelflux/config/userconfig.js" > /dev/null fi - echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" echo -e "" sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 sleep 200 - } if [[ -f /home/$USER/install_conf.json ]]; then - import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') - if [[ "$import_settings" == "1" ]]; then + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + if [[ "$import_settings" == "1" ]]; then echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 0.5 enable_upnp=$(cat /home/$USER/install_conf.json | jq -r '.enable_upnp') upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') if [[ -n $enable_upnp && "$enable_upnp" != "" && "$enable_upnp" != "0" ]]; then - echo -e "${PIN}${CYAN} UPnP state = ${GREEN}Enable${NC}" && sleep 0.5 + echo -e "${PIN}${CYAN} UPnP state = ${GREEN}Enable${NC}" && sleep 0.5 else - echo -e "${PIN}${CYAN} UPnP state = ${RED}Disable${NC}" && sleep 0.5 + echo -e "${PIN}${CYAN} UPnP state = ${RED}Disable${NC}" && sleep 0.5 fi if [[ -n $upnp_port && "$upnp_port" != "" && "$upnp_port" != "0" ]]; then - echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" && sleep 0.5 + echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" && sleep 0.5 else - echo -e "${PIN}${CYAN} UPnP port = ${RED}NULL${NC}" && sleep 0.5 + echo -e "${PIN}${CYAN} UPnP port = ${RED}NULL${NC}" && sleep 0.5 fi if [[ -n $gateway_ip && "$gateway_ip" != "" && "$gateway_ip" != "0" ]]; then echo -e "${PIN}${CYAN} Gateway = ${GREEN}$gateway_ip${NC}" && sleep 0.5 @@ -202,25 +179,26 @@ if [[ -f /home/$USER/install_conf.json ]]; then fi if [[ -z $enable_upnp ]]; then - CHOICE=$( - whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ - "1)" "Enable UPnP Mode" \ - "2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 -) + CHOICE=$( + whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ + "1)" "Enable UPnP Mode" \ + "2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 + ) else - # if enable_upnp is 1 then set choice to 1 else set choice to 2 - if [[ "$enable_upnp" == "1" ]]; then - CHOICE="1)" - else - CHOICE="2)" - fi + # if enable_upnp is 1 then set choice to 1 else set choice to 2 + if [[ "$enable_upnp" == "1" ]]; then + CHOICE="1)" + else + CHOICE="2)" + fi fi case $CHOICE in "1)") - upnp_enable + upnp_enable ;; "2)") - upnp_disable + upnp_disable ;; esac + From f44135060591c311b6c61f6b787354afca0f4946 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Wed, 24 Aug 2022 13:22:07 +0200 Subject: [PATCH 0634/1176] Minor edit --- install_pro.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 9f7ab326..c8a7aa44 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1048,7 +1048,6 @@ function status_loop() { fi done fi - echo -e "" install_watchdog check display_banner From 9e0c730911371731a5aebaaf7e6767c323b1c9e6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Thu, 25 Aug 2022 15:50:08 +0200 Subject: [PATCH 0635/1176] cleanup and improvement --- flux_common.sh | 1088 ++++++++++++++---------- geo_test.sh | 56 -- install_pro.sh | 215 +---- multitoolbox.sh | 2150 ++++++++++++++++++----------------------------- 4 files changed, 1457 insertions(+), 2052 deletions(-) delete mode 100644 geo_test.sh diff --git a/flux_common.sh b/flux_common.sh index bf27a3fe..3ac2a6bf 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -21,11 +21,209 @@ RIGHT_ANGLE="${GREEN}\xE2\x88\x9F${NC}" #bootstrap variable server_offline="0" failed_counter="0" +#Explorers +network_url_1="explorer.zelcash.online" +network_url_2="explorer.runonflux.io" +network_url_3="blockbook.zel.network" #dialog color export NEWT_COLORS=' title=black, ' - +##### CONFIGS SECTION ###################################### +function watchdog_conf_create(){ + sudo touch /home/$USER/watchdog/config.js + sudo chown $USER:$USER /home/$USER/watchdog/config.js + cat <<- EOF > /home/$USER/watchdog/config.js + module.exports = { + label: '${node_label}', + tier_eps_min: '${eps_limit}', + zelflux_update: '${flux_update}', + zelcash_update: '${daemon_update}', + zelbench_update: '${bench_update}', + action: '${fix_action}', + ping: '${ping}', + web_hook_url: '${discord}', + telegram_alert: '${telegram_alert}', + telegram_bot_token: '${telegram_bot_token}', + telegram_chat_id: '${telegram_chat_id}' + } + EOF +} +function fluxos_conf_create(){ + touch /home/$USER/$FLUX_DIR/config/userconfig.js + cat <<- EOF > /home/$USER/$FLUX_DIR/config/userconfig.js + module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${ZELID}', + kadena: '${KDA_A}', + testnet: false + } + } + EOF +} +function flux_daemon_conf_create() { + touch /home/$USER/$CONFIG_DIR/$CONFIG_FILE + cat <<- EOF > /home/$CONFIG_DIR/$CONFIG_FILE + rpcuser=$RPCUSER + rpcpassword=$PASSWORD + rpcallowip=127.0.0.1 + rpcallowip=172.18.0.1 + rpcport=$RPCPORT + port=$PORT + zelnode=1 + zelnodeprivkey=$zelnodeprivkey + zelnodeoutpoint=$zelnodeoutpoint + zelnodeindex=$zelnodeindex + server=1 + daemon=1 + txindex=1 + addressindex=1 + timestampindex=1 + spentindex=1 + insightexplorer=1 + experimentalfeatures=1 + listen=1 + externalip=$WANIP + bind=0.0.0.0 + addnode=80.211.207.17 + addnode=95.217.12.176 + addnode=89.58.3.209 + addnode=161.97.85.103 + addnode=194.163.176.185 + addnode=explorer.flux.zelcore.io + addnode=explorer.runonflux.io + addnode=explorer.zelcash.online + addnode=blockbook.runonflux.io + addnode=202.61.202.21 + addnode=89.58.40.172 + addnode=37.120.176.206 + addnode=66.119.15.83 + addnode=66.94.118.208 + addnode=99.48.162.169 + addnode=97.120.40.143 + addnode=99.48.162.167 + addnode=108.30.50.162 + addnode=154.12.242.89 + addnode=67.43.96.139 + addnode=66.94.107.219 + addnode=66.94.110.117 + addnode=154.12.225.203 + addnode=176.9.72.41 + addnode=65.108.198.119 + addnode=65.108.200.110 + addnode=46.38.251.110 + addnode=95.214.55.47 + addnode=202.61.236.202 + addnode=65.108.141.153 + addnode=178.170.46.91 + addnode=66.119.15.64 + addnode=65.108.46.178 + addnode=94.130.220.41 + addnode=178.170.48.110 + addnode=78.35.147.57 + addnode=66.119.15.101 + addnode=66.119.15.96 + addnode=38.88.125.25 + addnode=66.119.15.110 + addnode=103.13.31.149 + addnode=212.80.212.238 + addnode=212.80.213.172 + addnode=212.80.212.228 + addnode=121.112.224.186 + addnode=114.181.141.16 + addnode=167.179.115.100 + addnode=153.226.219.80 + addnode=24.79.73.50 + addnode=76.68.219.102 + addnode=70.52.20.8 + addnode=184.145.181.147 + addnode=68.150.72.135 + addnode=198.27.83.181 + addnode=167.114.82.63 + addnode=24.76.166.6 + addnode=173.33.170.150 + addnode=99.231.229.245 + addnode=70.82.102.140 + addnode=192.95.30.188 + addnode=75.158.245.77 + addnode=142.113.239.49 + addnode=66.70.176.241 + addnode=174.93.146.224 + addnode=216.232.124.38 + addnode=207.34.248.197 + addnode=76.68.219.102 + addnode=149.56.25.82 + addnode=74.57.74.166 + addnode=142.169.180.47 + addnode=70.67.210.148 + addnode=86.5.78.14 + addnode=87.244.105.94 + addnode=86.132.192.193 + addnode=86.27.168.85 + addnode=86.31.168.107 + addnode=84.71.79.220 + addnode=154.57.235.104 + addnode=86.13.102.145 + addnode=86.31.168.107 + addnode=86.13.68.100 + addnode=151.225.136.163 + addnode=5.45.110.123 + addnode=45.142.178.251 + addnode=89.58.5.234 + addnode=45.136.30.81 + addnode=202.61.255.238 + addnode=89.58.7.2 + addnode=89.58.36.46 + addnode=89.58.32.76 + addnode=89.58.39.81 + addnode=89.58.39.153 + addnode=202.61.244.71 + addnode=89.58.37.172 + addnode=89.58.36.118 + addnode=31.145.161.44 + addnode=217.131.61.221 + addnode=80.28.72.254 + addnode=85.49.210.36 + addnode=84.77.69.203 + addnode=51.38.1.195 + addnode=51.38.1.194 + maxconnections=256 + EOF +} +function install_conf_create(){ + sudo touch /home/$USER/install_conf.json + sudo chown $USER:$USER /home/$USER/install_conf.json + cat <<- EOF > /home/$USER/install_conf.json + { + "import_settings": "${import_settings}", + "prvkey": "${prvkey}", + "outpoint": "${outpoint}", + "index": "${index}", + "zelid": "${zel_id}", + "kda_address": "${kda_address}", + "firewall_disable": "${firewall_disable}", + "bootstrap_url": "${bootstrap_url}", + "bootstrap_zip_del": "${bootstrap_zip_del}", + "swapon": "${swapon}", + "use_old_chain": "${use_old_chain}", + "node_label": "${node_label}", + "zelflux_update": "${zelflux_update}", + "zelcash_update": "${zelcash_update}", + "zelbench_update": "${zelbench_update}", + "discord": "${discord}", + "ping": "${ping}", + "telegram_alert": "${telegram_alert}", + "telegram_bot_token": "${telegram_bot_token}", + "telegram_chat_id": "${telegram_chat_id}", + "eps_limit": "${eps_limit}", + "enable_upnp": "${enable_upnp}", + "upnp_port": "${FLUX_PORT}", + "gateway_ip": "${gateway_ip}" + } + EOF +} +###### HELPERS SECTION function round() { printf "%.${2}f" "${1}" } @@ -114,6 +312,209 @@ function spinning_timer() { done echo -ne "${MSG2}" } +function integration_check() { + FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) + ELEMENTS=${#FILE_ARRAY[@]} + for (( i=0;i<$ELEMENTS;i++)); do + string="${FILE_ARRAY[${i}]}......................................" + string=${string::40} + if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then + echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" + CORRUPTED="1" + fi + done + if [[ "$CORRUPTED" == "1" ]]; then + echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" + echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" + echo -e "" + exit + fi + +} +function import_config_file() { + if [[ -f /home/$USER/install_conf.json ]]; then + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') + bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') + use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') + prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') + outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') + index=$(cat /home/$USER/install_conf.json | jq -r '.index') + ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') + KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') + flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') + daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') + bench_update=$(cat /home/$USER/install_conf.json | jq -r '.zelbench_update') + node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') + eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') + discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') + ping=$(cat /home/$USER/install_conf.json | jq -r '.ping') + telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') + telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') + telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') + echo -e "" + echo -e "${ARROW} ${YELLOW}Install config:" + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then + echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + if [[ "$import_settings" == "1" ]]; then + echo -e "${PIN}${CYAN} Import installation configurations...............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi + + if [[ "$use_old_chain" == "1" ]]; then + echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in script............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + if [[ "$bootstrap_zip_del" == "1" || -z "$bootstrap_zip_del" ]]; then + echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi + if [[ "$discord" != "" && "$discord" != "0" ]] || [[ "$telegram_alert" == '1' ]]; then + echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi +} +function get_ip() { + WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + if [[ "$WANIP" == "" || "$WANIP" = *htmlhead* ]]; then + WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + if [[ "$WANIP" == "" || "$WANIP" = *htmlhead* ]]; then + WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') + fi + if [[ "$1" == "install" ]]; then + if [[ "$WANIP" == "" || "$WANIP" = *htmlhead* ]]; then + echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" + echo + exit + fi + string_limit_check_mark "IP: $WANIP ..........................................." "IP: ${GREEN}$WANIP${CYAN} ..........................................." + fi +} +function check_benchmarks() { + var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") + limit=$2 + if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]]; then + var_round=$(round "$var_benchmark" 2) + echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" + fi +} +function display_banner() { + echo -e "${BLUE}" + figlet -t -k "FLUXNODE" + figlet -t -k "INSTALLATION COMPLETED" + echo -e "${YELLOW}================================================================================================================================" + echo -e "" + if pm2 -v > /dev/null 2>&1; then + pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) + if [[ "$pm2_flux_status" == "online" ]]; then + pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" + else + if [[ "$pm2_flux_status" != "" ]]; then + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" + fi + fi + echo -e "" + fi + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" + echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" + echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" + echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" + echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} $1 getinfo${NC}" + echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} $1 getbenchmarks${NC}" + echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} $1 restartnodebenchmarks${NC}" + echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} $1 stop${NC}" + echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" + echo + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" + echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" + echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" + echo -e "" + if [[ "$WATCHDOG_INSTALL" == "1" ]]; then + echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" + echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" + echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" + echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo + echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" + echo -e "" + fi + echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" + echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" + sleep 1 + cd $HOME + exec bash +} +function create_swap() { + if [[ -z "$swapon" ]]; then + #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + fi + else + if [[ "$swapon" == "1" ]]; then + MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') + gb=$(awk "BEGIN {print $MEM/1048576}") + GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') + if [ "$GB" -lt 2 ]; then + (( swapsize=GB*2 )) + swap="$swapsize"G + elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then + swap=4G + elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then + swap=2G + fi + if ! grep -q "swapfile" /etc/fstab; then + sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 + sudo chmod 600 /swapfile > /dev/null 2>&1 + sudo mkswap /swapfile > /dev/null 2>&1 + sudo swapon /swapfile > /dev/null 2>&1 + echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + fi + fi + fi + sleep 2 +} +######### BOOTSTRAP SECTION ############################ function tar_file_unpack() { echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" pv $1 | tar -zx -C $2 @@ -349,235 +750,25 @@ function start_service() { pm2 restart flux > /dev/null 2>&1 && sleep 2 pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 } -function get_ip() { - WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - if [[ "$WANIP" == "" || "$WANIP" = *htmlhead* ]]; then - WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - if [[ "$WANIP" == "" || "$WANIP" = *htmlhead* ]]; then - WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') - fi - if [[ "$1" == "install" ]]; then - if [[ "$WANIP" == "" || "$WANIP" = *htmlhead* ]]; then - echo -e "${ARROW} ${CYAN}IP address could not be found, installation stopped .........[${X_MARK}${CYAN}]${NC}" - echo - exit - fi - string_limit_check_mark "IP: $WANIP ..........................................." "IP: ${GREEN}$WANIP${CYAN} ..........................................." - fi -} -function selfhosting() { - if [[ "$1" != "install" ]]; then - echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - fi - echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" - echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 - if [[ "$1" != "install" ]]; then - get_ip - fi - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 - else - echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 - echo -e "" - return 1 - fi - echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 - sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 - sudo touch /home/$USER/ip_check.sh - sudo chown $USER:$USER /home/$USER/ip_check.sh - cat <<-'EOF' > /home/$USER/ip_check.sh - #!/bin/bash - function get_ip(){ - WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - fi - if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then - WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') - fi - } - if [[ $1 == "restart" ]]; then - #give 3min to connect with internet - sleep 180 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - fi - if [[ $1 == "ip_check" ]]; then - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') - if [[ "$api_port" == "" ]]; then - api_port="16127" - fi - confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') - if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then - if [[ "$WANIP" != "$confirmed_ip" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi - fi - fi - EOF - sudo chmod +x /home/$USER/ip_check.sh - echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 - sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 - if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" - else - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" - fi - echo -e "" -} -function integration_check() { - FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) - ELEMENTS=${#FILE_ARRAY[@]} - for (( i=0;i<$ELEMENTS;i++)); do - string="${FILE_ARRAY[${i}]}......................................" - string=${string::40} - if [ -f "$COIN_PATH/${FILE_ARRAY[${i}]}" ]; then - echo -e "${ARROW}${CYAN} $string[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${ARROW}${CYAN} $string[${X_MARK}${CYAN}]${NC}" - CORRUPTED="1" - fi - done - if [[ "$CORRUPTED" == "1" ]]; then - echo -e "${WORNING} ${CYAN}Flux daemon package corrupted...${NC}" - echo -e "${WORNING} ${CYAN}Will exit out so try and run the script again...${NC}" - echo -e "" - exit - fi - -} -function config_file() { - if [[ -f /home/$USER/install_conf.json ]]; then - import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') - bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') - bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') - use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') - prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') - outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') - index=$(cat /home/$USER/install_conf.json | jq -r '.index') - ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') - KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') - fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') - flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') - daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') - bench_update=$(cat /home/$USER/install_conf.json | jq -r '.zelbench_update') - node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') - eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') - discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') - ping=$(cat /home/$USER/install_conf.json | jq -r '.ping') - telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') - telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') - telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') - echo -e "" - echo -e "${ARROW} ${YELLOW}Install config:" - if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then - echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - if [[ "$import_settings" == "1" ]]; then - echo -e "${PIN}${CYAN} Import installation configurations...............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi - - if [[ "$use_old_chain" == "1" ]]; then - echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then - echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in script............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - if [[ "$bootstrap_zip_del" == "1" || -z "$bootstrap_zip_del" ]]; then - echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi - if [[ "$discord" != "" && "$discord" != "0" ]] || [[ "$telegram_alert" == '1' ]]; then - echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi -} -function check_benchmarks() { - var_benchmark=$($BENCH_CLI getbenchmarks | jq ".$1") - limit=$2 - if [[ $(echo "$limit>$var_benchmark" | bc) == "1" ]]; then - var_round=$(round "$var_benchmark" 2) - echo -e "${X_MARK} ${CYAN}$3 $var_round $4${NC}" - fi -} -function flux_package() { - sudo apt-get update -y > /dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" - sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 - sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 - integration_check -} -function zk_params() { - echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" - bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 - sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 -} -function log_rotate() { - echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" - sleep 1 - if [ -f /etc/logrotate.d/$2 ]; then - sudo rm -rf /etc/logrotate.d/$2 - sleep 2 - fi - sudo touch /etc/logrotate.d/$2 - sudo chown $USER:$USER /etc/logrotate.d/$2 - cat <<-EOF > /etc/logrotate.d/$2 - $3 { - compress - copytruncate - missingok - $4 - rotate $5 - } - EOF - sudo chown root:root /etc/logrotate.d/$2 -} -function install_mongod() { - echo -e "" - echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" - sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 - sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 - sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 - sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 - sudo systemctl enable mongod > /dev/null 2>&1 - sudo systemctl start mongod > /dev/null 2>&1 - if mongod --version > /dev/null 2>&1; then - string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." - echo - else - string_limit_x_mark "MongoDB was not installed................................." - echo +######### INSTALLATION SECTION ############################ +function install_mongod() { + echo -e "" + echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" + sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 + sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 + sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 + sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 + sudo systemctl enable mongod > /dev/null 2>&1 + sudo systemctl start mongod > /dev/null 2>&1 + if mongod --version > /dev/null 2>&1; then + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo + else + string_limit_x_mark "MongoDB was not installed................................." + echo fi } function install_nodejs() { @@ -613,115 +804,6 @@ function install_nodejs() { echo fi } -function check() { - cd - pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - #sleep 120 - #cd /home/$USER/zelflux - #pm2 stop flux - #npm install --legacy-peer-deps > /dev/null 2>&1 - #pm2 start flux - #cd - NUM='300' - MSG1='Finalizing Flux installation please be patient this will take about ~5min...' - MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" - echo && spinning_timer - echo - $BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 - NUM='300' - MSG1='Restarting benchmark...' - MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo && echo - echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" - echo -e "${YELLOW}======================${NC}" - bench_benchmarks=$($BENCH_CLI getbenchmarks) - if [[ "bench_benchmarks" != "" ]]; then - bench_status=$(jq -r '.status' <<< "$bench_benchmarks") - if [[ "$bench_status" == "failed" ]]; then - echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" - check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" - check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" - else - echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" - bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") - echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" - bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") - bench_ram=$(round "$bench_ram" 2) - echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" - bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") - bench_ssd=$(round "$bench_ssd" 2) - echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" - bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") - bench_hdd=$(round "$bench_hdd" 2) - echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" - bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") - bench_ddwrite=$(round "$bench_ddwrite" 2) - echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" - bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") - bench_eps=$(round "$bench_eps" 2) - echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" - fi - else - echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" - fi -} -function display_banner() { - echo -e "${BLUE}" - figlet -t -k "FLUXNODE" - figlet -t -k "INSTALLATION COMPLETED" - echo -e "${YELLOW}================================================================================================================================" - echo -e "" - if pm2 -v > /dev/null 2>&1; then - pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) - if [[ "$pm2_flux_status" == "online" ]]; then - pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${BOOK} ${CYAN}Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" - else - if [[ "$pm2_flux_status" != "" ]]; then - pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) - echo -e "${PIN} ${CYAN}PM2 Flux status: ${RED}$pm2_flux_status${NC}, restarts: ${RED}$pm2_flux_restarts${NC}" - fi - fi - echo -e "" - fi - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX DAEMON.${NC}" - echo -e "${PIN} ${CYAN}Start Flux daemon: ${SEA}sudo systemctl start zelcash${NC}" - echo -e "${PIN} ${CYAN}Stop Flux daemon: ${SEA}sudo systemctl stop zelcash${NC}" - echo -e "${PIN} ${CYAN}Help list: ${SEA}${COIN_CLI} help${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE BENCHMARK.${NC}" - echo -e "${PIN} ${CYAN}Get info: ${SEA}${BENCH_CLI} $1 getinfo${NC}" - echo -e "${PIN} ${CYAN}Check benchmark: ${SEA}${BENCH_CLI} $1 getbenchmarks${NC}" - echo -e "${PIN} ${CYAN}Restart benchmark: ${SEA}${BENCH_CLI} $1 restartnodebenchmarks${NC}" - echo -e "${PIN} ${CYAN}Stop benchmark: ${SEA}${BENCH_CLI} $1 stop${NC}" - echo -e "${PIN} ${CYAN}Start benchmark: ${SEA}sudo systemctl restart zelcash${NC}" - echo - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" - echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" - echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" - echo -e "" - if [[ "$WATCHDOG_INSTALL" == "1" ]]; then - echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE WATCHDOG.${NC}" - echo -e "${PIN} ${CYAN}Stop watchdog: ${SEA}pm2 stop watchdog${NC}" - echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" - echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" - echo - echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" - echo -e "" - fi - echo -e "${PIN} ${CYAN}To access your frontend to Flux enter this in as your url: ${SEA}${WANIP}:${ZELFRONTPORT}${NC}" - echo -e "${YELLOW}===================================================================================================================[${GREEN}Duration: $((($(date +%s)-$start_install)/60)) min. $((($(date +%s)-$start_install) % 60)) sec.${YELLOW}]${NC}" - sleep 1 - cd $HOME - exec bash -} function start_install() { start_install=`date +%s` sudo echo -e "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo @@ -756,7 +838,7 @@ function start_install() { echo -e "${ARROW} ${CYAN}Current directory ${GREEN}$(pwd)${CYAN}${NC}" fi sleep 1 - config_file + import_config_file if [[ -z "$index" || -z "$outpoint" || -z "$prvkey" ]]; then import_date else @@ -782,85 +864,37 @@ function start_install() { if [[ "$node_label" != "" && "$node_label" != "0" ]]; then echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" && sleep 1 else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 - fi - if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - fi - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 - fi - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 - fi - fi - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 - fi - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 - fi - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 - fi - echo -e "" - fi - fi -} -function create_swap() { - if [[ -z "$swapon" ]]; then - #echo -e "${YELLOW}Creating swap if none detected...${NC}" && sleep 1 - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G - fi - if ! grep -q "swapfile" /etc/fstab; then - # if whiptail --yesno "No swapfile detected would you like to create one?" 8 54; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" - fi - else - if [[ "$swapon" == "1" ]]; then - MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') - gb=$(awk "BEGIN {print $MEM/1048576}") - GB=$(echo "$gb" | awk '{printf("%d\n",$1 + 0.5)}') - if [ "$GB" -lt 2 ]; then - (( swapsize=GB*2 )) - swap="$swapsize"G - elif [[ $GB -ge 2 ]] && [[ $GB -le 16 ]]; then - swap=4G - elif [[ $GB -gt 16 ]] && [[ $GB -lt 32 ]]; then - swap=2G + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 fi - if ! grep -q "swapfile" /etc/fstab; then - sudo fallocate -l "$swap" /swapfile > /dev/null 2>&1 - sudo chmod 600 /swapfile > /dev/null 2>&1 - sudo mkswap /swapfile > /dev/null 2>&1 - sudo swapon /swapfile > /dev/null 2>&1 - echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Created ${SEA}${swap}${YELLOW} swapfile${NC}" + if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + fi + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" && sleep 1 + fi + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" && sleep 1 + fi + fi + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" && sleep 1 + fi + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" && sleep 1 + fi + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" && sleep 1 fi + echo -e "" fi fi - sleep 2 } function install_packages() { echo -e "${ARROW} ${YELLOW}Installing Packages...${NC}" @@ -906,35 +940,71 @@ function pm2_install(){ echo fi } -function multinode(){ - echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit +function finalizing() { + cd + pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + #sleep 120 + #cd /home/$USER/zelflux + #pm2 stop flux + #npm install --legacy-peer-deps > /dev/null 2>&1 + #pm2 start flux + #cd + NUM='300' + MSG1='Finalizing Flux installation please be patient this will take about ~5min...' + MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + echo && spinning_timer + echo + $BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 + NUM='300' + MSG1='Restarting benchmark...' + MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo + echo -e "${BOOK}${YELLOW} Flux benchmarks:${NC}" + echo -e "${YELLOW}======================${NC}" + bench_benchmarks=$($BENCH_CLI getbenchmarks) + if [[ "bench_benchmarks" != "" ]]; then + bench_status=$(jq -r '.status' <<< "$bench_benchmarks") + if [[ "$bench_status" == "failed" ]]; then + echo -e "${ARROW} ${CYAN}Flux benchmark failed...............[${X_MARK}${CYAN}]${NC}" + check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" + check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" + else + echo -e "${BOOK}${CYAN} STATUS: ${GREEN}$bench_status${NC}" + bench_cores=$(jq -r '.cores' <<< "$bench_benchmarks") + echo -e "${BOOK}${CYAN} CORES: ${GREEN}$bench_cores${NC}" + bench_ram=$(jq -r '.ram' <<< "$bench_benchmarks") + bench_ram=$(round "$bench_ram" 2) + echo -e "${BOOK}${CYAN} RAM: ${GREEN}$bench_ram${NC}" + bench_ssd=$(jq -r '.ssd' <<< "$bench_benchmarks") + bench_ssd=$(round "$bench_ssd" 2) + echo -e "${BOOK}${CYAN} SSD: ${GREEN}$bench_ssd${NC}" + bench_hdd=$(jq -r '.hdd' <<< "$bench_benchmarks") + bench_hdd=$(round "$bench_hdd" 2) + echo -e "${BOOK}${CYAN} HDD: ${GREEN}$bench_hdd${NC}" + bench_ddwrite=$(jq -r '.ddwrite' <<< "$bench_benchmarks") + bench_ddwrite=$(round "$bench_ddwrite" 2) + echo -e "${BOOK}${CYAN} DDWRITE: ${GREEN}$bench_ddwrite${NC}" + bench_eps=$(jq -r '.eps' <<< "$bench_benchmarks") + bench_eps=$(round "$bench_eps" 2) + echo -e "${BOOK}${CYAN} EPS: ${GREEN}$bench_eps${NC}" + fi + else + echo -e "${ARROW} ${CYAN}Flux benchmark not responding.................[${X_MARK}${CYAN}]${NC}" fi - echo -e "" - echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" - echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" - echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" - echo -e "" - echo -e "${ARROW} ${RED}IMPORTANT:${NC}" - echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" - echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" - echo -e "" - echo -e "${YELLOW}================================================================${NC}" - echo -e "" - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" - echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" - echo -e "" - exit - fi - sleep 8 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) +} +function zk_params() { + echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" + bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 + sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 +} +function flux_package() { + sudo apt-get update -y > /dev/null 2>&1 && sleep 2 + echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" + sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 + sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 + integration_check } function create_service_scripts() { echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 @@ -1055,6 +1125,138 @@ function create_service() { sudo chown root:root /etc/systemd/system/zelcash.service sudo systemctl daemon-reload } +#### LOGS SECTION +function log_rotate() { + echo -e "${ARROW} ${YELLOW}Configuring log rotate function for $1 logs...${NC}" + sleep 1 + if [ -f /etc/logrotate.d/$2 ]; then + sudo rm -rf /etc/logrotate.d/$2 + sleep 1 + fi + sudo touch /etc/logrotate.d/$2 + sudo chown $USER:$USER /etc/logrotate.d/$2 + cat <<-EOF > /etc/logrotate.d/$2 + $3 { + compress + copytruncate + missingok + $4 + rotate $5 + } + EOF + sudo chown root:root /etc/logrotate.d/$2 +} +#### MULTITOOLBOX OPTIONS SECTION +function selfhosting() { + if [[ "$1" != "install" ]]; then + echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + fi + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" + echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 + if [[ "$1" != "install" ]]; then + get_ip + fi + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + else + echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 + echo -e "" + return 1 + fi + echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 + sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 + sudo touch /home/$USER/ip_check.sh + sudo chown $USER:$USER /home/$USER/ip_check.sh + cat <<-'EOF' > /home/$USER/ip_check.sh + #!/bin/bash + function get_ip(){ + WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl --silent -m 10 https://checkip.amazonaws.com | tr -dc '[:alnum:].') + fi + if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then + WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') + fi + } + if [[ $1 == "restart" ]]; then + #give 3min to connect with internet + sleep 180 + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + fi + if [[ $1 == "ip_check" ]]; then + get_ip + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + if [[ "$api_port" == "" ]]; then + api_port="16127" + fi + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') + if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then + if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi + fi + fi + EOF + sudo chmod +x /home/$USER/ip_check.sh + echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 + sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 + if [[ "$crontab_check" == "0" ]]; then + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + else + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + fi + echo -e "" +} +function multinode(){ + echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + echo -e "" + echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" + echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" + echo -e "${HOT} ${CYAN}Create up to 8 node using same public address ${NC}" + echo -e "" + echo -e "${ARROW} ${RED}IMPORTANT:${NC}" + echo -e "${BOOK} ${RED}Each node need to set different port for communication${NC}" + echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" + echo -e "" + echo -e "${YELLOW}================================================================${NC}" + echo -e "" + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" + echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" + echo -e "" + exit + fi + sleep 8 + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) +} function install_watchtower(){ echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" diff --git a/geo_test.sh b/geo_test.sh deleted file mode 100644 index 34a37403..00000000 --- a/geo_test.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" - -# THIS LOOKS UNUSED. CANDIDATE FOR DELETION. -function server_geolocation(){ - -ip_output1=$(curl -s -m 10 http://ip-api.com/json/cdn-${rand_by_domain[$i]}.runonflux.io?fields=status,country,timezone 2>/dev/null | jq . 2>/dev/null) -ip_status1=$( jq -r .status 2>/dev/null <<< "$ip_output") - -if [[ "$ip_status1" == "success" ]]; then -country1=$(jq -r .country <<< "$ip_output1") -org1=$(jq -r .org <<< "$ip_output1") -continent1=$(jq -r .timezone <<< "$ip_output1") -else -country1="UKNOW" -continent1="UKNOW" -fi - -continent1=$(cut -f1 -d"/" <<< "$continent1" ) - -if [[ "$continent1" =~ "Europe" ]]; then - server_continent="EU" -fi - -if [[ "$continent1" =~ "America" ]]; then - server_continent="US" -fi - -if [[ "$continent1" =~ "Asia" ]]; then - server_continent="AS" -fi - -#echo -e "${ARROW} ${CYAN}Checking bootstrap server location....${NC}" -#echo -e "${ARROW} ${CYAN}Server Location: $country, Continent: $continent ${NC}" - -} - - -if ! jq --version > /dev/null 2>&1; then - sudo apt install jq -y > /dev/null 2>&1 -fi - -get_ip -bootstrap_geolocation - -if [[ "$Server_offline" == "1" ]]; then - exit 1 -fi - - #bootstrap_rand_ip - bootstrap_index=$((${#richable[@]}-1)) - r=$(shuf -i 0-$bootstrap_index -n 1) - indexb=${richable[$r]} - BOOTSTRAP_ZIP="http://cdn-$indexb.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" - echo -e "$BOOTSTRAP_ZIP" diff --git a/install_pro.sh b/install_pro.sh index c8a7aa44..ca5bf2b5 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -26,173 +26,7 @@ ZELNODEPORT=16128 #MDBPORT=27017 RPCPORT=16124 PORT=16125 -#explorer networks -network_url_1="explorer.zelcash.online" -#network_url_2="explorer.runonflux.io" -network_url_3="blockbook.zel.network" -##### Config layout section ###################################### -function watchdog_conf(){ - sudo touch /home/$USER/watchdog/config.js - sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat << EOF > /home/$USER/watchdog/config.js - module.exports = { - label: '${node_label}', - tier_eps_min: '${eps_limit}', - zelflux_update: '${flux_update}', - zelcash_update: '${daemon_update}', - zelbench_update: '${bench_update}', - action: '${fix_action}', - ping: '${ping}', - web_hook_url: '${discord}', - telegram_alert: '${telegram_alert}', - telegram_bot_token: '${telegram_bot_token}', - telegram_chat_id: '${telegram_chat_id}' - } -EOF -} -function fluxOS_conf(){ - touch /home/$USER/$FLUX_DIR/config/userconfig.js - cat << EOF > /home/$USER/$FLUX_DIR/config/userconfig.js - module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - kadena: '${KDA_A}', - testnet: false - } - } -EOF -} -function flux_daemon_conf() { - touch /home/$USER/$CONFIG_DIR/$CONFIG_FILE - cat << EOF > ~/$CONFIG_DIR/$CONFIG_FILE - rpcuser=$RPCUSER - rpcpassword=$PASSWORD - rpcallowip=127.0.0.1 - rpcallowip=172.18.0.1 - rpcport=$RPCPORT - port=$PORT - zelnode=1 - zelnodeprivkey=$zelnodeprivkey - zelnodeoutpoint=$zelnodeoutpoint - zelnodeindex=$zelnodeindex - server=1 - daemon=1 - txindex=1 - addressindex=1 - timestampindex=1 - spentindex=1 - insightexplorer=1 - experimentalfeatures=1 - listen=1 - externalip=$WANIP - bind=0.0.0.0 - addnode=80.211.207.17 - addnode=95.217.12.176 - addnode=89.58.3.209 - addnode=161.97.85.103 - addnode=194.163.176.185 - addnode=explorer.flux.zelcore.io - addnode=explorer.runonflux.io - addnode=explorer.zelcash.online - addnode=blockbook.runonflux.io - addnode=202.61.202.21 - addnode=89.58.40.172 - addnode=37.120.176.206 - addnode=66.119.15.83 - addnode=66.94.118.208 - addnode=99.48.162.169 - addnode=97.120.40.143 - addnode=99.48.162.167 - addnode=108.30.50.162 - addnode=154.12.242.89 - addnode=67.43.96.139 - addnode=66.94.107.219 - addnode=66.94.110.117 - addnode=154.12.225.203 - addnode=176.9.72.41 - addnode=65.108.198.119 - addnode=65.108.200.110 - addnode=46.38.251.110 - addnode=95.214.55.47 - addnode=202.61.236.202 - addnode=65.108.141.153 - addnode=178.170.46.91 - addnode=66.119.15.64 - addnode=65.108.46.178 - addnode=94.130.220.41 - addnode=178.170.48.110 - addnode=78.35.147.57 - addnode=66.119.15.101 - addnode=66.119.15.96 - addnode=38.88.125.25 - addnode=66.119.15.110 - addnode=103.13.31.149 - addnode=212.80.212.238 - addnode=212.80.213.172 - addnode=212.80.212.228 - addnode=121.112.224.186 - addnode=114.181.141.16 - addnode=167.179.115.100 - addnode=153.226.219.80 - addnode=24.79.73.50 - addnode=76.68.219.102 - addnode=70.52.20.8 - addnode=184.145.181.147 - addnode=68.150.72.135 - addnode=198.27.83.181 - addnode=167.114.82.63 - addnode=24.76.166.6 - addnode=173.33.170.150 - addnode=99.231.229.245 - addnode=70.82.102.140 - addnode=192.95.30.188 - addnode=75.158.245.77 - addnode=142.113.239.49 - addnode=66.70.176.241 - addnode=174.93.146.224 - addnode=216.232.124.38 - addnode=207.34.248.197 - addnode=76.68.219.102 - addnode=149.56.25.82 - addnode=74.57.74.166 - addnode=142.169.180.47 - addnode=70.67.210.148 - addnode=86.5.78.14 - addnode=87.244.105.94 - addnode=86.132.192.193 - addnode=86.27.168.85 - addnode=86.31.168.107 - addnode=84.71.79.220 - addnode=154.57.235.104 - addnode=86.13.102.145 - addnode=86.31.168.107 - addnode=86.13.68.100 - addnode=151.225.136.163 - addnode=5.45.110.123 - addnode=45.142.178.251 - addnode=89.58.5.234 - addnode=45.136.30.81 - addnode=202.61.255.238 - addnode=89.58.7.2 - addnode=89.58.36.46 - addnode=89.58.32.76 - addnode=89.58.39.81 - addnode=89.58.39.153 - addnode=202.61.244.71 - addnode=89.58.37.172 - addnode=89.58.36.118 - addnode=31.145.161.44 - addnode=217.131.61.221 - addnode=80.28.72.254 - addnode=85.49.210.36 - addnode=84.77.69.203 - addnode=51.38.1.195 - addnode=51.38.1.194 - maxconnections=256 -EOF -} -################################################################## + function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" @@ -208,27 +42,6 @@ function config_veryfity(){ fi fi } -function pm2_install(){ - echo -e "${ARROW} ${YELLOW}PM2 installing...${NC}" - npm install pm2@latest -g > /dev/null 2>&1 - if pm2 -v > /dev/null 2>&1; then - echo -e "${ARROW} ${CYAN}Configuring PM2...${NC}" - pm2 startup systemd -u $USER > /dev/null 2>&1 - sudo env PATH=$PATH:/home/$USER/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u $USER --hp /home/$USER > /dev/null 2>&1 - pm2 install pm2-logrotate > /dev/null 2>&1 - pm2 set pm2-logrotate:max_size 6M > /dev/null 2>&1 - pm2 set pm2-logrotate:retain 6 > /dev/null 2>&1 - pm2 set pm2-logrotate:compress true > /dev/null 2>&1 - pm2 set pm2-logrotate:workerInterval 3600 > /dev/null 2>&1 - pm2 set pm2-logrotate:rotateInterval '0 12 * * 0' > /dev/null 2>&1 - source ~/.bashrc - string_limit_check_mark "PM2 v$(pm2 -v) installed................................." "PM2 ${GREEN}v$(pm2 -v)${CYAN} installed................................." - echo -e "" - else - string_limit_x_mark "PM2 was not installed................................." - echo -e "" - fi -} function import_date() { if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then if [[ -z "$import_settings" ]]; then @@ -402,7 +215,7 @@ function install_watchdog() { echo -e "${ARROW} ${CYAN}Creating config file....${NC}" fix_action='1' if [[ "$import_settings" == "0" && -f /home/$USER/install_conf.json ]]; then - watchdog_conf + watchdog_conf_create if [[ -f /home/$USER/watchdog/watchdog.js ]]; then current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." @@ -414,7 +227,7 @@ function install_watchdog() { return fi if [[ "$IMPORT_ZELCONF" == "1" ]]; then - watchdog_conf + watchdog_conf_create if [[ -f /home/$USER/watchdog/watchdog.js ]]; then current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." @@ -552,7 +365,7 @@ function install_watchdog() { else eps_limit=0; fi - watchdog_conf + watchdog_conf_create pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 pm2 save > /dev/null 2>&1 if [[ -f /home/$USER/watchdog/watchdog.js ]]; then @@ -688,20 +501,6 @@ function wipe_clean() { echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" fi } -function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - done - done - echo -ne "${MSG2}" -} function ssh_port() { if [[ -z "$ssh_port" ]]; then SSHPORT=$(grep -w Port /etc/ssh/sshd_config | sed -e 's/.*Port //') @@ -736,7 +535,7 @@ function create_conf() { PASSWORD=${WANIP}-$(date +%s) fi mkdir /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - flux_daemon_conf + flux_daemon_conf_create if [[ "$IMPORT_ZELID" == "0" ]]; then while true do @@ -976,7 +775,7 @@ function install_flux() { git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Creating FluxOS configuration file...${NC}" - fluxOS_conf + fluxos_conf_create if [ -d ~/$FLUX_DIR ]; then current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) string_limit_check_mark "FluxOS v$current_ver installed................................." "FluxOS ${GREEN}v$current_ver${CYAN} installed................................." @@ -1049,7 +848,7 @@ function status_loop() { done fi install_watchdog - check + finalizing display_banner } #end of functions diff --git a/multitoolbox.sh b/multitoolbox.sh index a14ed9a3..f0b88d67 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,420 +1,338 @@ #!/bin/bash if ! [[ -z $1 ]]; then - if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then - export ROOT_BRANCH="$1" - export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH - unset ROOT_BRANCH - unset BRANCH_ALREADY_REFERENCED - exit - fi + if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then + export ROOT_BRANCH="$1" + export BRANCH_ALREADY_REFERENCED='1' + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCED + exit + fi else - export ROOT_BRANCH='master' + export ROOT_BRANCH='master' fi - source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" - - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' else - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' fi FLUX_DIR='zelflux' FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' -Server_offline=0 - dversion="v7.3" PM2_INSTALL="0" zelflux_setting_import="0" - function config_veryfity(){ - - if [[ -f /home/$USER/.flux/flux.conf ]]; then - + if [[ -f /home/$USER/.flux/flux.conf ]]; then echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) - if [[ "$insightexplorer" == "1" ]]; then - - echo -e "${ARROW} ${CYAN}Insightexplorer enabled.............[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Insightexplorer enabled..............[${CHECK_MARK}${CYAN}]${NC}" echo "" - else - - echo -e "${WORNING} ${CYAN}Insightexplorer enabled.............[${X_MARK}${CYAN}]${NC}" + echo -e "${WORNING} ${CYAN}Insightexplorer disabled.............[${X_MARK}${CYAN}]${NC}" echo -e "${WORNING} ${CYAN}Use option 2 for node re-install${NC}" echo -e "" exit - fi - fi - } - - function config_file() { + if [[ -f /home/$USER/install_conf.json ]]; then + + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') + bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') + use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') + prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') + outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') + index=$(cat /home/$USER/install_conf.json | jq -r '.index') + zel_id=$(cat /home/$USER/install_conf.json | jq -r '.zelid') + kda_address=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + + echo -e "${ARROW} ${YELLOW}Install config summary:" + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then + echo -e "${PIN}${CYAN}Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" + else + if [[ "$import_settings" == "1" ]]; then + echo -e "${PIN}${CYAN}Import settings from exist config files..........................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi -if [[ -f /home/$USER/install_conf.json ]]; then - -import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') -bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') -bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') -use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') -prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') -outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') -index=$(cat /home/$USER/install_conf.json | jq -r '.index') -zel_id=$(cat /home/$USER/install_conf.json | jq -r '.zelid') -kda_address=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') - -echo -e "${ARROW} ${YELLOW}Install config summary:" -if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then -echo -e "${PIN}${CYAN}Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else - -if [[ "$import_settings" == "1" ]]; then -echo -e "${PIN}${CYAN}Import settings from exist config files..........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -fi - -if [[ "$use_old_chain" == "1" ]]; then -echo -e "${PIN}${CYAN}Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - -else - -if [[ "$bootstrap_url" == "" ]]; then -echo -e "${PIN}${CYAN}Use Flux Bootstrap from source build in scripts..................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN}Use Flux Bootstrap from own source...............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -if [[ "$bootstrap_zip_del" == "1" ]]; then -echo -e "${PIN}${CYAN}Remove Flux Bootstrap archive file...............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN}Leave Flux Bootstrap archive file................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -fi - - -if [[ ( "$discord" != "" && "$discord" != "0" ) || "$telegram_alert" == '1' ]]; then -echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -else -echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi + if [[ "$use_old_chain" == "1" ]]; then + echo -e "${PIN}${CYAN}Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" + else + if [[ "$bootstrap_url" == "" ]]; then + echo -e "${PIN}${CYAN}Use Flux Bootstrap from source build in scripts..................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${PIN}${CYAN}Use Flux Bootstrap from own source...............................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$bootstrap_zip_del" == "1" ]]; then + echo -e "${PIN}${CYAN}Remove Flux Bootstrap archive file...............................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${PIN}${CYAN}Leave Flux Bootstrap archive file................................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi -if [[ ( "$enable_upnp" != "" && "$enable_upnp" != "0" ) ]]; then - echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 0.5 - echo -e "${CYAN} UPnP Port: ${GREEN}$upnp_port${NC}" && sleep 0.5 - echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" && sleep 0.5 -fi + if [[ ( "$discord" != "" && "$discord" != "0" ) || "$telegram_alert" == '1' ]]; then + echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" + fi -fi + if [[ ( "$enable_upnp" != "" && "$enable_upnp" != "0" ) ]]; then + echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${CYAN} UPnP Port: ${GREEN}$upnp_port${NC}" + echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" + fi + fi } - - - function install_flux() { -echo -e "${GREEN}Module: Re-install FluxOS${NC}" -echo -e "${YELLOW}================================================================${NC}" + echo -e "${GREEN}Module: Re-install FluxOS${NC}" + echo -e "${YELLOW}================================================================${NC}" -if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit -fi + fi - if pm2 -v > /dev/null 2>&1; then - pm2 del zelflux > /dev/null 2>&1 - pm2 del flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - fi + if pm2 -v > /dev/null 2>&1; then + pm2 del zelflux > /dev/null 2>&1 + pm2 del flux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + fi -docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) -resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) -mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) - -if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then -echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 -echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 -echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 -fi - -if [[ $docker_check != 0 ]]; then -echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 -echo -e "${ARROW} ${CYAN}Removing containers...${NC}" -sudo aa-remove-unknown > /dev/null 2>&1 && sudo service docker restart > /dev/null 2>&1 && sleep 2 - -#docker ps | grep -Eo "^[0-9a-z]{8,}\b" | -docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | -while read line; do -sudo docker stop $line > /dev/null 2>&1 && sleep 2 -sudo docker rm $line > /dev/null 2>&1 && sleep 2 -done -fi + docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) + resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) + mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) + if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then + echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" + echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" + echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 + fi -if [[ $resource_check != 0 ]]; then -echo -e "${ARROW} ${YELLOW}Detected locked resource...${NC}" && sleep 1 -echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" && sleep 1 -df | egrep 'flux' | awk '{ print $1}' | -while read line; do -sudo umount -l $line && sleep 1 -done -fi + if [[ $docker_check != 0 ]]; then + echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" + echo -e "${ARROW} ${CYAN}Removing containers...${NC}" + sudo aa-remove-unknown > /dev/null 2>&1 && sudo service docker restart > /dev/null 2>&1 + docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | + while read line; do + sudo docker stop $line > /dev/null 2>&1 && sleep 1 + sudo docker rm $line > /dev/null 2>&1 && sleep 1 + done + fi -if [ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]; then + if [[ $resource_check != 0 ]]; then + echo -e "${ARROW} ${YELLOW}Detected locked resource...${NC}" + echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" + df | egrep 'flux' | awk '{ print $1}' | + while read line; do + sudo umount -l $line + done + fi + if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then echo -e "${ARROW} ${CYAN}Importing setting...${NC}" zel_id=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') WANIP=$(grep -w ipaddress /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*ipaddress: .//' | sed -e 's/.\{2\}$//') - - echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$zel_id${NC}" && sleep 1 - + echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$zel_id${NC}" KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - - echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" && sleep 1 - + echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" fi - - - echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" && sleep 1 - echo + echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" + echo -e "" echo -e "${ARROW} ${CYAN}Removing any instances of Flux....${NC}" - sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 2 - #sudo rm -rf zelflux > /dev/null 2>&1 && sleep 2 + sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 zelflux_setting_import="1" + fi -fi - -if [ -d /home/$USER/$FLUX_DIR ]; then - + if [ -d /home/$USER/$FLUX_DIR ]; then echo -e "${ARROW} ${CYAN}Removing any instances of Flux....${NC}" - #sudo rm -rf zelflux > /dev/null 2>&1 && sleep 2 - sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 2 - -fi - -echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" -#git clone --single-branch --branch development https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 -git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 2 - -if [ -d /home/$USER/$FLUX_DIR ] -then - -if [[ -f /home/$USER/$FLUX_DIR/package.json ]]; then - current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) -else - string_limit_x_mark "Flux was not downloaded, run script again..........................................." - echo - exit -fi - -string_limit_check_mark "Flux v$current_ver downloaded..........................................." "Flux ${GREEN}v$current_ver${CYAN} downloaded..........................................." -else -string_limit_x_mark "Flux was not downloaded, run script again..........................................." -echo -exit -fi - - -if [[ "$zelflux_setting_import" == "0" ]]; then + sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 + fi -ip_confirm + echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" + git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 1 + if [[ -d /home/$USER/$FLUX_DIR ]]; then -while true - do - zel_id="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then - string_limit_check_mark "Zel ID is valid..........................................." - break + if [[ -f /home/$USER/$FLUX_DIR/package.json ]]; then + current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) else - string_limit_x_mark "Zel ID is not valid try again..........................................." - sleep 2 - fi - - done - - - touch ~/$FLUX_DIR/config/userconfig.js - cat << EOF > ~/$FLUX_DIR/config/userconfig.js -module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${zel_id}', - testnet: false - } - } -EOF - -else - -if [[ "$KDA_A" != "" ]]; then - - touch ~/$FLUX_DIR/config/userconfig.js - cat << EOF > ~/$FLUX_DIR/config/userconfig.js -module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${zel_id}', - kadena: '${KDA_A}', - testnet: false - } - } -EOF - -else - - touch ~/$FLUX_DIR/config/userconfig.js - cat << EOF > ~/$FLUX_DIR/config/userconfig.js -module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${zel_id}', - testnet: false - } - } -EOF + string_limit_x_mark "Flux was not downloaded, run script again..........................................." + echo + exit + fi + string_limit_check_mark "Flux v$current_ver downloaded..........................................." "Flux ${GREEN}v$current_ver${CYAN} downloaded..........................................." + else + string_limit_x_mark "Flux was not downloaded, run script again..........................................." + echo + exit + fi -fi + if [[ "$zelflux_setting_import" == "0" ]]; then + get_ip "install" + while true + do + zel_id="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + done -fi + while true + do + KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=0" + sleep 2 + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + fluxOS_conf + fi -if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then -string_limit_check_mark "Flux configuration successfull..........................................." -else -string_limit_x_mark "Flux installation failed, missing config file..........................................." -echo -exit -fi - - if pm2 -v > /dev/null 2>&1; then - - rm restart_zelflux.sh > /dev/null 2>&1 - pm2 del flux > /dev/null 2>&1 - pm2 del zelflux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" - echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" - echo - pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=60000 --max-restarts=40 --name flux --time > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - pm2 list + if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + string_limit_check_mark "Flux configuration successfull..........................................." + else + string_limit_x_mark "Flux installation failed, missing config file..........................................." + echo + exit + fi - else - - pm2_install() + if pm2 -v > /dev/null 2>&1; then + rm restart_zelflux.sh > /dev/null 2>&1 + pm2 del flux > /dev/null 2>&1 + pm2 del zelflux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" + echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" + echo -e "" + pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=60000 --max-restarts=40 --name flux --time > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + pm2 list + else + pm2_install if [[ "$PM2_INSTALL" == "1" ]]; then echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" echo pm2 list fi - fi - + fi } - function create_config() { - - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit -fi - -echo -e "${GREEN}Module: Create FluxNode installation config file${NC}" -echo -e "${YELLOW}================================================================${NC}" - - -if jq --version > /dev/null 2>&1; then - sleep 0.2 -else - echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" - sudo apt install jq -y > /dev/null 2>&1 - - if jq --version > /dev/null 2>&1 - then + fi + echo -e "${GREEN}Module: Create FluxNode installation config file${NC}" + echo -e "${YELLOW}================================================================${NC}" + if jq --version > /dev/null 2>&1; then + sleep 0.2 + else + echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" + sudo apt install jq -y > /dev/null 2>&1 + if jq --version > /dev/null 2>&1; then #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." echo else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" + #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" string_limit_x_mark "JQ was not installed................................." echo exit fi -fi - -skip_zelcash_config='0' -skip_bootstrap='0' - -if [[ -d /home/$USER/$CONFIG_DIR ]]; then - - if whiptail --yesno "Would you like import old settings from daemon and Flux?" 8 65; then - import_settings='1' - skip_zelcash_config='1' - sleep 1 - else - import_settings='0' - sleep 1 + fi + skip_zelcash_config='0' + skip_bootstrap='0' + if [[ -d /home/$USER/$CONFIG_DIR ]]; then + if whiptail --yesno "Would you like import old settings from daemon and Flux?" 8 65; then + import_settings='1' + skip_zelcash_config='1' + sleep 1 + else + import_settings='0' + sleep 1 + fi + if whiptail --yesno "Would you like use exist Flux chain?" 8 65; then + use_old_chain='1' + skip_bootstrap='1' + sleep 1 + else + use_old_chain='0' + sleep 1 + fi fi - if whiptail --yesno "Would you like use exist Flux chain?" 8 65; then - use_old_chain='1' - skip_bootstrap='1' - sleep 1 + if [[ "$skip_zelcash_config" == "1" ]]; then + prvkey="" + outpoint="" + index="" + zelid="" + kda_address="" + node_label="0" + fix_action="1" + eps_limit="0" + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" else - use_old_chain='0' + prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) + sleep 1 + outpoint=$(whiptail --inputbox "Enter your FluxNode Collateral TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) + sleep 1 + index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) + sleep 1 + while true + do + zel_id=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) + if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then + echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" + sleep 4 + fi + done + sleep 1 + while true + do + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=0" + sleep 2 + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done sleep 1 - fi - -fi - -if [[ "$skip_zelcash_config" == "1" ]]; then - - prvkey="" - outpoint="" - index="" - zelid="" - kda_address="" - node_label="0" - fix_action="1" - eps_limit="0" - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - -else - - prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) - sleep 1 - outpoint=$(whiptail --inputbox "Enter your FluxNode Collateral TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) - sleep 1 - index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) - sleep 1 - zel_id=$(whiptail --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) - sleep 1 - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - sleep 1 - if whiptail --yesno "Would you like enable autoupdate?" 8 65; then zelflux_update='1' zelcash_update='1' @@ -424,18 +342,10 @@ else zelcash_update='0' zelbench_update='0' fi - - - if [[ "$KDA_A" == "" ]]; then - kda_address="" - else - kda_address="kadena:$KDA_A?chainid=0" - fi - - if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then - enable_upnp='1' - gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router)" 8 85 3>&1 1>&2 2>&3) - upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ + if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then + enable_upnp='1' + gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router)" 8 85 3>&1 1>&2 2>&3) + upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ "Use the UP/DOWN arrows to highlight the port you want. Press Spacebar on the port you want to select, THEN press ENTER." 17 50 8 \ "16127" "" ON \ "16137" "" OFF \ @@ -445,23 +355,19 @@ else "16177" "" OFF \ "16187" "" OFF \ "16197" "" OFF 3>&1 1>&2 2>&3) - else - enable_upnp="0" - gateway_ip="" - upnp_port="" - fi + else + enable_upnp="0" + gateway_ip="" + upnp_port="" + fi - if whiptail --yesno "Would you like enable alert notification?" 8 65; then - + if whiptail --yesno "Would you like enable alert notification?" 8 65; then whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 sleep 1 - CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ "1" "Discord notification " ON \ "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) - - if [ -z "$CHOICES" ]; then - + if [[ -z "$CHOICES" ]]; then echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" sleep 1 discord="0" @@ -470,378 +376,276 @@ else telegram_bot_token="0" telegram_chat_id="0" node_label="0" - else - - for CHOICE in $CHOICES; do - case "$CHOICE" in - "1") - - discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) - sleep 1 - - if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - - while true - do - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) - if [[ $ping == ?(-)+([0-9]) ]]; then - string_limit_check_mark "UserID is valid..........................................." - break - else - string_limit_x_mark "UserID is not valid try again............................." - sleep 1 - fi - done - - sleep 1 - + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break else - ping="0" - sleep 1 - fi - - ;; - "2") - + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + else + ping="0" + sleep 1 + fi + ;; + "2") telegram_alert="1" - - while true - do - telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) - if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then string_limit_check_mark "Bot token is valid..........................................." break - else - string_limit_x_mark "Bot token is not valid try again............................." - sleep 1 - fi - done - - sleep 1 - - while true - do - telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) - if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then - string_limit_check_mark "Chat ID is valid..........................................." - break - else - string_limit_x_mark "Chat ID is not valid try again............................." - sleep 1 - fi + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + sleep 1 + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + ;; + esac done + fi + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + else + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" + sleep 1 + fi - sleep 1 - - ;; - esac - done -fi - - while true - do - node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - string_limit_check_mark "Node name is valid..........................................." - break - else - string_limit_x_mark "Node name is not valid try again............................." - sleep 1 - fi - done - -else - - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - node_label="0" - sleep 1 - -fi - - -if [[ "$discord" == 0 ]]; then - ping="0" -fi - - -if [[ "$telegram_alert" == 0 || "$telegram_alert" == "" ]]; then - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" -fi - - index_from_file="$index" - tx_from_file="$outpoint" - stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - -if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -sSL -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') -fi - -if [[ $stak_info == ?(-)+([0-9]) ]]; then - - case $stak_info in - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; - esac - -else - eps_limit=0; -fi - - - -if [[ "$skip_bootstrap" == "0" ]]; then + if [[ "$discord" == 0 ]]; then + ping="0" + fi - if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then - - bootstrap_url="0" - sleep 1 + if [[ "$telegram_alert" == 0 || "$telegram_alert" == "" ]]; then + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + fi - else - bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) - sleep 1 + index_from_file="$index" + tx_from_file="$outpoint" + stak_info=$(curl -sSL -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -sSL -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + fi + if [[ $stak_info == ?(-)+([0-9]) ]]; then + case $stak_info in + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; + esac + else + eps_limit=0; + fi fi - - if whiptail --yesno "Would you like keep bootstrap archive file localy?" 8 65; then - bootstrap_zip_del='0' - sleep 1 - else - bootstrap_zip_del='1' - sleep 1 + if [[ "$skip_bootstrap" == "0" ]]; then + if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then + bootstrap_url="0" + sleep 1 + else + bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) + sleep 1 + fi + if whiptail --yesno "Would you like keep bootstrap archive file localy?" 8 65; then + bootstrap_zip_del='0' + sleep 1 + else + bootstrap_zip_del='1' + sleep 1 + fi fi - -fi - -fi - -firewall_disable='1' -swapon='1' - -rm /home/$USER/install_conf.json > /dev/null 2>&1 -sudo touch /home/$USER/install_conf.json -sudo chown $USER:$USER /home/$USER/install_conf.json - cat << EOF > /home/$USER/install_conf.json -{ - "import_settings": "${import_settings}", - "prvkey": "${prvkey}", - "outpoint": "${outpoint}", - "index": "${index}", - "zelid": "${zel_id}", - "kda_address": "${kda_address}", - "firewall_disable": "${firewall_disable}", - "bootstrap_url": "${bootstrap_url}", - "bootstrap_zip_del": "${bootstrap_zip_del}", - "swapon": "${swapon}", - "use_old_chain": "${use_old_chain}", - "node_label": "${node_label}", - "zelflux_update": "${zelflux_update}", - "zelcash_update": "${zelcash_update}", - "zelbench_update": "${zelbench_update}", - "discord": "${discord}", - "ping": "${ping}", - "telegram_alert": "${telegram_alert}", - "telegram_bot_token": "${telegram_bot_token}", - "telegram_chat_id": "${telegram_chat_id}", - "eps_limit": "${eps_limit}", - "enable_upnp": "${enable_upnp}", - "upnp_port": "${FLUX_PORT}", - "gateway_ip": "${gateway_ip}" + firewall_disable='1' + swapon='1' + rm /home/$USER/install_conf.json > /dev/null 2>&1 + install_conf_create + config_file + echo -e } -EOF - -config_file -echo - -} - - function install_watchdog() { - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit -fi - -echo -e "${GREEN}Module: Install watchdog for FluxNode${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if ! pm2 -v > /dev/null 2>&1 -then -pm2_install - if [[ "$PM2_INSTALL" == "0" ]]; then - exit - fi -echo -e "" -fi - -echo -e "${ARROW} ${CYAN}Cleaning...${NC}" -pm2 del watchdog > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 -sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 - -echo -e "${ARROW} ${CYAN}Downloading...${NC}" -cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 -mv post-merge /home/$USER/watchdog/.git/hooks/post-merge -sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge -echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" -cd watchdog && npm install > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Creating config file....${NC}" - - -if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then -flux_update='1' -sleep 1 -else -flux_update='0' -sleep 1 -fi - -if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then -daemon_update='1' -sleep 1 -else -daemon_update='0' -sleep 1 -fi - -if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then -bench_update='1' -sleep 1 -else -bench_update='0' -sleep 1 -fi - -#if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then -fix_action='1' -#sleep 1 -#else -#fix_action='0' -##sleep 1 -#fi - -telegram_alert=0; -discord=0; - -if whiptail --yesno "Would you like enable alert notification?" 8 60; then - -sleep 1 - -whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 - -sleep 1 - -CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ - "1" "Discord notification " ON \ - "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) - -if [ -z "$CHOICES" ]; then - - echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" - sleep 1 - discord=0; - ping=0; + fi + echo -e "${GREEN}Module: Install watchdog for FluxNode${NC}" + echo -e "${YELLOW}================================================================${NC}" + if ! pm2 -v > /dev/null 2>&1; then + pm2_install + if [[ "$PM2_INSTALL" == "0" ]]; then + exit + fi + echo -e "" + fi + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + pm2 del watchdog > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Downloading...${NC}" + cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" + wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 + mv post-merge /home/$USER/watchdog/.git/hooks/post-merge + sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge + echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" + cd watchdog && npm install > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Creating config file....${NC}" + if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then + flux_update='1' + sleep 1 + else + flux_update='0' + sleep 1 + fi + if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then + daemon_update='1' + sleep 1 + else + daemon_update='0' + sleep 1 + fi + if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then + bench_update='1' + sleep 1 + else + bench_update='0' + sleep 1 + fi + #if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then + fix_action='1' + #sleep 1 + #else + #fix_action='0' + ##sleep 1 + #fi telegram_alert=0; - telegram_bot_token=0; - telegram_chat_id=0; - node_label=0; - -else - for CHOICE in $CHOICES; do - case "$CHOICE" in - "1") - - discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + discord=0; + if whiptail --yesno "Would you like enable alert notification?" 8 60; then + sleep 1 + whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 + sleep 1 + CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + if [[ -z "$CHOICES" ]]; then + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" sleep 1 + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + node_label=0; + else + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + else + ping=0; + sleep 1 + fi + ;; + "2") + telegram_alert=1; + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done - if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - - while true - do - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) - if [[ $ping == ?(-)+([0-9]) ]]; then - string_limit_check_mark "UserID is valid..........................................." - break - else - string_limit_x_mark "UserID is not valid try again............................." - sleep 1 - fi - done + sleep 1 + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done - sleep 1 + sleep 1 + ;; + esac + done + fi + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break else - ping=0; + string_limit_x_mark "Node name is not valid try again............................." sleep 1 - fi - - ;; - "2") - - telegram_alert=1; - - while true - do - telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) - if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then - string_limit_check_mark "Bot token is valid..........................................." - break - else - string_limit_x_mark "Bot token is not valid try again............................." - sleep 1 - fi + fi done - - sleep 1 - - while true - do - telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) - if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then - string_limit_check_mark "Chat ID is valid..........................................." - break - else - string_limit_x_mark "Chat ID is not valid try again............................." - sleep 1 - fi - done - - sleep 1 - - ;; - esac - done -fi - - while true - do - node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - string_limit_check_mark "Node name is valid..........................................." - break - else - string_limit_x_mark "Node name is not valid try again............................." - sleep 1 - fi - done - - sleep 1 - - -else - + sleep 1 + else node_label=0; discord=0; ping=0; @@ -849,529 +653,266 @@ else telegram_bot_token=0; telegram_chat_id=0; sleep 1 -fi - - -if [[ $discord == 0 ]]; then + fi + if [[ $discord == 0 ]]; then ping=0; -fi - - -if [[ $telegram_alert == 0 ]]; then + fi + if [[ $telegram_alert == 0 ]]; then telegram_bot_token=0; telegram_chat_id=0; -fi - - -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - + fi + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi -fi - -if [[ $stak_info == ?(-)+([0-9]) ]]; then - - case $stak_info in - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; - esac - -else -eps_limit=0; -fi - - - -sudo touch /home/$USER/watchdog/config.js -sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat << EOF > /home/$USER/watchdog/config.js -module.exports = { - label: '${node_label}', - tier_eps_min: '${eps_limit}', - zelflux_update: '${flux_update}', - zelcash_update: '${daemon_update}', - zelbench_update: '${bench_update}', - action: '${fix_action}', - ping: '${ping}', - web_hook_url: '${discord}', - telegram_alert: '${telegram_alert}', - telegram_bot_token: '${telegram_bot_token}', - telegram_chat_id: '${telegram_chat_id}' -} -EOF - -echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" -pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 -pm2 save > /dev/null 2>&1 -if [[ -f /home/$USER/watchdog/watchdog.js ]] -then -current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) -#echo -e "${ARROW} ${CYAN}Watchdog ${GREEN}v$current_ver${CYAN} installed successful.${NC}" -string_limit_check_mark "Watchdog v$current_ver installed..........................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed..........................................." -else -#echo -e "${ARROW} ${CYAN}Watchdog installion failed.${NC}" -string_limit_x_mark "Watchdog was not installed..........................................." -fi -echo + fi + if [[ $stak_info == ?(-)+([0-9]) ]]; then + case $stak_info in + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; + esac + else + eps_limit=0; + fi + watchdog_conf_create + echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + if [[ -f /home/$USER/watchdog/watchdog.js ]]; then + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + string_limit_check_mark "Watchdog v$current_ver installed..........................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed..........................................." + else + string_limit_x_mark "Watchdog was not installed..........................................." + fi + echo -e "" } - - - function flux_daemon_bootstrap() { - - echo -e "${GREEN}Module: Restore Flux blockchain from bootstrap${NC}" + echo -e "${GREEN}Module: Restore Flux blockchain from bootstrap${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - cd echo -e "${NC}" - config_veryfity - bootstrap + exit + fi + cd + echo -e "${NC}" + config_veryfity + bootstrap } - - function install_node(){ - -echo -e "${GREEN}Module: Install FluxNode${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${GREEN}Module: Install FluxNode${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit -fi - -if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit -fi - -if [[ $(lsb_release -cs) == "jammy" ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit -fi - - -if sudo docker run hello-world > /dev/null 2>&1 -then -echo -e "" -else -echo -e "${WORNING}${CYAN}Docker is not working correct or is not installed.${NC}" -exit -fi - - -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) - - + fi + if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + if [[ $(lsb_release -cs) == "jammy" ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + if sudo docker run hello-world > /dev/null 2>&1; then + echo -e "" + else + echo -e "${WORNING}${CYAN}Docker is not working correct or is not installed.${NC}" + exit + fi + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) } - - function install_docker(){ - -echo -e "${GREEN}Module: Install Docker${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" != "root" ]]; then + echo -e "${GREEN}Module: Install Docker${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" != "root" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the root account use command 'sudo su -'.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit -fi - - - -if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then - + fi + if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit - -fi - -if [[ $(lsb_release -cs) == "jammy" ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit -fi - -if [[ -z "$usernew" ]]; then - usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" - usernew=$(awk '{print tolower($0)}' <<< "$usernew") -else - echo -e "${PIN}${CYAN} Import docker user '$usernew' from environment variable............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 -fi - -echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" -adduser --gecos "" "$usernew" -usermod -aG sudo "$usernew" > /dev/null 2>&1 -echo -e "${ARROW} ${YELLOW}Update and upgrade system...${NC}" -apt update -y && apt upgrade -y -if ! ufw version > /dev/null 2>&1 -then -echo -e "${ARROW} ${YELLOW}Installing ufw firewall..${NC}" -sudo apt-get install -y ufw > /dev/null 2>&1 -fi - -cron_check=$(systemctl status cron 2> /dev/null | grep 'active' | wc -l) -if [[ "$cron_check" == "0" ]]; then -echo -e "${ARROW} ${YELLOW}Installing crontab...${NC}" -sudo apt-get install -y cron > /dev/null 2>&1 -fi - -echo -e "${ARROW} ${YELLOW}Installing docker...${NC}" -echo -e "${ARROW} ${CYAN}Architecture: ${GREEN}$(dpkg --print-architecture)${NC}" - -if [[ -f /usr/share/keyrings/docker-archive-keyring.gpg ]]; then + fi + if [[ $(lsb_release -cs) == "jammy" ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + if [[ -z "$usernew" ]]; then + usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" + usernew=$(awk '{print tolower($0)}' <<< "$usernew") + else + echo -e "${PIN}${CYAN} Import docker user '$usernew' from environment variable............[${CHECK_MARK}${CYAN}]${NC}" + fi + echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" + adduser --gecos "" "$usernew" + usermod -aG sudo "$usernew" > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Update and upgrade system...${NC}" + apt update -y && apt upgrade -y + if ! ufw version > /dev/null 2>&1; then + echo -e "${ARROW} ${YELLOW}Installing ufw firewall..${NC}" + sudo apt-get install -y ufw > /dev/null 2>&1 + fi + cron_check=$(systemctl status cron 2> /dev/null | grep 'active' | wc -l) + if [[ "$cron_check" == "0" ]]; then + echo -e "${ARROW} ${YELLOW}Installing crontab...${NC}" + sudo apt-get install -y cron > /dev/null 2>&1 + fi + echo -e "${ARROW} ${YELLOW}Installing docker...${NC}" + echo -e "${ARROW} ${CYAN}Architecture: ${GREEN}$(dpkg --print-architecture)${NC}" + if [[ -f /usr/share/keyrings/docker-archive-keyring.gpg ]]; then sudo rm /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 -fi - -if [[ -f /etc/apt/sources.list.d/docker.list ]]; then + fi + if [[ -f /etc/apt/sources.list.d/docker.list ]]; then sudo rm /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 -fi - - -if [[ $(lsb_release -d) = *Debian* ]] -then - -sudo apt-get remove docker docker-engine docker.io containerd runc -y > /dev/null 2>&1 -sudo apt-get update -y > /dev/null 2>&1 -sudo apt-get -y install apt-transport-https ca-certificates > /dev/null 2>&1 -sudo apt-get -y install curl gnupg-agent software-properties-common > /dev/null 2>&1 -#curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - > /dev/null 2>&1 -#sudo add-apt-repository -y "deb [arch=amd64,arm64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /dev/null 2>&1 -curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 -sudo apt-get update -y > /dev/null 2>&1 -sudo apt-get install docker-ce docker-ce-cli containerd.io -y > /dev/null 2>&1 - -else - -sudo apt-get remove docker docker-engine docker.io containerd runc -y > /dev/null 2>&1 -sudo apt-get -y install apt-transport-https ca-certificates > /dev/null 2>&1 -sudo apt-get -y install curl gnupg-agent software-properties-common > /dev/null 2>&1 - -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 -#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - > /dev/null 2>&1 -#sudo add-apt-repository -y "deb [arch=amd64,arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /dev/null 2>&1 -sudo apt-get update -y > /dev/null 2>&1 -sudo apt-get install docker-ce docker-ce-cli containerd.io -y > /dev/null 2>&1 - -fi - -# echo -e "${YELLOW}Creating docker group..${NC}" -# groupadd docker -echo -e "${ARROW} ${YELLOW}Adding $usernew to docker group...${NC}" -adduser "$usernew" docker -echo -e "${NC}" -echo -e "${YELLOW}=====================================================${NC}" -echo -e "${YELLOW}Running through some checks...${NC}" -echo -e "${YELLOW}=====================================================${NC}" - -if sudo docker run hello-world > /dev/null 2>&1 -then - echo -e "${CHECK_MARK} ${CYAN}Docker is installed${NC}" -else - echo -e "${X_MARK} ${CYAN}Docker did not installed${NC}" -fi - -if [[ $(getent group docker | grep "$usernew") ]] -then - echo -e "${CHECK_MARK} ${CYAN}User $usernew is member of 'docker'${NC}" -else - echo -e "${X_MARK} ${CYAN}User $usernew is not member of 'docker'${NC}" -fi - -echo -e "${YELLOW}=====================================================${NC}" -echo -e "${NC}" -read -p "Would you like switch to user account Y/N?" -n 1 -r -echo -e "${NC}" -if [[ $REPLY =~ ^[Yy]$ ]] -then -su - $usernew -fi - + fi + if [[ $(lsb_release -d) = *Debian* ]]; then + sudo apt-get remove docker docker-engine docker.io containerd runc -y > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get -y install apt-transport-https ca-certificates > /dev/null 2>&1 + sudo apt-get -y install curl gnupg-agent software-properties-common > /dev/null 2>&1 + #curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - > /dev/null 2>&1 + #sudo add-apt-repository -y "deb [arch=amd64,arm64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /dev/null 2>&1 + curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get install docker-ce docker-ce-cli containerd.io -y > /dev/null 2>&1 + else + sudo apt-get remove docker docker-engine docker.io containerd runc -y > /dev/null 2>&1 + sudo apt-get -y install apt-transport-https ca-certificates > /dev/null 2>&1 + sudo apt-get -y install curl gnupg-agent software-properties-common > /dev/null 2>&1 + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 + #curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - > /dev/null 2>&1 + #sudo add-apt-repository -y "deb [arch=amd64,arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get install docker-ce docker-ce-cli containerd.io -y > /dev/null 2>&1 + fi + echo -e "${ARROW} ${YELLOW}Adding $usernew to docker group...${NC}" + adduser "$usernew" docker + echo -e "${NC}" + echo -e "${YELLOW}=====================================================${NC}" + echo -e "${YELLOW}Running through some checks...${NC}" + echo -e "${YELLOW}=====================================================${NC}" + if sudo docker run hello-world > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN}Docker is installed${NC}" + else + echo -e "${X_MARK} ${CYAN}Docker did not installed${NC}" + fi + if [[ $(getent group docker | grep "$usernew") ]]; then + echo -e "${CHECK_MARK} ${CYAN}User $usernew is member of 'docker'${NC}" + else + echo -e "${X_MARK} ${CYAN}User $usernew is not member of 'docker'${NC}" + fi + echo -e "${YELLOW}=====================================================${NC}" + echo -e "${NC}" + read -p "Would you like switch to user account Y/N?" -n 1 -r + echo -e "${NC}" + if [[ $REPLY =~ ^[Yy]$ ]]; then + su - $usernew + fi } - -function daemon_reconfiguration() -{ - -echo -e "${GREEN}Module: Flux Daemon Reconfiguration${NC}" -echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then +function daemon_reconfiguration(){ + echo -e "${GREEN}Module: Flux Daemon Reconfiguration${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit -fi - -config_veryfity - -echo -echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" -sleep 4 -skip_change='3' -zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" -sleep 1 -zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3)" -sleep 1 -zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" -sleep 1 -#externalip="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode IP" 8 60 3>&1 1>&2 2>&3)" -#sleep 1 - -if [[ "$zelnodeprivkey" == "" ]]; then -skip_change=$((skip_change-1)) -echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" -fi - -if [[ "$zelnodeoutpoint" == "" ]]; then -skip_change=$((skip_change-1)) -echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" -fi - -if [[ "$zelnodeindex" == "" ]]; then -skip_change=$((skip_change-1)) -echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" -fi - -#if [[ "$externalip" == "" ]]; then -#skip_change=$((skip_change-1)) -#echo -e "${ARROW} ${CYAN}Replace FluxNode IP skipped.........................[${CHECK_MARK}${CYAN}]${NC}" -#fi - - -if [[ "$skip_change" == "0" ]]; then -echo -e "${ARROW} ${YELLOW}All fields are empty changes skipped...${NC}" -echo -exit -fi - -echo -e "${ARROW} ${CYAN}Stopping Flux daemon service...${NC}" -sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 -sudo fuser -k 16125/tcp > /dev/null 2>&1 - - -if [[ "$zelnodeprivkey" != "" ]]; then - -if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode identity key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" - fi -fi - -fi - -if [[ "$zelnodeoutpoint" != "" ]]; then - -if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode outpoint replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" - fi -fi - -fi - -if [[ "$zelnodeindex" != "" ]]; then - -if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" - - fi -fi - -fi - -#if [[ "$externalip" != "" ]]; then - -#if [[ "externalip=$externalip" == $(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -#echo -e "${ARROW} ${CYAN}Replace FluxNode IP skipped.........................[${CHECK_MARK}${CYAN}]${NC}" - # else - # sed -i "s/$(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE)/externalip=$externalip/" ~/$CONFIG_DIR/$CONFIG_FILE - #if [[ "externalip=$externalip" == $(grep -w externalip ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - # echo -e "${ARROW} ${CYAN}FluxNode IP replaced successful.....................[${CHECK_MARK}${CYAN}]${NC}" - - # fi -#fi -#fi - -pm2 restart flux > /dev/null 2>&1 -sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 -NUM='35' -MSG1='Restarting daemon service...' -MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo -e "" && echo -e "" - -} - -function create_service_scripts() { - -echo -e "${ARROW} ${CYAN}Creating Flux daemon service scripts...${NC}" && sleep 1 -sudo touch /home/$USER/start_daemon_service.sh -sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - cat <<'EOF' > /home/$USER/start_daemon_service.sh -#!/bin/bash -#color codes -RED='\033[1;31m' -CYAN='\033[1;36m' -NC='\033[0m' -#emoji codes -BOOK="${RED}\xF0\x9F\x93\x8B${NC}" -WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" -sleep 2 -echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" -echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" -bench_status_pind=$(pgrep fluxbenchd) -daemon_status_pind=$(pgrep fluxd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi -bench_status_pind=$(pgrep zelbenchd) -daemon_status_pind=$(pgrep zelcashd) -if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then -echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" -else -if [[ "$bench_status_pind" != "" ]]; then -echo -e "${WORNING} Running benchmark process detected${NC}" -echo -e "${WORNING} Killing benchmark...${NC}" -sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 -fi -if [[ "$daemon_status_pind" != "" ]]; then -echo -e "${WORNING} Running daemon process detected${NC}" -echo -e "${WORNING} Killing daemon...${NC}" -sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 -fi -sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 -fi -if [[ -f /usr/local/bin/fluxd ]]; then -bash -c "fluxd" -exit -else -bash -c "zelcashd" -exit -fi -EOF - - -sudo touch /home/$USER/stop_daemon_service.sh -sudo chown $USER:$USER /home/$USER/stop_daemon_service.sh - cat <<'EOF' > /home/$USER/stop_daemon_service.sh -#!/bin/bash -if [[ -f /usr/local/bin/flux-cli ]]; then -bash -c "flux-cli stop" -else -bash -c "zelcash-cli stop" -fi -exit -EOF - -echo -e "${ARROW} ${CYAN}Setting scripts permissions...${NC}" && sleep 1 -sudo chmod +x /home/$USER/stop_daemon_service.sh -sudo chmod +x /home/$USER/start_daemon_service.sh -echo -e "${ARROW} ${CYAN}Reloading service config...${NC}" && sleep 1 -sudo systemctl daemon-reload > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Starting Flux daemon....${NC}" && sleep 1 -sudo systemctl start zelcash > /dev/null 2>&1 -echo -e "" -} + fi + config_veryfity + echo -e "" + echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" + sleep 2 + skip_change='3' + zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" + sleep 1 + zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3)" + sleep 1 + zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" + sleep 1 + if [[ "$zelnodeprivkey" == "" ]]; then + skip_change=$((skip_change-1)) + echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$zelnodeoutpoint" == "" ]]; then + skip_change=$((skip_change-1)) + echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$zelnodeindex" == "" ]]; then + skip_change=$((skip_change-1)) + echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$skip_change" == "0" ]]; then + echo -e "${ARROW} ${YELLOW}All fields are empty changes skipped...${NC}" + echo + exit + fi + echo -e "${ARROW} ${CYAN}Stopping Flux daemon service...${NC}" + sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 + sudo fuser -k 16125/tcp > /dev/null 2>&1 + if [[ "$zelnodeprivkey" != "" ]]; then + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode identity key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi -function create_service() { + if [[ "$zelnodeoutpoint" != "" ]]; then + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode outpoint replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi - echo -e "${GREEN}Module: Flux Daemon service creator${NC}" - echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - -echo -e "" -echo -e "${ARROW} ${CYAN}Cleaning...${NC}" && sleep 1 -sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 -sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 -sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 -sudo rm -rf /etc/systemd/system/zelcash.service > /dev/null 2>&1 - -echo -e "${ARROW} ${CYAN}Creating Flux daemon service...${NC}" && sleep 1 -sudo touch /etc/systemd/system/zelcash.service -sudo chown $USER:$USER /etc/systemd/system/zelcash.service -cat << EOF > /etc/systemd/system/zelcash.service -[Unit] -Description=Flux daemon service -After=network.target -[Service] -Type=forking -User=$USER -Group=$USER -ExecStart=/home/$USER/start_daemon_service.sh -ExecStop=-/home/$USER/stop_daemon_service.sh -Restart=always -RestartSec=10 -PrivateTmp=true -TimeoutStopSec=60s -TimeoutStartSec=15s -StartLimitInterval=120s -StartLimitBurst=5 -[Install] -WantedBy=multi-user.target -EOF - sudo chown root:root /etc/systemd/system/zelcash.service + if [[ "$zelnodeindex" != "" ]]; then + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi + pm2 restart flux > /dev/null 2>&1 + sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 + NUM='35' + MSG1='Restarting daemon service...' + MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo -e "" && echo -e "" } - function replace_kadena { - while true do KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) @@ -1383,62 +924,40 @@ function replace_kadena { fi break done - - -if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then - - sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js - - if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Kadena address replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then + sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Kadena address replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + fi + else + insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "kadena: '$kda_address'," + echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" fi - -else - - insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "kadena: '$kda_address'," - echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" - -fi - - } - - function replace_zelid() { - -while true + while true do - new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then string_limit_check_mark "Zel ID is valid..........................................." break else string_limit_x_mark "Zel ID is not valid try again..........................................." sleep 2 - fi - + fi done - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js - - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - + echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi } - - function fluxos_reconfiguration { - echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" @@ -1446,82 +965,66 @@ function fluxos_reconfiguration { echo -e "${NC}" exit fi - if ! [[ -f /home/$USER/zelflux/config/userconfig.js ]]; then echo -e "${WORNING} ${CYAN}FluxOS userconfig.js not exist, operation aborted${NC}" echo -e "" exit fi - - CHOICE=$( whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ "1)" "Replace ZELID" \ "2)" "Add/Replace kadena address" 3>&2 2>&1 1>&3 - ) - - -case $CHOICE in - "1)") - replace_zelid - ;; - "2)") - replace_kadena - ;; -esac - + ) + case $CHOICE in + "1)") + replace_zelid + ;; + "2)") + replace_kadena + ;; + esac } - - - function install_watchtower(){ - +function install_watchtower(){ echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" - -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit - fi - -echo -e "" -echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" -apps_check=$(docker ps | grep "flux_watchtower") - -if [[ "$apps_check" != "" ]]; then -echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" -docker stop flux_watchtower > /dev/null 2>&1 -sleep 2 -echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" -docker rm flux_watchtower > /dev/null 2>&1 -fi - -echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" -docker pull containrrr/watchtower:latest > /dev/null 2>&1 -echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" -random=$(shuf -i 7500-35000 -n 1) -echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" -apps_id=$(docker run -d \ ---restart unless-stopped \ ---name flux_watchtower \ --v /var/run/docker.sock:/var/run/docker.sock \ -containrrr/watchtower \ ---cleanup --interval $random 2> /dev/null) -if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then -echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" -else -echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" -fi - - } - + fi + echo -e "" + echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" + apps_check=$(docker ps | grep "flux_watchtower") + if [[ "$apps_check" != "" ]]; then + echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" + docker stop flux_watchtower > /dev/null 2>&1 + sleep 2 + echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" + docker rm flux_watchtower > /dev/null 2>&1 + fi + echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" + docker pull containrrr/watchtower:latest > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" + random=$(shuf -i 7500-35000 -n 1) + echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" + apps_id=$(docker run -d \ + --restart unless-stopped \ + --name flux_watchtower \ + -v /var/run/docker.sock:/var/run/docker.sock \ + containrrr/watchtower \ + --cleanup --interval $random 2> /dev/null) + if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then + echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" + else + echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" + fi - function mongod_db_fix() { +} +function mongod_db_fix() { echo -e "${GREEN}Module: Recover corrupted MongoDB database${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" @@ -1529,7 +1032,6 @@ fi echo -e "${NC}" exit fi - echo -e "" echo -e "${WORNING} ${CYAN}Stopping mongod service ${NC}" && sleep 1 sudo systemctl stop mongod @@ -1541,49 +1043,38 @@ fi echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" && sleep 1 sudo systemctl start mongod echo -e "" - - - } - +} -if ! figlet -v > /dev/null 2>&1 -then -sudo apt-get update -y > /dev/null 2>&1 -sudo apt-get install -y figlet > /dev/null 2>&1 +if ! figlet -v > /dev/null 2>&1; then + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get install -y figlet > /dev/null 2>&1 fi -if ! pv -V > /dev/null 2>&1 -then -sudo apt-get install -y pv > /dev/null 2>&1 +if ! pv -V > /dev/null 2>&1; then + sudo apt-get install -y pv > /dev/null 2>&1 fi -if ! gzip -V > /dev/null 2>&1 -then -sudo apt-get install -y gzip > /dev/null 2>&1 +if ! gzip -V > /dev/null 2>&1; then + sudo apt-get install -y gzip > /dev/null 2>&1 fi -if ! zip -v > /dev/null 2>&1 -then -sudo apt-get install -y zip > /dev/null 2>&1 +if ! zip -v > /dev/null 2>&1; then + sudo apt-get install -y zip > /dev/null 2>&1 fi -if ! whiptail -v > /dev/null 2>&1 -then -sudo apt-get install -y whiptail > /dev/null 2>&1 +if ! whiptail -v > /dev/null 2>&1; then + sudo apt-get install -y whiptail > /dev/null 2>&1 fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then -echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc -echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc -source /etc/bash.bashrc + echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc + echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc + source /etc/bash.bashrc fi if ! wget --version > /dev/null 2>&1 ; then - sudo apt install -y wget > /dev/null 2>&1 && sleep 2 + sudo apt install -y wget > /dev/null 2>&1 && sleep 2 fi - - - clear sleep 1 echo -e "${BLUE}" @@ -1612,9 +1103,7 @@ echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Rout echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " - - case "$REPLY" in - +case "$REPLY" in 1) clear sleep 1 @@ -1635,12 +1124,6 @@ read -rp "Pick an option and hit ENTER: " sleep 1 install_watchdog ;; - -# 5) - # clear - #sleep 1 - #mongodb_bootstrap -# ;; 5) clear sleep 1 @@ -1651,7 +1134,7 @@ read -rp "Pick an option and hit ENTER: " sleep 1 create_config ;; - 7) + 7) clear sleep 1 install_flux @@ -1660,66 +1143,43 @@ read -rp "Pick an option and hit ENTER: " clear sleep 1 daemon_reconfiguration - ;; - -# 10) - # clear - # sleep 1 - # kda_bootstrap - -# ;; - 9) clear sleep 1 - create_oldnode_service - create_oldnode_service_scripts - ;; - + create_service_scripts + create_service + ;; 10) clear sleep 1 selfhosting ;; - - 11) + 11) clear sleep 1 fluxos_reconfiguration echo -e "" ;; - - 12) + 12) clear sleep 1 install_watchtower echo -e "" - ;; - - 13) + ;; + 13) clear sleep 1 mongod_db_fix echo -e "" ;; - - 14) + 14) clear sleep 1 multinode echo -e "" ;; - - -# 8) - #clear - # sleep 1 - #install_kernel -# ;; - - esac - +esac # USED FOR CLEANUP AT END OF SCRIPT unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED From d6e6666237f5f8683f53a666f683078d0c51c983 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Thu, 25 Aug 2022 17:05:51 +0200 Subject: [PATCH 0636/1176] formatting unification and vscode settinga --- .vscode/settings.json | 3 + apps_info.sh | 54 +- cdn-speedtest.sh | 80 +- flux_common.sh | 54 +- install_pro.sh | 1570 ++++++++++++++++--------------- multinode.sh | 336 +++---- multitoolbox.sh | 2052 ++++++++++++++++++++--------------------- 7 files changed, 2075 insertions(+), 2074 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..7ec7eb37 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "bashBeautify.tabSize": 2 +} \ No newline at end of file diff --git a/apps_info.sh b/apps_info.sh index e39a9ec1..17ccf9e9 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -1,15 +1,15 @@ #!/bin/bash if ! [[ -z $1 ]]; then - if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then - export ROOT_BRANCH="$1" - export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/apps_info.sh) $ROOT_BRANCH - unset ROOT_BRANCH - unset BRANCH_ALREADY_REFERENCED - exit - fi + if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then + export ROOT_BRANCH="$1" + export BRANCH_ALREADY_REFERENCED='1' + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/apps_info.sh) $ROOT_BRANCH + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCED + exit + fi else - export ROOT_BRANCH='master' + export ROOT_BRANCH='master' fi source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" apps_info=$(curl -SsL -m 10 https://api.runonflux.io/apps/globalappsspecifications) @@ -23,24 +23,24 @@ echo -e "Apps count: ${#name[@]}" echo -e "-------------------------------------" for((i=0;i<${#name[@]};i++)); do - expire=$((${height[i]}+22000)) - block_diff=$((expire-explorer_network_hight)) - if [[ "$1" =~ '^[0-9]+$' ]]; then - block_limit="$1" - else - block_limit="1000" - fi - if [[ "$block_diff" -le "$block_limit" ]]; then - echo -e "Apps name: ${name[i]}" - echo -e "Registered height: ${height[i]}" - echo -e "Expire height: $expire" - if [[ "$block_diff" -gt "0" ]]; then - echo -e "Block till expire: $block_diff" - else - echo -e "Info: Apps expired!" - fi - echo -e "-------------------------------------" - fi + expire=$((${height[i]}+22000)) + block_diff=$((expire-explorer_network_hight)) + if [[ "$1" =~ '^[0-9]+$' ]]; then + block_limit="$1" + else + block_limit="1000" + fi + if [[ "$block_diff" -le "$block_limit" ]]; then + echo -e "Apps name: ${name[i]}" + echo -e "Registered height: ${height[i]}" + echo -e "Expire height: $expire" + if [[ "$block_diff" -gt "0" ]]; then + echo -e "Block till expire: $block_diff" + else + echo -e "Info: Apps expired!" + fi + echo -e "-------------------------------------" + fi done unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED \ No newline at end of file diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index 42546feb..dabaae33 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -1,5 +1,4 @@ #!/bin/bash - # Usage: # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "<test_time_in_s>" "<file_name>" "<array_url_list_via_export>" # @@ -12,7 +11,7 @@ # # Example 3 ( for testing cdn with default settings ) # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) - +########################################################################################################################################### #color codes YELLOW='\033[1;33m' GREEN='\033[1;32m' @@ -26,26 +25,29 @@ CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}" failed_counter="0" if ! bc -v > /dev/null 2>&1 ; then - sudo apt install -y bc > /dev/null 2>&1 && sleep 1 + sudo apt install -y bc > /dev/null 2>&1 && sleep 1 fi + if [[ -z $1 ]]; then - dTime="5" + dTime="5" else - dTime="$1" + dTime="$1" fi + if [[ -z $2 || "$2" == "0" ]]; then - BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" + BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" else - BOOTSTRAP_FILE="$2" + BOOTSTRAP_FILE="$2" fi + if [[ -z $3 ]]; then - rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") + rand_by_domain=("5" "6" "7" "8" "9" "10" "11" "12") else - msg="$3" - shift - shift - rand_by_domain=("$@") - custom_url="1" + msg="$3" + shift + shift + rand_by_domain=("$@") + custom_url="1" fi size_list=() i=0 @@ -54,48 +56,48 @@ echo -e "${ARROW} ${CYAN}Running quick download speed test for ${BOOTSTRAP_FILE} start_test=`date +%s` while [ $i -lt $len ]; do - if [[ "$custom_url" == "1" ]]; then - testing=$(curl -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) - else - testing=$(curl -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) - fi - testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') - mb=$(bc <<<"scale=2; $testing_size / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') - if [[ "$custom_url" == "1" ]]; then - domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${rand_by_domain[$i]}) - echo -e " ${RIGHT_ANGLE} ${GREEN}URL - ${YELLOW}${domain}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" - else - echo -e " ${RIGHT_ANGLE} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" - fi - size_list+=($testing_size) - if [[ "$testing_size" == "0" ]]; then - failed_counter=$(($failed_counter+1)) - fi - i=$(($i+1)) + if [[ "$custom_url" == "1" ]]; then + testing=$(curl -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + else + testing=$(curl -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + fi + testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') + mb=$(bc <<<"scale=2; $testing_size / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') + if [[ "$custom_url" == "1" ]]; then + domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${rand_by_domain[$i]}) + echo -e " ${RIGHT_ANGLE} ${GREEN}URL - ${YELLOW}${domain}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + else + echo -e " ${RIGHT_ANGLE} ${GREEN}cdn-${YELLOW}${rand_by_domain[$i]}${GREEN} - Bits Downloaded: ${YELLOW}$testing_size${NC} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + fi + size_list+=($testing_size) + if [[ "$testing_size" == "0" ]]; then + failed_counter=$(($failed_counter+1)) + fi + i=$(($i+1)) done rServerList=$((${#size_list[@]}-$failed_counter)) echo -e "${ARROW} ${CYAN}Valid servers: ${GREEN}${rServerList} ${CYAN}- Duration: ${GREEN}$((($(date +%s)-$start_test)/60)) min. $((($(date +%s)-$start_test) % 60)) sec.${NC}" sudo rm -rf testspeed > /dev/null 2>&1 if [[ "$rServerList" == "0" ]]; then - exit + exit fi arr_max=$(printf '%s\n' "${size_list[@]}" | sort -n | tail -1) for i in "${!size_list[@]}"; do - [[ "${size_list[i]}" == "$arr_max" ]] && - max_indexes+=($i) + [[ "${size_list[i]}" == "$arr_max" ]] && + max_indexes+=($i) done server_index=${rand_by_domain[${max_indexes[0]}]} if [[ "$custom_url" == "1" ]]; then - BOOTSTRAP_URL="$server_index" + BOOTSTRAP_URL="$server_index" else - BOOTSTRAP_URL="http://cdn-${server_index}.runonflux.io/apps/fluxshare/getfile/" + BOOTSTRAP_URL="http://cdn-${server_index}.runonflux.io/apps/fluxshare/getfile/" fi DOWNLOAD_URL="${BOOTSTRAP_URL}${BOOTSTRAP_FILE}" mb=$(bc <<<"scale=2; $arr_max / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') if [[ "$custom_url" == "1" ]]; then - domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${server_index}) - echo -e "${ARROW} ${CYAN}Best server is: ${YELLOW}${domain} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + domain=$(sed -e 's|^[^/]*//||' -e 's|/.*$||' <<< ${server_index}) + echo -e "${ARROW} ${CYAN}Best server is: ${YELLOW}${domain} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" else - echo -e "${ARROW} ${CYAN}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" + echo -e "${ARROW} ${CYAN}Best server is: ${GREEN}cdn-${YELLOW}${rand_by_domain[${max_indexes[0]}]} ${GREEN}Average speed: ${YELLOW}$mb ${GREEN}MB/s${NC}" fi echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}${DOWNLOAD_URL}${NC}" diff --git a/flux_common.sh b/flux_common.sh index 3ac2a6bf..f04c3472 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -54,10 +54,10 @@ function fluxos_conf_create(){ cat <<- EOF > /home/$USER/$FLUX_DIR/config/userconfig.js module.exports = { initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - kadena: '${KDA_A}', - testnet: false + ipaddress: '${WANIP}', + zelid: '${ZELID}', + kadena: '${KDA_A}', + testnet: false } } EOF @@ -867,7 +867,7 @@ function start_install() { echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" && sleep 1 fi if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" fi if [[ "$discord" != "" && "$discord" != "0" ]]; then echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" && sleep 1 @@ -1028,14 +1028,14 @@ function create_service_scripts() { echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" else if [[ "$bench_status_pind" != "" ]]; then - echo -e "${WORNING} Running benchmark process detected${NC}" - echo -e "${WORNING} Killing benchmark...${NC}" - sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 + echo -e "${WORNING} Running benchmark process detected${NC}" + echo -e "${WORNING} Killing benchmark...${NC}" + sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 fi if [[ "$daemon_status_pind" != "" ]]; then - echo -e "${WORNING} Running daemon process detected${NC}" - echo -e "${WORNING} Killing daemon...${NC}" - sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 + echo -e "${WORNING} Running daemon process detected${NC}" + echo -e "${WORNING} Killing daemon...${NC}" + sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 fi sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 fi @@ -1045,19 +1045,19 @@ function create_service_scripts() { echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" else if [[ "$bench_status_pind" != "" ]]; then - echo -e "${WORNING} Running benchmark process detected${NC}" - echo -e "${WORNING} Killing benchmark...${NC}" - sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 + echo -e "${WORNING} Running benchmark process detected${NC}" + echo -e "${WORNING} Killing benchmark...${NC}" + sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 fi if [[ "$daemon_status_pind" != "" ]]; then - echo -e "${WORNING} Running daemon process detected${NC}" - echo -e "${WORNING} Killing daemon...${NC}" - sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 + echo -e "${WORNING} Running daemon process detected${NC}" + echo -e "${WORNING} Killing daemon...${NC}" + sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 fi sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 fi if [[ -f /usr/local/bin/fluxd ]]; then - bash -c "fluxd" + bash -c "fluxd" exit else bash -c "zelcashd" @@ -1193,9 +1193,9 @@ function selfhosting() { get_ip device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 fi fi if [[ $1 == "ip_check" ]]; then @@ -1203,15 +1203,15 @@ function selfhosting() { device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') if [[ "$api_port" == "" ]]; then - api_port="16127" + api_port="16127" fi confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then - if [[ "$WANIP" != "$confirmed_ip" ]]; then - date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 - fi + if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + fi fi fi EOF diff --git a/install_pro.sh b/install_pro.sh index ca5bf2b5..e111a676 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -28,540 +28,536 @@ RPCPORT=16124 PORT=16125 function config_veryfity(){ - if [[ -f /home/$USER/.flux/flux.conf ]]; then - echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" - insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) - if [[ "$insightexplorer" == "1" ]]; then - echo -e "${ARROW} ${CYAN}Insightexplorer enabled.................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${ARROW} ${CYAN}Insightexplorer enabled.................[${X_MARK}${CYAN}]${NC}" - echo -e "${ARROW} ${CYAN}Removing wallet.dat...${NC}" - echo -e "${ARROW} ${CYAN}Use old chain will be skipped...${NC}" - sudo rm -rf /home/$USER/$CONFIG_DIR/wallet.dat && sleep 1 - SKIP_OLD_CHAIN="1" - fi - fi + if [[ -f /home/$USER/.flux/flux.conf ]]; then + echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" + insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) + if [[ "$insightexplorer" == "1" ]]; then + echo -e "${ARROW} ${CYAN}Insightexplorer enabled.................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${ARROW} ${CYAN}Insightexplorer enabled.................[${X_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Removing wallet.dat...${NC}" + echo -e "${ARROW} ${CYAN}Use old chain will be skipped...${NC}" + sudo rm -rf /home/$USER/$CONFIG_DIR/wallet.dat && sleep 1 + SKIP_OLD_CHAIN="1" + fi + fi } function import_date() { - if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then - if [[ -z "$import_settings" ]]; then - if whiptail --yesno "Would you like to import data from Flux config files Y/N?" 8 60; then - OLD_CONFIG=0 - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - OLD_CONFIG=1 - fi - IMPORT_ZELCONF="1" - echo - echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" - if [[ "$OLD_CONFIG" == "1" ]]; then - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' - fi - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" - IMPORT_ZELID="1" - fi - KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" - fi - fi - if [[ -f /home/$USER/watchdog/config.js ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" - fi - - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - fi - - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" - fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" - fi - fi - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" - fi - - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" - fi - - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" - fi - fi - fi - else - if [[ "$import_settings" == "1" ]]; then - OLD_CONFIG=0 - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - OLD_CONFIG=1 - fi - IMPORT_ZELCONF="1" - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" - if [[ "$OLD_CONFIG" == "1" ]]; then - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' - fi - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" - IMPORT_ZELID="1" - fi - KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" - fi - fi - if [[ -f /home/$USER/watchdog/config.js ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" - fi - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - fi - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" - fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" - fi - fi - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" - fi - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" - fi - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" - fi - fi - fi - fi - fi - echo -e "" + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then + if [[ -z "$import_settings" ]]; then + if whiptail --yesno "Would you like to import data from Flux config files Y/N?" 8 60; then + OLD_CONFIG=0 + if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + OLD_CONFIG=1 + fi + IMPORT_ZELCONF="1" + echo + echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" + zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" + zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" + if [[ "$OLD_CONFIG" == "1" ]]; then + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' + fi + if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" + IMPORT_ZELID="1" + fi + KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" + fi + fi + if [[ -f /home/$USER/watchdog/config.js ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" + fi + + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + fi + + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" + fi + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" + fi + fi + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" + fi + + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" + fi + + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" + fi + fi + fi + else + if [[ "$import_settings" == "1" ]]; then + OLD_CONFIG=0 + if [[ -d /home/$USER/.zelcash ]]; then + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' + OLD_CONFIG=1 + fi + IMPORT_ZELCONF="1" + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" + zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" + zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" + if [[ "$OLD_CONFIG" == "1" ]]; then + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' + fi + if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" + IMPORT_ZELID="1" + fi + KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" + fi + fi + if [[ -f /home/$USER/watchdog/config.js ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" + fi + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + fi + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" + fi + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" + fi + fi + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" + fi + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" + fi + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" + fi + fi + fi + fi + fi + echo -e "" } function install_watchdog() { - echo -e "${ARROW} ${YELLOW}Watchdog installing...${NC}" - if pm2 -v > /dev/null 2>&1; then - WATCHDOG_INSTALL="1" - cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 - wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 - mv post-merge /home/$USER/watchdog/.git/hooks/post-merge - sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge - cd watchdog && npm install > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Creating config file....${NC}" - fix_action='1' - if [[ "$import_settings" == "0" && -f /home/$USER/install_conf.json ]]; then - watchdog_conf_create - if [[ -f /home/$USER/watchdog/watchdog.js ]]; then - current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) - string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." - pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - else - string_limit_x_mark "Watchdog was not installed................................." - fi - return - fi - if [[ "$IMPORT_ZELCONF" == "1" ]]; then - watchdog_conf_create - if [[ -f /home/$USER/watchdog/watchdog.js ]]; then - current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) - string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." - pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - else - string_limit_x_mark "Watchdog was not installed................................." - fi - return - fi - if whiptail --yesno "Would you like enable autoupdate?" 8 60; then - flux_update='1' - daemon_update='1' - bench_update='1' - else - flux_update='0' - daemon_update='0' - bench_update='0' - fi - discord='0' - if whiptail --yesno "Would you like enable alert notification?" 8 60; then - sleep 1 - whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 - sleep 1 - CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ - "1" "Discord notification " ON \ - "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) - if [ -z "$CHOICES" ]; then - echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" - sleep 1 - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - node_label="0" - else - for CHOICE in $CHOICES; - do - case "$CHOICE" in - "1") - discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) - sleep 1 - if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + echo -e "${ARROW} ${YELLOW}Watchdog installing...${NC}" + if pm2 -v > /dev/null 2>&1; then + WATCHDOG_INSTALL="1" + cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 + wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 + mv post-merge /home/$USER/watchdog/.git/hooks/post-merge + sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge + cd watchdog && npm install > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Creating config file....${NC}" + fix_action='1' + if [[ "$import_settings" == "0" && -f /home/$USER/install_conf.json ]]; then + watchdog_conf_create + if [[ -f /home/$USER/watchdog/watchdog.js ]]; then + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + else + string_limit_x_mark "Watchdog was not installed................................." + fi + return + fi + if [[ "$IMPORT_ZELCONF" == "1" ]]; then + watchdog_conf_create + if [[ -f /home/$USER/watchdog/watchdog.js ]]; then + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + else + string_limit_x_mark "Watchdog was not installed................................." + fi + return + fi + if whiptail --yesno "Would you like enable autoupdate?" 8 60; then + flux_update='1' + daemon_update='1' + bench_update='1' + else + flux_update='0' + daemon_update='0' + bench_update='0' + fi + discord='0' + if whiptail --yesno "Would you like enable alert notification?" 8 60; then + sleep 1 + whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 + sleep 1 + CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + if [ -z "$CHOICES" ]; then + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" + sleep 1 + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" + else + for CHOICE in $CHOICES; + do + case "$CHOICE" in + "1") + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - while true - do - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) - if [[ $ping == ?(-)+([0-9]) ]]; then - string_limit_check_mark "UserID is valid..........................................." - break - else - string_limit_x_mark "UserID is not valid try again............................." - sleep 1 - fi - done - sleep 1 - else - ping=0; - sleep 1 - fi - ;; - "2") - telegram_alert="1" - while true - do - telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) - if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then - string_limit_check_mark "Bot token is valid..........................................." - break - else - string_limit_x_mark "Bot token is not valid try again............................." - sleep 1 - fi - done - sleep 1 - while true - do - telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) - if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then - string_limit_check_mark "Chat ID is valid..........................................." - break - else - string_limit_x_mark "Chat ID is not valid try again............................." - sleep 1 - fi - done - sleep 1 - ;; - esac - done - fi - while true - do - node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - string_limit_check_mark "Node name is valid..........................................." - break - else - string_limit_x_mark "Node name is not valid try again............................." - sleep 1 - fi - done - else - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - node_label="0" - sleep 1 - fi - if [[ "$discord" == 0 ]]; then - ping="0"; - fi - if [[ "$telegram_alert" == 0 ]]; then - telegram_bot_token="0"; - telegram_chat_id="0"; - fi - if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - fi - fi - if [[ $stak_info == ?(-)+([0-9]) ]]; then + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + else + ping=0; + sleep 1 + fi + ;; + "2") + telegram_alert="1" + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + sleep 1 + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + ;; + esac + done + fi + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + else + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" + sleep 1 + fi + if [[ "$discord" == 0 ]]; then + ping="0"; + fi + if [[ "$telegram_alert" == 0 ]]; then + telegram_bot_token="0"; + telegram_chat_id="0"; + fi + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + fi + fi + if [[ $stak_info == ?(-)+([0-9]) ]]; then - case $stak_info in - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; - esac - else - eps_limit=0; - fi - watchdog_conf_create - pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - if [[ -f /home/$USER/watchdog/watchdog.js ]]; then - current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) - string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." - else - string_limit_x_mark "Watchdog was not installed................................." - fi - else - string_limit_x_mark "Watchdog was not installed................................." - fi + case $stak_info in + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; + esac + else + eps_limit=0; + fi + watchdog_conf_create + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + if [[ -f /home/$USER/watchdog/watchdog.js ]]; then + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + string_limit_check_mark "Watchdog v$current_ver installed................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed................................." + else + string_limit_x_mark "Watchdog was not installed................................." + fi + else + string_limit_x_mark "Watchdog was not installed................................." + fi } function wipe_clean() { - echo -e "${ARROW} ${YELLOW}Removing any instances of FluxNode${NC}" - apt_number=$(ps aux | grep 'apt' | wc -l) - if [[ "$apt_number" > 1 ]]; then - sudo killall apt > /dev/null 2>&1 - sudo killall apt-get > /dev/null 2>&1 - sudo dpkg --configure -a > /dev/null 2>&1 - fi - echo -e "${ARROW} ${CYAN}Stopping all services and running processes...${NC}" - sudo killall nano > /dev/null 2>&1 - $COIN_CLI stop > /dev/null 2>&1 && sleep 2 - sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 - sudo killall -s SIGKILL $COIN_DAEMON > /dev/null 2>&1 && sleep 2 - $BENCH_CLI stop > /dev/null 2>&1 && sleep 2 - sudo killall -s SIGKILL $BENCH_NAME > /dev/null 2>&1 && sleep 1 - sudo fuser -k 16127/tcp > /dev/null 2>&1 && sleep 1 - sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 - sudo rm -rf /usr/bin/flux* > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Removing daemon && benchmark...${NC}" - sudo apt-get remove $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 - sudo apt-get purge $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 - sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 - sudo rm -rf /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 - tmux kill-server > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Removing PM2...${NC}" - pm2 del zelflux > /dev/null 2>&1 && sleep 1 - pm2 del flux > /dev/null 2>&1 && sleep 1 - pm2 del watchdog > /dev/null 2>&1 && sleep 1 - pm2 save > /dev/null 2>&1 - pm2 unstartup > /dev/null 2>&1 && sleep 1 - pm2 flush > /dev/null 2>&1 && sleep 1 - pm2 save > /dev/null 2>&1 && sleep 1 - pm2 kill > /dev/null 2>&1 && sleep 1 - npm remove pm2 -g > /dev/null 2>&1 && sleep 1 - echo -e "${ARROW} ${CYAN}Removing others files and scripts...${NC}" - sudo rm -rf watchgod > /dev/null 2>&1 && sleep 1 - sudo rm -rf $BENCH_DIR_LOG && sleep 1 - sudo rm -rf /etc/logrotate.d/mongolog > /dev/null 2>&1 - sudo rm -rf /etc/logrotate.d/zeldebuglog > /dev/null 2>&1 - rm update.sh > /dev/null 2>&1 - rm restart_zelflux.sh > /dev/null 2>&1 - rm zelnodeupdate.sh > /dev/null 2>&1 - rm start.sh > /dev/null 2>&1 - rm update-zelflux.sh > /dev/null 2>&1 - sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 - zelcash-cli stop > /dev/null 2>&1 && sleep 2 - sudo killall -s SIGKILL zelcashd > /dev/null 2>&1 - zelbench-cli stop > /dev/null 2>&1 - sudo killall -s SIGKILL zelbenchd > /dev/null 2>&1 - sudo rm /usr/local/bin/zel* > /dev/null 2>&1 && sleep 1 - sudo apt-get purge zelcash zelbench -y > /dev/null 2>&1 && sleep 1 - sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 - sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 - sudo rm -rf zelflux > /dev/null 2>&1 && sleep 1 - sudo rm -rf .zelbenchmark > /dev/null 2>&1 && sleep 1 - sudo rm -rf .fluxbenchmark > /dev/null 2>&1 && sleep 1 - sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 - sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 - if [[ -d /home/$USER/.zelcash ]]; then - echo -e "${ARROW} ${CYAN}Moving ~/.zelcash to ~/.flux${NC}" - sudo mv /home/$USER/.zelcash /home/$USER/.flux > /dev/null 2>&1 && sleep 1 - sudo mv /home/$USER/.flux/zelcash.conf /home/$USER/.flux/flux.conf > /dev/null 2>&1 && sleep 1 - fi - if [[ -d /home/$USER/$CONFIG_DIR ]]; then - config_veryfity - if [[ -z "$use_old_chain" ]]; then - - if [[ "$SKIP_OLD_CHAIN" == "0" ]]; then - - if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then - echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf /home/$USERNAME/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate > /dev/null 2>&1 - sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - else - BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log - sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/database - sudo rm -rf /home/$USER/$CONFIG_DIR/sporks - fi - else - echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf /home/$USER/$CONFIG_DIR/determ_zelnodes /home/$USER/$CONFIG_DIR/sporks /home/$USER/$CONFIG_DIR/database /home/$USER/$CONFIG_DIR/blocks /home/$USER/$CONFIG_DIR/chainstate > /dev/null 2>&1 - sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - fi - else - - if [[ "$use_old_chain" == "1" ]]; then - BOOTSTRAP_SKIP="1" - sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat - sudo rm -rf /home/$USER/$CONFIG_DIR/db.log - sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log - sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf - sudo rm -rf /home/$USER/$CONFIG_DIR/database - sudo rm -rf /home/$USER/$CONFIG_DIR/sporks - else - echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" - sudo rm -rf /home/$USER/$CONFIG_DIR/determ_zelnodes /home/$USER/$CONFIG_DIR/sporks /home/$USER/$CONFIG_DIR/database /home/$USER/$CONFIG_DIR/blocks /home/$USER/$CONFIG_DIR/chainstate > /dev/null 2>&1 - sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - fi - fi - fi - sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 - sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 - sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 - if [[ $(sudo ufw status | grep "Status: active") ]]; then - sudo ufw disable > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - else - echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" - fi + echo -e "${ARROW} ${YELLOW}Removing any instances of FluxNode${NC}" + apt_number=$(ps aux | grep 'apt' | wc -l) + if [[ "$apt_number" > 1 ]]; then + sudo killall apt > /dev/null 2>&1 + sudo killall apt-get > /dev/null 2>&1 + sudo dpkg --configure -a > /dev/null 2>&1 + fi + echo -e "${ARROW} ${CYAN}Stopping all services and running processes...${NC}" + sudo killall nano > /dev/null 2>&1 + $COIN_CLI stop > /dev/null 2>&1 && sleep 2 + sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 + sudo killall -s SIGKILL $COIN_DAEMON > /dev/null 2>&1 && sleep 2 + $BENCH_CLI stop > /dev/null 2>&1 && sleep 2 + sudo killall -s SIGKILL $BENCH_NAME > /dev/null 2>&1 && sleep 1 + sudo fuser -k 16127/tcp > /dev/null 2>&1 && sleep 1 + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + sudo rm -rf /usr/bin/flux* > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}Removing daemon && benchmark...${NC}" + sudo apt-get remove $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 + sudo apt-get purge $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 1 + sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 + sudo rm -rf /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 + tmux kill-server > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}Removing PM2...${NC}" + pm2 del zelflux > /dev/null 2>&1 && sleep 1 + pm2 del flux > /dev/null 2>&1 && sleep 1 + pm2 del watchdog > /dev/null 2>&1 && sleep 1 + pm2 save > /dev/null 2>&1 + pm2 unstartup > /dev/null 2>&1 && sleep 1 + pm2 flush > /dev/null 2>&1 && sleep 1 + pm2 save > /dev/null 2>&1 && sleep 1 + pm2 kill > /dev/null 2>&1 && sleep 1 + npm remove pm2 -g > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}Removing others files and scripts...${NC}" + sudo rm -rf watchgod > /dev/null 2>&1 && sleep 1 + sudo rm -rf $BENCH_DIR_LOG && sleep 1 + sudo rm -rf /etc/logrotate.d/mongolog > /dev/null 2>&1 + sudo rm -rf /etc/logrotate.d/zeldebuglog > /dev/null 2>&1 + rm update.sh > /dev/null 2>&1 + rm restart_zelflux.sh > /dev/null 2>&1 + rm zelnodeupdate.sh > /dev/null 2>&1 + rm start.sh > /dev/null 2>&1 + rm update-zelflux.sh > /dev/null 2>&1 + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + zelcash-cli stop > /dev/null 2>&1 && sleep 2 + sudo killall -s SIGKILL zelcashd > /dev/null 2>&1 + zelbench-cli stop > /dev/null 2>&1 + sudo killall -s SIGKILL zelbenchd > /dev/null 2>&1 + sudo rm /usr/local/bin/zel* > /dev/null 2>&1 && sleep 1 + sudo apt-get purge zelcash zelbench -y > /dev/null 2>&1 && sleep 1 + sudo apt-get autoremove -y > /dev/null 2>&1 && sleep 1 + sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 && sleep 1 + sudo rm -rf zelflux > /dev/null 2>&1 && sleep 1 + sudo rm -rf .zelbenchmark > /dev/null 2>&1 && sleep 1 + sudo rm -rf .fluxbenchmark > /dev/null 2>&1 && sleep 1 + sudo rm -rf /home/$USER/stop_zelcash_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/start_zelcash_service.sh > /dev/null 2>&1 + if [[ -d /home/$USER/.zelcash ]]; then + echo -e "${ARROW} ${CYAN}Moving ~/.zelcash to ~/.flux${NC}" + sudo mv /home/$USER/.zelcash /home/$USER/.flux > /dev/null 2>&1 && sleep 1 + sudo mv /home/$USER/.flux/zelcash.conf /home/$USER/.flux/flux.conf > /dev/null 2>&1 && sleep 1 + fi + if [[ -d /home/$USER/$CONFIG_DIR ]]; then + config_veryfity + if [[ -z "$use_old_chain" ]]; then + if [[ "$SKIP_OLD_CHAIN" == "0" ]]; then + if ! whiptail --yesno "Would you like to use old chain from Flux daemon config directory?" 8 60; then + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf /home/$USERNAME/$CONFIG_DIR/determ_zelnodes ~/$CONFIG_DIR/sporks ~/$CONFIG_DIR/database ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate > /dev/null 2>&1 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + else + BOOTSTRAP_SKIP="1" + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/database + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks + fi + else + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf /home/$USER/$CONFIG_DIR/determ_zelnodes /home/$USER/$CONFIG_DIR/sporks /home/$USER/$CONFIG_DIR/database /home/$USER/$CONFIG_DIR/blocks /home/$USER/$CONFIG_DIR/chainstate > /dev/null 2>&1 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + fi + else + if [[ "$use_old_chain" == "1" ]]; then + BOOTSTRAP_SKIP="1" + sudo rm -rf /home/$USER/$CONFIG_DIR/fee_estimates.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/peers.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnode.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodecache.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/zelnodepayments.dat + sudo rm -rf /home/$USER/$CONFIG_DIR/db.log + sudo rm -rf /home/$USER/$CONFIG_DIR/debug.log + sudo rm -rf /home/$USER/$CONFIG_DIR/flux.conf + sudo rm -rf /home/$USER/$CONFIG_DIR/database + sudo rm -rf /home/$USER/$CONFIG_DIR/sporks + else + echo -e "${ARROW} ${CYAN}Removing Flux daemon config directory...${NC}" + sudo rm -rf /home/$USER/$CONFIG_DIR/determ_zelnodes /home/$USER/$CONFIG_DIR/sporks /home/$USER/$CONFIG_DIR/database /home/$USER/$CONFIG_DIR/blocks /home/$USER/$CONFIG_DIR/chainstate > /dev/null 2>&1 + sudo rm -rf /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + fi + fi + fi + sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 + sudo rm -rf /home/$USER/stop_daemon_service.sh > /dev/null 2>&1 + sudo rm -rf /home/$USER/start_daemon_service.sh > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Checking firewall status...${NC}" && sleep 1 + if [[ $(sudo ufw status | grep "Status: active") ]]; then + sudo ufw disable > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + else + echo -e "${ARROW} ${CYAN}Firewall status: ${RED}Disabled${NC}" + fi } function ssh_port() { - if [[ -z "$ssh_port" ]]; then - SSHPORT=$(grep -w Port /etc/ssh/sshd_config | sed -e 's/.*Port //') - echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 - else - pettern='^[0-9]+$' - if [[ $ssh_port =~ $pettern ]] ; then - SSHPORT="$ssh_port" - echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 - else - echo -e "${ARROW} ${CYAN}SSH port must be integer................[${X_MARK}${CYAN}]${NC}}" - echo - exit - fi - fi + if [[ -z "$ssh_port" ]]; then + SSHPORT=$(grep -w Port /etc/ssh/sshd_config | sed -e 's/.*Port //') + echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 + else + pettern='^[0-9]+$' + if [[ $ssh_port =~ $pettern ]] ; then + SSHPORT="$ssh_port" + echo -e "${ARROW} ${YELLOW}Using SSH port:${SEA} $SSHPORT${NC}" && sleep 1 + else + echo -e "${ARROW} ${CYAN}SSH port must be integer................[${X_MARK}${CYAN}]${NC}}" + echo + exit + fi + fi } function create_conf() { - - echo -e "${ARROW} ${YELLOW}Creating Flux daemon config file...${NC}" - if [ -f ~/$CONFIG_DIR/$CONFIG_FILE ]; then - echo -e "${ARROW} ${CYAN}Existing conf file found backing up to $COIN_NAME.old ...${NC}" - mv ~/$CONFIG_DIR/$CONFIG_FILE ~/$CONFIG_DIR/$COIN_NAME.old; - fi - RPCUSER=$(pwgen -1 8 -n) - PASSWORD=$(pwgen -1 20 -n) - if [[ "$IMPORT_ZELCONF" == "0" ]]; then - zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) - zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) - zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) - fi - if [ "x$PASSWORD" = "x" ]; then - PASSWORD=${WANIP}-$(date +%s) - fi - mkdir /home/$USER/$CONFIG_DIR > /dev/null 2>&1 - flux_daemon_conf_create - if [[ "$IMPORT_ZELID" == "0" ]]; then - while true - do - ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) - if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then - echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" - sleep 4 - fi - done - while true - do - KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=0" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - fi + echo -e "${ARROW} ${YELLOW}Creating Flux daemon config file...${NC}" + if [ -f ~/$CONFIG_DIR/$CONFIG_FILE ]; then + echo -e "${ARROW} ${CYAN}Existing conf file found backing up to $COIN_NAME.old ...${NC}" + mv ~/$CONFIG_DIR/$CONFIG_FILE ~/$CONFIG_DIR/$COIN_NAME.old; + fi + RPCUSER=$(pwgen -1 8 -n) + PASSWORD=$(pwgen -1 20 -n) + if [[ "$IMPORT_ZELCONF" == "0" ]]; then + zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) + zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) + zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) + fi + if [ "x$PASSWORD" = "x" ]; then + PASSWORD=${WANIP}-$(date +%s) + fi + mkdir /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + flux_daemon_conf_create + if [[ "$IMPORT_ZELID" == "0" ]]; then + while true + do + ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) + if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then + echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" + sleep 4 + fi + done + while true + do + KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=0" + sleep 2 + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + fi } function install_daemon() { sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 @@ -569,287 +565,287 @@ function install_daemon() { echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 - if [[ "$(lsb_release -cs)" == "xenial" ]]; then - echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - flux_package && sleep 2 - else - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - if [[ "$(lsb_release -cs)" == "impish" ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - fi - # downloading key && save it as keyring - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" - sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - flux_package && sleep 2 - else - echo -e "" - echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo -e "" - exit - fi - fi + if [[ "$(lsb_release -cs)" == "xenial" ]]; then + echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + flux_package && sleep 2 + else + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + if [[ "$(lsb_release -cs)" == "impish" ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + fi + # downloading key && save it as keyring + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" + sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi + if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + flux_package && sleep 2 + else + echo -e "" + echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo -e "" + exit + fi + fi } function basic_security() { - echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" - sudo ufw allow "$SSHPORT"/tcp > /dev/null 2>&1 - sudo ufw logging on > /dev/null 2>&1 - sudo ufw default deny incoming > /dev/null 2>&1 - sudo ufw allow out from any to any port 123 > /dev/null 2>&1 - sudo ufw allow out to any port 80 > /dev/null 2>&1 - sudo ufw allow out to any port 443 > /dev/null 2>&1 - sudo ufw allow out to any port 53 > /dev/null 2>&1 - #FluxOS communication - sudo ufw allow 16100:16199/tcp > /dev/null 2>&1 - sudo ufw default deny outgoing > /dev/null 2>&1 - sudo ufw limit OpenSSH > /dev/null 2>&1 - echo "y" | sudo ufw enable > /dev/null 2>&1 - sudo ufw reload > /dev/null 2>&1 - sudo systemctl enable fail2ban > /dev/null 2>&1 - sudo systemctl start fail2ban > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Configuring firewall and enabling fail2ban...${NC}" + sudo ufw allow "$SSHPORT"/tcp > /dev/null 2>&1 + sudo ufw logging on > /dev/null 2>&1 + sudo ufw default deny incoming > /dev/null 2>&1 + sudo ufw allow out from any to any port 123 > /dev/null 2>&1 + sudo ufw allow out to any port 80 > /dev/null 2>&1 + sudo ufw allow out to any port 443 > /dev/null 2>&1 + sudo ufw allow out to any port 53 > /dev/null 2>&1 + #FluxOS communication + sudo ufw allow 16100:16199/tcp > /dev/null 2>&1 + sudo ufw default deny outgoing > /dev/null 2>&1 + sudo ufw limit OpenSSH > /dev/null 2>&1 + echo "y" | sudo ufw enable > /dev/null 2>&1 + sudo ufw reload > /dev/null 2>&1 + sudo systemctl enable fail2ban > /dev/null 2>&1 + sudo systemctl start fail2ban > /dev/null 2>&1 } function start_daemon() { - sudo systemctl enable zelcash.service > /dev/null 2>&1 - sudo systemctl start zelcash > /dev/null 2>&1 - x=1 - while [ $x -le 6 ] - do - NUM='300' - MSG1='Starting daemon & syncing with chain please be patient this will take about 5 min...' - MSG2='' - spinning_timer - chain_check=$($COIN_CLI getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) - if [[ "$chain_check" == "1" ]]; then - echo -e "" - echo -e "${ARROW} ${CYAN}Activating best chain detected....Awaiting increased for next 5min${NC}" - fi - if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then - break - fi - if [[ "$x" -gt 6 ]]; then - echo -e "${ARROW} ${CYAN}Maximum timeout exceeded...${NC}" - break - fi - x=$(( $x + 1 )) - done - if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then - NUM='2' - MSG1='Getting info...' - MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo && echo - daemon_version=$($COIN_CLI getinfo | jq -r '.version') - string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." - bench_version=$($BENCH_CLI getinfo | jq -r '.version') - string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." - echo - pm2_install - else - echo -e "" - echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" - if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then - error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') - if [[ "$error_line" != "" ]]; then - echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" - echo -e "${WORNING} ${CYAN}$error_line${NC}" - echo -e "" - exit - fi - fi - if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then - echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" - echo -n "" - else - echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" - echo -n "" - exit - fi - fi + sudo systemctl enable zelcash.service > /dev/null 2>&1 + sudo systemctl start zelcash > /dev/null 2>&1 + x=1 + while [ $x -le 6 ] + do + NUM='300' + MSG1='Starting daemon & syncing with chain please be patient this will take about 5 min...' + MSG2='' + spinning_timer + chain_check=$($COIN_CLI getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) + if [[ "$chain_check" == "1" ]]; then + echo -e "" + echo -e "${ARROW} ${CYAN}Activating best chain detected....Awaiting increased for next 5min${NC}" + fi + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + break + fi + if [[ "$x" -gt 6 ]]; then + echo -e "${ARROW} ${CYAN}Maximum timeout exceeded...${NC}" + break + fi + x=$(( $x + 1 )) + done + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + NUM='2' + MSG1='Getting info...' + MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo + daemon_version=$($COIN_CLI getinfo | jq -r '.version') + string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." + bench_version=$($BENCH_CLI getinfo | jq -r '.version') + string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." + echo + pm2_install + else + echo -e "" + echo -e "${WORNING} ${RED}Something is not right the daemon did not start or still loading...${NC}" + if [[ -f /home/$USER/$CONFIG_DIR/debug.log ]]; then + error_line=$(egrep -a --color 'Error:' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + if [[ "$error_line" != "" ]]; then + echo -e "${WORNING} ${CYAN}Last error from ~/$CONFIG_DIR/debug.log: ${NC}" + echo -e "${WORNING} ${CYAN}$error_line${NC}" + echo -e "" + exit + fi + fi + if whiptail --yesno "Something is not right the daemon did not start or still loading....\nWould you like continue the installation (make sure that flux daemon working) Y/N?" 8 90; then + echo -e "${ARROW} ${CYAN}Problem with daemon noticed but user want continue installation... ${NC}" + echo -n "" + else + echo -e "${WORNING} ${RED}Installation stopped by user...${NC}" + echo -n "" + exit + fi + fi } function install_process() { - echo -e "${ARROW} ${YELLOW}Configuring firewall...${NC}" - sudo ufw allow $ZELFRONTPORT/tcp > /dev/null 2>&1 - sudo ufw allow $LOCPORT/tcp > /dev/null 2>&1 - sudo ufw allow $ZELNODEPORT/tcp > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" - sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 - sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - if [[ $(lsb_release -cs) = *jammy* ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - else - curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - fi - if [[ $(lsb_release -d) = *Debian* ]]; then - if [[ $(lsb_release -cs) = *stretch* || $(lsb_release -cs) = *buster* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - else + echo -e "${ARROW} ${YELLOW}Configuring firewall...${NC}" + sudo ufw allow $ZELFRONTPORT/tcp > /dev/null 2>&1 + sudo ufw allow $LOCPORT/tcp > /dev/null 2>&1 + sudo ufw allow $ZELNODEPORT/tcp > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" + sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 + sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + if [[ $(lsb_release -cs) = *jammy* ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + else + curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + fi + if [[ $(lsb_release -d) = *Debian* ]]; then + if [[ $(lsb_release -cs) = *stretch* || $(lsb_release -cs) = *buster* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - fi - elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - if [[ $(lsb_release -cs) = *focal* || $(lsb_release -cs) = *bionic* || $(lsb_release -cs) = *xenial* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - elif [[ $(lsb_release -cs) = *jammy* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - fi - else - echo -e "${WORNING} ${RED}OS type not supported..${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi - if ! sysbench --version > /dev/null 2>&1; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Sysbench installing...${NC}" - curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh 2> /dev/null | sudo bash > /dev/null 2>&1 - sudo apt -y install sysbench > /dev/null 2>&1 + fi + elif [[ $(lsb_release -d) = *Ubuntu* ]]; then + if [[ $(lsb_release -cs) = *focal* || $(lsb_release -cs) = *bionic* || $(lsb_release -cs) = *xenial* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + elif [[ $(lsb_release -cs) = *jammy* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + fi + else + echo -e "${WORNING} ${RED}OS type not supported..${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + if ! sysbench --version > /dev/null 2>&1; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Sysbench installing...${NC}" + curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh 2> /dev/null | sudo bash > /dev/null 2>&1 + sudo apt -y install sysbench > /dev/null 2>&1 if sysbench --version > /dev/null 2>&1; then string_limit_check_mark "Sysbench $(sysbench --version | awk '{print $2}') installed................................." "Sysbench ${GREEN}$(sysbench --version | awk '{print $2}')${CYAN} installed................................." fi - fi - install_mongod - install_nodejs - install_flux - sleep 2 + fi + install_mongod + install_nodejs + install_flux + sleep 2 } function install_flux() { - echo -e "${ARROW} ${YELLOW}FluxOS installing...${NC}" - docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) - resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) - mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) + echo -e "${ARROW} ${YELLOW}FluxOS installing...${NC}" + docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) + resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) + mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) - if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then - #echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 - echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 - echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 - fi + if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then + #echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" && sleep 1 + echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 + fi - if [[ $docker_check != 0 ]]; then - #echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 - echo -e "${ARROW} ${CYAN}Removing containers...${NC}" - sudo service docker restart > /dev/null 2>&1 && sleep 2 - docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | - while read line; do - sudo docker stop $line > /dev/null 2>&1 && sleep 2 - sudo docker rm $line > /dev/null 2>&1 && sleep 2 - done - fi - if [[ $resource_check != 0 ]]; then - #echo -e "${ARROW} ${YELLOW}Detected locked resource${NC}" && sleep 1 - echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 - df | egrep 'flux' | awk '{ print $1}' | - while read line; do - sudo umount -l $line && sleep 1 - done - fi - if [ -d "./$FLUX_DIR" ]; then - echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS${NC}" - sudo rm -rf $FLUX_DIR - fi - - git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Creating FluxOS configuration file...${NC}" - fluxos_conf_create - if [ -d ~/$FLUX_DIR ]; then - current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - string_limit_check_mark "FluxOS v$current_ver installed................................." "FluxOS ${GREEN}v$current_ver${CYAN} installed................................." - echo -e "" - else - string_limit_x_mark "FluxOS was not installed................................." - echo -e "" - fi + if [[ $docker_check != 0 ]]; then + #echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Removing containers...${NC}" + sudo service docker restart > /dev/null 2>&1 && sleep 2 + docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | + while read line; do + sudo docker stop $line > /dev/null 2>&1 && sleep 2 + sudo docker rm $line > /dev/null 2>&1 && sleep 2 + done + fi + if [[ $resource_check != 0 ]]; then + #echo -e "${ARROW} ${YELLOW}Detected locked resource${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 + df | egrep 'flux' | awk '{ print $1}' | + while read line; do + sudo umount -l $line && sleep 1 + done + fi + if [ -d "./$FLUX_DIR" ]; then + echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS${NC}" + sudo rm -rf $FLUX_DIR + fi + + git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Creating FluxOS configuration file...${NC}" + fluxos_conf_create + if [ -d ~/$FLUX_DIR ]; then + current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) + string_limit_check_mark "FluxOS v$current_ver installed................................." "FluxOS ${GREEN}v$current_ver${CYAN} installed................................." + echo -e "" + else + string_limit_x_mark "FluxOS was not installed................................." + echo -e "" + fi } function status_loop() { - network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") - if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks' 2> /dev/null) ]]; then - echo -e "" - echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) - LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - NUM='2' - MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN}" - MSG2="${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo && echo - else - echo -e "" - echo -e "${CLOCK}${GREEN}FLUX DAEMON SYNCING...${NC}" - f=0 - start_sync=`date +%s` - while true - do - network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) - LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - if [[ "$LEFT" == "0" ]]; then - time_break='5' - else - time_break='20' - fi - if [[ $LOCAL_BLOCK_HIGHT == "" ]]; then - f=$((f+1)) - LOCAL_BLOCK_HIGHT="N/A" - LEFT="N/A" - CONNECTIONS="N/A" - sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 - sudo systemctl start zelcash > /dev/null 2>&1 - NUM='60' - MSG1="Syncing progress => Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" - MSG2='' - spinning_timer - network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') - LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - fi - NUM="$time_break" - MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" - MSG2='' - spinning_timer - if [[ "$EXPLORER_BLOCK_HIGHT" == "$LOCAL_BLOCK_HIGHT" ]]; then - echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" - break - fi - done - fi - install_watchdog - finalizing - display_banner + network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) + + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") + if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks' 2> /dev/null) ]]; then + echo -e "" + echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + NUM='2' + MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN}" + MSG2="${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo + else + echo -e "" + echo -e "${CLOCK}${GREEN}FLUX DAEMON SYNCING...${NC}" + f=0 + start_sync=`date +%s` + while true + do + network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + if [[ "$LEFT" == "0" ]]; then + time_break='5' + else + time_break='20' + fi + if [[ $LOCAL_BLOCK_HIGHT == "" ]]; then + f=$((f+1)) + LOCAL_BLOCK_HIGHT="N/A" + LEFT="N/A" + CONNECTIONS="N/A" + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo systemctl start zelcash > /dev/null 2>&1 + NUM='60' + MSG1="Syncing progress => Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer + network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') + CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + fi + NUM="$time_break" + MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer + if [[ "$EXPLORER_BLOCK_HIGHT" == "$LOCAL_BLOCK_HIGHT" ]]; then + echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + break + fi + done + fi + install_watchdog + finalizing + display_banner } #end of functions start_install @@ -862,7 +858,7 @@ create_conf install_daemon zk_params if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then - bootstrap "install" + bootstrap "install" fi create_service_scripts create_service "install" diff --git a/multinode.sh b/multinode.sh index 60a49a28..6af68b27 100644 --- a/multinode.sh +++ b/multinode.sh @@ -2,148 +2,148 @@ source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" function upnp_enable() { - try="0" - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" - echo -e "" - exit - fi - while true - do - echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" - # Check if upnp_port is set - if [[ -z "$upnp_port" ]]; then - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) - else - FLUX_PORT=$(echo $upnp_port) - fi - if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then - string_limit_check_mark "Port is valid..........................................." - break - else - string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." - sleep 1 - try=$(($try+1)) - if [[ "$try" -gt "3" ]]; then - echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" - echo -e "" - exit - fi - fi - done - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then - sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" - fi - else - insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," - echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ -d /home/$USER/.fluxbenchmark ]]; then - sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null - echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null - else - echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null - fi - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" - echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" - #API PORT - sudo ufw allow $FLUX_PORT > /dev/null 2>&1 - #HOME UI PORT - sudo ufw allow $(($FLUX_PORT-1)) > /dev/null 2>&1 - #if ! route -h > /dev/null 2>&1 ; then - # sudo apt install net-tools > /dev/null 2>&1 - #fi - #router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) - if [[ -z "$gateway_ip" ]]; then - router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) - else - router_ip=$(echo $gateway_ip) - fi - if [[ "$router_ip" != "" ]]; then - if [[ -z "$gateway_ip" ]]; then - if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then - is_correct="0" - fi - else - is_correct="0" - fi - if [[ "$is_correct" == "0" ]]; then - sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 - sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 - sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 - sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 - else - while true - do - - router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) - - if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then - echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - string_limit_x_mark "IP $router_ip is not valid ..............................." - sleep 1 - fi - - done - sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 - sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 - sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 - sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 - fi - else - while true - do - router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) - if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then - echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - string_limit_x_mark "IP $router_ip is not valid ..............................." - sleep 1 - fi - done - sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 - sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 - sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 - sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 - fi - fi - sudo systemctl restart zelcash > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 - sleep 200 - echo -e "${ARROW}${YELLOW} Checking FluxOS logs... ${NC}" - error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") - if [[ "$error_check" == "" ]]; then - echo -e "" - LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') - echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${LOCAL_IP}:$(($FLUX_PORT-1))${NC}" - echo -e "" - else - echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" - echo -e "" - fi + try="0" + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" + echo -e "" + exit + fi + while true + do + echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" + # Check if upnp_port is set + if [[ -z "$upnp_port" ]]; then + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) + else + FLUX_PORT=$(echo $upnp_port) + fi + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then + string_limit_check_mark "Port is valid..........................................." + break + else + string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." + sleep 1 + try=$(($try+1)) + if [[ "$try" -gt "3" ]]; then + echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" + echo -e "" + exit + fi + fi + done + if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then + sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + fi + else + insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," + echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ -d /home/$USER/.fluxbenchmark ]]; then + sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null + echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + else + echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + fi + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" + #API PORT + sudo ufw allow $FLUX_PORT > /dev/null 2>&1 + #HOME UI PORT + sudo ufw allow $(($FLUX_PORT-1)) > /dev/null 2>&1 + #if ! route -h > /dev/null 2>&1 ; then + # sudo apt install net-tools > /dev/null 2>&1 + #fi + #router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) + if [[ -z "$gateway_ip" ]]; then + router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + else + router_ip=$(echo $gateway_ip) + fi + if [[ "$router_ip" != "" ]]; then + if [[ -z "$gateway_ip" ]]; then + if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then + is_correct="0" + fi + else + is_correct="0" + fi + if [[ "$is_correct" == "0" ]]; then + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + else + while true + do + + router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) + + if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then + echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + string_limit_x_mark "IP $router_ip is not valid ..............................." + sleep 1 + fi + + done + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + fi + else + while true + do + router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) + if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then + echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + string_limit_x_mark "IP $router_ip is not valid ..............................." + sleep 1 + fi + done + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + fi + fi + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + sleep 200 + echo -e "${ARROW}${YELLOW} Checking FluxOS logs... ${NC}" + error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") + if [[ "$error_check" == "" ]]; then + echo -e "" + LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') + echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${LOCAL_IP}:$(($FLUX_PORT-1))${NC}" + echo -e "" + else + echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" + echo -e "" + fi } function upnp_disable() { if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" - echo -e "" - exit + echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" + echo -e "" + exit fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${CYAN}Removing FluxOS UPnP configuration.....${NC}" sudo rm -rf /home/$USER/.fluxbenchmark/fluxbench.conf else - echo -e "${ARROW} ${YELLOW}UPnP Mode is already disabled...${NC}" - echo -e "" - exit + echo -e "${ARROW} ${YELLOW}UPnP Mode is already disabled...${NC}" + echo -e "" + exit fi if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep 'apiport' | wc -l) == "1" ]]; then - cat /home/$USER/zelflux/config/userconfig.js | sed '/apiport/d' | sudo tee "/home/$USER/zelflux/config/userconfig.js" > /dev/null + cat /home/$USER/zelflux/config/userconfig.js | sed '/apiport/d' | sudo tee "/home/$USER/zelflux/config/userconfig.js" > /dev/null fi echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" echo -e "" @@ -153,52 +153,52 @@ function upnp_disable() { } if [[ -f /home/$USER/install_conf.json ]]; then - import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') - if [[ "$import_settings" == "1" ]]; then - echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 0.5 - enable_upnp=$(cat /home/$USER/install_conf.json | jq -r '.enable_upnp') - upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') - gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') - if [[ -n $enable_upnp && "$enable_upnp" != "" && "$enable_upnp" != "0" ]]; then - echo -e "${PIN}${CYAN} UPnP state = ${GREEN}Enable${NC}" && sleep 0.5 - else - echo -e "${PIN}${CYAN} UPnP state = ${RED}Disable${NC}" && sleep 0.5 - fi - if [[ -n $upnp_port && "$upnp_port" != "" && "$upnp_port" != "0" ]]; then - echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" && sleep 0.5 - else - echo -e "${PIN}${CYAN} UPnP port = ${RED}NULL${NC}" && sleep 0.5 - fi - if [[ -n $gateway_ip && "$gateway_ip" != "" && "$gateway_ip" != "0" ]]; then - echo -e "${PIN}${CYAN} Gateway = ${GREEN}$gateway_ip${NC}" && sleep 0.5 - else - echo -e "${PIN}${CYAN} Gateway = ${RED}NULL${NC}" && sleep 0.5 - fi - echo -e "" - fi + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + if [[ "$import_settings" == "1" ]]; then + echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 0.5 + enable_upnp=$(cat /home/$USER/install_conf.json | jq -r '.enable_upnp') + upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') + gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') + if [[ -n $enable_upnp && "$enable_upnp" != "" && "$enable_upnp" != "0" ]]; then + echo -e "${PIN}${CYAN} UPnP state = ${GREEN}Enable${NC}" && sleep 0.5 + else + echo -e "${PIN}${CYAN} UPnP state = ${RED}Disable${NC}" && sleep 0.5 + fi + if [[ -n $upnp_port && "$upnp_port" != "" && "$upnp_port" != "0" ]]; then + echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" && sleep 0.5 + else + echo -e "${PIN}${CYAN} UPnP port = ${RED}NULL${NC}" && sleep 0.5 + fi + if [[ -n $gateway_ip && "$gateway_ip" != "" && "$gateway_ip" != "0" ]]; then + echo -e "${PIN}${CYAN} Gateway = ${GREEN}$gateway_ip${NC}" && sleep 0.5 + else + echo -e "${PIN}${CYAN} Gateway = ${RED}NULL${NC}" && sleep 0.5 + fi + echo -e "" + fi fi if [[ -z $enable_upnp ]]; then - CHOICE=$( - whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ - "1)" "Enable UPnP Mode" \ - "2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 - ) + CHOICE=$( + whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ + "1)" "Enable UPnP Mode" \ + "2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 + ) else - # if enable_upnp is 1 then set choice to 1 else set choice to 2 - if [[ "$enable_upnp" == "1" ]]; then - CHOICE="1)" - else - CHOICE="2)" - fi + # if enable_upnp is 1 then set choice to 1 else set choice to 2 + if [[ "$enable_upnp" == "1" ]]; then + CHOICE="1)" + else + CHOICE="2)" + fi fi case $CHOICE in "1)") - upnp_enable + upnp_enable ;; "2)") - upnp_disable + upnp_disable ;; esac diff --git a/multitoolbox.sh b/multitoolbox.sh index f0b88d67..9e14e1b2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,24 +1,24 @@ #!/bin/bash if ! [[ -z $1 ]]; then - if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then - export ROOT_BRANCH="$1" - export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH - unset ROOT_BRANCH - unset BRANCH_ALREADY_REFERENCED - exit - fi + if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then + export ROOT_BRANCH="$1" + export BRANCH_ALREADY_REFERENCED='1' + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCED + exit + fi else - export ROOT_BRANCH='master' + export ROOT_BRANCH='master' fi source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' else - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' fi FLUX_DIR='zelflux' @@ -29,1051 +29,1051 @@ PM2_INSTALL="0" zelflux_setting_import="0" function config_veryfity(){ - if [[ -f /home/$USER/.flux/flux.conf ]]; then - echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" - insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) - if [[ "$insightexplorer" == "1" ]]; then - echo -e "${ARROW} ${CYAN}Insightexplorer enabled..............[${CHECK_MARK}${CYAN}]${NC}" - echo "" - else - echo -e "${WORNING} ${CYAN}Insightexplorer disabled.............[${X_MARK}${CYAN}]${NC}" - echo -e "${WORNING} ${CYAN}Use option 2 for node re-install${NC}" - echo -e "" - exit - fi - fi + if [[ -f /home/$USER/.flux/flux.conf ]]; then + echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" + insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) + if [[ "$insightexplorer" == "1" ]]; then + echo -e "${ARROW} ${CYAN}Insightexplorer enabled..............[${CHECK_MARK}${CYAN}]${NC}" + echo "" + else + echo -e "${WORNING} ${CYAN}Insightexplorer disabled.............[${X_MARK}${CYAN}]${NC}" + echo -e "${WORNING} ${CYAN}Use option 2 for node re-install${NC}" + echo -e "" + exit + fi + fi } function config_file() { - if [[ -f /home/$USER/install_conf.json ]]; then + if [[ -f /home/$USER/install_conf.json ]]; then - import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') - bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') - bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') - use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') - prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') - outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') - index=$(cat /home/$USER/install_conf.json | jq -r '.index') - zel_id=$(cat /home/$USER/install_conf.json | jq -r '.zelid') - kda_address=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') + bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') + use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') + prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') + outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') + index=$(cat /home/$USER/install_conf.json | jq -r '.index') + zel_id=$(cat /home/$USER/install_conf.json | jq -r '.zelid') + kda_address=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') - echo -e "${ARROW} ${YELLOW}Install config summary:" - if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then - echo -e "${PIN}${CYAN}Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" - else - if [[ "$import_settings" == "1" ]]; then - echo -e "${PIN}${CYAN}Import settings from exist config files..........................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi + echo -e "${ARROW} ${YELLOW}Install config summary:" + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then + echo -e "${PIN}${CYAN}Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" + else + if [[ "$import_settings" == "1" ]]; then + echo -e "${PIN}${CYAN}Import settings from exist config files..........................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi - if [[ "$use_old_chain" == "1" ]]; then - echo -e "${PIN}${CYAN}Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" - else - if [[ "$bootstrap_url" == "" ]]; then - echo -e "${PIN}${CYAN}Use Flux Bootstrap from source build in scripts..................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${PIN}${CYAN}Use Flux Bootstrap from own source...............................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ "$bootstrap_zip_del" == "1" ]]; then - echo -e "${PIN}${CYAN}Remove Flux Bootstrap archive file...............................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${PIN}${CYAN}Leave Flux Bootstrap archive file................................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi + if [[ "$use_old_chain" == "1" ]]; then + echo -e "${PIN}${CYAN}Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" + else + if [[ "$bootstrap_url" == "" ]]; then + echo -e "${PIN}${CYAN}Use Flux Bootstrap from source build in scripts..................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${PIN}${CYAN}Use Flux Bootstrap from own source...............................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$bootstrap_zip_del" == "1" ]]; then + echo -e "${PIN}${CYAN}Remove Flux Bootstrap archive file...............................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${PIN}${CYAN}Leave Flux Bootstrap archive file................................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi - if [[ ( "$discord" != "" && "$discord" != "0" ) || "$telegram_alert" == '1' ]]; then - echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" - fi + if [[ ( "$discord" != "" && "$discord" != "0" ) || "$telegram_alert" == '1' ]]; then + echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" + fi - if [[ ( "$enable_upnp" != "" && "$enable_upnp" != "0" ) ]]; then - echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" - echo -e "${CYAN} UPnP Port: ${GREEN}$upnp_port${NC}" - echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" - fi - fi + if [[ ( "$enable_upnp" != "" && "$enable_upnp" != "0" ) ]]; then + echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${CYAN} UPnP Port: ${GREEN}$upnp_port${NC}" + echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" + fi + fi } function install_flux() { - echo -e "${GREEN}Module: Re-install FluxOS${NC}" - echo -e "${YELLOW}================================================================${NC}" + echo -e "${GREEN}Module: Re-install FluxOS${NC}" + echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi + if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi - if pm2 -v > /dev/null 2>&1; then - pm2 del zelflux > /dev/null 2>&1 - pm2 del flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - fi + if pm2 -v > /dev/null 2>&1; then + pm2 del zelflux > /dev/null 2>&1 + pm2 del flux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + fi - docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) - resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) - mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) - if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then - echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" - echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" - echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 - fi + docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) + resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) + mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) + if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then + echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" + echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" + echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 + fi - if [[ $docker_check != 0 ]]; then - echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" - echo -e "${ARROW} ${CYAN}Removing containers...${NC}" - sudo aa-remove-unknown > /dev/null 2>&1 && sudo service docker restart > /dev/null 2>&1 - docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | - while read line; do - sudo docker stop $line > /dev/null 2>&1 && sleep 1 - sudo docker rm $line > /dev/null 2>&1 && sleep 1 - done - fi + if [[ $docker_check != 0 ]]; then + echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" + echo -e "${ARROW} ${CYAN}Removing containers...${NC}" + sudo aa-remove-unknown > /dev/null 2>&1 && sudo service docker restart > /dev/null 2>&1 + docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | + while read line; do + sudo docker stop $line > /dev/null 2>&1 && sleep 1 + sudo docker rm $line > /dev/null 2>&1 && sleep 1 + done + fi - if [[ $resource_check != 0 ]]; then - echo -e "${ARROW} ${YELLOW}Detected locked resource...${NC}" - echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" - df | egrep 'flux' | awk '{ print $1}' | - while read line; do - sudo umount -l $line - done - fi + if [[ $resource_check != 0 ]]; then + echo -e "${ARROW} ${YELLOW}Detected locked resource...${NC}" + echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" + df | egrep 'flux' | awk '{ print $1}' | + while read line; do + sudo umount -l $line + done + fi - if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then - echo -e "${ARROW} ${CYAN}Importing setting...${NC}" - zel_id=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - WANIP=$(grep -w ipaddress /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*ipaddress: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$zel_id${NC}" - KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" - fi - echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" - echo -e "" - echo -e "${ARROW} ${CYAN}Removing any instances of Flux....${NC}" - sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 - zelflux_setting_import="1" - fi + if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + echo -e "${ARROW} ${CYAN}Importing setting...${NC}" + zel_id=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + WANIP=$(grep -w ipaddress /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*ipaddress: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$zel_id${NC}" + KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" + fi + echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" + echo -e "" + echo -e "${ARROW} ${CYAN}Removing any instances of Flux....${NC}" + sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 + zelflux_setting_import="1" + fi - if [ -d /home/$USER/$FLUX_DIR ]; then - echo -e "${ARROW} ${CYAN}Removing any instances of Flux....${NC}" - sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 - fi + if [ -d /home/$USER/$FLUX_DIR ]; then + echo -e "${ARROW} ${CYAN}Removing any instances of Flux....${NC}" + sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 + fi - echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" - git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 1 - if [[ -d /home/$USER/$FLUX_DIR ]]; then + echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" + git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 1 + if [[ -d /home/$USER/$FLUX_DIR ]]; then - if [[ -f /home/$USER/$FLUX_DIR/package.json ]]; then - current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - else - string_limit_x_mark "Flux was not downloaded, run script again..........................................." - echo - exit - fi - string_limit_check_mark "Flux v$current_ver downloaded..........................................." "Flux ${GREEN}v$current_ver${CYAN} downloaded..........................................." - else - string_limit_x_mark "Flux was not downloaded, run script again..........................................." - echo - exit - fi + if [[ -f /home/$USER/$FLUX_DIR/package.json ]]; then + current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) + else + string_limit_x_mark "Flux was not downloaded, run script again..........................................." + echo + exit + fi + string_limit_check_mark "Flux v$current_ver downloaded..........................................." "Flux ${GREEN}v$current_ver${CYAN} downloaded..........................................." + else + string_limit_x_mark "Flux was not downloaded, run script again..........................................." + echo + exit + fi - if [[ "$zelflux_setting_import" == "0" ]]; then - get_ip "install" - while true - do - zel_id="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then - string_limit_check_mark "Zel ID is valid..........................................." - break - else - string_limit_x_mark "Zel ID is not valid try again..........................................." - sleep 2 - fi - done + if [[ "$zelflux_setting_import" == "0" ]]; then + get_ip "install" + while true + do + zel_id="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + done - while true - do - KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=0" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - fluxOS_conf - fi - - if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then - string_limit_check_mark "Flux configuration successfull..........................................." - else - string_limit_x_mark "Flux installation failed, missing config file..........................................." - echo - exit - fi + while true + do + KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=0" + sleep 2 + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + fluxOS_conf + fi + + if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + string_limit_check_mark "Flux configuration successfull..........................................." + else + string_limit_x_mark "Flux installation failed, missing config file..........................................." + echo + exit + fi - if pm2 -v > /dev/null 2>&1; then - rm restart_zelflux.sh > /dev/null 2>&1 - pm2 del flux > /dev/null 2>&1 - pm2 del zelflux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" - echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" - echo -e "" - pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=60000 --max-restarts=40 --name flux --time > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - pm2 list - else - pm2_install - if [[ "$PM2_INSTALL" == "1" ]]; then - echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" - echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" - echo - pm2 list - fi - fi + if pm2 -v > /dev/null 2>&1; then + rm restart_zelflux.sh > /dev/null 2>&1 + pm2 del flux > /dev/null 2>&1 + pm2 del zelflux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" + echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" + echo -e "" + pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=60000 --max-restarts=40 --name flux --time > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + pm2 list + else + pm2_install + if [[ "$PM2_INSTALL" == "1" ]]; then + echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" + echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" + echo + pm2 list + fi + fi } function create_config() { - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - echo -e "${GREEN}Module: Create FluxNode installation config file${NC}" - echo -e "${YELLOW}================================================================${NC}" - if jq --version > /dev/null 2>&1; then - sleep 0.2 - else - echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" - sudo apt install jq -y > /dev/null 2>&1 - if jq --version > /dev/null 2>&1; then - #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" - string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" - string_limit_x_mark "JQ was not installed................................." - echo - exit - fi - fi - skip_zelcash_config='0' - skip_bootstrap='0' - if [[ -d /home/$USER/$CONFIG_DIR ]]; then - if whiptail --yesno "Would you like import old settings from daemon and Flux?" 8 65; then - import_settings='1' - skip_zelcash_config='1' - sleep 1 - else - import_settings='0' - sleep 1 - fi - if whiptail --yesno "Would you like use exist Flux chain?" 8 65; then - use_old_chain='1' - skip_bootstrap='1' - sleep 1 - else - use_old_chain='0' - sleep 1 - fi - fi + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + echo -e "${GREEN}Module: Create FluxNode installation config file${NC}" + echo -e "${YELLOW}================================================================${NC}" + if jq --version > /dev/null 2>&1; then + sleep 0.2 + else + echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" + sudo apt install jq -y > /dev/null 2>&1 + if jq --version > /dev/null 2>&1; then + #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" + string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." + echo + else + #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" + string_limit_x_mark "JQ was not installed................................." + echo + exit + fi + fi + skip_zelcash_config='0' + skip_bootstrap='0' + if [[ -d /home/$USER/$CONFIG_DIR ]]; then + if whiptail --yesno "Would you like import old settings from daemon and Flux?" 8 65; then + import_settings='1' + skip_zelcash_config='1' + sleep 1 + else + import_settings='0' + sleep 1 + fi + if whiptail --yesno "Would you like use exist Flux chain?" 8 65; then + use_old_chain='1' + skip_bootstrap='1' + sleep 1 + else + use_old_chain='0' + sleep 1 + fi + fi - if [[ "$skip_zelcash_config" == "1" ]]; then - prvkey="" - outpoint="" - index="" - zelid="" - kda_address="" - node_label="0" - fix_action="1" - eps_limit="0" - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - else - prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) - sleep 1 - outpoint=$(whiptail --inputbox "Enter your FluxNode Collateral TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) - sleep 1 - index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) - sleep 1 - while true - do - zel_id=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) - if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then - echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" - sleep 4 - fi - done - sleep 1 - while true - do - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=0" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - sleep 1 - if whiptail --yesno "Would you like enable autoupdate?" 8 65; then - zelflux_update='1' - zelcash_update='1' - zelbench_update='1' - else - zelflux_update='0' - zelcash_update='0' - zelbench_update='0' - fi - if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then - enable_upnp='1' - gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router)" 8 85 3>&1 1>&2 2>&3) - upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ - "Use the UP/DOWN arrows to highlight the port you want. Press Spacebar on the port you want to select, THEN press ENTER." 17 50 8 \ - "16127" "" ON \ - "16137" "" OFF \ - "16147" "" OFF \ - "16157" "" OFF \ - "16167" "" OFF \ - "16177" "" OFF \ - "16187" "" OFF \ - "16197" "" OFF 3>&1 1>&2 2>&3) - else - enable_upnp="0" - gateway_ip="" - upnp_port="" - fi - - if whiptail --yesno "Would you like enable alert notification?" 8 65; then - whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 - sleep 1 - CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ - "1" "Discord notification " ON \ - "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) - if [[ -z "$CHOICES" ]]; then - echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" - sleep 1 - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - node_label="0" - else - for CHOICE in $CHOICES; do - case "$CHOICE" in - "1") - discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) - sleep 1 - if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - while true - do - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) - if [[ $ping == ?(-)+([0-9]) ]]; then - string_limit_check_mark "UserID is valid..........................................." - break - else - string_limit_x_mark "UserID is not valid try again............................." - sleep 1 - fi - done - sleep 1 - else - ping="0" - sleep 1 - fi - ;; - "2") - telegram_alert="1" - while true - do - telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) - if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then - string_limit_check_mark "Bot token is valid..........................................." - break - else - string_limit_x_mark "Bot token is not valid try again............................." - sleep 1 - fi - done - sleep 1 - while true - do - telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) - if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then - string_limit_check_mark "Chat ID is valid..........................................." - break - else - string_limit_x_mark "Chat ID is not valid try again............................." - sleep 1 - fi - done - sleep 1 - ;; - esac - done - fi - while true - do - node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - string_limit_check_mark "Node name is valid..........................................." - break - else - string_limit_x_mark "Node name is not valid try again............................." - sleep 1 - fi - done - else - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - node_label="0" - sleep 1 - fi + if [[ "$skip_zelcash_config" == "1" ]]; then + prvkey="" + outpoint="" + index="" + zelid="" + kda_address="" + node_label="0" + fix_action="1" + eps_limit="0" + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + else + prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) + sleep 1 + outpoint=$(whiptail --inputbox "Enter your FluxNode Collateral TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) + sleep 1 + index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) + sleep 1 + while true + do + zel_id=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) + if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then + echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" + sleep 4 + fi + done + sleep 1 + while true + do + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=0" + sleep 2 + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + sleep 1 + if whiptail --yesno "Would you like enable autoupdate?" 8 65; then + zelflux_update='1' + zelcash_update='1' + zelbench_update='1' + else + zelflux_update='0' + zelcash_update='0' + zelbench_update='0' + fi + if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then + enable_upnp='1' + gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router)" 8 85 3>&1 1>&2 2>&3) + upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ + "Use the UP/DOWN arrows to highlight the port you want. Press Spacebar on the port you want to select, THEN press ENTER." 17 50 8 \ + "16127" "" ON \ + "16137" "" OFF \ + "16147" "" OFF \ + "16157" "" OFF \ + "16167" "" OFF \ + "16177" "" OFF \ + "16187" "" OFF \ + "16197" "" OFF 3>&1 1>&2 2>&3) + else + enable_upnp="0" + gateway_ip="" + upnp_port="" + fi + + if whiptail --yesno "Would you like enable alert notification?" 8 65; then + whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 + sleep 1 + CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + if [[ -z "$CHOICES" ]]; then + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" + sleep 1 + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" + else + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + else + ping="0" + sleep 1 + fi + ;; + "2") + telegram_alert="1" + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + sleep 1 + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + ;; + esac + done + fi + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + else + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" + sleep 1 + fi - if [[ "$discord" == 0 ]]; then - ping="0" - fi + if [[ "$discord" == 0 ]]; then + ping="0" + fi - if [[ "$telegram_alert" == 0 || "$telegram_alert" == "" ]]; then - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - fi + if [[ "$telegram_alert" == 0 || "$telegram_alert" == "" ]]; then + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + fi - index_from_file="$index" - tx_from_file="$outpoint" - stak_info=$(curl -sSL -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -sSL -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - fi - if [[ $stak_info == ?(-)+([0-9]) ]]; then - case $stak_info in - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; - esac - else - eps_limit=0; - fi - fi - if [[ "$skip_bootstrap" == "0" ]]; then - if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then - bootstrap_url="0" - sleep 1 - else - bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) - sleep 1 - fi - if whiptail --yesno "Would you like keep bootstrap archive file localy?" 8 65; then - bootstrap_zip_del='0' - sleep 1 - else - bootstrap_zip_del='1' - sleep 1 - fi - fi - firewall_disable='1' - swapon='1' - rm /home/$USER/install_conf.json > /dev/null 2>&1 - install_conf_create - config_file - echo -e + index_from_file="$index" + tx_from_file="$outpoint" + stak_info=$(curl -sSL -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -sSL -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + fi + if [[ $stak_info == ?(-)+([0-9]) ]]; then + case $stak_info in + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; + esac + else + eps_limit=0; + fi + fi + if [[ "$skip_bootstrap" == "0" ]]; then + if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then + bootstrap_url="0" + sleep 1 + else + bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) + sleep 1 + fi + if whiptail --yesno "Would you like keep bootstrap archive file localy?" 8 65; then + bootstrap_zip_del='0' + sleep 1 + else + bootstrap_zip_del='1' + sleep 1 + fi + fi + firewall_disable='1' + swapon='1' + rm /home/$USER/install_conf.json > /dev/null 2>&1 + install_conf_create + config_file + echo -e } function install_watchdog() { - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - echo -e "${GREEN}Module: Install watchdog for FluxNode${NC}" - echo -e "${YELLOW}================================================================${NC}" - if ! pm2 -v > /dev/null 2>&1; then - pm2_install - if [[ "$PM2_INSTALL" == "0" ]]; then - exit - fi - echo -e "" - fi - echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - pm2 del watchdog > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Downloading...${NC}" - cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" - wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 - mv post-merge /home/$USER/watchdog/.git/hooks/post-merge - sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge - echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" - cd watchdog && npm install > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Creating config file....${NC}" - if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then - flux_update='1' - sleep 1 - else - flux_update='0' - sleep 1 - fi - if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then - daemon_update='1' - sleep 1 - else - daemon_update='0' - sleep 1 - fi - if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then - bench_update='1' - sleep 1 - else - bench_update='0' - sleep 1 - fi - #if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then - fix_action='1' - #sleep 1 - #else - #fix_action='0' - ##sleep 1 - #fi - telegram_alert=0; - discord=0; - if whiptail --yesno "Would you like enable alert notification?" 8 60; then - sleep 1 - whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 - sleep 1 - CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ - "1" "Discord notification " ON \ - "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) - if [[ -z "$CHOICES" ]]; then - echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" - sleep 1 - discord=0; - ping=0; - telegram_alert=0; - telegram_bot_token=0; - telegram_chat_id=0; - node_label=0; - else - for CHOICE in $CHOICES; do - case "$CHOICE" in - "1") - discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) - sleep 1 - if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - while true - do - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) - if [[ $ping == ?(-)+([0-9]) ]]; then - string_limit_check_mark "UserID is valid..........................................." - break - else - string_limit_x_mark "UserID is not valid try again............................." - sleep 1 - fi - done - sleep 1 - else - ping=0; - sleep 1 - fi - ;; - "2") - telegram_alert=1; - while true - do - telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) - if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then - string_limit_check_mark "Bot token is valid..........................................." - break - else - string_limit_x_mark "Bot token is not valid try again............................." - sleep 1 - fi - done + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + echo -e "${GREEN}Module: Install watchdog for FluxNode${NC}" + echo -e "${YELLOW}================================================================${NC}" + if ! pm2 -v > /dev/null 2>&1; then + pm2_install + if [[ "$PM2_INSTALL" == "0" ]]; then + exit + fi + echo -e "" + fi + echo -e "${ARROW} ${CYAN}Cleaning...${NC}" + pm2 del watchdog > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Downloading...${NC}" + cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" + wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 + mv post-merge /home/$USER/watchdog/.git/hooks/post-merge + sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge + echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" + cd watchdog && npm install > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Creating config file....${NC}" + if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then + flux_update='1' + sleep 1 + else + flux_update='0' + sleep 1 + fi + if whiptail --yesno "Would you like enable Flux daemon auto update?" 8 60; then + daemon_update='1' + sleep 1 + else + daemon_update='0' + sleep 1 + fi + if whiptail --yesno "Would you like enable Flux benchmark auto update?" 8 60; then + bench_update='1' + sleep 1 + else + bench_update='0' + sleep 1 + fi + #if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then + fix_action='1' + #sleep 1 + #else + #fix_action='0' + ##sleep 1 + #fi + telegram_alert=0; + discord=0; + if whiptail --yesno "Would you like enable alert notification?" 8 60; then + sleep 1 + whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 + sleep 1 + CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + if [[ -z "$CHOICES" ]]; then + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" + sleep 1 + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + node_label=0; + else + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + else + ping=0; + sleep 1 + fi + ;; + "2") + telegram_alert=1; + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done - sleep 1 - while true - do - telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) - if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then - string_limit_check_mark "Chat ID is valid..........................................." - break - else - string_limit_x_mark "Chat ID is not valid try again............................." - sleep 1 - fi - done + sleep 1 + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done - sleep 1 - ;; - esac - done - fi + sleep 1 + ;; + esac + done + fi - while true - do - node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - string_limit_check_mark "Node name is valid..........................................." - break - else - string_limit_x_mark "Node name is not valid try again............................." - sleep 1 - fi - done - sleep 1 - else - node_label=0; - discord=0; - ping=0; - telegram_alert=0; - telegram_bot_token=0; - telegram_chat_id=0; - sleep 1 - fi - if [[ $discord == 0 ]]; then - ping=0; - fi - if [[ $telegram_alert == 0 ]]; then - telegram_bot_token=0; - telegram_chat_id=0; - fi - if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - fi - fi - if [[ $stak_info == ?(-)+([0-9]) ]]; then - case $stak_info in - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; - esac - else - eps_limit=0; - fi - watchdog_conf_create - echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" - pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - if [[ -f /home/$USER/watchdog/watchdog.js ]]; then - current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) - string_limit_check_mark "Watchdog v$current_ver installed..........................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed..........................................." - else - string_limit_x_mark "Watchdog was not installed..........................................." - fi - echo -e "" + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + sleep 1 + else + node_label=0; + discord=0; + ping=0; + telegram_alert=0; + telegram_bot_token=0; + telegram_chat_id=0; + sleep 1 + fi + if [[ $discord == 0 ]]; then + ping=0; + fi + if [[ $telegram_alert == 0 ]]; then + telegram_bot_token=0; + telegram_chat_id=0; + fi + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + fi + fi + if [[ $stak_info == ?(-)+([0-9]) ]]; then + case $stak_info in + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; + esac + else + eps_limit=0; + fi + watchdog_conf_create + echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + if [[ -f /home/$USER/watchdog/watchdog.js ]]; then + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + string_limit_check_mark "Watchdog v$current_ver installed..........................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed..........................................." + else + string_limit_x_mark "Watchdog was not installed..........................................." + fi + echo -e "" } function flux_daemon_bootstrap() { - echo -e "${GREEN}Module: Restore Flux blockchain from bootstrap${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - cd - echo -e "${NC}" - config_veryfity - bootstrap + echo -e "${GREEN}Module: Restore Flux blockchain from bootstrap${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + cd + echo -e "${NC}" + config_veryfity + bootstrap } function install_node(){ - echo -e "${GREEN}Module: Install FluxNode${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi - if [[ $(lsb_release -cs) == "jammy" ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi - if sudo docker run hello-world > /dev/null 2>&1; then - echo -e "" - else - echo -e "${WORNING}${CYAN}Docker is not working correct or is not installed.${NC}" - exit - fi - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) + echo -e "${GREEN}Module: Install FluxNode${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + if [[ $(lsb_release -cs) == "jammy" ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + if sudo docker run hello-world > /dev/null 2>&1; then + echo -e "" + else + echo -e "${WORNING}${CYAN}Docker is not working correct or is not installed.${NC}" + exit + fi + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) } function install_docker(){ - echo -e "${GREEN}Module: Install Docker${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" != "root" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the root account use command 'sudo su -'.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi - if [[ $(lsb_release -cs) == "jammy" ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi - if [[ -z "$usernew" ]]; then - usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" - usernew=$(awk '{print tolower($0)}' <<< "$usernew") - else - echo -e "${PIN}${CYAN} Import docker user '$usernew' from environment variable............[${CHECK_MARK}${CYAN}]${NC}" - fi - echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" - adduser --gecos "" "$usernew" - usermod -aG sudo "$usernew" > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Update and upgrade system...${NC}" - apt update -y && apt upgrade -y - if ! ufw version > /dev/null 2>&1; then - echo -e "${ARROW} ${YELLOW}Installing ufw firewall..${NC}" - sudo apt-get install -y ufw > /dev/null 2>&1 - fi - cron_check=$(systemctl status cron 2> /dev/null | grep 'active' | wc -l) - if [[ "$cron_check" == "0" ]]; then - echo -e "${ARROW} ${YELLOW}Installing crontab...${NC}" - sudo apt-get install -y cron > /dev/null 2>&1 - fi - echo -e "${ARROW} ${YELLOW}Installing docker...${NC}" - echo -e "${ARROW} ${CYAN}Architecture: ${GREEN}$(dpkg --print-architecture)${NC}" - if [[ -f /usr/share/keyrings/docker-archive-keyring.gpg ]]; then - sudo rm /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 - fi - if [[ -f /etc/apt/sources.list.d/docker.list ]]; then - sudo rm /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 - fi - if [[ $(lsb_release -d) = *Debian* ]]; then - sudo apt-get remove docker docker-engine docker.io containerd runc -y > /dev/null 2>&1 - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get -y install apt-transport-https ca-certificates > /dev/null 2>&1 - sudo apt-get -y install curl gnupg-agent software-properties-common > /dev/null 2>&1 - #curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - > /dev/null 2>&1 - #sudo add-apt-repository -y "deb [arch=amd64,arm64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /dev/null 2>&1 - curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get install docker-ce docker-ce-cli containerd.io -y > /dev/null 2>&1 - else - sudo apt-get remove docker docker-engine docker.io containerd runc -y > /dev/null 2>&1 - sudo apt-get -y install apt-transport-https ca-certificates > /dev/null 2>&1 - sudo apt-get -y install curl gnupg-agent software-properties-common > /dev/null 2>&1 - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 - #curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - > /dev/null 2>&1 - #sudo add-apt-repository -y "deb [arch=amd64,arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /dev/null 2>&1 - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get install docker-ce docker-ce-cli containerd.io -y > /dev/null 2>&1 - fi - echo -e "${ARROW} ${YELLOW}Adding $usernew to docker group...${NC}" - adduser "$usernew" docker - echo -e "${NC}" - echo -e "${YELLOW}=====================================================${NC}" - echo -e "${YELLOW}Running through some checks...${NC}" - echo -e "${YELLOW}=====================================================${NC}" - if sudo docker run hello-world > /dev/null 2>&1; then - echo -e "${CHECK_MARK} ${CYAN}Docker is installed${NC}" - else - echo -e "${X_MARK} ${CYAN}Docker did not installed${NC}" - fi - if [[ $(getent group docker | grep "$usernew") ]]; then - echo -e "${CHECK_MARK} ${CYAN}User $usernew is member of 'docker'${NC}" - else - echo -e "${X_MARK} ${CYAN}User $usernew is not member of 'docker'${NC}" - fi - echo -e "${YELLOW}=====================================================${NC}" - echo -e "${NC}" - read -p "Would you like switch to user account Y/N?" -n 1 -r - echo -e "${NC}" - if [[ $REPLY =~ ^[Yy]$ ]]; then - su - $usernew - fi + echo -e "${GREEN}Module: Install Docker${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" != "root" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the root account use command 'sudo su -'.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + if [[ $(lsb_release -cs) == "jammy" ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + if [[ -z "$usernew" ]]; then + usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" + usernew=$(awk '{print tolower($0)}' <<< "$usernew") + else + echo -e "${PIN}${CYAN} Import docker user '$usernew' from environment variable............[${CHECK_MARK}${CYAN}]${NC}" + fi + echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" + adduser --gecos "" "$usernew" + usermod -aG sudo "$usernew" > /dev/null 2>&1 + echo -e "${ARROW} ${YELLOW}Update and upgrade system...${NC}" + apt update -y && apt upgrade -y + if ! ufw version > /dev/null 2>&1; then + echo -e "${ARROW} ${YELLOW}Installing ufw firewall..${NC}" + sudo apt-get install -y ufw > /dev/null 2>&1 + fi + cron_check=$(systemctl status cron 2> /dev/null | grep 'active' | wc -l) + if [[ "$cron_check" == "0" ]]; then + echo -e "${ARROW} ${YELLOW}Installing crontab...${NC}" + sudo apt-get install -y cron > /dev/null 2>&1 + fi + echo -e "${ARROW} ${YELLOW}Installing docker...${NC}" + echo -e "${ARROW} ${CYAN}Architecture: ${GREEN}$(dpkg --print-architecture)${NC}" + if [[ -f /usr/share/keyrings/docker-archive-keyring.gpg ]]; then + sudo rm /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 + fi + if [[ -f /etc/apt/sources.list.d/docker.list ]]; then + sudo rm /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 + fi + if [[ $(lsb_release -d) = *Debian* ]]; then + sudo apt-get remove docker docker-engine docker.io containerd runc -y > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get -y install apt-transport-https ca-certificates > /dev/null 2>&1 + sudo apt-get -y install curl gnupg-agent software-properties-common > /dev/null 2>&1 + #curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - > /dev/null 2>&1 + #sudo add-apt-repository -y "deb [arch=amd64,arm64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /dev/null 2>&1 + curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get install docker-ce docker-ce-cli containerd.io -y > /dev/null 2>&1 + else + sudo apt-get remove docker docker-engine docker.io containerd runc -y > /dev/null 2>&1 + sudo apt-get -y install apt-transport-https ca-certificates > /dev/null 2>&1 + sudo apt-get -y install curl gnupg-agent software-properties-common > /dev/null 2>&1 + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 2>&1 + #curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - > /dev/null 2>&1 + #sudo add-apt-repository -y "deb [arch=amd64,arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get install docker-ce docker-ce-cli containerd.io -y > /dev/null 2>&1 + fi + echo -e "${ARROW} ${YELLOW}Adding $usernew to docker group...${NC}" + adduser "$usernew" docker + echo -e "${NC}" + echo -e "${YELLOW}=====================================================${NC}" + echo -e "${YELLOW}Running through some checks...${NC}" + echo -e "${YELLOW}=====================================================${NC}" + if sudo docker run hello-world > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN}Docker is installed${NC}" + else + echo -e "${X_MARK} ${CYAN}Docker did not installed${NC}" + fi + if [[ $(getent group docker | grep "$usernew") ]]; then + echo -e "${CHECK_MARK} ${CYAN}User $usernew is member of 'docker'${NC}" + else + echo -e "${X_MARK} ${CYAN}User $usernew is not member of 'docker'${NC}" + fi + echo -e "${YELLOW}=====================================================${NC}" + echo -e "${NC}" + read -p "Would you like switch to user account Y/N?" -n 1 -r + echo -e "${NC}" + if [[ $REPLY =~ ^[Yy]$ ]]; then + su - $usernew + fi } function daemon_reconfiguration(){ - echo -e "${GREEN}Module: Flux Daemon Reconfiguration${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - config_veryfity - echo -e "" - echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" - sleep 2 - skip_change='3' - zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" - sleep 1 - zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3)" - sleep 1 - zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" - sleep 1 - if [[ "$zelnodeprivkey" == "" ]]; then - skip_change=$((skip_change-1)) - echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ "$zelnodeoutpoint" == "" ]]; then - skip_change=$((skip_change-1)) - echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ "$zelnodeindex" == "" ]]; then - skip_change=$((skip_change-1)) - echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ "$skip_change" == "0" ]]; then - echo -e "${ARROW} ${YELLOW}All fields are empty changes skipped...${NC}" - echo - exit - fi - echo -e "${ARROW} ${CYAN}Stopping Flux daemon service...${NC}" - sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 - sudo fuser -k 16125/tcp > /dev/null 2>&1 - if [[ "$zelnodeprivkey" != "" ]]; then - if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode identity key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - fi + echo -e "${GREEN}Module: Flux Daemon Reconfiguration${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + config_veryfity + echo -e "" + echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" + sleep 2 + skip_change='3' + zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" + sleep 1 + zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3)" + sleep 1 + zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" + sleep 1 + if [[ "$zelnodeprivkey" == "" ]]; then + skip_change=$((skip_change-1)) + echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$zelnodeoutpoint" == "" ]]; then + skip_change=$((skip_change-1)) + echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$zelnodeindex" == "" ]]; then + skip_change=$((skip_change-1)) + echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$skip_change" == "0" ]]; then + echo -e "${ARROW} ${YELLOW}All fields are empty changes skipped...${NC}" + echo + exit + fi + echo -e "${ARROW} ${CYAN}Stopping Flux daemon service...${NC}" + sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 + sudo fuser -k 16125/tcp > /dev/null 2>&1 + if [[ "$zelnodeprivkey" != "" ]]; then + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode identity key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi - if [[ "$zelnodeoutpoint" != "" ]]; then - if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode outpoint replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - fi + if [[ "$zelnodeoutpoint" != "" ]]; then + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode outpoint replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi - if [[ "$zelnodeindex" != "" ]]; then - if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - fi - pm2 restart flux > /dev/null 2>&1 - sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 - NUM='35' - MSG1='Restarting daemon service...' - MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo -e "" && echo -e "" + if [[ "$zelnodeindex" != "" ]]; then + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi + pm2 restart flux > /dev/null 2>&1 + sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 + NUM='35' + MSG1='Restarting daemon service...' + MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo -e "" && echo -e "" } function replace_kadena { while true - do - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - kda_address="kadena:$KDA_A?chainid=0" - if [[ "$KDA_A" == "" ]]; then - echo -e "${WORNING} ${CYAN}Kadena address can't be empty string, operation aborted...${NC}" - echo -e "" - exit - fi - break + do + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + kda_address="kadena:$KDA_A?chainid=0" + if [[ "$KDA_A" == "" ]]; then + echo -e "${WORNING} ${CYAN}Kadena address can't be empty string, operation aborted...${NC}" + echo -e "" + exit + fi + break done - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then - sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Kadena address replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" - fi - else - insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "kadena: '$kda_address'," - echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" - fi + if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then + sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Kadena address replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + fi + else + insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "kadena: '$kda_address'," + echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" + fi } function replace_zelid() { - while true - do - new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then - string_limit_check_mark "Zel ID is valid..........................................." - break - else - string_limit_x_mark "Zel ID is not valid try again..........................................." - sleep 2 - fi - done - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi + while true + do + new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + done + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi } function fluxos_reconfiguration { echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit fi if ! [[ -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}FluxOS userconfig.js not exist, operation aborted${NC}" - echo -e "" - exit + echo -e "${WORNING} ${CYAN}FluxOS userconfig.js not exist, operation aborted${NC}" + echo -e "" + exit fi CHOICE=$( whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ "1)" "Replace ZELID" \ "2)" "Add/Replace kadena address" 3>&2 2>&1 1>&3 - ) - case $CHOICE in - "1)") - replace_zelid - ;; - "2)") - replace_kadena - ;; - esac + ) + case $CHOICE in + "1)") + replace_zelid + ;; + "2)") + replace_kadena + ;; + esac } function install_watchtower(){ echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - echo -e "" - echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" - apps_check=$(docker ps | grep "flux_watchtower") - if [[ "$apps_check" != "" ]]; then - echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" - docker stop flux_watchtower > /dev/null 2>&1 - sleep 2 - echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" - docker rm flux_watchtower > /dev/null 2>&1 - fi - echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" - docker pull containrrr/watchtower:latest > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" - random=$(shuf -i 7500-35000 -n 1) - echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" - apps_id=$(docker run -d \ - --restart unless-stopped \ - --name flux_watchtower \ - -v /var/run/docker.sock:/var/run/docker.sock \ - containrrr/watchtower \ - --cleanup --interval $random 2> /dev/null) - if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then - echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" - else - echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" - fi + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + echo -e "" + echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" + apps_check=$(docker ps | grep "flux_watchtower") + if [[ "$apps_check" != "" ]]; then + echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" + docker stop flux_watchtower > /dev/null 2>&1 + sleep 2 + echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" + docker rm flux_watchtower > /dev/null 2>&1 + fi + echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" + docker pull containrrr/watchtower:latest > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" + random=$(shuf -i 7500-35000 -n 1) + echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" + apps_id=$(docker run -d \ + --restart unless-stopped \ + --name flux_watchtower \ + -v /var/run/docker.sock:/var/run/docker.sock \ + containrrr/watchtower \ + --cleanup --interval $random 2> /dev/null) + if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then + echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" + else + echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" + fi } function mongod_db_fix() { - echo -e "${GREEN}Module: Recover corrupted MongoDB database${NC}" - echo -e "${YELLOW}================================================================${NC}" + echo -e "${GREEN}Module: Recover corrupted MongoDB database${NC}" + echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - echo -e "" - echo -e "${WORNING} ${CYAN}Stopping mongod service ${NC}" && sleep 1 - sudo systemctl stop mongod - echo -e "${WORNING} ${CYAN}Fix for corrupted DB ${NC}" && sleep 1 - sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair - echo -e "${WORNING} ${CYAN}Fix for bad privilege ${NC}" && sleep 1 - sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 - sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 - echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" && sleep 1 - sudo systemctl start mongod - echo -e "" + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + echo -e "" + echo -e "${WORNING} ${CYAN}Stopping mongod service ${NC}" && sleep 1 + sudo systemctl stop mongod + echo -e "${WORNING} ${CYAN}Fix for corrupted DB ${NC}" && sleep 1 + sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair + echo -e "${WORNING} ${CYAN}Fix for bad privilege ${NC}" && sleep 1 + sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 + sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 + echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" && sleep 1 + sudo systemctl start mongod + echo -e "" } if ! figlet -v > /dev/null 2>&1; then - sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get install -y figlet > /dev/null 2>&1 + sudo apt-get update -y > /dev/null 2>&1 + sudo apt-get install -y figlet > /dev/null 2>&1 fi if ! pv -V > /dev/null 2>&1; then - sudo apt-get install -y pv > /dev/null 2>&1 + sudo apt-get install -y pv > /dev/null 2>&1 fi if ! gzip -V > /dev/null 2>&1; then - sudo apt-get install -y gzip > /dev/null 2>&1 + sudo apt-get install -y gzip > /dev/null 2>&1 fi if ! zip -v > /dev/null 2>&1; then - sudo apt-get install -y zip > /dev/null 2>&1 + sudo apt-get install -y zip > /dev/null 2>&1 fi if ! whiptail -v > /dev/null 2>&1; then - sudo apt-get install -y whiptail > /dev/null 2>&1 + sudo apt-get install -y whiptail > /dev/null 2>&1 fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then - echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc - echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc - source /etc/bash.bashrc + echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc + echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc + source /etc/bash.bashrc fi if ! wget --version > /dev/null 2>&1 ; then - sudo apt install -y wget > /dev/null 2>&1 && sleep 2 + sudo apt install -y wget > /dev/null 2>&1 && sleep 2 fi clear sleep 1 @@ -1105,79 +1105,79 @@ echo -e "${YELLOW}============================================================== read -rp "Pick an option and hit ENTER: " case "$REPLY" in 1) - clear - sleep 1 - install_docker + clear + sleep 1 + install_docker ;; 2) - clear - sleep 1 - install_node + clear + sleep 1 + install_node ;; 3) - clear - sleep 1 - analyzer_and_fixer + clear + sleep 1 + analyzer_and_fixer ;; - 4) - clear - sleep 1 - install_watchdog + 4) + clear + sleep 1 + install_watchdog ;; - 5) - clear - sleep 1 - flux_daemon_bootstrap + 5) + clear + sleep 1 + flux_daemon_bootstrap ;; - 6) - clear - sleep 1 - create_config + 6) + clear + sleep 1 + create_config ;; - 7) - clear - sleep 1 - install_flux + 7) + clear + sleep 1 + install_flux ;; 8) - clear - sleep 1 - daemon_reconfiguration + clear + sleep 1 + daemon_reconfiguration ;; 9) - clear - sleep 1 - create_service_scripts - create_service - ;; - 10) - clear - sleep 1 - selfhosting + clear + sleep 1 + create_service_scripts + create_service + ;; + 10) + clear + sleep 1 + selfhosting ;; - 11) - clear - sleep 1 - fluxos_reconfiguration - echo -e "" + 11) + clear + sleep 1 + fluxos_reconfiguration + echo -e "" ;; - 12) - clear - sleep 1 - install_watchtower - echo -e "" - ;; - 13) - clear - sleep 1 - mongod_db_fix - echo -e "" + 12) + clear + sleep 1 + install_watchtower + echo -e "" + ;; + 13) + clear + sleep 1 + mongod_db_fix + echo -e "" ;; - 14) - clear - sleep 1 - multinode - echo -e "" + 14) + clear + sleep 1 + multinode + echo -e "" ;; esac # USED FOR CLEANUP AT END OF SCRIPT From f1e812ae18a9e697db16b0319ac4971f0b158dce Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Fri, 26 Aug 2022 11:02:18 +0200 Subject: [PATCH 0637/1176] update vscode settings --- .vscode/settings.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7ec7eb37..7d8a6566 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,5 @@ { - "bashBeautify.tabSize": 2 + "editor.tabSize": 2, + "editor.insertSpaces": false, + "editor.detectIndentation": false } \ No newline at end of file From d2c54c89fcc7c74b9395fc0e82cf5aa69cdfe27f Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Sun, 28 Aug 2022 15:28:32 +0200 Subject: [PATCH 0638/1176] formatting and cleanup --- apps_info.sh | 9 +- cdn-speedtest.sh | 6 +- nodeanalizerandfixer.sh | 1623 ++++++++++++++++----------------------- 3 files changed, 661 insertions(+), 977 deletions(-) diff --git a/apps_info.sh b/apps_info.sh index 17ccf9e9..43ad5dd3 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -3,7 +3,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/apps_info.sh) $ROOT_BRANCH + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/apps_info.sh) $ROOT_BRANCH $2 unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED exit @@ -11,8 +11,7 @@ if ! [[ -z $1 ]]; then else export ROOT_BRANCH='master' fi -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" -apps_info=$(curl -SsL -m 10 https://api.runonflux.io/apps/globalappsspecifications) + name=($(jq -r .data[].name <<< "$apps_info")) height=($(jq -r .data[].height <<< "$apps_info")) network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') @@ -25,8 +24,8 @@ for((i=0;i<${#name[@]};i++)); do expire=$((${height[i]}+22000)) block_diff=$((expire-explorer_network_hight)) - if [[ "$1" =~ '^[0-9]+$' ]]; then - block_limit="$1" + if [[ "$2" =~ '^[0-9]+$' ]]; then + block_limit="$2" else block_limit="1000" fi diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index dabaae33..dbdbab06 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -1,4 +1,5 @@ #!/bin/bash +# # Usage: # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "<test_time_in_s>" "<file_name>" "<array_url_list_via_export>" # @@ -11,7 +12,8 @@ # # Example 3 ( for testing cdn with default settings ) # bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) -########################################################################################################################################### +# +# #color codes YELLOW='\033[1;33m' GREEN='\033[1;32m' @@ -27,13 +29,11 @@ failed_counter="0" if ! bc -v > /dev/null 2>&1 ; then sudo apt install -y bc > /dev/null 2>&1 && sleep 1 fi - if [[ -z $1 ]]; then dTime="5" else dTime="$1" fi - if [[ -z $2 || "$2" == "0" ]]; then BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" else diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index a931002d..43110667 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -19,681 +19,505 @@ SCVESION=v4.0 FLUX_DIR='zelflux' COIN_NAME='zelcash' COIN_DAEMON='zelcashd' -#COIN_CLI='zelcash-cli' - - BENCH_DIR_LOG='.zelbenchmark' BENCH_DAEMON='zelbenchd' BENCH_NAME='zelbench' -#BENCH_CLI='zelbench-cli' - - if [[ -f /usr/local/bin/flux-cli ]]; then - COIN_CLI='flux-cli' + COIN_CLI='flux-cli' else - COIN_CLI='zelcash-cli' + COIN_CLI='zelcash-cli' fi if [[ -f /usr/local/bin/fluxbench-cli ]]; then - BENCH_CLI='fluxbench-cli' + BENCH_CLI='fluxbench-cli' else - BENCH_CLI='zelbench-cli' + BENCH_CLI='zelbench-cli' fi - - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' + CONFIG_DIR='.zelcash' + CONFIG_FILE='zelcash.conf' else - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' + CONFIG_DIR='.flux' + CONFIG_FILE='flux.conf' fi - if [[ -d /home/$USER/.zelbenchmark ]]; then -BENCH_DIR_LOG='.zelbenchmark' + BENCH_DIR_LOG='.zelbenchmark' else -BENCH_DIR_LOG='.fluxbenchmark' + BENCH_DIR_LOG='.fluxbenchmark' fi - - - - WANIP=$(curl --silent -m 15 https://checkip.amazonaws.com | tr -dc '[:alnum:].') - if [[ "$WANIP" == "" ]]; then - WANIP=$(curl --silent -m 15 https://ipv4bot.whatismyipaddress.com | tr -dc '[:alnum:].') - else - WANIP=$(curl --silent -m 15 https://api.ipify.org | tr -dc '[:alnum:].') - fi - - +get_ip #function function show_time() { - num=$1 - min=0 - hour=0 - day=0 - if((num>59));then - ((sec=num%60)) - ((num=num/60)) - if((num>59));then - ((min=num%60)) - ((num=num/60)) - if((num>23));then - ((hour=num%24)) - ((day=num/24)) - else - ((hour=num)) - fi - else - ((min=num)) - fi - else - ((sec=num)) - fi - echo -e "${PIN} ${CYAN}Last error was \c" - echo -e "${RED}$day"d "$hour"h "$min"m "$sec"s"${CYAN} ago.${NC}" + num=$1 + min=0 + hour=0 + day=0 + if((num>59));then + ((sec=num%60)) + ((num=num/60)) + if((num>59));then + ((min=num%60)) + ((num=num/60)) + if((num>23));then + ((hour=num%24)) + ((day=num/24)) + else + ((hour=num)) + fi + else + ((min=num)) + fi + else + ((sec=num)) + fi + echo -e "${PIN} ${CYAN}Last error was \c" + echo -e "${RED}$day"d "$hour"h "$min"m "$sec"s"${CYAN} ago.${NC}" } - - function check_listen_ports(){ - -if ! lsof -v > /dev/null 2>&1; then -sudo apt-get install lsof -y > /dev/null 2>&1 && sleep 2 -fi - - - - - -if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then -FluxAPI=$(grep -Po "(?<=fluxport=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) -FLUXOS_CONFIG=$(grep -Po "$FluxAPI" /home/$USER/zelflux/config/userconfig.js) - if [[ "$FLUXOS_CONFIG" != "" ]]; then - FluxUI=$(($FluxAPI-1)) - UPNP=1 - else - FluxAPI=16127 - FluxUI=16126 - UPNP=0 - fi -else -FluxAPI=16127 -FluxUI=16126 -UPNP=0 -fi - - -if sudo lsof -i -n | grep LISTEN | grep 27017 | grep mongod > /dev/null 2>&1; then -echo -e "${CHECK_MARK} ${CYAN} Mongod listen on port 27017${NC}" -else -echo -e "${X_MARK} ${CYAN} Mongod not listen${NC}" -fi - -if sudo lsof -i -n | grep LISTEN | grep 16125 | grep fluxd > /dev/null 2>&1; then -echo -e "${CHECK_MARK} ${CYAN} Flux daemon listen on port 16125${NC}" -else - - if sudo lsof -i -n | grep LISTEN | grep 16125 | grep zelcashd > /dev/null 2>&1; then - echo -e "${CHECK_MARK} ${CYAN} Flux daemon listen on port 16125${NC}" - else - echo -e "${X_MARK} ${CYAN} Flux daemon not listen${NC}" - fi - -fi - -#if [[ sudo lsof -i -n | grep LISTEN | grep 16125 | grep fluxd > /dev/null 2>&1 ]] || [[ sudo lsof -i -n | grep LISTEN | grep 16125 | grep zelcashd > /dev/null 2>&1 ]]; then -#echo -e "${CHECK_MARK} ${CYAN} Flux daemon listen on port 16125${NC}" -#else -#echo -e "${X_MARK} ${CYAN} Flux daemon not listen${NC}" -#fi - -if sudo lsof -i -n | grep LISTEN | grep 16224 | grep bench > /dev/null 2>&1; then -echo -e "${CHECK_MARK} ${CYAN} Flux benchmark listen on port 16224${NC}" -else -echo -e "${X_MARK} ${CYAN} Flux benchmark not listen${NC}" -fi - -if sudo lsof -i -n | grep LISTEN | grep $FluxUI | grep node > /dev/null 2>&1 -then -ZELFLUX_PORT1="1" -fi - -if sudo lsof -i -n | grep LISTEN | grep $FluxAPI | grep node > /dev/null 2>&1 -then -ZELFLUX_PORT2="1" -fi - -if [[ "$ZELFLUX_PORT1" == "1" && "$ZELFLUX_PORT2" == "1" ]] -then -echo -e "${CHECK_MARK} ${CYAN} Flux listen on ports $FluxUI/$FluxAPI ${NC}" -else -echo -e "${X_MARK} ${CYAN} Flux not listen${NC}" -fi - -echo -e "" -echo -e "${BOOK} ${YELLOW}FluxOS networking: ${NC}" -if [[ "$UPNP" == "1" ]]; then -echo -e "${PIN} ${CYAN}UPnP MODE: ${GREEN}ENABLED${NC}" -else -echo -e "${PIN} ${CYAN}UPnP MODE: ${RED}DISABLED${NC}" -fi -echo -e "${PIN} ${CYAN}FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" -echo -e "${PIN} ${CYAN}FluxUI PORT: ${ORANGE}$FluxUI ${NC}" - -if [[ -f /home/$USER/.pm2/logs/flux-out.log ]]; then -error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") - if [[ "$error_check" != "" ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Checking FluxOS logs... ${NC}" - echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." - echo -e "" - fi -fi - + if ! lsof -v > /dev/null 2>&1; then + sudo apt-get install lsof -y > /dev/null 2>&1 && sleep 1 + fi + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + FluxAPI=$(grep -Po "(?<=fluxport=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) + FLUXOS_CONFIG=$(grep -Po "$FluxAPI" /home/$USER/zelflux/config/userconfig.js) + if [[ "$FLUXOS_CONFIG" != "" ]]; then + FluxUI=$(($FluxAPI-1)) + UPNP=1 + else + FluxAPI=16127 + FluxUI=16126 + UPNP=0 + fi + else + FluxAPI=16127 + FluxUI=16126 + UPNP=0 + fi + if sudo lsof -i -n | grep LISTEN | grep 27017 | grep mongod > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Mongod listen on port 27017${NC}" + else + echo -e "${X_MARK} ${CYAN} Mongod not listen${NC}" + fi + if sudo lsof -i -n | grep LISTEN | grep 16125 | grep fluxd > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Flux daemon listen on port 16125${NC}" + else + if sudo lsof -i -n | grep LISTEN | grep 16125 | grep zelcashd > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Flux daemon listen on port 16125${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux daemon not listen${NC}" + fi + fi + if sudo lsof -i -n | grep LISTEN | grep 16224 | grep bench > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Flux benchmark listen on port 16224${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux benchmark not listen${NC}" + fi + if sudo lsof -i -n | grep LISTEN | grep $FluxUI | grep node > /dev/null 2>&1; then + ZELFLUX_PORT1="1" + fi + if sudo lsof -i -n | grep LISTEN | grep $FluxAPI | grep node > /dev/null 2>&1 ; then + ZELFLUX_PORT2="1" + fi + if [[ "$ZELFLUX_PORT1" == "1" && "$ZELFLUX_PORT2" == "1" ]]; then + echo -e "${CHECK_MARK} ${CYAN} Flux listen on ports $FluxUI/$FluxAPI ${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux not listen${NC}" + fi + echo -e "" + echo -e "${BOOK} ${YELLOW}FluxOS networking: ${NC}" + if [[ "$UPNP" == "1" ]]; then + echo -e "${PIN} ${CYAN}UPnP MODE: ${GREEN}ENABLED${NC}" + else + echo -e "${PIN} ${CYAN}UPnP MODE: ${RED}DISABLED${NC}" + fi + echo -e "${PIN} ${CYAN}FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" + echo -e "${PIN} ${CYAN}FluxUI PORT: ${ORANGE}$FluxUI ${NC}" + if [[ -f /home/$USER/.pm2/logs/flux-out.log ]]; then + error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") + if [[ "$error_check" != "" ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Checking FluxOS logs... ${NC}" + echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." + echo -e "" + fi + fi } +function get_last_benchmark(){ + if [[ "$2" == "check" ]]; then + + info_check=$(grep 'Found' /home/$USER/$BENCH_DIR_LOG/debug.log | egrep 'Found|Historical' | grep $1 | tail -n1 | egrep -o '[0-9]+(\.[0-9]+)|([0-9]+)' | tail -n1 | awk '{printf "%.2f\n", $1}') + if [[ "$info_check" == "" ]]; then + skipp_debug=1 + return 1 + fi + + fi -function get_last_benchmark() -{ - - if [[ "$2" == "check" ]]; then - - info_check=$(grep 'Found' /home/$USER/$BENCH_DIR_LOG/debug.log | egrep 'Found|Historical' | grep $1 | tail -n1 | egrep -o '[0-9]+(\.[0-9]+)|([0-9]+)' | tail -n1 | awk '{printf "%.2f\n", $1}') - if [[ "$info_check" == "" ]]; then - skipp_debug=1 - return 1 - fi - - fi - - - if [[ "$1" == "cores" ]]; then - cores=$(grep 'Found' /home/$USER/$BENCH_DIR_LOG/debug.log | egrep 'Found|Historical' | grep 'cores' | tail -n1 | egrep -Eo '[^ ]+$') - echo -e "${PIN}${CYAN} CORES: ${GREEN}$cores${NC}" - fi - - if [[ "$1" == "HDD" || "$1" == "DD_WRITE" || "$1" == "ram" || "$1" == "eps" ]] && [[ "$2" != "check" ]]; then - - info=$(grep 'Found' /home/$USER/$BENCH_DIR_LOG/debug.log | egrep 'Found|Historical' | grep $1 | tail -n1 | egrep -o '[0-9]+(\.[0-9]+)|([0-9]+)' | tail -n1 | awk '{printf "%.2f\n", $1}') - if [[ "$1" == "ram" ]]; then - echo -e "${PIN}${CYAN} RAM: ${GREEN}$info${NC}" - fi + if [[ "$1" == "cores" ]]; then + cores=$(grep 'Found' /home/$USER/$BENCH_DIR_LOG/debug.log | egrep 'Found|Historical' | grep 'cores' | tail -n1 | egrep -Eo '[^ ]+$') + echo -e "${PIN}${CYAN} CORES: ${GREEN}$cores${NC}" + fi - if [[ "$1" == "eps" ]]; then - echo -e "${PIN}${CYAN} EPS: ${GREEN}$info${NC}" - fi + if [[ "$1" == "HDD" || "$1" == "DD_WRITE" || "$1" == "ram" || "$1" == "eps" ]] && [[ "$2" != "check" ]]; then - if [[ "$1" == "DD_WRITE" ]]; then - echo -e "${PIN}${CYAN} DD_WRITE: ${GREEN}$info${NC}" - fi + info=$(grep 'Found' /home/$USER/$BENCH_DIR_LOG/debug.log | egrep 'Found|Historical' | grep $1 | tail -n1 | egrep -o '[0-9]+(\.[0-9]+)|([0-9]+)' | tail -n1 | awk '{printf "%.2f\n", $1}') - if [[ "$1" == "HDD" ]]; then - echo -e "${PIN}${CYAN} HDD: ${GREEN}$info${NC}" - fi + if [[ "$1" == "ram" ]]; then + echo -e "${PIN}${CYAN} RAM: ${GREEN}$info${NC}" + fi - fi + if [[ "$1" == "eps" ]]; then + echo -e "${PIN}${CYAN} EPS: ${GREEN}$info${NC}" + fi + if [[ "$1" == "DD_WRITE" ]]; then + echo -e "${PIN}${CYAN} DD_WRITE: ${GREEN}$info${NC}" + fi + if [[ "$1" == "HDD" ]]; then + echo -e "${PIN}${CYAN} HDD: ${GREEN}$info${NC}" + fi + fi } - function integration(){ - -PATH_TO_FOLDER=( /usr/local/bin/ ) -if [[ -f /usr/local/bin/fluxd ]]; then - FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) -else - FILE_ARRAY=( 'zelbench-cli' 'zelbenchd' 'zelcash-cli' 'zelcashd' 'zelcash-fetch-params.sh' 'zelcash-tx' ) -fi - -ELEMENTS=${#FILE_ARRAY[@]} -NOT_FOUND="0" - -for (( i=0;i<$ELEMENTS;i++)); do - - if [ -f $PATH_TO_FOLDER${FILE_ARRAY[${i}]} ]; then - echo -e "${CHECK_MARK} ${CYAN} ${FILE_ARRAY[${i}]}" - else - echo -e "${X_MARK} ${CYAN} ${FILE_ARRAY[${i}]}" - NOT_FOUND="1" - fi -done - + PATH_TO_FOLDER=( /usr/local/bin/ ) + if [[ -f /usr/local/bin/fluxd ]]; then + FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) + else + FILE_ARRAY=( 'zelbench-cli' 'zelbenchd' 'zelcash-cli' 'zelcashd' 'zelcash-fetch-params.sh' 'zelcash-tx' ) + fi + ELEMENTS=${#FILE_ARRAY[@]} + NOT_FOUND="0" + for (( i=0;i<$ELEMENTS;i++)); do + if [ -f $PATH_TO_FOLDER${FILE_ARRAY[${i}]} ]; then + echo -e "${CHECK_MARK} ${CYAN} ${FILE_ARRAY[${i}]}" + else + echo -e "${X_MARK} ${CYAN} ${FILE_ARRAY[${i}]}" + NOT_FOUND="1" + fi + done } - -if [[ "$USER" == "root" ]] -then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user accont.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin"]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user accont.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit fi - sleep 1 -sudo apt install bc > /dev/null 2>&1 +if [[ ! bc -v ]]; then + sudo apt install bc > /dev/null 2>&1 +fi echo -e "${NC}" if [ -f /home/$USER/$BENCH_DIR_LOG/debug.log ]; then -echo -e "${BOOK} ${YELLOW}Checking Flux benchmark $BENCH_DIR_LOG/debug.log${NC}" -if [[ $(egrep -ac -wi --color 'Failed' /home/$USER/$BENCH_DIR_LOG/debug.log) != "0" ]]; then -echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(egrep -ac --color 'Failed' /home/$USER/$BENCH_DIR_LOG/debug.log)${CYAN} error events${NC}" -#egrep -wi --color 'warning|error|critical|failed' ~/.zelbenchmark/debug.log -error_line=$(egrep -a --color 'Failed' /home/$USER/$BENCH_DIR_LOG/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') -event_date=$(egrep -a --color 'Failed' /home/$USER/$BENCH_DIR_LOG/debug.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}') -echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" -event_time_uxtime=$(date -ud "$event_date" +"%s") -event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') -event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') -echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" -event_time="$event_time_uxtime" -now_date=$(date +%s) -tdiff=$((now_date-event_time)) -show_time "$tdiff" -echo -e "${PIN} ${CYAN}Creating Flux benchmark_debug_error.log${NC}" -egrep -a --color 'Failed' /home/$USER/$BENCH_DIR_LOG/debug.log > /home/$USER/benchmark_debug_error.log -echo -else -echo -e "${GREEN}\xF0\x9F\x94\x8A ${CYAN}Found: ${GREEN}0 errors${NC}" -echo -fi - -skipp_debug=0 - -get_last_benchmark "HDD" "check" - -if [[ "$skipp_debug" == "0" ]]; then - - echo -e "${BOOK} ${YELLOW}Last benchmark from ~/$BENCH_DIR_LOG/debug.log${NC}" - get_last_benchmark "HDD" - get_last_benchmark "DD_WRITE" - get_last_benchmark "ram" - get_last_benchmark "cores" - echo -fi -#else -#echo -e "${RED}Debug file not exists${NC}" -#echo + echo -e "${BOOK} ${YELLOW}Checking Flux benchmark $BENCH_DIR_LOG/debug.log${NC}" + if [[ $(egrep -ac -wi --color 'Failed' /home/$USER/$BENCH_DIR_LOG/debug.log) != "0" ]]; then + echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(egrep -ac --color 'Failed' /home/$USER/$BENCH_DIR_LOG/debug.log)${CYAN} error events${NC}" + #egrep -wi --color 'warning|error|critical|failed' ~/.zelbenchmark/debug.log + error_line=$(egrep -a --color 'Failed' /home/$USER/$BENCH_DIR_LOG/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + event_date=$(egrep -a --color 'Failed' /home/$USER/$BENCH_DIR_LOG/debug.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}') + echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" + event_time_uxtime=$(date -ud "$event_date" +"%s") + event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" + event_time="$event_time_uxtime" + now_date=$(date +%s) + tdiff=$((now_date-event_time)) + show_time "$tdiff" + echo -e "${PIN} ${CYAN}Creating Flux benchmark_debug_error.log${NC}" + egrep -a --color 'Failed' /home/$USER/$BENCH_DIR_LOG/debug.log > /home/$USER/benchmark_debug_error.log + echo -e "" + else + echo -e "${GREEN}\xF0\x9F\x94\x8A ${CYAN}Found: ${GREEN}0 errors${NC}" + echo -e "" + fi + skipp_debug=0 + get_last_benchmark "HDD" "check" + if [[ "$skipp_debug" == "0" ]]; then + echo -e "${BOOK} ${YELLOW}Last benchmark from ~/$BENCH_DIR_LOG/debug.log${NC}" + get_last_benchmark "HDD" + get_last_benchmark "DD_WRITE" + get_last_benchmark "ram" + get_last_benchmark "cores" + echo -e "" + fi fi - - - if [ -f /home/$USER/$CONFIG_DIR/debug.log ]; then -echo -e "${BOOK} ${YELLOW}Checking Flux daemon ~/$CONFIG_DIR/debug.log${NC}" -if [[ $(egrep -ac -wi --color 'error|failed' /home/$USER//$CONFIG_DIR/debug.log) != "0" ]]; then -echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(egrep -ac -wi --color 'error|failed' /home/$USER/$CONFIG_DIR/debug.log)${CYAN} error events, ${RED}$(egrep -ac -wi --color 'benchmarking' /home/$USER/$CONFIG_DIR/debug.log) ${CYAN}related to benchmark${NC}" -if [[ $(egrep -ac -wi --color 'benchmarking' /home/$USER/$CONFIG_DIR/debug.log) != "0" ]]; then -echo -e "${BOOK} ${CYAN}FluxBench errors info:${NC}" -error_line=$(egrep -a --color 'benchmarking' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') -event_date=$(egrep -a --color 'benchmarking' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}') -echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" -event_time_uxtime=$(date -ud "$event_date" +"%s") -event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') -event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') -echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" -event_time="$event_time_uxtime" -now_date=$(date +%s) -tdiff=$((now_date-event_time)) -show_time "$tdiff" -fi -echo -e "${PIN} ${CYAN}Creating flux_daemon_debug_error.log${NC}" -egrep -a --color 'error|failed' /home/$USER/$CONFIG_DIR/debug.log > /home/$USER/flux_daemon_debug_error.log -echo -else -echo -e "${GREEN}\xF0\x9F\x94\x8A ${CYAN}Found: ${GREEN}0 errors${NC}" -echo -fi -#else -#echo -e "${RED}Debug file not exists${NC}" -#echo + echo -e "${BOOK} ${YELLOW}Checking Flux daemon ~/$CONFIG_DIR/debug.log${NC}" + if [[ $(egrep -ac -wi --color 'error|failed' /home/$USER//$CONFIG_DIR/debug.log) != "0" ]]; then + echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(egrep -ac -wi --color 'error|failed' /home/$USER/$CONFIG_DIR/debug.log)${CYAN} error events, ${RED}$(egrep -ac -wi --color 'benchmarking' /home/$USER/$CONFIG_DIR/debug.log) ${CYAN}related to benchmark${NC}" + if [[ $(egrep -ac -wi --color 'benchmarking' /home/$USER/$CONFIG_DIR/debug.log) != "0" ]]; then + echo -e "${BOOK} ${CYAN}FluxBench errors info:${NC}" + error_line=$(egrep -a --color 'benchmarking' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + event_date=$(egrep -a --color 'benchmarking' /home/$USER/$CONFIG_DIR/debug.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}') + echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" + event_time_uxtime=$(date -ud "$event_date" +"%s") + event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" + event_time="$event_time_uxtime" + now_date=$(date +%s) + tdiff=$((now_date-event_time)) + show_time "$tdiff" + fi + echo -e "${PIN} ${CYAN}Creating flux_daemon_debug_error.log${NC}" + egrep -a --color 'error|failed' /home/$USER/$CONFIG_DIR/debug.log > /home/$USER/flux_daemon_debug_error.log + echo -e "" + else + echo -e "${GREEN}\xF0\x9F\x94\x8A ${CYAN}Found: ${GREEN}0 errors${NC}" + echo -e "" + fi fi - usercheck=$(getent group docker) if [[ "$usercheck" =~ "," ]]; then -echo -e "" -echo -e "${WORNING} ${CYAN} Detected multiple users in docker group...${NC}" -echo -e "${WORNING} ${CYAN} More then one instance of flux daemon will cause it to malfunction...${NC}" -echo -e "${WORNING} ${CYAN} If u installed FluxOS on more then one user you need delete one instance of it...${NC}" -echo -e "${WORNING} ${CYAN} To check the list of users type: getent group docker ${NC}" -echo -e "${WORNING} ${CYAN} To remove unwanted users type: sudo deluser --remove-home user_name ${NC}" -echo -e "${WORNING} ${CYAN} To reboot server type: sudo reboot -n ${NC}" + echo -e "" + echo -e "${WORNING} ${CYAN} Detected multiple users in docker group...${NC}" + echo -e "${WORNING} ${CYAN} More then one instance of flux daemon will cause it to malfunction...${NC}" + echo -e "${WORNING} ${CYAN} If u installed FluxOS on more then one user you need delete one instance of it...${NC}" + echo -e "${WORNING} ${CYAN} To check the list of users type: getent group docker ${NC}" + echo -e "${WORNING} ${CYAN} To remove unwanted users type: sudo deluser --remove-home user_name ${NC}" + echo -e "${WORNING} ${CYAN} To reboot server type: sudo reboot -n ${NC}" fi - - if [[ "$($BENCH_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + echo -e "${BOOK} ${YELLOW}Flux benchmark status:${NC}" + bench_getatus=$($BENCH_CLI getstatus) + bench_status=$(jq -r '.status' <<< "$bench_getatus") + bench_benchmark=$(jq -r '.benchmarking' <<< "$bench_getatus") + bench_back=$(jq -r '.zelback' <<< "$bench_getatus") + if [[ "$bench_back" == "null" ]]; then + bench_back=$(jq -r '.flux' <<< "$bench_getatus") + fi -echo -e "${BOOK} ${YELLOW}Flux benchmark status:${NC}" -bench_getatus=$($BENCH_CLI getstatus) -bench_status=$(jq -r '.status' <<< "$bench_getatus") -bench_benchmark=$(jq -r '.benchmarking' <<< "$bench_getatus") -bench_back=$(jq -r '.zelback' <<< "$bench_getatus") -if [[ "$bench_back" == "null" ]]; then -bench_back=$(jq -r '.flux' <<< "$bench_getatus") -fi - -bench_getinfo=$($BENCH_CLI getinfo) -bench_version=$(jq -r '.version' <<< "$bench_getinfo") - -if [[ "$bench_benchmark" == "failed" || "$bench_benchmark" == "toaster" ]]; then -bench_benchmark_color="${RED}$bench_benchmark" -else -bench_benchmark_color="${SEA}$bench_benchmark" -fi - -if [[ "$bench_status" == "online" ]]; then -bench_status_color="${SEA}$bench_status" -else -bench_status_color="${RED}$bench_status" -fi - -if [[ "$bench_back" == "connected" ]]; then -bench_back_color="${SEA}$bench_back" -else -bench_back_color="${RED}$bench_back" -fi - -echo -e "${PIN} ${CYAN}Flux benchmark version: ${SEA}$bench_version${NC}" -echo -e "${PIN} ${CYAN}Flux benchmark status: $bench_status_color${NC}" -echo -e "${PIN} ${CYAN}Benchmark: $bench_benchmark_color${NC}" -echo -e "${PIN} ${CYAN}Flux: $bench_back_color${NC}" -echo -e "${NC}" - -if [[ "$bench_benchmark" == "running" ]]; then -echo -e "${ARROW} ${CYAN} Benchmarking hasn't completed, please wait until benchmarking has completed.${NC}" -fi - -if [[ "$bench_benchmark" == "CUMULUS" || "$bench_benchmark" == "NIMBUS" || "$bench_benchmark" == "STRATUS" ]]; then -echo -e "${CHECK_MARK} ${CYAN} Flux benchmark working correct, all requirements met.${NC}" -fi - -if [[ "$bench_benchmark" == "failed" ]]; then -echo -e "${X_MARK} ${CYAN} Flux benchmark problem detected, check benchmark debug.log${NC}" -fi - -core=$($BENCH_CLI getbenchmarks | jq '.cores') - -if [[ "$bench_benchmark" == "failed" && "$core" > "0" ]]; then -BTEST="1" -echo -e "${X_MARK} ${CYAN} Flux benchmark working correct but minimum system requirements not met.${NC}" -check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" -check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" -fi -#if [[ "$zelbench_benchmark" == "toaster" || "$zelbench_benchmark" == "failed" ]]; then -##lc_numeric_var=$(locale | grep LC_NUMERIC | sed -e 's/.*LC_NUMERIC=//') -##lc_numeric_need='"en_US.UTF-8"' -##if [ "$lc_numeric_var" == "$lc_numeric_need" ] -##then -##echo -e "${CHECK_MARK} ${CYAN} LC_NUMERIC is correct${NC}" -##else -##echo -e "${X_MARK} ${CYAN} You need set LC_NUMERIC to en_US.UTF-8${NC}" -##LC_CHECK="1" -##fi -#fi -if [[ "$bench_back" == "disconnected" ]]; then -echo -e "${X_MARK} ${CYAN} FluxBack does not work properly${NC}" - - + bench_getinfo=$($BENCH_CLI getinfo) + bench_version=$(jq -r '.version' <<< "$bench_getinfo") -WANIP=$(wget http://ipecho.net/plain -O - -q) -if [[ "$WANIP" == "" ]]; then - WANIP=$(curl ifconfig.me) -fi + if [[ "$bench_benchmark" == "failed" || "$bench_benchmark" == "toaster" ]]; then + bench_benchmark_color="${RED}$bench_benchmark" + else + bench_benchmark_color="${SEA}$bench_benchmark" + fi -if [[ "$WANIP" != "" ]]; then + if [[ "$bench_status" == "online" ]]; then + bench_status_color="${SEA}$bench_status" + else + bench_status_color="${RED}$bench_status" + fi -back_error_check=$(curl -s -m 5 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .status ) + if [[ "$bench_back" == "connected" ]]; then + bench_back_color="${SEA}$bench_back" + else + bench_back_color="${RED}$bench_back" + fi - if [[ "$back_error_check" != "success" && "$back_error_check" != "" ]]; then - - back_error=$(curl -s -m 8 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .data.message.message 2>/dev/null ) - - if [[ "$back_error" != "" ]]; then - - echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" - - else - - back_error=$(curl -s -m 8 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .data.message 2>/dev/null ) - - if [[ "$back_error" != "" ]]; then - - echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" - - fi - fi - fi - fi + echo -e "${PIN} ${CYAN}Flux benchmark version: ${SEA}$bench_version${NC}" + echo -e "${PIN} ${CYAN}Flux benchmark status: $bench_status_color${NC}" + echo -e "${PIN} ${CYAN}Benchmark: $bench_benchmark_color${NC}" + echo -e "${PIN} ${CYAN}Flux: $bench_back_color${NC}" + echo -e "${NC}" -device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') -local_device_ip=$(ip a list $device_name | grep -o $WANIP ) + if [[ "$bench_benchmark" == "running" ]]; then + echo -e "${ARROW} ${CYAN} Benchmarking hasn't completed, please wait until benchmarking has completed.${NC}" + fi -if [[ "$WANIP" != "" ]]; then + if [[ "$bench_benchmark" == "CUMULUS" || "$bench_benchmark" == "NIMBUS" || "$bench_benchmark" == "STRATUS" ]]; then + echo -e "${CHECK_MARK} ${CYAN} Flux benchmark working correct, all requirements met.${NC}" + fi - if [[ "$local_device_ip" == "$WANIP" ]]; then - echo -e "${CHECK_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) matches local device(${GREEN}$device_name${CYAN}) IP(${GREEN}$local_device_ip${CYAN})${NC}" - else - echo -e "${X_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) not matches local device(${GREEN}$device_name${CYAN}) IP${NC}" - echo -e "${ARROW} ${CYAN} If you under NAT use option 10 from multitoolbox (self-hosting)${NC}" - ## dev_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2"0"}') - ## sudo ip addr add "$WANPI" dev "$dev_name" - # IP_FIX="1" - fi - -else -echo -e "${ARROW} ${CYAN} Local device(${GREEN}$device_name${CYAN}) IP veryfication failed...${NC}" -fi + if [[ "$bench_benchmark" == "failed" ]]; then + echo -e "${X_MARK} ${CYAN} Flux benchmark problem detected, check benchmark debug.log${NC}" + fi + core=$($BENCH_CLI getbenchmarks | jq '.cores') + if [[ "$bench_benchmark" == "failed" && "$core" > "0" ]]; then + BTEST="1" + echo -e "${X_MARK} ${CYAN} Flux benchmark working correct but minimum system requirements not met.${NC}" + check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" + check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" + fi + #if [[ "$zelbench_benchmark" == "toaster" || "$zelbench_benchmark" == "failed" ]]; then + ##lc_numeric_var=$(locale | grep LC_NUMERIC | sed -e 's/.*LC_NUMERIC=//') + ##lc_numeric_need='"en_US.UTF-8"' + ##if [ "$lc_numeric_var" == "$lc_numeric_need" ] + ##then + ##echo -e "${CHECK_MARK} ${CYAN} LC_NUMERIC is correct${NC}" + ##else + ##echo -e "${X_MARK} ${CYAN} You need set LC_NUMERIC to en_US.UTF-8${NC}" + ##LC_CHECK="1" + ##fi + #fi + if [[ "$bench_back" == "disconnected" ]]; then + echo -e "${X_MARK} ${CYAN} FluxBack does not work properly${NC}" + if [[ "$WANIP" != "" ]]; then + back_error_check=$(curl -s -m 5 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .status ) + if [[ "$back_error_check" != "success" && "$back_error_check" != "" ]]; then + back_error=$(curl -s -m 8 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .data.message.message 2>/dev/null ) + if [[ "$back_error" != "" ]]; then + echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" + else + back_error=$(curl -s -m 8 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .data.message 2>/dev/null ) + if [[ "$back_error" != "" ]]; then + echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" + fi + fi + fi + fi + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + local_device_ip=$(ip a list $device_name | grep -o $WANIP ) + if [[ "$WANIP" != "" ]]; then + if [[ "$local_device_ip" == "$WANIP" ]]; then + echo -e "${CHECK_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) matches local device(${GREEN}$device_name${CYAN}) IP(${GREEN}$local_device_ip${CYAN})${NC}" + else + echo -e "${X_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) not matches local device(${GREEN}$device_name${CYAN}) IP${NC}" + echo -e "${ARROW} ${CYAN} If you under NAT use option 10 from multitoolbox (self-hosting)${NC}" + ## dev_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2"0"}') + ## sudo ip addr add "$WANPI" dev "$dev_name" + # IP_FIX="1" + fi + else + echo -e "${ARROW} ${CYAN} Local device(${GREEN}$device_name${CYAN}) IP veryfication failed...${NC}" + fi + fi + echo -e "${NC}" fi -echo -e "${NC}" -fi - if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then -echo -e "${BOOK} ${YELLOW}Flux deamon information:${NC}" -daemon_getinfo=$($COIN_CLI getinfo) -version=$(jq -r '.version' <<< "$daemon_getinfo") -blocks_hight=$(jq -r '.blocks' <<< "$daemon_getinfo") -protocolversion=$(jq -r '.protocolversion' <<< "$daemon_getinfo") -connections=$(jq -r '.connections' <<< "$daemon_getinfo") -error=$(jq -r '.error' <<< "$daemon_getinfo") - -if [[ "$error" != "" && "$error" != null ]]; then -echo -echo -e "${X_MARK} ${CYAN} Flux daemon error detected: ${RED}$error${CYAN}) IP${NC}" -fi - -echo -e "${PIN} ${CYAN}Version: ${SEA}$version${NC}" -echo -e "${PIN} ${CYAN}Protocolversion: ${SEA}$protocolversion${NC}" -echo -e "${PIN} ${CYAN}Connections: ${SEA}$connections${NC}" -echo -e "${PIN} ${CYAN}Blocks: ${SEA}$blocks_hight${NC}" - -network_height_01=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) -#network_height_02=$(curl -sk -m 5 https://explorer.flux.zelcore.io/api/status?q=getInfo | jq '.info.blocks') -network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) - -explorer_network_hight=$(max "$network_height_01" "$network_height_03") - -block_diff=$((explorer_network_hight-blocks_hight)) - -if [[ "$explorer_network_hight" != "0" ]]; then - - if [[ "$block_diff" < 10 ]]; then - echo -e "${PIN} ${CYAN}Status: ${GREEN}synced${NC}" - else - echo -e "${PIN} ${CYAN}Status: ${RED}not synced${NC}" - fi - -else - - echo -e "${PIN} ${CYAN}Info: ${RED}sync check skipped...${NC}" - -fi - -echo -e "" -echo -e "${BOOK} ${YELLOW}Checking node status:${NC}" -getzelnodestatus=$($COIN_CLI getzelnodestatus) -node_status=$(jq -r '.status' <<< "$getzelnodestatus") -collateral=$(jq -r '.collateral' <<< "$getzelnodestatus") - -if [ "$node_status" == "CONFIRMED" ] -then -node_status_color="${SEA}$node_status" -elif [ "$node_status" == "STARTED" ] -then -node_status_color="${YELLOW}$node_status" -else -node_status_color="${RED}$node_status" -fi - -echo -e "${PIN} ${CYAN}Node status: $node_status_color${NC}" - -if [[ "$node_status" == "DOS" ]]; then -blocks_till=$($COIN_CLI getdoslist | jq .[] | grep "$collateral" -A5 -B1 | jq .eligible_in) -dos_till=$((blocks_hight+blocks_till)) -echo -e "${PIN} ${RED}DOS ${CYAN}Till: ${ORANGE}$dos_till ${CYAN}EXPIRE_COUNT: ${ORANGE}$blocks_till${CYAN} Time left: ${RED}~$((2*blocks_till)) min. ${NC}" -fi - - -echo -e "${PIN} ${CYAN}Collateral: ${SEA}$collateral${NC}" -echo -e "" - -if [ "$node_status" != "CONFIRMED" ] -then - -if whiptail --yesno "Would you like to verify $CONFIG_FILE Y/N?" 8 60; then -ZELCONF="1" -zelnodeprivkey="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" -zelnodeoutpoint="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Output TX ID" 8 72 3>&1 1>&2 2>&3)" -zelnodeindex="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" -fi - -fi - - -flux_communication=$(curl -SsL -m 10 http://"$WANIP":16127/flux/checkcommunication 2>/dev/null | jq -r .data.message 2>/dev/null) -if [[ "$flux_communication" != "null" && "$flux_communication" != "" ]]; then -echo -e "${BOOK} ${YELLOW}Checking FluxOS communication: ${NC}" -echo -e "${ARROW} ${CYAN}$flux_communication${NC}" -echo -e "" -fi - -if [[ "$explorer_network_hight" != "0" ]]; then - -echo -e "${BOOK} ${YELLOW}Checking collateral:${NC}" -txhash=$(grep -o "\w*" <<< "$collateral") -txhash=$(sed -n "2p" <<< "$txhash") -txhash=$(egrep "\w{10,50}" <<< "$txhash") - -if [[ "$txhash" != "" ]]; then -#url_to_check="https://explorer.zel.cash/api/tx/$txhash" -#conf=$(wget -nv -qO - $url_to_check | jq '.confirmations') -stak_info="" -if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - #collateral_index=$(awk '{print $1}' <<< "$stak_info") - stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + echo -e "${BOOK} ${YELLOW}Flux deamon information:${NC}" + daemon_getinfo=$($COIN_CLI getinfo) + version=$(jq -r '.version' <<< "$daemon_getinfo") + blocks_hight=$(jq -r '.blocks' <<< "$daemon_getinfo") + protocolversion=$(jq -r '.protocolversion' <<< "$daemon_getinfo") + connections=$(jq -r '.connections' <<< "$daemon_getinfo") + error=$(jq -r '.error' <<< "$daemon_getinfo") + if [[ "$error" != "" && "$error" != null ]]; then + echo + echo -e "${X_MARK} ${CYAN} Flux daemon error detected: ${RED}$error${CYAN}) IP${NC}" fi - -fi - - if [[ "$stak_info" != "" ]]; then - - #if [[ -f /home/$USER/.zelcash/zelcash.conf ]]; then - - #index_from_file=$(grep -w zelnodeindex /home/$USER/.zelcash/zelcash.conf | sed -e 's/zelnodeindex=//') - #collateral_index=$(awk '{print $2}' <<< "$stak_info") - - #if [[ "$index_from_file" == "$collateral_index" ]]; then - #echo -e "${CHECK_MARK} ${CYAN} Zelnodeindex is correct" - #else - #echo -e "${X_MARK} ${CYAN} Zelnodeindex is not correct, correct one is $collateral_index" - #fi - #else - #collateral_index=$(awk '{print $1}' <<< "$stak_info") - #fi - type=$(awk '{print $1}' <<< "$stak_info") - conf=$($COIN_CLI gettxout $txhash $index_from_file | jq .confirmations) - - if [[ $conf == ?(-)+([0-9]) ]]; then - if [ "$conf" -ge "100" ]; then - echo -e "${CHECK_MARK} ${CYAN} Confirmations numbers >= 100($conf)${NC}" - else - echo -e "${X_MARK} ${CYAN} Confirmations numbers < 100($conf)${NC}" - fi + echo -e "${PIN} ${CYAN}Version: ${SEA}$version${NC}" + echo -e "${PIN} ${CYAN}Protocolversion: ${SEA}$protocolversion${NC}" + echo -e "${PIN} ${CYAN}Connections: ${SEA}$connections${NC}" + echo -e "${PIN} ${CYAN}Blocks: ${SEA}$blocks_hight${NC}" + network_height_01=$(curl -sk -m 5 https://$network/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) + network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) + explorer_network_hight=$(max "$network_height_01" "$network_height_03") + block_diff=$((explorer_network_hight-blocks_hight)) + if [[ "$explorer_network_hight" != "0" ]]; then + if [[ "$block_diff" < 10 ]]; then + echo -e "${PIN} ${CYAN}Status: ${GREEN}synced${NC}" else - echo -e "${X_MARK} ${CYAN} FluxNode outpoint is not valid${NC}" + echo -e "${PIN} ${CYAN}Status: ${RED}not synced${NC}" fi - - - if [[ $type == ?(-)+([0-9]) ]]; then - - case $type in - "1000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}CUMULUS${NC}" ;; - "12500") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}NIMBUS${NC}";; - "40000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}STRATUS${NC}";; - esac - - case $bench_benchmark in - "CUMULUS") bench_benchmark_value=1000 ;; - "NIMBUS") bench_benchmark_value=12500 ;; - "STRATUS") bench_benchmark_value=40000 ;; - esac - - #echo -e "$zelbench_benchmark_value" -> 10000 BASIC - # echo -e "$type" -> 25000 SUPER - - if [[ -z bench_benchmark_value ]]; then - echo -e "" - else - - if [[ "$bench_benchmark_value" -ge "$type" ]]; then - - case $type in - "1000") bench_benchmark_value_name="CUMULUS" ;; - "12500") bench_benchmark_value_name="NIMBUS" ;; - "40000") bench_benchmark_value_name="STRATUS" ;; - esac - - #echo -e "${CHECK_MARK} ${CYAN} Benchmark passed for ${GREEN}$bench_benchmark${CYAN} required ${GREEN}$bench_benchmark_value_name${NC}" - else - - case $type in - "1000") bench_benchmark_value_name="CUMULUS" ;; - "12500") bench_benchmark_value_name="NIMBUS" ;; - "40000") bench_benchmark_value_name="STRATUS" ;; - esac - - if [[ "$bench_benchmark" == "running" ]]; then - echo -en "" + else + echo -e "${PIN} ${CYAN}Info: ${RED}sync check skipped...${NC}" + fi + echo -e "" + echo -e "${BOOK} ${YELLOW}Checking node status:${NC}" + getzelnodestatus=$($COIN_CLI getzelnodestatus) + node_status=$(jq -r '.status' <<< "$getzelnodestatus") + collateral=$(jq -r '.collateral' <<< "$getzelnodestatus") + if [[ "$node_status" == "CONFIRMED" ]]; then + node_status_color="${SEA}$node_status" + elif [[ "$node_status" == "STARTED" ]];then + node_status_color="${YELLOW}$node_status" + else + node_status_color="${RED}$node_status" + fi + echo -e "${PIN} ${CYAN}Node status: $node_status_color${NC}" + if [[ "$node_status" == "DOS" ]]; then + blocks_till=$($COIN_CLI getdoslist | jq .[] | grep "$collateral" -A5 -B1 | jq .eligible_in) + dos_till=$((blocks_hight+blocks_till)) + echo -e "${PIN} ${RED}DOS ${CYAN}Till: ${ORANGE}$dos_till ${CYAN}EXPIRE_COUNT: ${ORANGE}$blocks_till${CYAN} Time left: ${RED}~$((2*blocks_till)) min. ${NC}" + fi + echo -e "${PIN} ${CYAN}Collateral: ${SEA}$collateral${NC}" + echo -e "" + if [[ "$node_status" != "CONFIRMED" ]]; then + if whiptail --yesno "Would you like to verify $CONFIG_FILE Y/N?" 8 60; then + ZELCONF="1" + zelnodeprivkey="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" + zelnodeoutpoint="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Output TX ID" 8 72 3>&1 1>&2 2>&3)" + zelnodeindex="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" + fi + fi + flux_communication=$(curl -SsL -m 10 http://"$WANIP":16127/flux/checkcommunication 2>/dev/null | jq -r .data.message 2>/dev/null) + if [[ "$flux_communication" != "null" && "$flux_communication" != "" ]]; then + echo -e "${BOOK} ${YELLOW}Checking FluxOS communication: ${NC}" + echo -e "${ARROW} ${CYAN}$flux_communication${NC}" + echo -e "" + fi + if [[ "$explorer_network_hight" != "0" ]]; then + echo -e "${BOOK} ${YELLOW}Checking collateral:${NC}" + txhash=$(grep -o "\w*" <<< "$collateral") + txhash=$(sed -n "2p" <<< "$txhash") + txhash=$(egrep "\w{10,50}" <<< "$txhash") + if [[ "$txhash" != "" ]]; then + stak_info="" + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + fi + fi + if [[ "$stak_info" != "" ]]; then + type=$(awk '{print $1}' <<< "$stak_info") + conf=$($COIN_CLI gettxout $txhash $index_from_file | jq .confirmations) + if [[ $conf == ?(-)+([0-9]) ]]; then + if [ "$conf" -ge "100" ]; then + echo -e "${CHECK_MARK} ${CYAN} Confirmations numbers >= 100($conf)${NC}" + else + echo -e "${X_MARK} ${CYAN} Confirmations numbers < 100($conf)${NC}" + fi + else + echo -e "${X_MARK} ${CYAN} FluxNode outpoint is not valid${NC}" + fi + if [[ $type == ?(-)+([0-9]) ]]; then + case $type in + "1000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}CUMULUS${NC}" ;; + "12500") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}NIMBUS${NC}";; + "40000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}STRATUS${NC}";; + esac + case $bench_benchmark in + "CUMULUS") bench_benchmark_value=1000 ;; + "NIMBUS") bench_benchmark_value=12500 ;; + "STRATUS") bench_benchmark_value=40000 ;; + esac + if [[ -z bench_benchmark_value ]]; then + echo -e "" + else + if [[ "$bench_benchmark_value" -ge "$type" ]]; then + case $type in + "1000") bench_benchmark_value_name="CUMULUS" ;; + "12500") bench_benchmark_value_name="NIMBUS" ;; + "40000") bench_benchmark_value_name="STRATUS" ;; + esac + else + case $type in + "1000") bench_benchmark_value_name="CUMULUS" ;; + "12500") bench_benchmark_value_name="NIMBUS" ;; + "40000") bench_benchmark_value_name="STRATUS" ;; + esac + if [[ "$bench_benchmark" == "running" ]]; then + echo -en "" + else + echo -en "" + fi + fi + fi + fi else - - # if [[ "$bench_benchmark" == "failed" ]]; then - echo -en "" - # else - # echo -e "${X_MARK} ${CYAN} Benchmark passed for ${GREEN}$bench_benchmark${CYAN} required ${RED}$bench_benchmark_value_name${NC}" - # fi - - fi + echo -e "${X_MARK} ${CYAN} Flux collateral check skipped...${NC}" + fi + #url_to_check="https://explorer.zel.cash/api/tx/$txhash" + #type=$(wget -nv -qO - $url_to_check | jq '.vout' | grep '"value"' | egrep -o '10000|25000|100000') + #type=$(zelcash-cli gettxout $txhash 0 | jq .value) fi - fi - - fi - - else - echo -e "${X_MARK} ${CYAN} Flux collateral check skipped...${NC}" + fi fi -#url_to_check="https://explorer.zel.cash/api/tx/$txhash" -#type=$(wget -nv -qO - $url_to_check | jq '.vout' | grep '"value"' | egrep -o '10000|25000|100000') -#type=$(zelcash-cli gettxout $txhash 0 | jq .value) -fi fi -fi - - - echo -e "${NC}" echo -e "${BOOK} ${YELLOW}Checking listen ports:${NC}" check_listen_ports @@ -701,408 +525,269 @@ echo -e "${NC}" echo -e "${BOOK} ${YELLOW}Daemon files integrity checking:${NC}" integration echo -e "" -#if ! whiptail --yesno "Detected IP address is $WANIP is this correct?" 8 60; then - #WANIP=$(whiptail --title "ZelNode ANALIZER/FiXER $SCVESION" --inputbox " Enter IP address" 8 36 3>&1 1>&2 2>&3) -#fi echo -e "${BOOK} ${YELLOW}Checking service:${NC}" - docker_working=0 -#snap_docker_running=$(sudo systemctl status snap.docker.dockerd.service 2> /dev/null | grep 'running' | grep -o 'since.*') -#snap_docker_inactive=$(sudo systemctl status snap.docker.dockerd.service 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') - docker_running=$(sudo systemctl status docker 2> /dev/null | grep 'running' | grep -o 'since.*') docker_inactive=$(sudo systemctl status docker 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') - mongod_running=$(sudo systemctl status mongod 2> /dev/null | grep 'running' | grep -o 'since.*') mongod_inactive=$(sudo systemctl status mongod 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') - daemon_running=$(sudo systemctl status zelcash 2> /dev/null | grep 'running' | grep -o 'since.*') daemon_inactive=$(sudo systemctl status zelcash 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') -#if sudo systemctl list-units | grep snap.docker.dockerd.service | egrep -wi 'running' > /dev/null 2>&1; then -#echo -e "${ARROW} ${CYAN}Docker(SNAP) service running ${SEA}$snap_docker_running${NC}" -#docker_working=1 -#else -#if [ "$snap_docker_inactive" != "" ]; then -#echo -e "${ARROW} ${CYAN}Docker(SNAP) service not running ${RED}$snap_docker_inactive${NC}" -#else -#echo -e "${ARROW} ${CYAN}Docker(SNAP) is not installed${NC}" -#fi -#fi - - if sudo systemctl list-units | grep docker.service | egrep -wi 'running' > /dev/null 2>&1; then - echo -e "${CHECK_MARK} ${CYAN}Docker service running ${SEA}$docker_running${NC}" - #docker_working=1 - else - if [[ "$docker_inactive" != "" ]]; then - echo -e "${X_MARK} ${CYAN}Docker service not running ${RED}$docker_inactive${NC}" - else - echo -e "${X_MARK} ${CYAN}Docker is not installed${NC}" - fi +if sudo systemctl list-units | grep docker.service | egrep -wi 'running' > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN}Docker service running ${SEA}$docker_running${NC}" + #docker_working=1 +else + if [[ "$docker_inactive" != "" ]]; then + echo -e "${X_MARK} ${CYAN}Docker service not running ${RED}$docker_inactive${NC}" + else + echo -e "${X_MARK} ${CYAN}Docker is not installed${NC}" fi - -#if [[ "$docker_working" == "1" ]]; then -#echo -e "${CHECK_MARK} ${CYAN} Docker is working correct${NC}" -#else -#echo -e "${X_MARK} ${CYAN} Docker is not working${NC}" -#fi - -#if systemctl list-units | grep docker.socket | egrep -wi 'running' > /dev/null 2>&1; then -#echo -e "${CHECK_MARK} ${CYAN} Docker Socket for the API running ${SEA}$docker_socket_running${NC}" -#else -#if [[ "$docker_socket_inactive" != "" ]]; then -#echo -e "${X_MARK} ${CYAN}Docker Socket for the API not running ${RED}$docker_socket_inactive ${NC}" -#else -#echo -e "${X_MARK} ${CYAN}Docker Socket for the API is not installed${NC}" -#fi -#fi - verifity_mongod=0 - if sudo systemctl list-units | grep mongod | egrep -wi 'running' > /dev/null 2>&1; then -echo -e "${CHECK_MARK} ${CYAN} MongoDB service running ${SEA}$mongod_running${NC}" -else - -if [[ "$mongod_inactive" != "" ]]; then -echo -e "${X_MARK} ${CYAN} MongoDB service not running ${RED}$mongod_inactive${NC}" -verifity_mongod=1 -else -echo -e "${X_MARK} ${CYAN} MongoDB service is not installed${NC}" -fi - + echo -e "${CHECK_MARK} ${CYAN} MongoDB service running ${SEA}$mongod_running${NC}" + else + if [[ "$mongod_inactive" != "" ]]; then + echo -e "${X_MARK} ${CYAN} MongoDB service not running ${RED}$mongod_inactive${NC}" + verifity_mongod=1 + else + echo -e "${X_MARK} ${CYAN} MongoDB service is not installed${NC}" + fi fi if sudo systemctl list-units | grep zelcash | egrep -wi 'running' > /dev/null 2>&1; then -echo -e "${CHECK_MARK} ${CYAN} Flux daemon service running ${SEA}$daemon_running${NC}" -else -if [[ "$daemon_inactive" != "" ]]; then -echo -e "${X_MARK} ${CYAN} Flux daemon service not running ${RED}$daemon_inactive${NC}" + echo -e "${CHECK_MARK} ${CYAN} Flux daemon service running ${SEA}$daemon_running${NC}" else -echo -e "${X_MARK} ${CYAN} Flux daemon service is not installed${NC}" -fi + if [[ "$daemon_inactive" != "" ]]; then + echo -e "${X_MARK} ${CYAN} Flux daemon service not running ${RED}$daemon_inactive${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux daemon service is not installed${NC}" + fi fi echo -e "" - if [[ "$verifity_mongod" != "0" ]]; then + mongod_lib_dir_ownership=$(ls -l /var/lib/mongodb | awk '{print $3}' | tail -n1) + mongod_log_dir_ownership=$(ls -l /var/log/mongodb | awk '{print $3}' | tail -n1) + if [[ -f /tmp/mongodb-27017.sock ]]; then + mongod_tmp_sock_ownership=$(ls -l /tmp/mongodb-27017.sock | awk '{print $3}') + else + mongod_tmp_sock_ownership="mongodb" + fi - - mongod_lib_dir_ownership=$(ls -l /var/lib/mongodb | awk '{print $3}' | tail -n1) - mongod_log_dir_ownership=$(ls -l /var/log/mongodb | awk '{print $3}' | tail -n1) - - if [[ -f /tmp/mongodb-27017.sock ]]; then - mongod_tmp_sock_ownership=$(ls -l /tmp/mongodb-27017.sock | awk '{print $3}') - else - mongod_tmp_sock_ownership="mongodb" - fi - - if [[ "$mongod_lib_dir_ownership" != "mongodb" || "$mongod_log_dir_ownership" != "mongodb" || "$mongod_tmp_sock_ownership" != "mongodb" ]]; then - - echo -e "${BOOK} ${YELLOW}Checking MongoDB:${NC}" - echo -e "${X_MARK} ${CYAN} MongodDB directory/ownership detected!" - echo - - - if [[ ! -d /var/lib/mongodb ]]; then - sudo mkdir /var/lib/mongodb > /dev/null 2>&1 - fi - - sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 - - if [[ ! -d /var/log/mongodb ]]; then - sudo mkdir /var/log/mongodb > /dev/null 2>&1 - fi - - sudo chown -R mongodb:mongodb /var/log/mongodb > /dev/null 2>&1 - chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 - - fi - + if [[ "$mongod_lib_dir_ownership" != "mongodb" || "$mongod_log_dir_ownership" != "mongodb" || "$mongod_tmp_sock_ownership" != "mongodb" ]]; then + echo -e "${BOOK} ${YELLOW}Checking MongoDB:${NC}" + echo -e "${X_MARK} ${CYAN} MongodDB directory/ownership detected!" + echo -e "" + if [[ ! -d /var/lib/mongodb ]]; then + sudo mkdir /var/lib/mongodb > /dev/null 2>&1 + fi + sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 + if [[ ! -d /var/log/mongodb ]]; then + sudo mkdir /var/log/mongodb > /dev/null 2>&1 + fi + sudo chown -R mongodb:mongodb /var/log/mongodb > /dev/null 2>&1 + chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 + fi fi - echo -e "${BOOK} ${YELLOW}Checking FluxOS:${NC}" - if pm2 -v > /dev/null 2>&1; then -pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) -if [[ "$pm2_flux_status" == "online" ]]; then -pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) -pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) -echo -e "${CHECK_MARK} ${CYAN} Pm2 FluxOS info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" -else -if [[ "$pm2_flux_status" != "" ]]; then -echo -e "${X_MARK} ${CYAN} Pm2 FluxOS status: ${RED}$pm2_flux_status ${NC}" -fi -fi - -pm2_flux_status=$(pm2 info zelflux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) -if [[ "$pm2_flux_status" == "online" ]]; then -pm2_flux_uptime=$(pm2 info zelflux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) -pm2_flux_restarts=$(pm2 info zelflux | grep 'restarts' | sed -r 's/│//gi' | xargs) -echo -e "${CHECK_MARK} ${CYAN} Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" -else -if [[ "$pm2_flux_status" != "" ]]; then -echo -e "${X_MARK} ${CYAN} Pm2 FluxOS status: ${RED}$pm2_flux_status ${NC}" -fi -fi - -else -echo -e "${X_MARK} ${CYAN} Pm2 is not installed${NC}" -fi - -if [[ $(curl -s -m 5 --head "$WANIP:$FluxUI" | head -n 1 | grep "200 OK") ]] -then -echo -e "${CHECK_MARK} ${CYAN} FluxOS front is working${NC}" -else -echo -e "${X_MARK} ${CYAN} FluxOS front is not working${NC}" -fi - -if [ -d /home/$USER/$FLUX_DIR ] -then -FILE=/home/$USER/$FLUX_DIR/config/userconfig.js -if [ -f "$FILE" ] -then - - current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - required_ver=$(curl -sS --max-time 10 https://raw.githubusercontent.com/RunOnFlux/flux/master/package.json | jq -r '.version') - -if [[ "$required_ver" != "" ]]; then - if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then - echo -e "${CHECK_MARK} ${CYAN} You have the current version of FluxOS ${GREEN}(v$required_ver)${NC}" - else - echo -e "${HOT} ${CYAN}New version of FluxOS available ${SEA}$required_ver${NC}" - FLUX_UPDATE="1" - fi - fi - -echo -e "${CHECK_MARK} ${CYAN} FluxOS config ~/$FLUX_DIR/config/userconfig.js exists${NC}" - -ZELIDLG=`echo -n $(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e "s/'//g" | sed -e "s/,//g" | sed -e "s/.*zelid://g") | wc -m` -if [[ "$ZELIDLG" -eq "35" || "$ZELIDLG" -eq "34" || "$ZELIDLG" -eq "33" ]]; then - echo -e "${CHECK_MARK} ${CYAN} Zel ID is valid${NC}" -elif [[ "$ZELIDLG" == "0" || "$ZELIDLG" == "2" ]]; then - echo -e "${X_MARK} ${CYAN} Zel ID is missing...${NC}" -else - echo -e "${X_MARK} ${CYAN} Zel ID is not valid${NC}" -fi - -if [ -f ~/$FLUX_DIR/error.log ] -then -echo -echo -e "${BOOK} ${YELLOW}FluxOS error.log file detected, check ~/zelflux/error.log" -echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(wc -l < /home/$USER/$FLUX_DIR/error.log)${CYAN} error events${NC}" -error_line=$(cat /home/$USER/$FLUX_DIR/error.log | grep 'Error' | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{3\}Z//' | xargs) -echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" -event_date=$(cat /home/$USER/$FLUX_DIR/error.log | grep 'Error' | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{3\}Z') -event_time_uxtime=$(date -d "$event_date" +"%s") -event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') -event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') -echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" -now_date=$(date +%s) -tdiff=$((now_date-event_time_uxtime)) -show_time "$tdiff" -fi - -#if [ ! -f ~/$FLUX_DIR/ZelFront/dist/index.html ] -#then -#echo -e "${WORNING} ${CYAN}Flux problem detected, missing ~/$FLUX_DIR/ZelFront/dist/index.html" -#fi + pm2_flux_status=$(pm2 info flux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) + if [[ "$pm2_flux_status" == "online" ]]; then + pm2_flux_uptime=$(pm2 info flux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) + pm2_flux_restarts=$(pm2 info flux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${CHECK_MARK} ${CYAN} Pm2 FluxOS info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" + else + if [[ "$pm2_flux_status" != "" ]]; then + echo -e "${X_MARK} ${CYAN} Pm2 FluxOS status: ${RED}$pm2_flux_status ${NC}" + fi + fi + pm2_flux_status=$(pm2 info zelflux 2> /dev/null | grep 'status' | sed -r 's/│//gi' | sed 's/status.//g' | xargs) + if [[ "$pm2_flux_status" == "online" ]]; then + pm2_flux_uptime=$(pm2 info zelflux | grep 'uptime' | sed -r 's/│//gi' | sed 's/uptime//g' | xargs) + pm2_flux_restarts=$(pm2 info zelflux | grep 'restarts' | sed -r 's/│//gi' | xargs) + echo -e "${CHECK_MARK} ${CYAN} Pm2 Flux info => status: ${GREEN}$pm2_flux_status${CYAN}, uptime: ${GREEN}$pm2_flux_uptime${NC} ${SEA}$pm2_flux_restarts${NC}" + else + if [[ "$pm2_flux_status" != "" ]]; then + echo -e "${X_MARK} ${CYAN} Pm2 FluxOS status: ${RED}$pm2_flux_status ${NC}" + fi + fi else -FLUXCONF="1" - echo -e "${X_MARK} ${CYAN}Flux config ~/$FLUX_DIR/config/userconfig.js does not exists${NC}" + echo -e "${X_MARK} ${CYAN} Pm2 is not installed${NC}" fi - +if [[ $(curl -s -m 5 --head "$WANIP:$FluxUI" | head -n 1 | grep "200 OK") ]]; then + echo -e "${CHECK_MARK} ${CYAN} FluxOS front is working${NC}" else - echo -e "${X_MARK} ${CYAN}Directory ~/$FLUX_DIR does not exists${CYAN}" + echo -e "${X_MARK} ${CYAN} FluxOS front is not working${NC}" fi +if [[ -d /home/$USER/$FLUX_DIR ]]; then + FILE=/home/$USER/$FLUX_DIR/config/userconfig.js + if [[ -f "$FILE" ]]; then + current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) + required_ver=$(curl -sS --max-time 10 https://raw.githubusercontent.com/RunOnFlux/flux/master/package.json | jq -r '.version') + if [[ "$required_ver" != "" ]]; then + if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then + echo -e "${CHECK_MARK} ${CYAN} You have the current version of FluxOS ${GREEN}(v$required_ver)${NC}" + else + echo -e "${HOT} ${CYAN}New version of FluxOS available ${SEA}$required_ver${NC}" + FLUX_UPDATE="1" + fi + fi + echo -e "${CHECK_MARK} ${CYAN} FluxOS config ~/$FLUX_DIR/config/userconfig.js exists${NC}" + ZELIDLG=`echo -n $(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e "s/'//g" | sed -e "s/,//g" | sed -e "s/.*zelid://g") | wc -m` + if [[ "$ZELIDLG" -eq "35" || "$ZELIDLG" -eq "34" || "$ZELIDLG" -eq "33" ]]; then + echo -e "${CHECK_MARK} ${CYAN} Zel ID is valid${NC}" + elif [[ "$ZELIDLG" == "0" || "$ZELIDLG" == "2" ]]; then + echo -e "${X_MARK} ${CYAN} Zel ID is missing...${NC}" + else + echo -e "${X_MARK} ${CYAN} Zel ID is not valid${NC}" + fi -if [[ "$ZELCONF" == "1" ]] -then -echo -echo -e "${BOOK} ${YELLOW}Checking ~/$CONFIG_DIR/$CONFIG_FILE${NC}" -if [[ $zelnodeprivkey == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') ]] -then -echo -e "${CHECK_MARK} ${CYAN} FluxNode Identity Key matches${NC}" + if [[ -f ~/$FLUX_DIR/error.log ]]; then + echo -e "" + echo -e "${BOOK} ${YELLOW}FluxOS error.log file detected, check ~/zelflux/error.log" + echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(wc -l < /home/$USER/$FLUX_DIR/error.log)${CYAN} error events${NC}" + error_line=$(cat /home/$USER/$FLUX_DIR/error.log | grep 'Error' | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{3\}Z//' | xargs) + echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" + event_date=$(cat /home/$USER/$FLUX_DIR/error.log | grep 'Error' | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{3\}Z') + event_time_uxtime=$(date -d "$event_date" +"%s") + event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" + now_date=$(date +%s) + tdiff=$((now_date-event_time_uxtime)) + show_time "$tdiff" + fi + else + FLUXCONF="1" + echo -e "${X_MARK} ${CYAN}Flux config ~/$FLUX_DIR/config/userconfig.js does not exists${NC}" + fi else -REPLACE="1" -echo -e "${X_MARK} ${CYAN} FluxNode Identity Key does not match${NC}" + echo -e "${X_MARK} ${CYAN}Directory ~/$FLUX_DIR does not exists${CYAN}" fi +if [[ "$ZELCONF" == "1" ]]; then + echo -e "" + echo -e "${BOOK} ${YELLOW}Checking ~/$CONFIG_DIR/$CONFIG_FILE${NC}" + if [[ $zelnodeprivkey == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') ]]; then + echo -e "${CHECK_MARK} ${CYAN} FluxNode Identity Key matches${NC}" + else + REPLACE="1" + echo -e "${X_MARK} ${CYAN} FluxNode Identity Key does not match${NC}" + fi -if [[ $zelnodeoutpoint == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') ]] -then -echo -e "${CHECK_MARK} ${CYAN} FluxNode Collateral TX ID matches${NC}" -else -REPLACE="1" -echo -e "${X_MARK} ${CYAN} FluxNode Collateral TX ID does not match${NC}" -fi + if [[ $zelnodeoutpoint == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') ]]; then + echo -e "${CHECK_MARK} ${CYAN} FluxNode Collateral TX ID matches${NC}" + else + REPLACE="1" + echo -e "${X_MARK} ${CYAN} FluxNode Collateral TX ID does not match${NC}" + fi -if [[ $zelnodeindex == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') ]] -then -echo -e "${CHECK_MARK} ${CYAN} FluxNode Output Index matches${NC}" -else -REPLACE="1" -echo -e "${X_MARK} ${CYAN} FluxNode Output Index does not match${NC}" -fi + if [[ $zelnodeindex == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') ]]; then + echo -e "${CHECK_MARK} ${CYAN} FluxNode Output Index matches${NC}" + else + REPLACE="1" + echo -e "${X_MARK} ${CYAN} FluxNode Output Index does not match${NC}" + fi fi - if [[ -f /home/$USER/watchdog/package.json ]]; then -echo -echo -e "${BOOK} ${YELLOW}Checking Watchdog:${NC}" - -current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) -required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/fluxnode-watchdog/master/package.json | jq -r '.version') - - if [[ "$required_ver" != "" ]]; then - if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then - echo -e "${CHECK_MARK} ${CYAN} You have the current version of Watchdog ${GREEN}(v$required_ver)${NC}" - else - echo -e "${HOT} ${CYAN}New version of Watchdog available ${SEA}$required_ver${NC}" - fi - fi - + echo -e "" + echo -e "${BOOK} ${YELLOW}Checking Watchdog:${NC}" + current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/fluxnode-watchdog/master/package.json | jq -r '.version') + if [[ "$required_ver" != "" ]]; then + if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then + echo -e "${CHECK_MARK} ${CYAN} You have the current version of Watchdog ${GREEN}(v$required_ver)${NC}" + else + echo -e "${HOT} ${CYAN}New version of Watchdog available ${SEA}$required_ver${NC}" + fi + fi fi - if [[ -f /home/$USER/watchdog/watchdog_error.log ]]; then -echo -echo -e "${BOOK} ${YELLOW}Watchdog watchdog_error.log file detected, check ~/watchdog/watchdog_error.log" -echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(wc -l < /home/$USER/watchdog/watchdog_error.log)${CYAN} error events${NC}" -error_line=$(cat /home/$USER/watchdog/watchdog_error.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') -echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" -event_date=$(cat /home/$USER/watchdog/watchdog_error.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}' | head -n1) -event_time_uxtime=$(date -ud "$event_date" +"%s") - -event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') -event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') - -echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" -now_date=$(date +%s) -tdiff=$((now_date-event_time_uxtime)) -show_time "$tdiff" + echo -e "" + echo -e "${BOOK} ${YELLOW}Watchdog watchdog_error.log file detected, check ~/watchdog/watchdog_error.log" + echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(wc -l < /home/$USER/watchdog/watchdog_error.log)${CYAN} error events${NC}" + error_line=$(cat /home/$USER/watchdog/watchdog_error.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" + event_date=$(cat /home/$USER/watchdog/watchdog_error.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}' | head -n1) + event_time_uxtime=$(date -ud "$event_date" +"%s") + event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" + now_date=$(date +%s) + tdiff=$((now_date-event_time_uxtime)) + show_time "$tdiff" fi echo -e "${YELLOW}===================================================${NC}" if [[ "$FLUX_UPDATE" == "1" ]]; then -read -p "Would you like to update Flux Y/N?" -n 1 -r -echo -e "" -if [[ $REPLY =~ ^[Yy]$ ]]; then -cd /home/$USER/$FLUX_DIR && git pull > /dev/null 2>&1 && cd -current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) -required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/flux/master/package.json | jq -r '.version') -if [[ "$required_ver" == "$current_ver" ]]; then -echo -e "${CHECK_MARK} ${CYAN}Flux updated successfully.${NC}" -echo -e "" -else -echo -e "${X_MARK} ${CYAN}Flux was not updated.${NC}" -echo -e "" -fi -fi + read -p "Would you like to update Flux Y/N?" -n 1 -r + echo -e "" + if [[ $REPLY =~ ^[Yy]$ ]]; then + cd /home/$USER/$FLUX_DIR && git pull > /dev/null 2>&1 && cd + current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) + required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/flux/master/package.json | jq -r '.version') + if [[ "$required_ver" == "$current_ver" ]]; then + echo -e "${CHECK_MARK} ${CYAN}Flux updated successfully.${NC}" + echo -e "" + else + echo -e "${X_MARK} ${CYAN}Flux was not updated.${NC}" + echo -e "" + fi + fi fi - if [[ "$REPLACE" == "1" ]]; then -read -p "Would you like to correct daemon config errors Y/N?" -n 1 -r -echo -e "" -if [[ $REPLY =~ ^[Yy]$ ]]; then -echo -e "${YELLOW}Stopping Flux daemon serivce...${NC}" -sudo systemctl stop "$COIN_NAME" -sudo fuser -k 16125/tcp > /dev/null 2>&1 -echo -e "" - -if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "\c" -else - - if [[ "$zelnodeprivkey" == "" ]]; then - echo -e " ${CYAN}FluxNode Identity Key skipped...............${NC}" - else - sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e " ${CYAN}FluxNode Identity Key replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" - fi - fi -fi + read -p "Would you like to correct daemon config errors Y/N?" -n 1 -r + echo -e "" + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo -e "${YELLOW}Stopping Flux daemon serivce...${NC}" + sudo systemctl stop "$COIN_NAME" + sudo fuser -k 16125/tcp > /dev/null 2>&1 + echo -e "" + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "\c" + else + if [[ "$zelnodeprivkey" == "" ]]; then + echo -e " ${CYAN}FluxNode Identity Key skipped...............${NC}" + else + sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e " ${CYAN}FluxNode Identity Key replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "\c" + else + if [[ "$zelnodeoutpoint" == "" ]]; then + echo -e " ${CYAN}FluxNode Collateral TX ID skipped...............${NC}" + else + sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e " ${CYAN}FluxNode Collateral TX ID replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi -if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -echo -e "\c" - else - - if [[ "$zelnodeoutpoint" == "" ]]; then - echo -e " ${CYAN}FluxNode Collateral TX ID skipped...............${NC}" - else - sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e " ${CYAN}FluxNode Collateral TX ID replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" - fi - fi -fi -if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then -echo -e "\c" - else - - if [[ "$zelnodeindex" == "" ]]; then - echo -e " ${CYAN}FluxNode Output Index skipped...............${NC}" - else - sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e " ${CYAN}FluxNode Output Index replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" - fi - fi -fi -echo -e "" -sudo systemctl start "$COIN_NAME" -NUM='35' -MSG1=' Restarting Flux daemon serivce...' -MSG2="${CYAN}............[${CHECK_MARK}${CYAN}]${NC}" -spinning_timer -echo -e "" -fi + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "\c" + else + if [[ "$zelnodeindex" == "" ]]; then + echo -e " ${CYAN}FluxNode Output Index skipped...............${NC}" + else + sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e " ${CYAN}FluxNode Output Index replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi + echo -e "" + sudo systemctl start "$COIN_NAME" + NUM='35' + MSG1=' Restarting Flux daemon serivce...' + MSG2="${CYAN}............[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo -e "" + fi fi - -#if [ "$IP_FIX" == "1" ]; then - -#netplan_io=$(dpkg -l netplan.io | grep -w 'netplan.io' | awk '{print $3}') - -#if [[ "$netplan_io" != "" ]]; then - -#if [[ ! -f /etc/netplan/666-static.yaml ]]; then -#read -p "Would you like to add your public ip to netplan.io? (recommended for NAT users) Y/N?" -n 1 -r -#echo -e "" -#if [[ $REPLY =~ ^[Yy]$ ]]; then - -#sudo ip addr add $WANIP dev $device_name:0 && sleep 2 -#ip_address=$(ip a list $device_name | grep -o $WANIP.* | awk '{printf $1}') - - -#sudo touch /etc/netplan/666-static.yaml -#sudo chown $USER:$USER /etc/netplan/666-static.yaml -#sudo cat << EOF > /etc/netplan/666-static.yaml -#network: - #version: 2 - # renderer: networkd - #ethernets: - # $device_name: - #addresses: - #- $ip_address -#EOF -#sudo chown root:root /etc/netplan/666-static.yaml -#fi - -#fi - -#fi - -#fi -echo -#if [ "$LC_CHECK" == "1" ]; then -#read -p "Would you like to change LC_NUMERIC to en_US.UTF-8 Y/N?" -n 1 -r -#echo -e "" -#if [[ $REPLY =~ ^[Yy]$ ]]; then -#sudo bash -c 'echo "LC_NUMERIC="en_US.UTF-8"" >>/etc/default/locale' -#echo -e "" -#echo -e "${CHECK_MARK} ${CYAN}LC_NUMERIC changed to en_US.UTF-8 now you need restart pc${NC}" -#read -p "Would you like to reboot pc Y/N?" -n 1 -r -#echo -e "" -#if [[ $REPLY =~ ^[Yy]$ ]]; then -#sudo reboot -n -#fi -#fi -#fi +echo -e "" \ No newline at end of file From 8883106ef089d2dc310103bdde878987a4b9c0d0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Sun, 28 Aug 2022 15:59:18 +0200 Subject: [PATCH 0639/1176] fix conditional --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 43110667..38541f1e 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -202,7 +202,7 @@ function integration(){ done } -if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin"]]; then +if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user accont.${NC}" echo -e "${YELLOW}================================================================${NC}" From e91f30cfc5821947d71068c8b8eb345ee3395084 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Sun, 28 Aug 2022 16:06:47 +0200 Subject: [PATCH 0640/1176] fix bc conditional --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 38541f1e..ecfe5908 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -210,8 +210,8 @@ if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then exit fi sleep 1 -if [[ ! bc -v ]]; then - sudo apt install bc > /dev/null 2>&1 +if ! bc -v > /dev/null 2>&1 ; then + sudo apt install -y bc > /dev/null 2>&1 && sleep 1 fi echo -e "${NC}" if [ -f /home/$USER/$BENCH_DIR_LOG/debug.log ]; then From 354d0cad3aec64d8c1c6097cce14682badbf8cca Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Sun, 28 Aug 2022 16:22:37 +0200 Subject: [PATCH 0641/1176] fix stak_info conditional --- nodeanalizerandfixer.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index ecfe5908..7e4831c0 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -455,6 +455,7 @@ if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" txhash=$(egrep "\w{10,50}" <<< "$txhash") if [[ "$txhash" != "" ]]; then stak_info="" + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') @@ -462,6 +463,7 @@ if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi fi + if [[ "$stak_info" != "" ]]; then type=$(awk '{print $1}' <<< "$stak_info") conf=$($COIN_CLI gettxout $txhash $index_from_file | jq .confirmations) @@ -474,17 +476,17 @@ if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" else echo -e "${X_MARK} ${CYAN} FluxNode outpoint is not valid${NC}" fi - if [[ $type == ?(-)+([0-9]) ]]; then - case $type in - "1000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}CUMULUS${NC}" ;; - "12500") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}NIMBUS${NC}";; - "40000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}STRATUS${NC}";; - esac - case $bench_benchmark in - "CUMULUS") bench_benchmark_value=1000 ;; - "NIMBUS") bench_benchmark_value=12500 ;; - "STRATUS") bench_benchmark_value=40000 ;; - esac + if [[ $type == ?(-)+([0-9]) ]]; then + case $type in + "1000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}CUMULUS${NC}" ;; + "12500") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}NIMBUS${NC}";; + "40000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}STRATUS${NC}";; + esac + case $bench_benchmark in + "CUMULUS") bench_benchmark_value=1000 ;; + "NIMBUS") bench_benchmark_value=12500 ;; + "STRATUS") bench_benchmark_value=40000 ;; + esac if [[ -z bench_benchmark_value ]]; then echo -e "" else @@ -507,17 +509,17 @@ if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" fi fi fi - fi - else - echo -e "${X_MARK} ${CYAN} Flux collateral check skipped...${NC}" fi + else + echo -e "${X_MARK} ${CYAN} Flux collateral check skipped...${NC}" + fi #url_to_check="https://explorer.zel.cash/api/tx/$txhash" #type=$(wget -nv -qO - $url_to_check | jq '.vout' | grep '"value"' | egrep -o '10000|25000|100000') #type=$(zelcash-cli gettxout $txhash 0 | jq .value) - fi fi fi fi + echo -e "${NC}" echo -e "${BOOK} ${YELLOW}Checking listen ports:${NC}" check_listen_ports From 844862afe69a0b7cf614810a87d2aec01824f8b1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Sun, 28 Aug 2022 16:27:04 +0200 Subject: [PATCH 0642/1176] fix docker service conditional --- nodeanalizerandfixer.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 7e4831c0..0d6de0d8 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -102,7 +102,7 @@ function check_listen_ports(){ echo -e "${X_MARK} ${CYAN} Mongod not listen${NC}" fi if sudo lsof -i -n | grep LISTEN | grep 16125 | grep fluxd > /dev/null 2>&1; then - echo -e "${CHECK_MARK} ${CYAN} Flux daemon listen on port 16125${NC}" + echo -e "${CHECK_MARK} ${CYAN} Flux daemon listen on port 16125${NC}" else if sudo lsof -i -n | grep LISTEN | grep 16125 | grep zelcashd > /dev/null 2>&1; then echo -e "${CHECK_MARK} ${CYAN} Flux daemon listen on port 16125${NC}" @@ -541,14 +541,15 @@ if sudo systemctl list-units | grep docker.service | egrep -wi 'running' > /dev/ #docker_working=1 else if [[ "$docker_inactive" != "" ]]; then - echo -e "${X_MARK} ${CYAN}Docker service not running ${RED}$docker_inactive${NC}" + echo -e "${X_MARK} ${CYAN}Docker service not running ${RED}$docker_inactive${NC}" else - echo -e "${X_MARK} ${CYAN}Docker is not installed${NC}" + echo -e "${X_MARK} ${CYAN}Docker is not installed${NC}" + fi fi verifity_mongod=0 if sudo systemctl list-units | grep mongod | egrep -wi 'running' > /dev/null 2>&1; then echo -e "${CHECK_MARK} ${CYAN} MongoDB service running ${SEA}$mongod_running${NC}" - else +else if [[ "$mongod_inactive" != "" ]]; then echo -e "${X_MARK} ${CYAN} MongoDB service not running ${RED}$mongod_inactive${NC}" verifity_mongod=1 From 042e7b712d8b1891eab8b0d3c58ead8cb055825d Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Sun, 28 Aug 2022 20:55:22 +0200 Subject: [PATCH 0643/1176] update explorers --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 0d6de0d8..ca473951 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -458,9 +458,9 @@ if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -s -m 10 https://$network_url_1/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 10 https://explorer.zelcash.online/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -s -m 10 https://$network_url_2/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi fi From e8c3df0045b929e5a8b3c1b7966c7f11aa5bbcef Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Sun, 28 Aug 2022 22:41:16 +0200 Subject: [PATCH 0644/1176] added fluxOS testnet flage as variable --- flux_common.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f04c3472..6412ba91 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -50,6 +50,13 @@ function watchdog_conf_create(){ EOF } function fluxos_conf_create(){ + + if [[ "$1" == "true" ]]; then + testnet=true + else + testnet=false + fi + touch /home/$USER/$FLUX_DIR/config/userconfig.js cat <<- EOF > /home/$USER/$FLUX_DIR/config/userconfig.js module.exports = { @@ -57,7 +64,7 @@ function fluxos_conf_create(){ ipaddress: '${WANIP}', zelid: '${ZELID}', kadena: '${KDA_A}', - testnet: false + testnet: `${testnet}` } } EOF From cad42deb1096ab4aebfc2f9dd4f7c3c73fbfe76a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 31 Aug 2022 17:02:13 +0200 Subject: [PATCH 0645/1176] fix missing USER variable --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 6412ba91..9707073c 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -71,7 +71,7 @@ function fluxos_conf_create(){ } function flux_daemon_conf_create() { touch /home/$USER/$CONFIG_DIR/$CONFIG_FILE - cat <<- EOF > /home/$CONFIG_DIR/$CONFIG_FILE + cat <<- EOF > /home/$USER/$CONFIG_DIR/$CONFIG_FILE rpcuser=$RPCUSER rpcpassword=$PASSWORD rpcallowip=127.0.0.1 From c772e28b324be39ca5e5bac42331ecab00181c9b Mon Sep 17 00:00:00 2001 From: XK4MiLX <C:\Users\k4mil\AppData\Roaming\The Bat!> Date: Wed, 31 Aug 2022 22:49:19 +0200 Subject: [PATCH 0646/1176] added networks variable --- apps_info.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps_info.sh b/apps_info.sh index 43ad5dd3..f453fc73 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -12,11 +12,14 @@ else export ROOT_BRANCH='master' fi +network_url_1="explorer.zelcash.online" +network_url_2="explorer.runonflux.io" + name=($(jq -r .data[].name <<< "$apps_info")) height=($(jq -r .data[].height <<< "$apps_info")) -network_height_01=$(curl -sk -m 5 https://explorer.runonflux.io/api/status?q=getInfo | jq '.info.blocks') -network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo | jq '.info.blocks') -explorer_network_hight=$(max "$network_height_01" "$network_height_03") +network_height_01=$(curl -sk -m 5 https://$network_url_1/api/status?q=getInfo | jq '.info.blocks') +network_height_02=$(curl -sk -m 5 https://$network_url_2/api/status?q=getInfo | jq '.info.blocks') +explorer_network_hight=$(max "$network_height_01" "$network_height_02") echo -e "" echo -e "Apps count: ${#name[@]}" echo -e "-------------------------------------" From 300d739424f134c5ff03b8c16f998117f36d1a14 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 11:26:48 +0200 Subject: [PATCH 0647/1176] Minor edits --- multitoolbox.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9e14e1b2..6847fed4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -116,13 +116,13 @@ function install_flux() { resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then - echo -e "${ARROW} ${YELLOW}Detected Flux MongoDB local apps collection ...${NC}" + echo -e "${ARROW} ${CYAN}Detected Flux MongoDB local apps collection ...${NC}" echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 fi if [[ $docker_check != 0 ]]; then - echo -e "${ARROW} ${YELLOW}Detected running docker container...${NC}" + echo -e "${ARROW} ${CYAN}Detected running docker container...${NC}" echo -e "${ARROW} ${CYAN}Removing containers...${NC}" sudo aa-remove-unknown > /dev/null 2>&1 && sudo service docker restart > /dev/null 2>&1 docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | @@ -133,7 +133,7 @@ function install_flux() { fi if [[ $resource_check != 0 ]]; then - echo -e "${ARROW} ${YELLOW}Detected locked resource...${NC}" + echo -e "${ARROW} ${CYAN}Detected locked resource...${NC}" echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" df | egrep 'flux' | awk '{ print $1}' | while read line; do @@ -152,30 +152,30 @@ function install_flux() { fi echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" echo -e "" - echo -e "${ARROW} ${CYAN}Removing any instances of Flux....${NC}" + echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 zelflux_setting_import="1" fi if [ -d /home/$USER/$FLUX_DIR ]; then - echo -e "${ARROW} ${CYAN}Removing any instances of Flux....${NC}" + echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 fi - echo -e "${ARROW} ${CYAN}Flux downloading...${NC}" + echo -e "${ARROW} ${CYAN}FluxOS downloading...${NC}" git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 1 if [[ -d /home/$USER/$FLUX_DIR ]]; then if [[ -f /home/$USER/$FLUX_DIR/package.json ]]; then current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) else - string_limit_x_mark "Flux was not downloaded, run script again..........................................." + string_limit_x_mark "FluxOS was not downloaded, run script again..........................................." echo exit fi - string_limit_check_mark "Flux v$current_ver downloaded..........................................." "Flux ${GREEN}v$current_ver${CYAN} downloaded..........................................." + string_limit_check_mark "FluxOS v$current_ver downloaded..........................................." "FluxOS ${GREEN}v$current_ver${CYAN} downloaded..........................................." else - string_limit_x_mark "Flux was not downloaded, run script again..........................................." + string_limit_x_mark "FluxOS was not downloaded, run script again..........................................." echo exit fi @@ -211,9 +211,9 @@ function install_flux() { fi if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then - string_limit_check_mark "Flux configuration successfull..........................................." + string_limit_check_mark "FluxOS configuration successfull..........................................." else - string_limit_x_mark "Flux installation failed, missing config file..........................................." + string_limit_x_mark "FluxOS installation failed, missing config file..........................................." echo exit fi @@ -223,8 +223,8 @@ function install_flux() { pm2 del flux > /dev/null 2>&1 pm2 del zelflux > /dev/null 2>&1 pm2 save > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" - echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" + echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" + echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" echo -e "" pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=60000 --max-restarts=40 --name flux --time > /dev/null 2>&1 pm2 save > /dev/null 2>&1 @@ -232,8 +232,8 @@ function install_flux() { else pm2_install if [[ "$PM2_INSTALL" == "1" ]]; then - echo -e "${ARROW} ${CYAN}Starting Flux....${NC}" - echo -e "${ARROW} ${CYAN}Flux loading will take 2-3min....${NC}" + echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" + echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" echo pm2 list fi From 5898944d560d1129a1003fe6f11acf851cbd1736 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 12:35:58 +0200 Subject: [PATCH 0648/1176] fixed fluxOS_conf --- multitoolbox.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6847fed4..8ce6d7d7 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -165,7 +165,6 @@ function install_flux() { echo -e "${ARROW} ${CYAN}FluxOS downloading...${NC}" git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 1 if [[ -d /home/$USER/$FLUX_DIR ]]; then - if [[ -f /home/$USER/$FLUX_DIR/package.json ]]; then current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) else @@ -207,9 +206,8 @@ function install_flux() { sleep 2 fi done - fluxOS_conf fi - + fluxOS_conf if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then string_limit_check_mark "FluxOS configuration successfull..........................................." else From 9d60758c8511859c3dcc1eb0c9e7a6a3c4aa182d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 12:46:42 +0200 Subject: [PATCH 0649/1176] fix function name --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8ce6d7d7..4dbff786 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -207,7 +207,7 @@ function install_flux() { fi done fi - fluxOS_conf + fluxos_conf_create if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then string_limit_check_mark "FluxOS configuration successfull..........................................." else From 6afbd632f15682761fe81125075663c5ef8cb83d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 12:55:46 +0200 Subject: [PATCH 0650/1176] fix zelid variable --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4dbff786..b1ab4f79 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -183,7 +183,7 @@ function install_flux() { get_ip "install" while true do - zel_id="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + ZELID="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then string_limit_check_mark "Zel ID is valid..........................................." break From 8b78debd3cfa85e8189d831a324ff3ba9e0316bb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:02:33 +0200 Subject: [PATCH 0651/1176] Minor edits --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index b1ab4f79..e35953ad 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -142,8 +142,8 @@ function install_flux() { fi if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then - echo -e "${ARROW} ${CYAN}Importing setting...${NC}" - zel_id=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + echo -e "${ARROW} ${CYAN}Import settings...${NC}" + ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') WANIP=$(grep -w ipaddress /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*ipaddress: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$zel_id${NC}" KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') From 237953d908e57e86b7856fa16c2398e1485bad7b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:08:03 +0200 Subject: [PATCH 0652/1176] prevent import empty value --- multitoolbox.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e35953ad..7aadb5d6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -154,7 +154,9 @@ function install_flux() { echo -e "" echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 - zelflux_setting_import="1" + if [[ "$ZELID" != "" && "$WANIP" != "" && "$KDA_A" != "" ]] + zelflux_setting_import="1" + fi fi if [ -d /home/$USER/$FLUX_DIR ]; then From 94c527fbb4c83478660876bdebdf4846400d03b5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:10:08 +0200 Subject: [PATCH 0653/1176] fix conditional --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7aadb5d6..e7c1a12a 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -154,7 +154,7 @@ function install_flux() { echo -e "" echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 - if [[ "$ZELID" != "" && "$WANIP" != "" && "$KDA_A" != "" ]] + if [[ "$ZELID" != "" && "$WANIP" != "" && "$KDA_A" != "" ]]; then zelflux_setting_import="1" fi fi From 80ca6aa9cf88697e7505e95c92cf3a4acec88bb7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:22:11 +0200 Subject: [PATCH 0654/1176] fix zelid validation check --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e7c1a12a..e6e3931f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -186,7 +186,7 @@ function install_flux() { while true do ZELID="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then + if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then string_limit_check_mark "Zel ID is valid..........................................." break else From b61d0d262caf976dd8be4faa8556f967502acf6f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:27:34 +0200 Subject: [PATCH 0655/1176] fix conditional --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e6e3931f..0d0bd39f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -154,7 +154,7 @@ function install_flux() { echo -e "" echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 - if [[ "$ZELID" != "" && "$WANIP" != "" && "$KDA_A" != "" ]]; then + if [[ "$ZELID" != "" || "$WANIP" != "" || "$KDA_A" != "" ]]; then zelflux_setting_import="1" fi fi From dcb37ce4d592117bc70559a8c11dd5d382b12fa4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:40:59 +0200 Subject: [PATCH 0656/1176] revert conditional --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 0d0bd39f..e6e3931f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -154,7 +154,7 @@ function install_flux() { echo -e "" echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 - if [[ "$ZELID" != "" || "$WANIP" != "" || "$KDA_A" != "" ]]; then + if [[ "$ZELID" != "" && "$WANIP" != "" && "$KDA_A" != "" ]]; then zelflux_setting_import="1" fi fi From 476858bbaf3b9301cbb0a6f3951eed35ade0a179 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:46:06 +0200 Subject: [PATCH 0657/1176] fix testnet variable --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 9707073c..53a48e69 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -52,9 +52,9 @@ function watchdog_conf_create(){ function fluxos_conf_create(){ if [[ "$1" == "true" ]]; then - testnet=true + testnet='true' else - testnet=false + testnet='false' fi touch /home/$USER/$FLUX_DIR/config/userconfig.js From 51559f770224756ba7f093c49a5f99f85f9300a2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 14:07:42 +0200 Subject: [PATCH 0658/1176] fix zelid display and testnet value --- flux_common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 53a48e69..81ffc711 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -52,9 +52,9 @@ function watchdog_conf_create(){ function fluxos_conf_create(){ if [[ "$1" == "true" ]]; then - testnet='true' + testnet=true else - testnet='false' + testnet=false fi touch /home/$USER/$FLUX_DIR/config/userconfig.js @@ -64,7 +64,7 @@ function fluxos_conf_create(){ ipaddress: '${WANIP}', zelid: '${ZELID}', kadena: '${KDA_A}', - testnet: `${testnet}` + testnet: '${testnet}' } } EOF From 4718a2955b4a34829b2ec6a68d00fd094d5f792e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 14:14:47 +0200 Subject: [PATCH 0659/1176] fix zelid display --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e6e3931f..6d278c0f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -145,7 +145,7 @@ function install_flux() { echo -e "${ARROW} ${CYAN}Import settings...${NC}" ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') WANIP=$(grep -w ipaddress /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*ipaddress: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$zel_id${NC}" + echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$ZELID${NC}" KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" From 65efc29394693b042a0dc0618695a9dc8dcb9125 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 1 Sep 2022 14:17:21 +0200 Subject: [PATCH 0660/1176] fix testnet value in config --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 81ffc711..f0321fc6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -64,7 +64,7 @@ function fluxos_conf_create(){ ipaddress: '${WANIP}', zelid: '${ZELID}', kadena: '${KDA_A}', - testnet: '${testnet}' + testnet: $testnet } } EOF From 4c5e5625909b02279289ea3449f869c2630d962c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 2 Sep 2022 11:22:39 +0200 Subject: [PATCH 0661/1176] import UPnP settings only if all variable set --- multinode.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/multinode.sh b/multinode.sh index 6af68b27..80940c5d 100644 --- a/multinode.sh +++ b/multinode.sh @@ -178,19 +178,14 @@ if [[ -f /home/$USER/install_conf.json ]]; then fi fi -if [[ -z $enable_upnp ]]; then +if [[ -z $enable_upnp || -z $gateway_ip || -z $upnp_port ]]; then CHOICE=$( whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ "1)" "Enable UPnP Mode" \ "2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 ) else - # if enable_upnp is 1 then set choice to 1 else set choice to 2 - if [[ "$enable_upnp" == "1" ]]; then - CHOICE="1)" - else - CHOICE="2)" - fi + CHOICE="1)" fi case $CHOICE in From c2632d2d85062b01d67306e0d4437d378c6ea9ca Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 2 Sep 2022 11:24:09 +0200 Subject: [PATCH 0662/1176] update import conditional --- multitoolbox.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6d278c0f..d9238f39 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -68,7 +68,7 @@ function config_file() { if [[ "$use_old_chain" == "1" ]]; then echo -e "${PIN}${CYAN}Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" else - if [[ "$bootstrap_url" == "" ]]; then + if [[ "$bootstrap_url" == "" || "$bootstrap_url" == "0" ]]; then echo -e "${PIN}${CYAN}Use Flux Bootstrap from source build in scripts..................[${CHECK_MARK}${CYAN}]${NC}" else echo -e "${PIN}${CYAN}Use Flux Bootstrap from own source...............................[${CHECK_MARK}${CYAN}]${NC}" @@ -86,7 +86,8 @@ function config_file() { echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" fi - if [[ ( "$enable_upnp" != "" && "$enable_upnp" != "0" ) ]]; then + + if [[ ! -z $enable_upnp && ! -z $gateway_ip && ! -z $upnp_port ]]; then echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" echo -e "${CYAN} UPnP Port: ${GREEN}$upnp_port${NC}" echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" From 69f06cab029c2069ff59e88e97c44e06a1953825 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 6 Sep 2022 12:02:53 +0200 Subject: [PATCH 0663/1176] added regex check for kadena address --- multitoolbox.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d9238f39..e2656a1f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -914,17 +914,22 @@ function daemon_reconfiguration(){ echo -e "" && echo -e "" } function replace_kadena { - while true + + while true do - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - kda_address="kadena:$KDA_A?chainid=0" - if [[ "$KDA_A" == "" ]]; then - echo -e "${WORNING} ${CYAN}Kadena address can't be empty string, operation aborted...${NC}" - echo -e "" - exit - fi - break - done + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + KDA_A=$(grep -Eo "^k:[0-9a-z]{64}\b" <<< "$KDA_A") + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=0" + sleep 2 + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then From ace2eb8ca966cdb1e51cfa80410c9cafa711c4d1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 6 Sep 2022 12:03:57 +0200 Subject: [PATCH 0664/1176] removed enable_upnp and cleanup --- multinode.sh | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/multinode.sh b/multinode.sh index 80940c5d..4ec1572e 100644 --- a/multinode.sh +++ b/multinode.sh @@ -15,7 +15,7 @@ function upnp_enable() { if [[ -z "$upnp_port" ]]; then FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) else - FLUX_PORT=$(echo $upnp_port) + FLUX_PORT="$upnp_port" fi if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then string_limit_check_mark "Port is valid..........................................." @@ -60,7 +60,7 @@ function upnp_enable() { if [[ -z "$gateway_ip" ]]; then router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) else - router_ip=$(echo $gateway_ip) + router_ip="$gateway_ip" fi if [[ "$router_ip" != "" ]]; then if [[ -z "$gateway_ip" ]]; then @@ -153,32 +153,17 @@ function upnp_disable() { } if [[ -f /home/$USER/install_conf.json ]]; then - import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') - if [[ "$import_settings" == "1" ]]; then + upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') + gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') + if [[ "$upnp_port" != "" && "$gateway_ip" != "" ]]; then echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 0.5 - enable_upnp=$(cat /home/$USER/install_conf.json | jq -r '.enable_upnp') - upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') - gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') - if [[ -n $enable_upnp && "$enable_upnp" != "" && "$enable_upnp" != "0" ]]; then - echo -e "${PIN}${CYAN} UPnP state = ${GREEN}Enable${NC}" && sleep 0.5 - else - echo -e "${PIN}${CYAN} UPnP state = ${RED}Disable${NC}" && sleep 0.5 - fi - if [[ -n $upnp_port && "$upnp_port" != "" && "$upnp_port" != "0" ]]; then - echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" && sleep 0.5 - else - echo -e "${PIN}${CYAN} UPnP port = ${RED}NULL${NC}" && sleep 0.5 - fi - if [[ -n $gateway_ip && "$gateway_ip" != "" && "$gateway_ip" != "0" ]]; then - echo -e "${PIN}${CYAN} Gateway = ${GREEN}$gateway_ip${NC}" && sleep 0.5 - else - echo -e "${PIN}${CYAN} Gateway = ${RED}NULL${NC}" && sleep 0.5 - fi + echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" + echo -e "${PIN}${CYAN} Gateway = ${GREEN}$gateway_ip${NC}" echo -e "" fi fi -if [[ -z $enable_upnp || -z $gateway_ip || -z $upnp_port ]]; then +if [[ -z "$gateway_ip" || -z "$upnp_port" ]]; then CHOICE=$( whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ "1)" "Enable UPnP Mode" \ From b28ad62c2d9cdd7b27be6a2c2bdd9976499b941b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 6 Sep 2022 12:12:49 +0200 Subject: [PATCH 0665/1176] fix kda_address --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e2656a1f..e3fc8427 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -921,7 +921,7 @@ function replace_kadena { KDA_A=$(grep -Eo "^k:[0-9a-z]{64}\b" <<< "$KDA_A") if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=0" + kda_address="kadena:$KDA_A?chainid=0" sleep 2 break else From 61fb40242634c5c560af398e5fe34d649abeeff6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 12:36:05 +0200 Subject: [PATCH 0666/1176] removed upnp_enable and import settings --- multinode.sh | 142 --------------------------------------------------- 1 file changed, 142 deletions(-) diff --git a/multinode.sh b/multinode.sh index 4ec1572e..908698be 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,133 +1,6 @@ #!/bin/bash source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" -function upnp_enable() { - try="0" - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" - echo -e "" - exit - fi - while true - do - echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" - # Check if upnp_port is set - if [[ -z "$upnp_port" ]]; then - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) - else - FLUX_PORT="$upnp_port" - fi - if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then - string_limit_check_mark "Port is valid..........................................." - break - else - string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." - sleep 1 - try=$(($try+1)) - if [[ "$try" -gt "3" ]]; then - echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" - echo -e "" - exit - fi - fi - done - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then - sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" - fi - else - insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," - echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ -d /home/$USER/.fluxbenchmark ]]; then - sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null - echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null - else - echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null - fi - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" - echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" - #API PORT - sudo ufw allow $FLUX_PORT > /dev/null 2>&1 - #HOME UI PORT - sudo ufw allow $(($FLUX_PORT-1)) > /dev/null 2>&1 - #if ! route -h > /dev/null 2>&1 ; then - # sudo apt install net-tools > /dev/null 2>&1 - #fi - #router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) - if [[ -z "$gateway_ip" ]]; then - router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) - else - router_ip="$gateway_ip" - fi - if [[ "$router_ip" != "" ]]; then - if [[ -z "$gateway_ip" ]]; then - if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then - is_correct="0" - fi - else - is_correct="0" - fi - if [[ "$is_correct" == "0" ]]; then - sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 - sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 - sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 - sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 - else - while true - do - - router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) - - if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then - echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - string_limit_x_mark "IP $router_ip is not valid ..............................." - sleep 1 - fi - - done - sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 - sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 - sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 - sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 - fi - else - while true - do - router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) - if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then - echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - string_limit_x_mark "IP $router_ip is not valid ..............................." - sleep 1 - fi - done - sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 - sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 - sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 - sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 - fi - fi - sudo systemctl restart zelcash > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 - sleep 200 - echo -e "${ARROW}${YELLOW} Checking FluxOS logs... ${NC}" - error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") - if [[ "$error_check" == "" ]]; then - echo -e "" - LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') - echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${LOCAL_IP}:$(($FLUX_PORT-1))${NC}" - echo -e "" - else - echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" - echo -e "" - fi -} function upnp_disable() { if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" @@ -152,26 +25,11 @@ function upnp_disable() { sleep 200 } -if [[ -f /home/$USER/install_conf.json ]]; then - upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') - gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') - if [[ "$upnp_port" != "" && "$gateway_ip" != "" ]]; then - echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 0.5 - echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" - echo -e "${PIN}${CYAN} Gateway = ${GREEN}$gateway_ip${NC}" - echo -e "" - fi -fi - -if [[ -z "$gateway_ip" || -z "$upnp_port" ]]; then CHOICE=$( whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ "1)" "Enable UPnP Mode" \ "2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 ) -else - CHOICE="1)" -fi case $CHOICE in "1)") From d0d5fdf0e2022b404b5e45409ea974a1a246f24b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 12:37:20 +0200 Subject: [PATCH 0667/1176] added upnp to main install script --- install_pro.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index e111a676..0451edb7 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -845,6 +845,9 @@ function status_loop() { fi install_watchdog finalizing + if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]]; then + upnp_enable + fi display_banner } #end of functions From 1561628bdae0d27d18599b3fa9bc2b64518baba9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 12:37:53 +0200 Subject: [PATCH 0668/1176] added upnp function --- flux_common.sh | 143 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f0321fc6..fa7cffa6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -224,7 +224,6 @@ function install_conf_create(){ "telegram_bot_token": "${telegram_bot_token}", "telegram_chat_id": "${telegram_chat_id}", "eps_limit": "${eps_limit}", - "enable_upnp": "${enable_upnp}", "upnp_port": "${FLUX_PORT}", "gateway_ip": "${gateway_ip}" } @@ -362,6 +361,9 @@ function import_config_file() { telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') + upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') + gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') + echo -e "" echo -e "${ARROW} ${YELLOW}Install config:" if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then @@ -386,11 +388,23 @@ function import_config_file() { echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi fi + + if [[ ! -z "$gateway_ip" && ! -z "$upnp_port" ]]; then + echo -e "${PIN}${CYAN} Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" + fi + + if [[ "$discord" != "" && "$discord" != "0" ]] || [[ "$telegram_alert" == '1' ]]; then + echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + if [[ "$discord" != "" && "$discord" != "0" ]] || [[ "$telegram_alert" == '1' ]]; then echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi + fi } function get_ip() { @@ -1153,6 +1167,133 @@ function log_rotate() { EOF sudo chown root:root /etc/logrotate.d/$2 } +function upnp_enable() { + try="0" + if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" + echo -e "" + return + fi + while true + do + echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" + # Check if upnp_port is set + if [[ -z "$upnp_port" ]]; then + FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) + else + FLUX_PORT="$upnp_port" + fi + if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then + string_limit_check_mark "Port is valid..........................................." + break + else + string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." + sleep 1 + try=$(($try+1)) + if [[ "$try" -gt "3" ]]; then + echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" + echo -e "" + exit + fi + fi + done + if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then + sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + fi + else + insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," + echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ -d /home/$USER/.fluxbenchmark ]]; then + sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null + echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + else + echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + fi + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" + #API PORT + sudo ufw allow $FLUX_PORT > /dev/null 2>&1 + #HOME UI PORT + sudo ufw allow $(($FLUX_PORT-1)) > /dev/null 2>&1 + #if ! route -h > /dev/null 2>&1 ; then + # sudo apt install net-tools > /dev/null 2>&1 + #fi + #router_ip=$(route -n | sed -nr 's/(0\.0\.0\.0) +([^ ]+) +\1.*/\2/p' 2>/dev/null) + if [[ -z "$gateway_ip" ]]; then + router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + else + router_ip="$gateway_ip" + fi + if [[ "$router_ip" != "" ]]; then + if [[ -z "$gateway_ip" ]]; then + if (whiptail --yesno "Is your router's IP $router_ip ?" 8 70); then + is_correct="0" + fi + else + is_correct="0" + fi + if [[ "$is_correct" == "0" ]]; then + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + else + while true + do + + router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) + + if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then + echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + string_limit_x_mark "IP $router_ip is not valid ..............................." + sleep 1 + fi + + done + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + fi + else + while true + do + router_ip=$(whiptail --inputbox "Enter your router's IP" 8 60 3>&1 1>&2 2>&3) + if [[ "$router_ip" =~ ^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$ ]]; then + echo -e "${ARROW} ${CYAN}IP $router_ip format is valid........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + string_limit_x_mark "IP $router_ip is not valid ..............................." + sleep 1 + fi + done + sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 + sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 + sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 + sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 + fi + fi + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + sleep 200 + echo -e "${ARROW}${YELLOW} Checking FluxOS logs... ${NC}" + error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") + if [[ "$error_check" == "" ]]; then + echo -e "" + LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') + echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${LOCAL_IP}:$(($FLUX_PORT-1))${NC}" + echo -e "" + else + echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" + echo -e "" + fi +} #### MULTITOOLBOX OPTIONS SECTION function selfhosting() { if [[ "$1" != "install" ]]; then From 28b4a787623976a3b1077764e76a10db13574c0e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 12:38:14 +0200 Subject: [PATCH 0669/1176] added import for upnp --- multitoolbox.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e3fc8427..960d083a 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -55,6 +55,8 @@ function config_file() { index=$(cat /home/$USER/install_conf.json | jq -r '.index') zel_id=$(cat /home/$USER/install_conf.json | jq -r '.zelid') kda_address=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') + gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') echo -e "${ARROW} ${YELLOW}Install config summary:" if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then @@ -86,11 +88,8 @@ function config_file() { echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" fi - - if [[ ! -z $enable_upnp && ! -z $gateway_ip && ! -z $upnp_port ]]; then - echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" - echo -e "${CYAN} UPnP Port: ${GREEN}$upnp_port${NC}" - echo -e "${CYAN} Gateway IP: ${GREEN}$gateway_ip${NC}" + if [[ ! -z $gateway_ip && ! -z $upnp_port ]]; then + echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" fi fi } @@ -344,7 +343,6 @@ function create_config() { zelbench_update='0' fi if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then - enable_upnp='1' gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router)" 8 85 3>&1 1>&2 2>&3) upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ "Use the UP/DOWN arrows to highlight the port you want. Press Spacebar on the port you want to select, THEN press ENTER." 17 50 8 \ @@ -357,7 +355,6 @@ function create_config() { "16187" "" OFF \ "16197" "" OFF 3>&1 1>&2 2>&3) else - enable_upnp="0" gateway_ip="" upnp_port="" fi From 65df822c47da14d8b4fe0339de900937d76dbadf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 12:55:01 +0200 Subject: [PATCH 0670/1176] moved UPnP function --- flux_common.sh | 1 + multitoolbox.sh | 33 ++++++++++++++++----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index fa7cffa6..1d7e7120 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1294,6 +1294,7 @@ function upnp_enable() { echo -e "" fi } + #### MULTITOOLBOX OPTIONS SECTION function selfhosting() { if [[ "$1" != "install" ]]; then diff --git a/multitoolbox.sh b/multitoolbox.sh index 960d083a..f07b2463 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -342,23 +342,6 @@ function create_config() { zelcash_update='0' zelbench_update='0' fi - if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then - gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router)" 8 85 3>&1 1>&2 2>&3) - upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ - "Use the UP/DOWN arrows to highlight the port you want. Press Spacebar on the port you want to select, THEN press ENTER." 17 50 8 \ - "16127" "" ON \ - "16137" "" OFF \ - "16147" "" OFF \ - "16157" "" OFF \ - "16167" "" OFF \ - "16177" "" OFF \ - "16187" "" OFF \ - "16197" "" OFF 3>&1 1>&2 2>&3) - else - gateway_ip="" - upnp_port="" - fi - if whiptail --yesno "Would you like enable alert notification?" 8 65; then whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 sleep 1 @@ -491,6 +474,22 @@ function create_config() { sleep 1 fi fi + if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then + gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router)" 8 85 3>&1 1>&2 2>&3) + upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ + "Use the UP/DOWN arrows to highlight the port you want. Press Spacebar on the port you want to select, THEN press ENTER." 17 50 8 \ + "16127" "" ON \ + "16137" "" OFF \ + "16147" "" OFF \ + "16157" "" OFF \ + "16167" "" OFF \ + "16177" "" OFF \ + "16187" "" OFF \ + "16197" "" OFF 3>&1 1>&2 2>&3) + else + gateway_ip="" + upnp_port="" + fi firewall_disable='1' swapon='1' rm /home/$USER/install_conf.json > /dev/null 2>&1 From 8ec7637282edc63d319b5b5c425b151218bb81f6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 13:10:39 +0200 Subject: [PATCH 0671/1176] added router info --- multitoolbox.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f07b2463..339016a0 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -460,7 +460,7 @@ function create_config() { fi if [[ "$skip_bootstrap" == "0" ]]; then if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then - bootstrap_url="0" + bootstrap_url="" sleep 1 else bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) @@ -475,7 +475,8 @@ function create_config() { fi fi if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then - gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router)" 8 85 3>&1 1>&2 2>&3) + router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router: $router_ip)" 8 85 3>&1 1>&2 2>&3) upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ "Use the UP/DOWN arrows to highlight the port you want. Press Spacebar on the port you want to select, THEN press ENTER." 17 50 8 \ "16127" "" ON \ From f0b4c53d46d1a05141623bc0d486468d38921083 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 13:17:02 +0200 Subject: [PATCH 0672/1176] fix upnp port in config --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 1d7e7120..6791d5fb 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -224,7 +224,7 @@ function install_conf_create(){ "telegram_bot_token": "${telegram_bot_token}", "telegram_chat_id": "${telegram_chat_id}", "eps_limit": "${eps_limit}", - "upnp_port": "${FLUX_PORT}", + "upnp_port": "${upnp_port}", "gateway_ip": "${gateway_ip}" } EOF From 6743afe07670c2c7436a080af5eeb9f7ecfc8028 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 13:21:45 +0200 Subject: [PATCH 0673/1176] removed info duplication --- flux_common.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 6791d5fb..ee1487cf 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -399,12 +399,6 @@ function import_config_file() { echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi - if [[ "$discord" != "" && "$discord" != "0" ]] || [[ "$telegram_alert" == '1' ]]; then - echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi } function get_ip() { From 2bd800d29a431d75c521fa62574f9ac73af1e6b0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 13:56:11 +0200 Subject: [PATCH 0674/1176] Minor edits --- flux_common.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index ee1487cf..d83d0004 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1163,6 +1163,8 @@ function log_rotate() { } function upnp_enable() { try="0" + echo -e "" + echo -e "${ARROW}${YELLOW} Creating UPnP configuration...${NC}" if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" echo -e "" @@ -1170,7 +1172,7 @@ function upnp_enable() { fi while true do - echo -e "${ARROW}${YELLOW} Checking port validation.....${NC}" + echo -e "${ARROW}${CYAN} Checking port validation.....${NC}" # Check if upnp_port is set if [[ -z "$upnp_port" ]]; then FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) @@ -1208,7 +1210,7 @@ function upnp_enable() { fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" - echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" + echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark.....${NC}" #API PORT sudo ufw allow $FLUX_PORT > /dev/null 2>&1 #HOME UI PORT @@ -1276,7 +1278,7 @@ function upnp_enable() { sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 sleep 200 - echo -e "${ARROW}${YELLOW} Checking FluxOS logs... ${NC}" + echo -e "${ARROW}${CYAN} Checking FluxOS logs... ${NC}" error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") if [[ "$error_check" == "" ]]; then echo -e "" From 34ed9c2cfebd6433aa58e5102fdd514a5f2369d5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:34:50 +0200 Subject: [PATCH 0675/1176] Minor edits --- flux_common.sh | 2 +- multinode.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index d83d0004..743c73cc 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1277,7 +1277,7 @@ function upnp_enable() { fi sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 - sleep 200 + sleep 150 echo -e "${ARROW}${CYAN} Checking FluxOS logs... ${NC}" error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") if [[ "$error_check" == "" ]]; then diff --git a/multinode.sh b/multinode.sh index 908698be..5107530c 100644 --- a/multinode.sh +++ b/multinode.sh @@ -22,7 +22,7 @@ function upnp_disable() { echo -e "" sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 - sleep 200 + sleep 10 } CHOICE=$( From 3d4ed250b0677351ef15a93e4dd936b99f04a40d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:40:09 +0200 Subject: [PATCH 0676/1176] removed empty line --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 743c73cc..3cf2d0e9 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1392,8 +1392,8 @@ function multinode(){ echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" echo -e "" echo -e "${YELLOW}================================================================${NC}" - echo -e "" if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "" echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" echo -e "" From 91dc7f954eb4e4a5c3ecab238559678a489a2b69 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:47:17 +0200 Subject: [PATCH 0677/1176] changed display color --- multinode.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/multinode.sh b/multinode.sh index 5107530c..460dd68e 100644 --- a/multinode.sh +++ b/multinode.sh @@ -8,17 +8,18 @@ function upnp_disable() { exit fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - echo -e "${ARROW} ${CYAN}Removing FluxOS UPnP configuration.....${NC}" + echo -e "" + echo -e "${ARROW} ${YELLOW}Removing FluxOS UPnP configuration.....${NC}" sudo rm -rf /home/$USER/.fluxbenchmark/fluxbench.conf else - echo -e "${ARROW} ${YELLOW}UPnP Mode is already disabled...${NC}" + echo -e "${ARROW} ${CYAN}UPnP Mode is already disabled...${NC}" echo -e "" exit fi if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep 'apiport' | wc -l) == "1" ]]; then cat /home/$USER/zelflux/config/userconfig.js | sed '/apiport/d' | sudo tee "/home/$USER/zelflux/config/userconfig.js" > /dev/null fi - echo -e "${ARROW} ${YELLOW}Restarting FluxOS and Benchmark.....${NC}" + echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark.....${NC}" echo -e "" sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 From 175bb8de64d1818e1a632b5633774847aeb74ff5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:59:01 +0200 Subject: [PATCH 0678/1176] fix sync check and communication check --- nodeanalizerandfixer.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index ca473951..0e2fe9bf 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -401,9 +401,9 @@ if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" echo -e "${PIN} ${CYAN}Protocolversion: ${SEA}$protocolversion${NC}" echo -e "${PIN} ${CYAN}Connections: ${SEA}$connections${NC}" echo -e "${PIN} ${CYAN}Blocks: ${SEA}$blocks_hight${NC}" - network_height_01=$(curl -sk -m 5 https://$network/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) - network_height_03=$(curl -sk -m 5 https://explorer.zelcash.online/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) - explorer_network_hight=$(max "$network_height_01" "$network_height_03") + network_height_01=$(curl -sk -m 5 https://$network_url_1/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) + network_height_02=$(curl -sk -m 5 https://$network_url_2/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) + explorer_network_hight=$(max "$network_height_01" "$network_height_02") block_diff=$((explorer_network_hight-blocks_hight)) if [[ "$explorer_network_hight" != "0" ]]; then if [[ "$block_diff" < 10 ]]; then @@ -442,7 +442,7 @@ if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" zelnodeindex="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" fi fi - flux_communication=$(curl -SsL -m 10 http://"$WANIP":16127/flux/checkcommunication 2>/dev/null | jq -r .data.message 2>/dev/null) + flux_communication=$(curl -SsL -m 10 http://"$WANIP":"$FluxAPI"/flux/checkcommunication 2>/dev/null | jq -r .data.message 2>/dev/null) if [[ "$flux_communication" != "null" && "$flux_communication" != "" ]]; then echo -e "${BOOK} ${YELLOW}Checking FluxOS communication: ${NC}" echo -e "${ARROW} ${CYAN}$flux_communication${NC}" From 1e01cbb63d896a98a207080de6f7f2bd09b5368d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 15:19:35 +0200 Subject: [PATCH 0679/1176] renamed bootstrap function --- flux_common.sh | 2 +- install_pro.sh | 2 +- multitoolbox.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 3cf2d0e9..5650faa8 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -622,7 +622,7 @@ function cdn_speedtest() { fi #echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}$DOWNLOAD_URL${NC}" } -function bootstrap() { +function bootstrap_new() { echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" if ! wget --version > /dev/null 2>&1 ; then sudo apt install -y wget > /dev/null 2>&1 && sleep 2 diff --git a/install_pro.sh b/install_pro.sh index 0451edb7..c51df725 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -861,7 +861,7 @@ create_conf install_daemon zk_params if [[ "$BOOTSTRAP_SKIP" == "0" ]]; then - bootstrap "install" + bootstrap_new "install" fi create_service_scripts create_service "install" diff --git a/multitoolbox.sh b/multitoolbox.sh index 339016a0..701486b5 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -701,7 +701,7 @@ function flux_daemon_bootstrap() { cd echo -e "${NC}" config_veryfity - bootstrap + bootstrap_new } function install_node(){ echo -e "${GREEN}Module: Install FluxNode${NC}" From 6136879142f2fa204e3fb8f8028f514b1fec9ff5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 15:45:46 +0200 Subject: [PATCH 0680/1176] added ctrl_c trap --- multitoolbox.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 701486b5..5a052d3f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,5 +1,14 @@ #!/bin/bash +trap ctrl_c INT + +function ctrl_c() { + echo -e "Cleaning branch variable..." + echo -e "" + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCED +} + if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" From 96d42409f93d61fd6e0460c9f4ec5bbc45def1ff Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:08:38 +0200 Subject: [PATCH 0681/1176] update trap --- multitoolbox.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5a052d3f..d0c96865 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -3,10 +3,12 @@ trap ctrl_c INT function ctrl_c() { - echo -e "Cleaning branch variable..." + echo -e "" + echo -e " Cleaning branch variable..." echo -e "" unset ROOT_BRANCH - unset BRANCH_ALREADY_REFERENCED + unset BRANCH_ALREADY_REFERENCE + exit } if ! [[ -z $1 ]]; then From 070436e67717ff7b33d0e7d659bea474ec20ab82 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:03:48 +0200 Subject: [PATCH 0682/1176] fix for option 5 --- flux_common.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 5650faa8..c1d96ee3 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -662,15 +662,26 @@ function bootstrap_new() { echo -e "" return 1 fi + if [[ "$Mode" != "install" ]]; then + stop_service + fi echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" else + if [[ "$Mode" != "install" ]]; then + stop_service + fi DOWNLOAD_URL="$bootstrap_url" echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" fi + + if [[ "$Mode" != "install" ]]; then + start_service + fi + if [[ -z "$bootstrap_zip_del" ]]; then rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 else From 2e29f5fb358723286416b8801b2d834556da41e4 Mon Sep 17 00:00:00 2001 From: Goldie <96921031+GGoldie@users.noreply.github.com> Date: Wed, 7 Sep 2022 22:43:42 +0100 Subject: [PATCH 0683/1176] Typo fixed Line 82 "Diuring re-installation old chain will be use" changed to "During re-installation old chain will be used" --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d0c96865..85f5390d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -79,7 +79,7 @@ function config_file() { fi if [[ "$use_old_chain" == "1" ]]; then - echo -e "${PIN}${CYAN}Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${PIN}${CYAN}During re-installation old chain will be used....................[${CHECK_MARK}${CYAN}]${NC}" else if [[ "$bootstrap_url" == "" || "$bootstrap_url" == "0" ]]; then echo -e "${PIN}${CYAN}Use Flux Bootstrap from source build in scripts..................[${CHECK_MARK}${CYAN}]${NC}" From 4a4f2210aa5a8d1fb0f0b69ad79d3f21cbfcca19 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 8 Sep 2022 00:52:01 +0200 Subject: [PATCH 0684/1176] added node reconfiguration from install config --- flux_common.sh | 222 +++++++++++++++++++++++++++++++++++++++++------- multitoolbox.sh | 214 ++++++++++++---------------------------------- 2 files changed, 247 insertions(+), 189 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index c1d96ee3..c3d01367 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -363,42 +363,42 @@ function import_config_file() { telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') - - echo -e "" - echo -e "${ARROW} ${YELLOW}Install config:" - if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then - echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - if [[ "$import_settings" == "1" ]]; then - echo -e "${PIN}${CYAN} Import installation configurations...............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi - - if [[ "$use_old_chain" == "1" ]]; then - echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then - echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in script............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + if [[ "$1" != "silent" ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Install config:" + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then + echo -e "${PIN}${CYAN} Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else - echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + if [[ "$import_settings" == "1" ]]; then + echo -e "${PIN}${CYAN} Import installation configurations...............................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi fi - if [[ "$bootstrap_zip_del" == "1" || -z "$bootstrap_zip_del" ]]; then - echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + + if [[ "$use_old_chain" == "1" ]]; then + echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else - echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in script............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + if [[ "$bootstrap_zip_del" == "1" || -z "$bootstrap_zip_del" ]]; then + echo -e "${PIN}${CYAN} Remove Flux daemon bootstrap archive file........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Leave Flux daemon bootstrap archive file.........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi fi - fi - - if [[ ! -z "$gateway_ip" && ! -z "$upnp_port" ]]; then - echo -e "${PIN}${CYAN} Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ "$discord" != "" && "$discord" != "0" ]] || [[ "$telegram_alert" == '1' ]]; then - echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - else - echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi + if [[ ! -z "$gateway_ip" && ! -z "$upnp_port" ]]; then + echo -e "${PIN}${CYAN} Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$discord" != "" && "$discord" != "0" ]] || [[ "$telegram_alert" == '1' ]]; then + echo -e "${PIN}${CYAN} Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + else + echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi fi } function get_ip() { @@ -529,6 +529,166 @@ function create_swap() { fi sleep 2 } +######### EDIT FUNCTION +function daemon_reconfiguration(){ + echo -e "${GREEN}Module: Flux Daemon Reconfiguration${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + config_veryfity + echo -e "" + echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" + sleep 2 + skip_change='3' + zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" + sleep 1 + zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3)" + sleep 1 + zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" + sleep 1 + if [[ "$zelnodeprivkey" == "" ]]; then + skip_change=$((skip_change-1)) + echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$zelnodeoutpoint" == "" ]]; then + skip_change=$((skip_change-1)) + echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$zelnodeindex" == "" ]]; then + skip_change=$((skip_change-1)) + echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$skip_change" == "0" ]]; then + echo -e "${ARROW} ${YELLOW}All fields are empty changes skipped...${NC}" + echo + exit + fi + echo -e "${ARROW} ${CYAN}Stopping Flux daemon service...${NC}" + sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 + sudo fuser -k 16125/tcp > /dev/null 2>&1 + if [[ "$zelnodeprivkey" != "" ]]; then + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode identity key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi + + if [[ "$zelnodeoutpoint" != "" ]]; then + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode outpoint replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi + + if [[ "$zelnodeindex" != "" ]]; then + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + fi + pm2 restart flux > /dev/null 2>&1 + sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 + NUM='35' + MSG1='Restarting daemon service...' + MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo -e "" && echo -e "" +} +function replace_kadena { + + if [[ -z "$KDA_A" ]]; then + while true + do + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + KDA_A=$(grep -Eo "^k:[0-9a-z]{64}\b" <<< "$KDA_A") + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + sleep 2 + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + fi + kda_address="kadena:$KDA_A?chainid=0" + if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then + sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Kadena address replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + fi + else + insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "kadena: '$kda_address'," + echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" + fi +} +function replace_zelid() { + while true + do + new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + done + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" + else + sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi +} +function fluxos_reconfiguration { + echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + if ! [[ -f /home/$USER/zelflux/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}FluxOS userconfig.js not exist, operation aborted${NC}" + echo -e "" + exit + fi + CHOICE=$( + whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ + "1)" "Replace ZELID" \ + "2)" "Add/Replace kadena address" 3>&2 2>&1 1>&3 + ) + case $CHOICE in + "1)") + replace_zelid + ;; + "2)") + replace_kadena + ;; + esac +} ######### BOOTSTRAP SECTION ############################ function tar_file_unpack() { echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" @@ -1172,6 +1332,7 @@ function log_rotate() { EOF sudo chown root:root /etc/logrotate.d/$2 } +#### UPnP function upnp_enable() { try="0" echo -e "" @@ -1301,7 +1462,6 @@ function upnp_enable() { echo -e "" fi } - #### MULTITOOLBOX OPTIONS SECTION function selfhosting() { if [[ "$1" != "install" ]]; then diff --git a/multitoolbox.sh b/multitoolbox.sh index d0c96865..8f89c1fb 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -840,164 +840,6 @@ function install_docker(){ su - $usernew fi } -function daemon_reconfiguration(){ - echo -e "${GREEN}Module: Flux Daemon Reconfiguration${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - config_veryfity - echo -e "" - echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" - sleep 2 - skip_change='3' - zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" - sleep 1 - zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3)" - sleep 1 - zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" - sleep 1 - if [[ "$zelnodeprivkey" == "" ]]; then - skip_change=$((skip_change-1)) - echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ "$zelnodeoutpoint" == "" ]]; then - skip_change=$((skip_change-1)) - echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ "$zelnodeindex" == "" ]]; then - skip_change=$((skip_change-1)) - echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ "$skip_change" == "0" ]]; then - echo -e "${ARROW} ${YELLOW}All fields are empty changes skipped...${NC}" - echo - exit - fi - echo -e "${ARROW} ${CYAN}Stopping Flux daemon service...${NC}" - sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 - sudo fuser -k 16125/tcp > /dev/null 2>&1 - if [[ "$zelnodeprivkey" != "" ]]; then - if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode identity key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - fi - - if [[ "$zelnodeoutpoint" != "" ]]; then - if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode outpoint replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - fi - - if [[ "$zelnodeindex" != "" ]]; then - if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - fi - pm2 restart flux > /dev/null 2>&1 - sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 - NUM='35' - MSG1='Restarting daemon service...' - MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo -e "" && echo -e "" -} -function replace_kadena { - - while true - do - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - KDA_A=$(grep -Eo "^k:[0-9a-z]{64}\b" <<< "$KDA_A") - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - kda_address="kadena:$KDA_A?chainid=0" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then - sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Kadena address replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" - fi - else - insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "kadena: '$kda_address'," - echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" - fi -} -function replace_zelid() { - while true - do - new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then - string_limit_check_mark "Zel ID is valid..........................................." - break - else - string_limit_x_mark "Zel ID is not valid try again..........................................." - sleep 2 - fi - done - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi -} -function fluxos_reconfiguration { - echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - if ! [[ -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}FluxOS userconfig.js not exist, operation aborted${NC}" - echo -e "" - exit - fi - CHOICE=$( - whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ - "1)" "Replace ZELID" \ - "2)" "Add/Replace kadena address" 3>&2 2>&1 1>&3 - ) - case $CHOICE in - "1)") - replace_zelid - ;; - "2)") - replace_kadena - ;; - esac -} function install_watchtower(){ echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1058,6 +900,46 @@ function mongod_db_fix() { sudo systemctl start mongod echo -e "" } +function node_reconfiguration() { + reset="" + if [[ -f /home/$USER/install_conf.json ]]; then + import_config_file + get_ip + if [[ -d /home/$USER/zelflux ]]; then + echo -e "${ARROW} ${CYAN}Creating FluxOS config file...${NC}" + sudo rm -rf /home/$USER/zelflux/config/userconfig.js > /dev/null 2>&1 + fluxos_conf_create + reset=0 + fi + if [[ -d /home/$USER/.flux ]]; then + echo -e "${ARROW} ${CYAN}Creating Daemon config file...${NC}" + sudo rm -rf /home/$USER/.flux/flux.conf > /dev/null 2>&1 + flux_daemon_conf_create + reset=0 + fi + if [[ -d /home/$USER/watchdog ]]l; then + echo -e "${ARROW} ${CYAN}Creating Watchdog config file...${NC}" + sudo rm -rf /home/$USER/watchdog/config.js > /dev/null 2>&1 + watchdog_conf_create + reset=0 + fi + if [[ -d /home/$USER/.flux ]]; then + if [[ ! -z "$upnp_port" && ! -z "$gateway_ip" ]]; then + reset=1 + upnp_enable + fi + fi + if [[ "$reset" == "0" ]]; then + echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark...${NC}" + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + sleep 10 + fi + else + echo -e "${ARROW} ${CYAN}Install config not exist, operation aborted...${NC}" + echo -e "" + fi +} if ! figlet -v > /dev/null 2>&1; then sudo apt-get update -y > /dev/null 2>&1 @@ -1114,6 +996,7 @@ echo -e "${CYAN}11 - FluxOS reconfiguration ${NC}" echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${CYAN}13 - Recover corrupted MongoDB database${NC}" echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Router with UPNP support) ${NC}" +echo -e "${CYAN}15 - Node reconfiguration from install config${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -1192,6 +1075,21 @@ case "$REPLY" in sleep 1 multinode echo -e "" + ;; + 15) + clear + sleep 1 + echo -e "${GREEN}Module: Node reconfiguration from install config${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + node_reconfiguration + echo -e "" ;; esac # USED FOR CLEANUP AT END OF SCRIPT From 73acbb7dfb16d0a6bf8cffbdc0fd139807e53739 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 8 Sep 2022 00:55:56 +0200 Subject: [PATCH 0685/1176] added silent mode to import config file --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8f89c1fb..2a70d1c6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -903,7 +903,7 @@ function mongod_db_fix() { function node_reconfiguration() { reset="" if [[ -f /home/$USER/install_conf.json ]]; then - import_config_file + import_config_file "silent" get_ip if [[ -d /home/$USER/zelflux ]]; then echo -e "${ARROW} ${CYAN}Creating FluxOS config file...${NC}" From 8267ea4b51a60636665f915df35b3c6d4b5013b1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 8 Sep 2022 00:58:10 +0200 Subject: [PATCH 0686/1176] fix conditional --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 2a70d1c6..d77ef33b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -917,7 +917,7 @@ function node_reconfiguration() { flux_daemon_conf_create reset=0 fi - if [[ -d /home/$USER/watchdog ]]l; then + if [[ -d /home/$USER/watchdog ]]; then echo -e "${ARROW} ${CYAN}Creating Watchdog config file...${NC}" sudo rm -rf /home/$USER/watchdog/config.js > /dev/null 2>&1 watchdog_conf_create From 2cdad0d2488495885a095d3057468e729511de2d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 8 Sep 2022 01:25:03 +0200 Subject: [PATCH 0687/1176] Minior edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d77ef33b..086b1d04 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -936,7 +936,7 @@ function node_reconfiguration() { sleep 10 fi else - echo -e "${ARROW} ${CYAN}Install config not exist, operation aborted...${NC}" + echo -e "${ARROW} ${CYAN}Install config file not exist, operation aborted...${NC}" echo -e "" fi } From 38268544738df15bd8b38b50f6dcb98c231be4cc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 8 Sep 2022 07:31:12 +0200 Subject: [PATCH 0688/1176] Added missing info for daemon config --- flux_common.sh | 5 +++++ install_pro.sh | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index c3d01367..c31dc7f9 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -25,6 +25,9 @@ failed_counter="0" network_url_1="explorer.zelcash.online" network_url_2="explorer.runonflux.io" network_url_3="blockbook.zel.network" +#Ports +RPCPORT=16124 +PORT=16125 #dialog color export NEWT_COLORS=' title=black, @@ -70,6 +73,8 @@ function fluxos_conf_create(){ EOF } function flux_daemon_conf_create() { + RPCUSER=$(pwgen -1 8 -n) + PASSWORD=$(pwgen -1 20 -n) touch /home/$USER/$CONFIG_DIR/$CONFIG_FILE cat <<- EOF > /home/$USER/$CONFIG_DIR/$CONFIG_FILE rpcuser=$RPCUSER diff --git a/install_pro.sh b/install_pro.sh index c51df725..d13b0c49 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -24,8 +24,7 @@ ZELFRONTPORT=16126 LOCPORT=16127 ZELNODEPORT=16128 #MDBPORT=27017 -RPCPORT=16124 -PORT=16125 + function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then @@ -520,16 +519,11 @@ function create_conf() { echo -e "${ARROW} ${CYAN}Existing conf file found backing up to $COIN_NAME.old ...${NC}" mv ~/$CONFIG_DIR/$CONFIG_FILE ~/$CONFIG_DIR/$COIN_NAME.old; fi - RPCUSER=$(pwgen -1 8 -n) - PASSWORD=$(pwgen -1 20 -n) if [[ "$IMPORT_ZELCONF" == "0" ]]; then zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) fi - if [ "x$PASSWORD" = "x" ]; then - PASSWORD=${WANIP}-$(date +%s) - fi mkdir /home/$USER/$CONFIG_DIR > /dev/null 2>&1 flux_daemon_conf_create if [[ "$IMPORT_ZELID" == "0" ]]; then From 1c719c092d37e1546a7ba3444d52cfd3635cf656 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 8 Sep 2022 08:01:31 +0200 Subject: [PATCH 0689/1176] added wallet and fluxos variable --- flux_common.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index c31dc7f9..5aa16cf5 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -25,6 +25,12 @@ failed_counter="0" network_url_1="explorer.zelcash.online" network_url_2="explorer.runonflux.io" network_url_3="blockbook.zel.network" +#Wallet variable +COIN_NAME='flux' +CONFIG_DIR='.flux' +CONFIG_FILE='flux.conf' +#FluxOS variablu +FLUX_DIR='zelflux' #Ports RPCPORT=16124 PORT=16125 From a4668f539d0f256cdd2ce2dde8d39638d6088d88 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 8 Sep 2022 08:02:20 +0200 Subject: [PATCH 0690/1176] fix typo --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 5aa16cf5..752a97f4 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -29,7 +29,7 @@ network_url_3="blockbook.zel.network" COIN_NAME='flux' CONFIG_DIR='.flux' CONFIG_FILE='flux.conf' -#FluxOS variablu +#FluxOS variable FLUX_DIR='zelflux' #Ports RPCPORT=16124 From e41d8c728a47ffa2385d64a321df0a5c02632504 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 8 Sep 2022 19:43:16 +0200 Subject: [PATCH 0691/1176] improved node reconfiguration and bug fix --- flux_common.sh | 4 ++++ multitoolbox.sh | 25 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 752a97f4..9049d061 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -353,14 +353,17 @@ function integration_check() { function import_config_file() { if [[ -f /home/$USER/install_conf.json ]]; then import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + #Daemon bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') index=$(cat /home/$USER/install_conf.json | jq -r '.index') + #FluxOS ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + #WatchDog fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') @@ -372,6 +375,7 @@ function import_config_file() { telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') + #UPnP upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') if [[ "$1" != "silent" ]]; then diff --git a/multitoolbox.sh b/multitoolbox.sh index 086b1d04..bcc3b246 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -905,17 +905,24 @@ function node_reconfiguration() { if [[ -f /home/$USER/install_conf.json ]]; then import_config_file "silent" get_ip - if [[ -d /home/$USER/zelflux ]]; then - echo -e "${ARROW} ${CYAN}Creating FluxOS config file...${NC}" - sudo rm -rf /home/$USER/zelflux/config/userconfig.js > /dev/null 2>&1 - fluxos_conf_create - reset=0 + if [[ -d /home/$USER/zelflux ]]; then + if [[ "$KDA_A" != "" && "$ZELID" != "" ]]; then + echo -e "${ARROW} ${CYAN}Creating FluxOS config file...${NC}" + sudo rm -rf /home/$USER/zelflux/config/userconfig.js > /dev/null 2>&1 + fluxos_conf_create + reset=0 + fi fi if [[ -d /home/$USER/.flux ]]; then - echo -e "${ARROW} ${CYAN}Creating Daemon config file...${NC}" - sudo rm -rf /home/$USER/.flux/flux.conf > /dev/null 2>&1 - flux_daemon_conf_create - reset=0 + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]]; then + zelnodeprivkey="$prvkey" + zelnodeoutpoint="$outpoint" + zelnodeindex="$index" + echo -e "${ARROW} ${CYAN}Creating Daemon config file...${NC}" + sudo rm -rf /home/$USER/.flux/flux.conf > /dev/null 2>&1 + flux_daemon_conf_create + reset=0 + fi fi if [[ -d /home/$USER/watchdog ]]; then echo -e "${ARROW} ${CYAN}Creating Watchdog config file...${NC}" From 6b0d9ed713ce78edc9953175f09bc4349beaa8de Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 13 Sep 2022 16:12:35 +0200 Subject: [PATCH 0692/1176] Add files via upload --- image/development.jpg | Bin 0 -> 115206 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 image/development.jpg diff --git a/image/development.jpg b/image/development.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0473a31d44f2d72a4cff789bd252dfa758211b3b GIT binary patch literal 115206 zcmeFZ2UL^mwk{kMMHEGPQ&6gO=^X^5ODCa(A|f>c(mPQQkS--4T}tQyX$c*r3J6Gt z(4_a?LJK$Ueeb#F?7f%6yT-o%IQJjxBkve6Nb=43&iOp^dE0j}dhr8rM@2zd0dVQk zCBQS>58z@PAP2a7>C(^F|GchTz4G(AhKG0MD*iQm{GaVQ!A*ke*Kb_M$G>sw#*LeV zxC@`)HqkA@+dqH*`6WL;{_|6~7vXjM>p$P|e|BAb1`uDrw0ybZ$|VNCW#UU$h%a5V z0O$dLOILB${xtZ1UY9Ok!Ml15XVQ(ExHnYZ!I^*M%4M9fSMl(0@Ak$0AAm=EmE-}h z%r#OiGkgX|GQKy_8P^$QOTUn7_iZ!rKX>vcxIsZlMNP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l;J|Thf`Z ztF3t$WM<n2{ycrTMF{{8<dn+2*qJ)mZcmlTn)J?6T$p-C!K*g{9#zg?lV#tT^jAyC z9>4Eu5$uSXe+!(`WNXqpwc*f}pQTgF%1f#217RV|rAkzv2b@F}XJ{_#A7jc)12U4J zj$NWG1=|6zGm@{P%|#d@Hkj~G<_9~-V>RlU;)^t6opNUTg4-i4%T)aX5e^L1i2Gwq z-nmG525-l{W;(4;8GS2Ye(#NRDdUIpoR+ao`*}~!*M=e3+BmW?jA0!iL%F_`s04_J zFr6r)zrotY^&xfcxb2S>8L7JD3+d}KA-Sskae+n(EjIk$BLcI(zm2#zX4!6{>j0Z> zx~;(5QBCM8UFx+|>wRRK`XOTAv++rcoK{iU=l~0^PAJ$S4-;#vqd+M`JCHtS4ZUnY zF-e?xg@WtM!(%&yLlT;FKGQQT<J#;sRq!iyXI*Zc&)@91{ao7aUaNDg-$xbEfyh(9 z;q#r9%REHMrro2k3uZuv==$xBFNunEb!n@2hLIJEX;PkHU8>alD(fF5LS6U8+M1l$ zz-50q-u|E}v*I&B`_7L+cL8CX@8X*tY+-=5J_rQFCa~4&OW^`PR-%ARm;cAT|3#Y1 z@qh9A12E8Ej@RT3RtSQ1Z2S%eAkY2?-eosp*)P3|IDr2B|1&QqU?Asp!vAtOlm2oT Ss9Pso<jDVj=XL1s<bMH(vJ~n7 literal 0 HcmV?d00001 From 1f002675c31354f87e656cc3a6948839c4c20740 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 13 Sep 2022 16:18:25 +0200 Subject: [PATCH 0693/1176] bump version --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index bcc3b246..f981f02f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -35,7 +35,7 @@ fi FLUX_DIR='zelflux' FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' -dversion="v7.3" +dversion="v7.4" PM2_INSTALL="0" zelflux_setting_import="0" From f0ec9a856f6efe00057d77f9e8d4c671b4deb41c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 13 Sep 2022 16:58:29 +0200 Subject: [PATCH 0694/1176] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d9ccf6b9..d3bb4cea 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ```bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` <b>2) MENU:</b> -![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/update_menu.png) +![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/development.jpg) <b>3) HOW USE MULTITOOLBOX TO SETUP FLUXNODE:</b> https://medium.com/zelinsights/zelnode-setup-the-easy-peasy-lemon-squeezy-way-fd89706ea03c <br> From 9ea2ba9b72b760febb28a278cf99b54db55bf2f0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 14 Sep 2022 00:48:01 +0200 Subject: [PATCH 0695/1176] added missing function --- apps_info.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps_info.sh b/apps_info.sh index f453fc73..cb7d2cba 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -12,6 +12,17 @@ else export ROOT_BRANCH='master' fi +function max(){ + m="0" + for n in "$@" + do + if egrep -o "^[0-9]+$" <<< "$n" &>/dev/null; then + [ "$n" -gt "$m" ] && m="$n" + fi + done + echo "$m" +} + network_url_1="explorer.zelcash.online" network_url_2="explorer.runonflux.io" @@ -45,4 +56,4 @@ do fi done unset ROOT_BRANCH -unset BRANCH_ALREADY_REFERENCED \ No newline at end of file +unset BRANCH_ALREADY_REFERENCED From f08363c3212e045ac75e709f8cd717263ce17ae2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 14 Sep 2022 00:54:45 +0200 Subject: [PATCH 0696/1176] Update apps_info.sh --- apps_info.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/apps_info.sh b/apps_info.sh index cb7d2cba..189ce017 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -26,6 +26,7 @@ function max(){ network_url_1="explorer.zelcash.online" network_url_2="explorer.runonflux.io" +apps_info=$(curl -SsL -m 10 https://api.runonflux.io/apps/globalappsspecifications) name=($(jq -r .data[].name <<< "$apps_info")) height=($(jq -r .data[].height <<< "$apps_info")) network_height_01=$(curl -sk -m 5 https://$network_url_1/api/status?q=getInfo | jq '.info.blocks') From 04c8d13456a45c96ad360f4409c767d59393c779 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 14 Sep 2022 11:14:08 +0200 Subject: [PATCH 0697/1176] fix kadena address variable and additional regex --- multitoolbox.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f981f02f..3ef103c2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -333,9 +333,10 @@ function create_config() { while true do KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + KDA_A=$(grep -Eo "^k:[0-9a-z]{64}\b" <<< "$KDA_A") if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=0" + kda_address="kadena:$KDA_A?chainid=0" sleep 2 break else From 4a70edf91910e69973d6606dedaf608aee1e8829 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 14 Sep 2022 12:00:49 +0200 Subject: [PATCH 0698/1176] enabled fix action as default --- multitoolbox.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3ef103c2..45152926 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -926,9 +926,10 @@ function node_reconfiguration() { fi fi if [[ -d /home/$USER/watchdog ]]; then - echo -e "${ARROW} ${CYAN}Creating Watchdog config file...${NC}" + echo -e "${ARROW} ${CYAN}Creating Watchdog config file...${NC}" sudo rm -rf /home/$USER/watchdog/config.js > /dev/null 2>&1 - watchdog_conf_create + fix_action='1' + watchdog_conf_create reset=0 fi if [[ -d /home/$USER/.flux ]]; then From d3effd6d5ae3906d8e75c080a4b575b25b2414b3 Mon Sep 17 00:00:00 2001 From: Tadeas Kmenta <tadeas.kmenta@zel.cash> Date: Tue, 20 Sep 2022 15:41:24 +0700 Subject: [PATCH 0699/1176] use also github apt --- install_pro.sh | 5 ++++- install_pro_testnet.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index d13b0c49..1cebafb1 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -560,7 +560,8 @@ function install_daemon() { sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "xenial" ]]; then - echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 if ! gpg --list-keys Zel > /dev/null; then @@ -578,8 +579,10 @@ function install_daemon() { sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "impish" ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 fi # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index ef253626..a2e954a9 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -697,7 +697,8 @@ function install_daemon() { if [[ "$(lsb_release -cs)" == "xenial" ]]; then - echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 @@ -722,8 +723,10 @@ else if [[ "$(lsb_release -cs)" == "impish" ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 fi From 502193391695b68f1771ec8f8b2e89258db84d7c Mon Sep 17 00:00:00 2001 From: Tadeas Kmenta <tadeas.kmenta@zel.cash> Date: Tue, 20 Sep 2022 17:12:58 +0700 Subject: [PATCH 0700/1176] overwrite with github apt --- install_pro.sh | 4 ++-- install_pro_testnet.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 1cebafb1..b6b51688 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -579,10 +579,10 @@ function install_daemon() { sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "impish" ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 fi # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index a2e954a9..cb25c09b 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -723,10 +723,10 @@ else if [[ "$(lsb_release -cs)" == "impish" ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 fi From fb17d847bb8da1378b0281966918c0d392c384a2 Mon Sep 17 00:00:00 2001 From: TheTrunk <TheTrunk@users.noreply.github.com> Date: Tue, 20 Sep 2022 17:17:17 +0700 Subject: [PATCH 0701/1176] fastgit --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d3bb4cea..ea5295bc 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ <b>1) HOW RUN SCRIPT</b> ```bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` +Note: If you are having difficulties, try fastgit.org provider +```bash -i <(curl -s https://raw.fastgit.org/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` + <b>2) MENU:</b> ![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/development.jpg) From 11031251c2122d5a60a408859be63336849cef6c Mon Sep 17 00:00:00 2001 From: TheTrunk <TheTrunk@users.noreply.github.com> Date: Tue, 20 Sep 2022 17:17:27 +0700 Subject: [PATCH 0702/1176] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ea5295bc..d4beeaab 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ ```bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` Note: If you are having difficulties, try fastgit.org provider + ```bash -i <(curl -s https://raw.fastgit.org/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` <b>2) MENU:</b> From d514e676ebe02cd989ee3741162ab02ff9c1c103 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 20 Sep 2022 13:13:38 +0200 Subject: [PATCH 0703/1176] Create remote_call.sh --- remote_call.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 remote_call.sh diff --git a/remote_call.sh b/remote_call.sh new file mode 100644 index 00000000..3ad54e14 --- /dev/null +++ b/remote_call.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo +echo "# arguments called with ----> ${@} " +echo "# \$1 ----------------------> $1 " +echo "# \$2 ----------------------> $2 " +echo "# path to me ---------------> ${0} " +echo "# parent path --------------> ${0%/*} " +echo "# my name ------------------> ${0##*/} " +echo +exit From c250238f38784fc05046e78ec80d93ad582d6d8d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 20 Sep 2022 13:20:02 +0200 Subject: [PATCH 0704/1176] Update remote_call.sh --- remote_call.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/remote_call.sh b/remote_call.sh index 3ad54e14..f7434c54 100644 --- a/remote_call.sh +++ b/remote_call.sh @@ -2,6 +2,7 @@ echo echo "# arguments called with ----> ${@} " +echo "# \$0 ----------------------> $0 " echo "# \$1 ----------------------> $1 " echo "# \$2 ----------------------> $2 " echo "# path to me ---------------> ${0} " From eb03a85c1d47cd3e38f524d88b7f22f9f66e9e0c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 20 Sep 2022 19:45:00 +0200 Subject: [PATCH 0705/1176] disabled runonflux.github.io repo --- install_pro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index b6b51688..6c7bc40c 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -579,10 +579,10 @@ function install_daemon() { sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "impish" ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 fi # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 From 0227e9ad3fb991a393e76e49dad5c4a415690b65 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 20 Sep 2022 19:45:50 +0200 Subject: [PATCH 0706/1176] disabled repo --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 6c7bc40c..e6c10a8d 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -561,7 +561,7 @@ function install_daemon() { sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "xenial" ]]; then echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + #echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 if ! gpg --list-keys Zel > /dev/null; then From ab8c942a5976f5e67eb22a5b111174d097754016 Mon Sep 17 00:00:00 2001 From: Coder of Stuff <coderofstuff@gmail.com> Date: Wed, 28 Sep 2022 18:35:55 -0600 Subject: [PATCH 0707/1176] Remove extra source list entry for focal During the Flux Daemon && Benchmark installing step the extra line for the apt source will make installing fluxbench error out. Removing this extra line fixes that. --- install_pro_testnet.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index cb25c09b..ac760de6 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -726,7 +726,6 @@ else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 fi From f05364bf6875e5a5472a97838ecfce13d276e3bd Mon Sep 17 00:00:00 2001 From: Coder of Stuff <coderofstuff@gmail.com> Date: Wed, 28 Sep 2022 22:03:22 -0600 Subject: [PATCH 0708/1176] Add install parameter to testnet create_service Without this parameter, the create_service function will delete the scripts needed to start the daemon --- install_pro_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index ac760de6..4cea1a9f 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1402,7 +1402,7 @@ else # bootstrap # fi create_service_scripts - create_service + create_service "install" # if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then # echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" From f9802562eee1c33fd549cb881d5f99461ce24434 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 29 Sep 2022 12:08:09 +0200 Subject: [PATCH 0709/1176] added apt.fluxos.network --- install_pro.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index e6c10a8d..cb702ecf 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -560,7 +560,7 @@ function install_daemon() { sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "xenial" ]]; then - echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 #echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 @@ -578,10 +578,10 @@ function install_daemon() { fi sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "impish" ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 fi # downloading key && save it as keyring From 608052c4c79f49dc7f68236c1992b02026761ff5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 29 Sep 2022 17:47:34 +0200 Subject: [PATCH 0710/1176] Update flux_common.sh --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 9049d061..1e5d7549 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1389,7 +1389,7 @@ function upnp_enable() { insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" fi - if [[ -d /home/$USER/.fluxbenchmark ]]; then + if [[ ! -d /home/$USER/.fluxbenchmark ]]; then sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null else From b87dc7373078bd93171f95ee5e23b8ee06e09491 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 30 Sep 2022 10:39:04 +0200 Subject: [PATCH 0711/1176] improved selfhosting - added config file for device name --- flux_common.sh | 81 +++++++++++++++++++++++++++++++++++++------------ multitoolbox.sh | 2 +- 2 files changed, 63 insertions(+), 20 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 1e5d7549..3c436878 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1478,26 +1478,62 @@ function upnp_enable() { fi } #### MULTITOOLBOX OPTIONS SECTION -function selfhosting() { - if [[ "$1" != "install" ]]; then - echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" +function selfhosting_creator(){ + + echo -e "${GREEN}Module: Self-hosting ip cron service${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - fi + echo -e "${NC}" + exit + fi + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" + CHOICE=$( + whiptail --title "FluxOS Selfhosting Configuration" --menu "Make your choice" 15 40 6 \ + "1)" "Auto detection (Recommended)" \ + "2)" "Device - create config" 3>&2 2>&1 1>&3 + ) + case $CHOICE in + "1)") + selfhosting + ;; + "2)") + device_setup=$(whiptail --inputbox "Enter your device name" 8 60 3>&1 1>&2 2>&3) + if [[ "$device_setup" != "" ]]; then + if [[ ! -f /home/$USER/device_conf.json ]]; then + echo "{}" > device_conf.json + fi + echo "$(jq -r --arg value "$device_setup" 'device_name=$value' device_conf.json)" > device_conf.json + echo -e "${ARROW} ${CYAN}Config created successful, path: /home/$USER/device_conf.json, device name: $device_setup" + echo -e "" + fi + selfhosting + ;; + esac +} + +function selfhosting() { + if [[ "$1" == "install" ]]; then + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" + fi + echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 if [[ "$1" != "install" ]]; then get_ip fi - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + + if [[ -z "$device_setup" ]]; then + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + else + device_name="$device_setup" + fi + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name:0 > /dev/null 2>&1 + sudo ip addr add $WANIP dev $device_name > /dev/null 2>&1 else echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 echo -e "" @@ -1509,6 +1545,7 @@ function selfhosting() { sudo chown $USER:$USER /home/$USER/ip_check.sh cat <<-'EOF' > /home/$USER/ip_check.sh #!/bin/bash + function get_ip(){ WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') if [[ "$WANIP" == "" || "$WANIP" = *html* ]]; then @@ -1518,20 +1555,26 @@ function selfhosting() { WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') fi } + + get_ip + if [[ -f /home/$USER/device_conf.json ]]; then + device_name=$(jq -r .device_name /home/$USER/device_conf.json) + echo -e "Device from config, name: $device_name" >> /home/$USER/ip_history.log + else + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + echo -e "Device auto detection, name $device_name" >> /home/$USER/ip_history.log + fi + if [[ $1 == "restart" ]]; then #give 3min to connect with internet sleep 180 - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') if [[ "$device_name" != "" && "$WANIP" != "" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + sudo ip addr add $WANIP dev $device_name && sleep 2 fi fi if [[ $1 == "ip_check" ]]; then - get_ip - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') if [[ "$api_port" == "" ]]; then api_port="16127" @@ -1541,7 +1584,7 @@ function selfhosting() { if [[ "$WANIP" != "$confirmed_ip" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log - sudo ip addr add $WANIP dev $device_name:0 && sleep 2 + sudo ip addr add $WANIP dev $device_name && sleep 2 fi fi fi diff --git a/multitoolbox.sh b/multitoolbox.sh index 2c13023e..c07270c9 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1059,7 +1059,7 @@ case "$REPLY" in 10) clear sleep 1 - selfhosting + selfhosting_creator ;; 11) clear From bf815cad10742da274f02b89a9697f81bae56815 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 30 Sep 2022 10:48:10 +0200 Subject: [PATCH 0712/1176] fix for jq key --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 3c436878..147b4a0a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1507,7 +1507,7 @@ function selfhosting_creator(){ if [[ ! -f /home/$USER/device_conf.json ]]; then echo "{}" > device_conf.json fi - echo "$(jq -r --arg value "$device_setup" 'device_name=$value' device_conf.json)" > device_conf.json + echo "$(jq -r --arg value "$device_setup" '.device_name=$value' device_conf.json)" > device_conf.json echo -e "${ARROW} ${CYAN}Config created successful, path: /home/$USER/device_conf.json, device name: $device_setup" echo -e "" fi @@ -1520,7 +1520,7 @@ function selfhosting() { if [[ "$1" == "install" ]]; then echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" fi - + echo -e "${ARROW} ${CYAN}Adding IP for device...${NC}" && sleep 1 if [[ "$1" != "install" ]]; then get_ip From bd80d2ed8d76be72bb22add008aea50842e3e0da Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 30 Sep 2022 10:51:18 +0200 Subject: [PATCH 0713/1176] removed empy line --- flux_common.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 147b4a0a..6c2a9d33 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1509,7 +1509,6 @@ function selfhosting_creator(){ fi echo "$(jq -r --arg value "$device_setup" '.device_name=$value' device_conf.json)" > device_conf.json echo -e "${ARROW} ${CYAN}Config created successful, path: /home/$USER/device_conf.json, device name: $device_setup" - echo -e "" fi selfhosting ;; From 005eac64f70539a2be12910ad0e0ab8649eaf9e3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 30 Sep 2022 11:21:57 +0200 Subject: [PATCH 0714/1176] added get_device_name --- flux_common.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 6c2a9d33..ffab17a0 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1538,7 +1538,7 @@ function selfhosting() { echo -e "" return 1 fi - echo -e "${ARROW} ${CYAN}Creating ip check script...${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Creating IP check script...${NC}" && sleep 1 sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 sudo touch /home/$USER/ip_check.sh sudo chown $USER:$USER /home/$USER/ip_check.sh @@ -1554,19 +1554,21 @@ function selfhosting() { WANIP=$(curl --silent -m 10 https://api.ipify.org | tr -dc '[:alnum:].') fi } - + + function get_device_name(){ + if [[ -f /home/$USER/device_conf.json ]]; then + device_name=$(jq -r .device_name /home/$USER/device_conf.json) + echo -e "Device from config, name: $device_name" >> /home/$USER/ip_history.log + else + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + echo -e "Device auto detection, name $device_name" >> /home/$USER/ip_history.log + fi + } get_ip - if [[ -f /home/$USER/device_conf.json ]]; then - device_name=$(jq -r .device_name /home/$USER/device_conf.json) - echo -e "Device from config, name: $device_name" >> /home/$USER/ip_history.log - else - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - echo -e "Device auto detection, name $device_name" >> /home/$USER/ip_history.log - fi - if [[ $1 == "restart" ]]; then #give 3min to connect with internet sleep 180 + get_device_name if [[ "$device_name" != "" && "$WANIP" != "" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log @@ -1574,6 +1576,7 @@ function selfhosting() { fi fi if [[ $1 == "ip_check" ]]; then + get_device_name api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') if [[ "$api_port" == "" ]]; then api_port="16127" From fb5e1742a9843bb3d092dd92b30ba748917ac1d5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 30 Sep 2022 18:19:01 +0200 Subject: [PATCH 0715/1176] added radiolist of device interface --- flux_common.sh | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index ffab17a0..8864a7cc 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1494,21 +1494,41 @@ function selfhosting_creator(){ echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" CHOICE=$( whiptail --title "FluxOS Selfhosting Configuration" --menu "Make your choice" 15 40 6 \ - "1)" "Auto detection (Recommended)" \ - "2)" "Device - create config" 3>&2 2>&1 1>&3 + "1)" "Auto Detection (Recommended)" \ + "2)" "Manual Configuration (Advance)" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") selfhosting ;; "2)") - device_setup=$(whiptail --inputbox "Enter your device name" 8 60 3>&1 1>&2 2>&3) + #device_setup=$(whiptail --inputbox "Enter your device name" 8 60 3>&1 1>&2 2>&3) + deviceList=($(route -n | awk '{ if ($8 != "" && $8 != "Iface" && $8 != "docker0" ) printf("%s\n", $8); }')) + elements=${#deviceList[@]} + choices=(); + for (( i=0;i<$elements;i++)); do + if [[ "$i" == "0" ]]; then + choices+=("${deviceList[i]}" "" "ON"); + else + choices+=("${deviceList[i]}" "" "OFF"); + fi + done; + device_setup=$( + whiptail --title " SELECT YOUR DEVICE INTERFACE " \ + --radiolist " \n Use the UP/DOWN arrows to highlight the device name you want. Press Spacebar on the device name you want to select, THEN press ENTER." 20 50 10 \ + "${choices[@]}" \ + 3>&2 2>&1 1>&3 + ); if [[ "$device_setup" != "" ]]; then if [[ ! -f /home/$USER/device_conf.json ]]; then echo "{}" > device_conf.json fi echo "$(jq -r --arg value "$device_setup" '.device_name=$value' device_conf.json)" > device_conf.json - echo -e "${ARROW} ${CYAN}Config created successful, path: /home/$USER/device_conf.json, device name: $device_setup" + echo -e "${ARROW} ${CYAN}Config created successful, path: /home/$USER/device_conf.json, device name: $device_setup ${NC}" + else + echo -e "${ARROW} ${CYAN}Operation aborted, device interface was not selected...${NC}" + echo -e "" + exit fi selfhosting ;; From 0b2f65cf5b5eaec33b015730f76408fc2c5c7064 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 30 Sep 2022 18:25:02 +0200 Subject: [PATCH 0716/1176] resize whiptail --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 8864a7cc..1d54a160 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1515,7 +1515,7 @@ function selfhosting_creator(){ done; device_setup=$( whiptail --title " SELECT YOUR DEVICE INTERFACE " \ - --radiolist " \n Use the UP/DOWN arrows to highlight the device name you want. Press Spacebar on the device name you want to select, THEN press ENTER." 20 50 10 \ + --radiolist " \n Use the UP/DOWN arrows to highlight the device name you want. Press Spacebar on the device name you want to select, THEN press ENTER." 25 55 10 \ "${choices[@]}" \ 3>&2 2>&1 1>&3 ); From 2ffbf1e468f29ba47d6c471bc17de6ddc19e891f Mon Sep 17 00:00:00 2001 From: JKTUNING <jktuned.crypto@gmail.com> Date: Sat, 1 Oct 2022 19:54:55 -0400 Subject: [PATCH 0717/1176] change url - for testing --- apps_info.sh | 2 +- cdn-speedtest.sh | 8 ++++---- flux_common.sh | 4 ++-- install_pro.sh | 4 ++-- install_pro_testnet.sh | 8 ++++---- multinode.sh | 2 +- multitoolbox.sh | 12 ++++++------ multitoolbox_testnet.sh | 10 +++++----- nodeanalizerandfixer.sh | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/apps_info.sh b/apps_info.sh index 189ce017..677b8b9e 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -3,7 +3,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/apps_info.sh) $ROOT_BRANCH $2 + bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/apps_info.sh) $ROOT_BRANCH $2 unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED exit diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index dbdbab06..7b010139 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -1,17 +1,17 @@ #!/bin/bash # # Usage: -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "<test_time_in_s>" "<file_name>" "<array_url_list_via_export>" +# bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/development/cdn-speedtest.sh) "<test_time_in_s>" "<file_name>" "<array_url_list_via_export>" # # Example 1 ( for testing custom servers ): # export list=("http://cdn-11.runonflux.io/apps/fluxshare/getfile/" "http://cdn-11.runonflux.io/apps/fluxshare/getfile/") -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "6" "flux_explorer_bootstrap.tar.gz" "${list[@]}" +# bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/development/cdn-speedtest.sh) "6" "flux_explorer_bootstrap.tar.gz" "${list[@]}" # # Example 2 ( for testing cdn with 6s download test of each server ) -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "6" +# bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/development/cdn-speedtest.sh) "6" # # Example 3 ( for testing cdn with default settings ) -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) +# bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/development/cdn-speedtest.sh) # # #color codes diff --git a/flux_common.sh b/flux_common.sh index 1e5d7549..86d722d9 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1586,7 +1586,7 @@ function multinode(){ exit fi sleep 8 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) + bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) } function install_watchtower(){ echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" @@ -1635,7 +1635,7 @@ function analyzer_and_fixer(){ echo -e "${NC}" exit fi - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) + bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) } diff --git a/install_pro.sh b/install_pro.sh index cb702ecf..ade9dcbc 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,5 +1,5 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" #wallet information COIN_NAME='flux' CONFIG_DIR='.flux' @@ -207,7 +207,7 @@ function install_watchdog() { if pm2 -v > /dev/null 2>&1; then WATCHDOG_INSTALL="1" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 - wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 + wget https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge cd watchdog && npm install > /dev/null 2>&1 diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index cb25c09b..2f5dfec0 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" # Bootstrap settings BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' @@ -147,7 +147,7 @@ WATCHDOG_INSTALL="1" echo -e "${ARROW} ${YELLOW}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" @@ -726,7 +726,7 @@ else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 fi @@ -1403,7 +1403,7 @@ else # bootstrap # fi create_service_scripts - create_service + create_service "install" # if whiptail --yesno "Is the fluxnode being installed on a vps?" 8 60; then # echo -e "${ARROW} ${YELLOW}Cron service for rotate ip skipped...${NC}" diff --git a/multinode.sh b/multinode.sh index 460dd68e..2a1c41fe 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,5 +1,5 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" function upnp_disable() { if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then diff --git a/multitoolbox.sh b/multitoolbox.sh index 2c13023e..f4252199 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -15,7 +15,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH + bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED exit @@ -23,7 +23,7 @@ if ! [[ -z $1 ]]; then else export ROOT_BRANCH='master' fi -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' CONFIG_FILE='zelcash.conf' @@ -534,7 +534,7 @@ function install_watchdog() { echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" - wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 + wget https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" @@ -743,7 +743,7 @@ function install_node(){ echo -e "${WORNING}${CYAN}Docker is not working correct or is not installed.${NC}" exit fi - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) + bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) } function install_docker(){ echo -e "${GREEN}Module: Install Docker${NC}" @@ -972,8 +972,8 @@ if ! whiptail -v > /dev/null 2>&1; then fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then - echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc - echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc + echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc + echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc source /etc/bash.bashrc fi diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 00d92122..4b24a4d5 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -4,7 +4,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox_testnet.sh) $ROOT_BRANCH + bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/multitoolbox_testnet.sh) $ROOT_BRANCH unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED exit @@ -13,7 +13,7 @@ else export ROOT_BRANCH='master' fi -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' @@ -538,7 +538,7 @@ sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" @@ -925,8 +925,8 @@ exit fi -# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) -bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro_testnet.sh) +# bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) +bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/install_pro_testnet.sh) } diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 0e2fe9bf..1f04aabe 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" #const REPLACE="0" From 761869063728bc159eb3043c3016c45c67fbfba8 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sun, 2 Oct 2022 09:31:36 +0100 Subject: [PATCH 0718/1176] Fix testnet install script --- install_pro_testnet.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 4cea1a9f..575f4546 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -722,10 +722,11 @@ else sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "impish" ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 fi From c27190a8ca5a18c2ad0e2c4b670cf12c62b45fdc Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sun, 2 Oct 2022 17:24:28 +0100 Subject: [PATCH 0719/1176] Fix testnet daemon install --- install_pro_testnet.sh | 113 ++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 57 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 575f4546..004c9038 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -694,74 +694,73 @@ function install_daemon() { echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 - -if [[ "$(lsb_release -cs)" == "xenial" ]]; then - - echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - - flux_package && sleep 2 -else - - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - - # cleaning - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - - if [[ "$(lsb_release -cs)" == "impish" ]]; then + sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 + if [[ "$(lsb_release -cs)" == "xenial" ]]; then + + echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + #echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + + flux_package && sleep 2 + else + + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + + + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + + if [[ "$(lsb_release -cs)" == "impish" ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - else + else echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - fi - - - # downloading key && save it as keyring - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" - sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi + # downloading key && save it as keyring + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" + sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi - if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - - flux_package && sleep 2 - - else + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi + + + if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + + flux_package && sleep 2 + + else + + echo -e "" + echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo -e "" + exit + fi - echo - echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi - -fi sudo rm -rf /tmp/flux* 2>&1 && sleep 2 sudo rm -rf /tmp/Flux* 2>&1 && sleep 2 From eb855f295da880f7df35c4ed50f459e156c32b9b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 2 Oct 2022 21:10:01 +0200 Subject: [PATCH 0720/1176] repo cleanup --- flux_common.sh | 31 ++++++++++++++++++++++++ install_pro.sh | 18 +++----------- install_pro_testnet.sh | 53 ++++++------------------------------------ 3 files changed, 41 insertions(+), 61 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 1d54a160..98d163d0 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1477,6 +1477,36 @@ function upnp_enable() { echo -e "" fi } +#### TESTNET + + +function testnet_binary(){ + sudo rm -rf /tmp/*lux* 2>&1 && sleep 2 + if [[ $(dpkg --print-architecture) = *amd* ]]; then + #DAEMON + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 + #BENCHMARK + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + else + #DAEMON + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-arm64-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 + #BENCHMARK + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + fi + sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 +} #### MULTITOOLBOX OPTIONS SECTION function selfhosting_creator(){ @@ -1547,6 +1577,7 @@ function selfhosting() { if [[ -z "$device_setup" ]]; then device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + echo -e "Device auto detection, name: $device_name" else device_name="$device_setup" fi diff --git a/install_pro.sh b/install_pro.sh index cb702ecf..8559cfd4 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -560,7 +560,7 @@ function install_daemon() { sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "xenial" ]]; then - echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 #echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 @@ -570,25 +570,13 @@ function install_daemon() { fi flux_package && sleep 2 else - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - if [[ "$(lsb_release -cs)" == "impish" ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - fi + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" - sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 fi if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 575f4546..746595a9 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -697,100 +697,61 @@ function install_daemon() { if [[ "$(lsb_release -cs)" == "xenial" ]]; then - echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 if ! gpg --list-keys Zel > /dev/null; then gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - + fi flux_package && sleep 2 else - - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - # cleaning sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - - if [[ "$(lsb_release -cs)" == "impish" ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - fi - - + sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" - sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 fi - - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 fi - - if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - flux_package && sleep 2 - else - echo echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit - - fi - + fi fi - -sudo rm -rf /tmp/flux* 2>&1 && sleep 2 -sudo rm -rf /tmp/Flux* 2>&1 && sleep 2 - +sudo rm -rf /tmp/*lux* 2>&1 && sleep 2 if [[ $(dpkg --print-architecture) = *amd* ]]; then - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Fluxbench-Linux-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 - else - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Flux-arm64-halving.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Fluxbench-arm-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 - - fi sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 From f7a6590dff3dca343978ede20a352248d65eaa13 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 2 Oct 2022 21:14:19 +0200 Subject: [PATCH 0721/1176] Update install_pro.sh --- install_pro.sh | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index cb702ecf..8559cfd4 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -560,7 +560,7 @@ function install_daemon() { sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "xenial" ]]; then - echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 #echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 @@ -570,25 +570,13 @@ function install_daemon() { fi flux_package && sleep 2 else - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - if [[ "$(lsb_release -cs)" == "impish" ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - fi + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" - sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 fi if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then From 7d9c580efbf1c6a4969ae8a02b318bbfec0dcd03 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 2 Oct 2022 21:15:23 +0200 Subject: [PATCH 0722/1176] Update install_pro_testnet.sh --- install_pro_testnet.sh | 114 ++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 76 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 004c9038..746595a9 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -694,102 +694,64 @@ function install_daemon() { echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 - sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 - if [[ "$(lsb_release -cs)" == "xenial" ]]; then - - echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - #echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - - flux_package && sleep 2 - else - - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - - - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - - if [[ "$(lsb_release -cs)" == "impish" ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - #echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://runonflux.github.io/aptrepo/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - fi - - - # downloading key && save it as keyring - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" - sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - - - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - - - if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - - flux_package && sleep 2 - - else - - echo -e "" - echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo -e "" - exit - fi +if [[ "$(lsb_release -cs)" == "xenial" ]]; then + + echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + flux_package && sleep 2 +else + # cleaning + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + # downloading key && save it as keyring + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 fi - -sudo rm -rf /tmp/flux* 2>&1 && sleep 2 -sudo rm -rf /tmp/Flux* 2>&1 && sleep 2 - + if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + fi + if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + flux_package && sleep 2 + else + echo + echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi +fi +sudo rm -rf /tmp/*lux* 2>&1 && sleep 2 if [[ $(dpkg --print-architecture) = *amd* ]]; then - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Fluxbench-Linux-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 - else - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Flux-arm64-halving.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 sudo tar xzvf /tmp/Fluxbench-arm-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 - - fi sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 From 06dde28011b5d9934ff75a539e55fcf7c8f77e2c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 2 Oct 2022 22:37:32 +0200 Subject: [PATCH 0723/1176] Update flux_common.sh --- flux_common.sh | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 1d54a160..59fa3533 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1477,6 +1477,36 @@ function upnp_enable() { echo -e "" fi } +#### TESTNET + + +function testnet_binary(){ + sudo rm -rf /tmp/*lux* 2>&1 && sleep 2 + if [[ $(dpkg --print-architecture) = *amd* ]]; then + #DAEMON + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 + #BENCHMARK + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + else + #DAEMON + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-arm64-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 + #BENCHMARK + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 + sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + fi + sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 +} #### MULTITOOLBOX OPTIONS SECTION function selfhosting_creator(){ @@ -1547,8 +1577,9 @@ function selfhosting() { if [[ -z "$device_setup" ]]; then device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + echo -e "Device auto detection, name: $device_name" else - device_name="$device_setup" + device_name="$device_setup" fi if [[ "$device_name" != "" && "$WANIP" != "" ]]; then From 894adce058290e39e2150919ec1b3242ed8054be Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 3 Oct 2022 10:39:23 +0200 Subject: [PATCH 0724/1176] update message --- flux_common.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 59fa3533..f9becef6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1577,7 +1577,9 @@ function selfhosting() { if [[ -z "$device_setup" ]]; then device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - echo -e "Device auto detection, name: $device_name" + if [[ "$device_name" != "" ]]; then + echo -e "${ARROW} ${CYAN}Device auto detection, name: ${GREEN}$device_name ${NC}" + fi else device_name="$device_setup" fi From 0b5dc89a12e6bf32a27e8b08899652f56df1130d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 3 Oct 2022 10:46:05 +0200 Subject: [PATCH 0725/1176] update message style --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f9becef6..08cc9210 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1554,7 +1554,7 @@ function selfhosting_creator(){ echo "{}" > device_conf.json fi echo "$(jq -r --arg value "$device_setup" '.device_name=$value' device_conf.json)" > device_conf.json - echo -e "${ARROW} ${CYAN}Config created successful, path: /home/$USER/device_conf.json, device name: $device_setup ${NC}" + echo -e "${ARROW} ${CYAN}Config created successful, path: ${SEA}/home/$USER/device_conf.json${CYAN}, device name: ${GREE}$device_setup${NC}" else echo -e "${ARROW} ${CYAN}Operation aborted, device interface was not selected...${NC}" echo -e "" From 15fe7bf8bddcd3eb2f6f8cef99f7e76bbd8cd913 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 3 Oct 2022 10:57:46 +0200 Subject: [PATCH 0726/1176] fix variable --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 08cc9210..fef8a7f1 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1554,7 +1554,7 @@ function selfhosting_creator(){ echo "{}" > device_conf.json fi echo "$(jq -r --arg value "$device_setup" '.device_name=$value' device_conf.json)" > device_conf.json - echo -e "${ARROW} ${CYAN}Config created successful, path: ${SEA}/home/$USER/device_conf.json${CYAN}, device name: ${GREE}$device_setup${NC}" + echo -e "${ARROW} ${CYAN}Config created successful, path: ${SEA}/home/$USER/device_conf.json${CYAN}, device name: ${GREEN}$device_setup${NC}" else echo -e "${ARROW} ${CYAN}Operation aborted, device interface was not selected...${NC}" echo -e "" From f26ee35d7f61dfbac9efa30b8cffc618af97beed Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 3 Oct 2022 11:34:25 +0200 Subject: [PATCH 0727/1176] removing exist config file --- flux_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index fef8a7f1..e5561515 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1529,6 +1529,9 @@ function selfhosting_creator(){ ) case $CHOICE in "1)") + if [[ -f /home/$USER/device_conf.json ]]; then + echo -e "${ARROW} ${CYAN}Removing config file, path: ${GREEN}/home/$USER/device_conf.json${NC}" + fi selfhosting ;; "2)") From ba462cf186989f753b509fa7e265822724cda17b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 3 Oct 2022 13:01:22 +0200 Subject: [PATCH 0728/1176] added exist upnp import settings --- install_pro.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 8559cfd4..8235ca9b 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -74,6 +74,12 @@ function import_date() { if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" fi + upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | sed -e 's/.\{2\}$//') + if [[ "$upnp_port" != "" ]]; then + gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" + echo -e "${PIN}${CYAN} Gateway IP = ${GREEN}$gateway_ip${NC}" + fi fi if [[ -f /home/$USER/watchdog/config.js ]]; then echo -e "" @@ -153,7 +159,13 @@ function import_date() { KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" - fi + fi + upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | sed -e 's/.\{2\}$//') + if [[ "$upnp_port" != "" ]]; then + gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" + echo -e "${PIN}${CYAN} Gateway IP = ${GREEN}$gateway_ip${NC}" + fi fi if [[ -f /home/$USER/watchdog/config.js ]]; then echo -e "" From 562f87aba7354e1b6eccb334090b137f45f0e4ac Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 3 Oct 2022 14:38:46 +0200 Subject: [PATCH 0729/1176] update display_banner - added pm2 logs --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index e5561515..c4c3c4a4 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -475,7 +475,7 @@ function display_banner() { echo echo -e "${ARROW}${YELLOW} COMMANDS TO MANAGE FLUX.${NC}" echo -e "${PIN} ${CYAN}Summary info: ${SEA}pm2 info flux${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 logs flux${NC}" echo -e "${PIN} ${CYAN}Stop Flux: ${SEA}pm2 stop flux${NC}" echo -e "${PIN} ${CYAN}Start Flux: ${SEA}pm2 start flux${NC}" echo -e "" @@ -485,7 +485,7 @@ function display_banner() { echo -e "${PIN} ${CYAN}Start watchdog: ${SEA}pm2 start watchdog --watch${NC}" echo -e "${PIN} ${CYAN}Restart watchdog: ${SEA}pm2 reload watchdog --watch${NC}" echo -e "${PIN} ${CYAN}Error logs: ${SEA}~/watchdog/watchdog_error.log${NC}" - echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 monit${NC}" + echo -e "${PIN} ${CYAN}Logs in real time: ${SEA}pm2 logs watchdog${NC}" echo echo -e "${PIN} ${RED}IMPORTANT: After installation check ${SEA}'pm2 list'${RED} if not work, type ${SEA}'source /home/$USER/.bashrc'${NC}" echo -e "" From 1da896a9abe4e496a342b22e03d67ff2c53dccb2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 5 Oct 2022 10:25:50 +0200 Subject: [PATCH 0730/1176] added MongoDB 6.0 --- install_pro.sh | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 8235ca9b..a700c51f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -573,7 +573,6 @@ function install_daemon() { sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "xenial" ]]; then echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - #echo 'deb https://runonflux.github.io/aptrepo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 if ! gpg --list-keys Zel > /dev/null; then @@ -691,25 +690,17 @@ function install_process() { echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - if [[ $(lsb_release -cs) = *jammy* ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - else - curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - fi +# if [[ $(lsb_release -cs) = *jammy* ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 +# else +# curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 +# fi + + if [[ $(lsb_release -d) = *Debian* ]]; then - if [[ $(lsb_release -cs) = *stretch* || $(lsb_release -cs) = *buster* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - fi + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - if [[ $(lsb_release -cs) = *focal* || $(lsb_release -cs) = *bionic* || $(lsb_release -cs) = *xenial* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - elif [[ $(lsb_release -cs) = *jammy* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list > /dev/null 2>&1 - else - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" 2> /dev/null | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - fi + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list else echo -e "${WORNING} ${RED}OS type not supported..${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" From d2d990126fb6051eb8a516094fb3c4a4efae643d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 5 Oct 2022 10:40:03 +0200 Subject: [PATCH 0731/1176] disabled echo --- install_pro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index a700c51f..dabec314 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -698,9 +698,9 @@ function install_process() { if [[ $(lsb_release -d) = *Debian* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 else echo -e "${WORNING} ${RED}OS type not supported..${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" From 9ed04ebaf597956503c06803fd6aebaec40a1be6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 5 Oct 2022 11:02:53 +0200 Subject: [PATCH 0732/1176] cleanup --- install_pro.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index dabec314..a719e250 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -690,13 +690,8 @@ function install_process() { echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 -# if [[ $(lsb_release -cs) = *jammy* ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 -# else -# curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 -# fi - - + + curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 if [[ $(lsb_release -d) = *Debian* ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 elif [[ $(lsb_release -d) = *Ubuntu* ]]; then From 3f39912c799faa1a14345660a31df211cca1629e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 7 Oct 2022 13:53:41 +0200 Subject: [PATCH 0733/1176] improvment - added testnet flage for function - added missing rm for selfhosting - enabled logs in selfhostong --- flux_common.sh | 86 +++++++++++++++++++++++++++++++++++++++++++++----- install_pro.sh | 86 +++++++------------------------------------------- 2 files changed, 90 insertions(+), 82 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index c4c3c4a4..279491c5 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -350,6 +350,75 @@ function integration_check() { fi } + +function flux_block_height() { + if [[ "$1" != "-testnet" ]]; then + network_height_01=$(curl -sk -m 8 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_02=$(curl -sk -m 8 https://$network_url_2/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + else + network_height_01=$(curl -sk -m 8 https://testnet.runonflux.io/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + network_height_02=$(curl -sk -m 8 https://testnet.runonflux.io/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) + fi + EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") +} + +function status_loop() { + flux_block_height "$1" + if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} $1 getinfo | jq '.blocks' 2> /dev/null) ]]; then + echo -e "" + echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} $1 getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) + CONNECTIONS=$(${COIN_CLI} $1 getinfo 2> /dev/null | jq '.connections' 2> /dev/null) + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + NUM='2' + MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN}" + MSG2="${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" + spinning_timer + echo && echo + else + echo -e "" + echo -e "${CLOCK}${GREEN}FLUX DAEMON SYNCING...${NC}" + f=0 + start_sync=`date +%s` + while true + do + flux_block_height "$1" + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} $1 getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) + CONNECTIONS=$(${COIN_CLI} $1 getinfo 2> /dev/null | jq '.connections' 2> /dev/null) + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + if [[ "$LEFT" == "0" ]]; then + time_break='5' + else + time_break='20' + fi + if [[ $LOCAL_BLOCK_HIGHT == "" ]]; then + f=$((f+1)) + LOCAL_BLOCK_HIGHT="N/A" + LEFT="N/A" + CONNECTIONS="N/A" + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo systemctl start zelcash > /dev/null 2>&1 + NUM='60' + MSG1="Syncing progress => Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer + flux_block_height "$1" + LOCAL_BLOCK_HIGHT=$(${COIN_CLI} $1 getinfo 2> /dev/null | jq '.blocks') + CONNECTIONS=$(${COIN_CLI} $1 getinfo 2> /dev/null | jq '.connections') + LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) + fi + NUM="$time_break" + MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" + MSG2='' + spinning_timer + if [[ "$EXPLORER_BLOCK_HIGHT" == "$LOCAL_BLOCK_HIGHT" ]]; then + echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" + break + fi + done + fi +} + function import_config_file() { if [[ -f /home/$USER/install_conf.json ]]; then import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') @@ -1143,7 +1212,7 @@ function pm2_install(){ } function finalizing() { cd - pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=30000 --max-restarts=40 --name flux --time > /dev/null 2>&1 + pm2 start /home/$USER/$FLUX_DIR/start.sh --max_memory_restart 2G --restart-delay 30000 --max-restarts 40 --name flux --time > /dev/null 2>&1 pm2 save > /dev/null 2>&1 #sleep 120 #cd /home/$USER/zelflux @@ -1478,8 +1547,6 @@ function upnp_enable() { fi } #### TESTNET - - function testnet_binary(){ sudo rm -rf /tmp/*lux* 2>&1 && sleep 2 if [[ $(dpkg --print-architecture) = *amd* ]]; then @@ -1530,6 +1597,7 @@ function selfhosting_creator(){ case $CHOICE in "1)") if [[ -f /home/$USER/device_conf.json ]]; then + sudo rm -rf /home/$USER/device_conf.json echo -e "${ARROW} ${CYAN}Removing config file, path: ${GREEN}/home/$USER/device_conf.json${NC}" fi selfhosting @@ -1588,7 +1656,8 @@ function selfhosting() { fi if [[ "$device_name" != "" && "$WANIP" != "" ]]; then - sudo ip addr add $WANIP dev $device_name > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Detected IP: ${GREEN}$WANIP ${NC}" + sudo ip addr add $WANIP dev $device_name else echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 echo -e "" @@ -1620,10 +1689,11 @@ function selfhosting() { echo -e "Device auto detection, name $device_name" >> /home/$USER/ip_history.log fi } - get_ip + if [[ $1 == "restart" ]]; then #give 3min to connect with internet sleep 180 + get_ip get_device_name if [[ "$device_name" != "" && "$WANIP" != "" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') @@ -1632,6 +1702,7 @@ function selfhosting() { fi fi if [[ $1 == "ip_check" ]]; then + get_ip get_device_name api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') if [[ "$api_port" == "" ]]; then @@ -1655,7 +1726,8 @@ function selfhosting() { (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" else - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + echo -e "${ARROW} ${CYAN}Cron jobs already exists, skipped... ${NC}" + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" fi echo -e "" } @@ -1738,5 +1810,3 @@ function analyzer_and_fixer(){ fi bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) } - - diff --git a/install_pro.sh b/install_pro.sh index a719e250..7d8316b5 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -634,12 +634,12 @@ function start_daemon() { MSG1='Starting daemon & syncing with chain please be patient this will take about 5 min...' MSG2='' spinning_timer - chain_check=$($COIN_CLI getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) + chain_check=$($COIN_CLI $1 getinfo 2>&1 >/dev/null | grep "Activating" | wc -l) if [[ "$chain_check" == "1" ]]; then echo -e "" echo -e "${ARROW} ${CYAN}Activating best chain detected....Awaiting increased for next 5min${NC}" fi - if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + if [[ "$($COIN_CLI $1 getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then break fi if [[ "$x" -gt 6 ]]; then @@ -648,15 +648,15 @@ function start_daemon() { fi x=$(( $x + 1 )) done - if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + if [[ "$($COIN_CLI $1 getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then NUM='2' MSG1='Getting info...' MSG2="${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" spinning_timer echo && echo - daemon_version=$($COIN_CLI getinfo | jq -r '.version') + daemon_version=$($COIN_CLI $1 getinfo | jq -r '.version') string_limit_check_mark "Flux daemon v$daemon_version installed................................." "Flux daemon ${GREEN}v$daemon_version${CYAN} installed................................." - bench_version=$($BENCH_CLI getinfo | jq -r '.version') + bench_version=$($BENCH_CLI $1 getinfo | jq -r '.version') string_limit_check_mark "Flux benchmark v$bench_version installed................................." "Flux benchmark ${GREEN}v$bench_version${CYAN} installed................................." echo pm2_install @@ -764,75 +764,7 @@ function install_flux() { echo -e "" fi } -function status_loop() { - network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") - if [[ "$EXPLORER_BLOCK_HIGHT" == $(${COIN_CLI} getinfo | jq '.blocks' 2> /dev/null) ]]; then - echo -e "" - echo -e "${CLOCK}${GREEN} FLUX DAEMON SYNCING...${NC}" - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) - LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - NUM='2' - MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN}" - MSG2="${CYAN} ................[${CHECK_MARK}${CYAN}]${NC}" - spinning_timer - echo && echo - else - echo -e "" - echo -e "${CLOCK}${GREEN}FLUX DAEMON SYNCING...${NC}" - f=0 - start_sync=`date +%s` - while true - do - network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks' 2> /dev/null) - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections' 2> /dev/null) - LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - if [[ "$LEFT" == "0" ]]; then - time_break='5' - else - time_break='20' - fi - if [[ $LOCAL_BLOCK_HIGHT == "" ]]; then - f=$((f+1)) - LOCAL_BLOCK_HIGHT="N/A" - LEFT="N/A" - CONNECTIONS="N/A" - sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 - sudo systemctl start zelcash > /dev/null 2>&1 - NUM='60' - MSG1="Syncing progress => Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" - MSG2='' - spinning_timer - network_height_01=$(curl -sk -m 10 https://$network_url_1/api/status?q=getInfo 2> /dev/null | jq '.info.blocks' 2> /dev/null) - network_height_02=$(curl -sk -m 10 https://$network_url_3/api/status?q=getInfo 2> /dev/null | jq '.backend.blocks' 2> /dev/null) - EXPLORER_BLOCK_HIGHT=$(max "$network_height_01" "$network_height_02") - LOCAL_BLOCK_HIGHT=$(${COIN_CLI} getinfo 2> /dev/null | jq '.blocks') - CONNECTIONS=$(${COIN_CLI} getinfo 2> /dev/null | jq '.connections') - LEFT=$((EXPLORER_BLOCK_HIGHT-LOCAL_BLOCK_HIGHT)) - fi - NUM="$time_break" - MSG1="Syncing progress >> Local block height: ${GREEN}$LOCAL_BLOCK_HIGHT${CYAN} Explorer block height: ${RED}$EXPLORER_BLOCK_HIGHT${CYAN} Left: ${YELLOW}$LEFT${CYAN} blocks, Connections: ${YELLOW}$CONNECTIONS${CYAN} Failed: ${RED}$f${NC}" - MSG2='' - spinning_timer - if [[ "$EXPLORER_BLOCK_HIGHT" == "$LOCAL_BLOCK_HIGHT" ]]; then - echo -e "${GREEN} Duration: $((($(date +%s)-$start_sync)/60)) min. $((($(date +%s)-$start_sync) % 60)) sec. ${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" - break - fi - done - fi - install_watchdog - finalizing - if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]]; then - upnp_enable - fi - display_banner -} + #end of functions start_install wipe_clean @@ -857,3 +789,9 @@ log_rotate "MongoDB" "mongod_debug_log" "/var/log/mongodb/*.log" "daily" "14" log_rotate "Docker" "docker_debug_log" "/var/lib/docker/containers/*/*.log" "daily" "7" basic_security status_loop +install_watchdog +finalizing +if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]]; then + upnp_enable +fi +display_banner From 3ef88b30c775d661cd2cfe6b4e2b492902bac381 Mon Sep 17 00:00:00 2001 From: JKTUNING <jktuned.crypto@gmail.com> Date: Fri, 7 Oct 2022 19:51:07 -0400 Subject: [PATCH 0734/1176] check avx flag --- install_pro.sh | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 79fcbc12..886606e2 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -691,17 +691,37 @@ function install_process() { sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - if [[ $(lsb_release -d) = *Debian* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 - elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + # check to see if cpu supports avx + avx_check=$(grep avx /proc/cpuinfo) + + # AVX instruction flag not found - so install 4.4 + # else install newest version 6.0 + if [[ avx_check == "" ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + if [[ $(lsb_release -d) = *Debian* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + elif [[ $(lsb_release -d) = *Ubuntu* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + else + echo -e "${WORNING} ${RED}OS type not supported..${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi else - echo -e "${WORNING} ${RED}OS type not supported..${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit + curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + if [[ $(lsb_release -d) = *Debian* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + elif [[ $(lsb_release -d) = *Ubuntu* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + else + echo -e "${WORNING} ${RED}OS type not supported..${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi fi + if ! sysbench --version > /dev/null 2>&1; then echo -e "" echo -e "${ARROW} ${YELLOW}Sysbench installing...${NC}" From c2abdc6ccbde8d163c0e7c8c57b482542cb27c81 Mon Sep 17 00:00:00 2001 From: JKTUNING <jktuned.crypto@gmail.com> Date: Fri, 7 Oct 2022 19:53:00 -0400 Subject: [PATCH 0735/1176] update URL --- apps_info.sh | 2 +- cdn-speedtest.sh | 8 ++++---- flux_common.sh | 4 ++-- install_pro.sh | 4 ++-- install_pro_testnet.sh | 4 ++-- multinode.sh | 2 +- multitoolbox.sh | 12 ++++++------ multitoolbox_testnet.sh | 10 +++++----- nodeanalizerandfixer.sh | 2 +- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/apps_info.sh b/apps_info.sh index 677b8b9e..189ce017 100644 --- a/apps_info.sh +++ b/apps_info.sh @@ -3,7 +3,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/apps_info.sh) $ROOT_BRANCH $2 + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/apps_info.sh) $ROOT_BRANCH $2 unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED exit diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index 7b010139..dbdbab06 100644 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -1,17 +1,17 @@ #!/bin/bash # # Usage: -# bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/development/cdn-speedtest.sh) "<test_time_in_s>" "<file_name>" "<array_url_list_via_export>" +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "<test_time_in_s>" "<file_name>" "<array_url_list_via_export>" # # Example 1 ( for testing custom servers ): # export list=("http://cdn-11.runonflux.io/apps/fluxshare/getfile/" "http://cdn-11.runonflux.io/apps/fluxshare/getfile/") -# bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/development/cdn-speedtest.sh) "6" "flux_explorer_bootstrap.tar.gz" "${list[@]}" +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "6" "flux_explorer_bootstrap.tar.gz" "${list[@]}" # # Example 2 ( for testing cdn with 6s download test of each server ) -# bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/development/cdn-speedtest.sh) "6" +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) "6" # # Example 3 ( for testing cdn with default settings ) -# bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/development/cdn-speedtest.sh) +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/development/cdn-speedtest.sh) # # #color codes diff --git a/flux_common.sh b/flux_common.sh index dcba5952..279491c5 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1759,7 +1759,7 @@ function multinode(){ exit fi sleep 8 - bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) } function install_watchtower(){ echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" @@ -1808,5 +1808,5 @@ function analyzer_and_fixer(){ echo -e "${NC}" exit fi - bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) } diff --git a/install_pro.sh b/install_pro.sh index 886606e2..10de741f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -1,5 +1,5 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" #wallet information COIN_NAME='flux' CONFIG_DIR='.flux' @@ -219,7 +219,7 @@ function install_watchdog() { if pm2 -v > /dev/null 2>&1; then WATCHDOG_INSTALL="1" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 - wget https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 + wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge cd watchdog && npm install > /dev/null 2>&1 diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 6086eef4..746595a9 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" # Bootstrap settings BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' @@ -147,7 +147,7 @@ WATCHDOG_INSTALL="1" echo -e "${ARROW} ${YELLOW}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${YELLOW}Installing watchdog module....${NC}" diff --git a/multinode.sh b/multinode.sh index 2a1c41fe..460dd68e 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,5 +1,5 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" function upnp_disable() { if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then diff --git a/multitoolbox.sh b/multitoolbox.sh index c54ba066..c07270c9 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -15,7 +15,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED exit @@ -23,7 +23,7 @@ if ! [[ -z $1 ]]; then else export ROOT_BRANCH='master' fi -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' CONFIG_FILE='zelcash.conf' @@ -534,7 +534,7 @@ function install_watchdog() { echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" - wget https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 + wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" @@ -743,7 +743,7 @@ function install_node(){ echo -e "${WORNING}${CYAN}Docker is not working correct or is not installed.${NC}" exit fi - bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) } function install_docker(){ echo -e "${GREEN}Module: Install Docker${NC}" @@ -972,8 +972,8 @@ if ! whiptail -v > /dev/null 2>&1; then fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then - echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc - echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc + echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc + echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc source /etc/bash.bashrc fi diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 4b24a4d5..00d92122 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -4,7 +4,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/multitoolbox_testnet.sh) $ROOT_BRANCH + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox_testnet.sh) $ROOT_BRANCH unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED exit @@ -13,7 +13,7 @@ else export ROOT_BRANCH='master' fi -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" BOOTSTRAP_ZIP='https://fluxnodeservice.com/daemon_bootstrap.tar.gz' @@ -538,7 +538,7 @@ sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Downloading...${NC}" cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" -wget https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 +wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 mv post-merge /home/$USER/watchdog/.git/hooks/post-merge sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" @@ -925,8 +925,8 @@ exit fi -# bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) -bash -i <(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/install_pro_testnet.sh) +# bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro.sh) +bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/install_pro_testnet.sh) } diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 1f04aabe..0e2fe9bf 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/JKTUNING/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" #const REPLACE="0" From e558cdfaafa3af5f788be05bca1b8f7ff1b62d69 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 8 Oct 2022 10:31:25 +0200 Subject: [PATCH 0736/1176] updated avx check --- install_pro.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 10de741f..dd08faf6 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -690,10 +690,8 @@ function install_process() { echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - - # check to see if cpu supports avx - avx_check=$(grep avx /proc/cpuinfo) - + # check to see if cpu supports avx + avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) # AVX instruction flag not found - so install 4.4 # else install newest version 6.0 if [[ avx_check == "" ]]; then From 97d31fa3573271d62790508158df95f59efde980 Mon Sep 17 00:00:00 2001 From: JKTUNING <jktuned.crypto@gmail.com> Date: Sat, 8 Oct 2022 09:50:03 -0400 Subject: [PATCH 0737/1176] fix avx_check variable --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index dd08faf6..a751a600 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -694,7 +694,7 @@ function install_process() { avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) # AVX instruction flag not found - so install 4.4 # else install newest version 6.0 - if [[ avx_check == "" ]]; then + if [[ "$avx_check" == "" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 if [[ $(lsb_release -d) = *Debian* ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 From b92a4c1ad3b11b0104c7c786bec856d0cfc85537 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 11:29:46 +0200 Subject: [PATCH 0738/1176] Update MongodDB FiX --- multitoolbox.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index c07270c9..d941f1dc 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -889,6 +889,48 @@ function mongod_db_fix() { echo -e "${NC}" exit fi + + + CHOICE=$( + whiptail --title "MongoDB FiXER" --menu "Make your choice" 15 40 6 \ + "1)" "Soft repair - mongod repair (database will stay)" \ + "2)" "Hard repair - complit reinstall (database will be removed)" 3>&2 2>&1 1>&3 + ) + case $CHOICE in + "1)") + echo -e "" + echo -e "${WORNING} ${CYAN}Stopping mongod service ${NC}" + sudo systemctl stop mongod + echo -e "${WORNING} ${CYAN}Fix for corrupted DB ${NC}" + sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair + echo -e "${WORNING} ${CYAN}Fix for bad privilege ${NC}" + sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 + sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 + echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" + sudo systemctl start mongod + echo -e "" + ;; + "2)") + echo -e "" + echo -e "${WORNING} ${CYAN}Stopping mongod service ${NC}" + sudo systemctl stop mongod + echo -e "${WORNING} ${CYAN}Removing MongoDB... ${NC}" + sudo apt-get purge mongodb* > /dev/null 2>&1 + echo -e "${WORNING} ${CYAN}Removing Database... ${NC}" + sudo rm -r /var/log/mongodb > /dev/null 2>&1 + sudo rm -r /var/lib/mongodb > /dev/null 2>&1 + echo -e "${WORNING} ${CYAN}Installing MongoDB... ${NC}" + sudo apt install mongodb-org -y > /dev/null 2>&1 + echo -e "${WORNING} ${CYAN}Fix for bad privilege ${NC}" + sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 + sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 + echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" + sudo systemctl start mongod + echo -e "" + ;; + esac + + echo -e "" echo -e "${WORNING} ${CYAN}Stopping mongod service ${NC}" && sleep 1 sudo systemctl stop mongod @@ -900,6 +942,9 @@ function mongod_db_fix() { echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" && sleep 1 sudo systemctl start mongod echo -e "" + sudo rm -r /var/log/mongodb + sudo rm -r /var/lib/mongodb + } function node_reconfiguration() { reset="" From 6fa7647e578029cd95fb6f54bd222f6e1cf6b2ce Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 11:36:35 +0200 Subject: [PATCH 0739/1176] whiptail resize --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d941f1dc..fdd1dcf4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -892,7 +892,7 @@ function mongod_db_fix() { CHOICE=$( - whiptail --title "MongoDB FiXER" --menu "Make your choice" 15 40 6 \ + whiptail --title "MongoDB FiXER" --menu "Make your choice" 15 65 8 \ "1)" "Soft repair - mongod repair (database will stay)" \ "2)" "Hard repair - complit reinstall (database will be removed)" 3>&2 2>&1 1>&3 ) From 16c2f63f4d5f3bd769180f66e0e34019e1be0c56 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 11:53:35 +0200 Subject: [PATCH 0740/1176] Update menu --- multitoolbox.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index fdd1dcf4..24e51ff7 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -880,7 +880,7 @@ function install_watchtower(){ } function mongod_db_fix() { - echo -e "${GREEN}Module: Recover corrupted MongoDB database${NC}" + echo -e "${GREEN}Module: MongoDB fix action${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" @@ -892,7 +892,7 @@ function mongod_db_fix() { CHOICE=$( - whiptail --title "MongoDB FiXER" --menu "Make your choice" 15 65 8 \ + whiptail --title "MongoDB fix action" --menu "Make your choice" 15 65 8 \ "1)" "Soft repair - mongod repair (database will stay)" \ "2)" "Hard repair - complit reinstall (database will be removed)" 3>&2 2>&1 1>&3 ) @@ -1048,7 +1048,7 @@ echo -e "${CYAN}9 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}11 - FluxOS reconfiguration ${NC}" echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" -echo -e "${CYAN}13 - Recover corrupted MongoDB database${NC}" +echo -e "${CYAN}13 - MongoDB fix action${NC}" echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Router with UPNP support) ${NC}" echo -e "${CYAN}15 - Node reconfiguration from install config${NC}" echo -e "${YELLOW}================================================================${NC}" From bf8945ddd55675bbd0f807c38c5481a045d6bf8c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 12:17:47 +0200 Subject: [PATCH 0741/1176] removed bad procedure --- multitoolbox.sh | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 24e51ff7..d2ef2e01 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -930,21 +930,6 @@ function mongod_db_fix() { ;; esac - - echo -e "" - echo -e "${WORNING} ${CYAN}Stopping mongod service ${NC}" && sleep 1 - sudo systemctl stop mongod - echo -e "${WORNING} ${CYAN}Fix for corrupted DB ${NC}" && sleep 1 - sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair - echo -e "${WORNING} ${CYAN}Fix for bad privilege ${NC}" && sleep 1 - sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 - sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 - echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" && sleep 1 - sudo systemctl start mongod - echo -e "" - sudo rm -r /var/log/mongodb - sudo rm -r /var/lib/mongodb - } function node_reconfiguration() { reset="" From 40a70896f3e22049a8348ac3ca27cb074f5bc283 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 12:44:25 +0200 Subject: [PATCH 0742/1176] Fix hard fix for mongodb --- multitoolbox.sh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d2ef2e01..42f6d3e5 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -899,32 +899,37 @@ function mongod_db_fix() { case $CHOICE in "1)") echo -e "" - echo -e "${WORNING} ${CYAN}Stopping mongod service ${NC}" + echo -e "${ARROW} ${YELLOW}Soft repair starting... ${NC}" + echo -e "${ARROW} ${CYAN}Stopping mongod service ${NC}" sudo systemctl stop mongod - echo -e "${WORNING} ${CYAN}Fix for corrupted DB ${NC}" + echo -e "${ARROW} ${CYAN}Fix for corrupted DB ${NC}" sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair - echo -e "${WORNING} ${CYAN}Fix for bad privilege ${NC}" + echo -e "${ARROW} ${CYAN}Fix for bad privilege ${NC}" sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 - echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" + echo -e "${ARROW} ${CYAN}Starting mongod service ${NC}" sudo systemctl start mongod echo -e "" ;; "2)") echo -e "" - echo -e "${WORNING} ${CYAN}Stopping mongod service ${NC}" + echo -e "${ARROW} ${YELLOW}Hard repair starting... ${NC}" + echo -e "${ARROW} ${CYAN}Stopping mongod service ${NC}" sudo systemctl stop mongod - echo -e "${WORNING} ${CYAN}Removing MongoDB... ${NC}" - sudo apt-get purge mongodb* > /dev/null 2>&1 - echo -e "${WORNING} ${CYAN}Removing Database... ${NC}" + echo -e "${ARROW} ${CYAN}Removing MongoDB... ${NC}" + sudo apt-get purge mongodb-org > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Removing Database... ${NC}" sudo rm -r /var/log/mongodb > /dev/null 2>&1 sudo rm -r /var/lib/mongodb > /dev/null 2>&1 - echo -e "${WORNING} ${CYAN}Installing MongoDB... ${NC}" + echo -e "${ARROW} ${CYAN}Installing MongoDB... ${NC}" sudo apt install mongodb-org -y > /dev/null 2>&1 - echo -e "${WORNING} ${CYAN}Fix for bad privilege ${NC}" + sudo mkdir -p /var/log/mongodb > /dev/null 2>&1 + sudo mkdir -p /var/lib/mongodb > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Settings privilege... ${NC}" + sudo chown -R mongodb:mongodb /var/log/mongodb > /dev/null 2>&1 sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 - echo -e "${WORNING} ${CYAN}Starting mongod service ${NC}" + echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" sudo systemctl start mongod echo -e "" ;; From 55570dbb77fab8aa6471452ff4da4d3e01612c60 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 12:52:06 +0200 Subject: [PATCH 0743/1176] Added yes for purge --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 42f6d3e5..fb4dc7d9 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -917,7 +917,7 @@ function mongod_db_fix() { echo -e "${ARROW} ${CYAN}Stopping mongod service ${NC}" sudo systemctl stop mongod echo -e "${ARROW} ${CYAN}Removing MongoDB... ${NC}" - sudo apt-get purge mongodb-org > /dev/null 2>&1 + sudo apt-get purge mongodb-org -y > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing Database... ${NC}" sudo rm -r /var/log/mongodb > /dev/null 2>&1 sudo rm -r /var/lib/mongodb > /dev/null 2>&1 From b975d980f130e3b8d35b24e50c8f4a5163069ca3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 13:26:57 +0200 Subject: [PATCH 0744/1176] added restoring db diuring fix --- multitoolbox.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index fb4dc7d9..504d42d7 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -916,6 +916,9 @@ function mongod_db_fix() { echo -e "${ARROW} ${YELLOW}Hard repair starting... ${NC}" echo -e "${ARROW} ${CYAN}Stopping mongod service ${NC}" sudo systemctl stop mongod + sudo rm -rf /home/$USER/mongoDB_backup.gz > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Backuping Database... ${NC}" + mongodump --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing MongoDB... ${NC}" sudo apt-get purge mongodb-org -y > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing Database... ${NC}" @@ -929,6 +932,8 @@ function mongod_db_fix() { sudo chown -R mongodb:mongodb /var/log/mongodb > /dev/null 2>&1 sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Restoring Database... ${NC}" + mongorestore --drop --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" sudo systemctl start mongod echo -e "" From 8af27031977fec4d6c71c69f296e91c336345594 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 13:39:25 +0200 Subject: [PATCH 0745/1176] disabled dump/restore --- multitoolbox.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 504d42d7..ed35c488 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -893,8 +893,8 @@ function mongod_db_fix() { CHOICE=$( whiptail --title "MongoDB fix action" --menu "Make your choice" 15 65 8 \ - "1)" "Soft repair - mongod repair (database will stay)" \ - "2)" "Hard repair - complit reinstall (database will be removed)" 3>&2 2>&1 1>&3 + "1)" "Soft repair - mongod repair" \ + "2)" "Hard repair - complit reinstall" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") @@ -914,11 +914,11 @@ function mongod_db_fix() { "2)") echo -e "" echo -e "${ARROW} ${YELLOW}Hard repair starting... ${NC}" - echo -e "${ARROW} ${CYAN}Stopping mongod service ${NC}" + echo -e "${ARROW} ${CYAN}Stopping mongod service...${NC}" sudo systemctl stop mongod - sudo rm -rf /home/$USER/mongoDB_backup.gz > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Backuping Database... ${NC}" - mongodump --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 + #sudo rm -rf /home/$USER/mongoDB_backup.gz > /dev/null 2>&1 + #echo -e "${ARROW} ${CYAN}Backuping Database... ${NC}" + #mongodump --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing MongoDB... ${NC}" sudo apt-get purge mongodb-org -y > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing Database... ${NC}" @@ -932,8 +932,8 @@ function mongod_db_fix() { sudo chown -R mongodb:mongodb /var/log/mongodb > /dev/null 2>&1 sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Restoring Database... ${NC}" - mongorestore --drop --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 + #echo -e "${ARROW} ${CYAN}Restoring Database... ${NC}" + #mongorestore --drop --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" sudo systemctl start mongod echo -e "" From 0374197050645fe5034fb0828ea3b92c72ca953b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:16:50 +0200 Subject: [PATCH 0746/1176] Minor improvment - disabled --repair output - added mongod information --- multitoolbox.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index ed35c488..f1c3fbd1 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -903,7 +903,7 @@ function mongod_db_fix() { echo -e "${ARROW} ${CYAN}Stopping mongod service ${NC}" sudo systemctl stop mongod echo -e "${ARROW} ${CYAN}Fix for corrupted DB ${NC}" - sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair + sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Fix for bad privilege ${NC}" sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 @@ -936,6 +936,12 @@ function mongod_db_fix() { #mongorestore --drop --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" sudo systemctl start mongod + if mongod --version > /dev/null 2>&1; then + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo -e "${ARROW} ${CYAN}Service status:${YELLOW}$(sudo systemctl status mongod | grep 'Active') ${NC}" + else + string_limit_x_mark "MongoDB was not installed................................." + fi echo -e "" ;; esac From f206fcdfa590e613433f9ebd16362a4af283f61a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:23:36 +0200 Subject: [PATCH 0747/1176] display correction --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f1c3fbd1..175d0e5c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -938,7 +938,7 @@ function mongod_db_fix() { sudo systemctl start mongod if mongod --version > /dev/null 2>&1; then string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." - echo -e "${ARROW} ${CYAN}Service status:${YELLOW}$(sudo systemctl status mongod | grep 'Active') ${NC}" + echo -e "${ARROW} ${CYAN}Service status:${SEA} $(sudo systemctl status mongod | grep -w 'Active' | sed -e 's/^[ \t]*//')${NC}" else string_limit_x_mark "MongoDB was not installed................................." fi From a24f58d71098b9af4a6dd534cb24a31772a5d390 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:30:34 +0200 Subject: [PATCH 0748/1176] added codename detection for mongod repo --- install_pro.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index a751a600..4d85dd28 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -697,9 +697,9 @@ function install_process() { if [[ "$avx_check" == "" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 if [[ $(lsb_release -d) = *Debian* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 else echo -e "${WORNING} ${RED}OS type not supported..${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" @@ -709,9 +709,9 @@ function install_process() { else curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 if [[ $(lsb_release -d) = *Debian* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 - elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + elif [[ $(lsb_release -d) = *Ubuntu* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 else echo -e "${WORNING} ${RED}OS type not supported..${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" From 7cec254ef71752f41c047d5eb535084ea96135ca Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 11 Oct 2022 11:19:55 +0200 Subject: [PATCH 0749/1176] Minor edits --- multitoolbox.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 175d0e5c..609aa8fe 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -880,7 +880,7 @@ function install_watchtower(){ } function mongod_db_fix() { - echo -e "${GREEN}Module: MongoDB fix action${NC}" + echo -e "${GREEN}Module: MongoDB FiX action${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" @@ -892,9 +892,9 @@ function mongod_db_fix() { CHOICE=$( - whiptail --title "MongoDB fix action" --menu "Make your choice" 15 65 8 \ - "1)" "Soft repair - mongod repair" \ - "2)" "Hard repair - complit reinstall" 3>&2 2>&1 1>&3 + whiptail --title "MongoDB FiX action" --menu "Make your choice" 15 65 8 \ + "1)" "Soft repair - MongoDB database repair" \ + "2)" "Hard repair - MongoDB re-install" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") @@ -1049,7 +1049,7 @@ echo -e "${CYAN}9 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}11 - FluxOS reconfiguration ${NC}" echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" -echo -e "${CYAN}13 - MongoDB fix action${NC}" +echo -e "${CYAN}13 - MongoDB FiX action${NC}" echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Router with UPNP support) ${NC}" echo -e "${CYAN}15 - Node reconfiguration from install config${NC}" echo -e "${YELLOW}================================================================${NC}" From 79c012e0e12296792aee3bac0b186bc0ed32a610 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 11 Oct 2022 19:38:33 +0200 Subject: [PATCH 0750/1176] update keyring system --- install_pro.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 4d85dd28..3aad4bbf 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -585,16 +585,28 @@ function install_daemon() { echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" + key_counter=0 + until [ $key_counter -gt 5 ] + do + if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + break + fi + echo -e "${CYAN}Retrieve keys failed will try again...${NC}" + sleep 5 sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + ((key_counter++)) + done + #if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + #echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" + #sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + #gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + #fi + #if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + #echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" + #sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + #gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + #fi if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then flux_package && sleep 2 else From 4e39eda64c4c3841ae5a9705283aeb9259991d85 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 12 Oct 2022 11:00:00 +0200 Subject: [PATCH 0751/1176] added disabling cron IP rotate service --- flux_common.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 279491c5..4f05d05f 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1588,7 +1588,6 @@ function selfhosting_creator(){ exit fi - echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" CHOICE=$( whiptail --title "FluxOS Selfhosting Configuration" --menu "Make your choice" 15 40 6 \ "1)" "Auto Detection (Recommended)" \ @@ -1596,6 +1595,7 @@ function selfhosting_creator(){ ) case $CHOICE in "1)") + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" if [[ -f /home/$USER/device_conf.json ]]; then sudo rm -rf /home/$USER/device_conf.json echo -e "${ARROW} ${CYAN}Removing config file, path: ${GREEN}/home/$USER/device_conf.json${NC}" @@ -1603,6 +1603,7 @@ function selfhosting_creator(){ selfhosting ;; "2)") + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" #device_setup=$(whiptail --inputbox "Enter your device name" 8 60 3>&1 1>&2 2>&3) deviceList=($(route -n | awk '{ if ($8 != "" && $8 != "Iface" && $8 != "docker0" ) printf("%s\n", $8); }')) elements=${#deviceList[@]} @@ -1633,6 +1634,14 @@ function selfhosting_creator(){ fi selfhosting ;; + "3)") + echo -e "${ARROW} ${YELLOW}Disabling cron service for IP rotate...${NC}" + echo -e "${ARROW} ${CYAN}Removing cron jobs...${NC}" + crontab -u $USER -l | grep -v 'ip_check' | crontab -u $USER - + echo -e "${ARROW} ${CYAN}Removing of files related to IP rotation...${NC}" + rm -rf /home/$USER/device_conf.json > /dev/null 2>&1 + rm -rf /home/$USER/ip_check.sh > /dev/null 2>&1 + echo -e "" esac } From 2e85d1f679c3d476682d7009d4ebfbb1ddfc008b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 12 Oct 2022 11:04:54 +0200 Subject: [PATCH 0752/1176] Update menu --- flux_common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 4f05d05f..d6845cf9 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1591,7 +1591,8 @@ function selfhosting_creator(){ CHOICE=$( whiptail --title "FluxOS Selfhosting Configuration" --menu "Make your choice" 15 40 6 \ "1)" "Auto Detection (Recommended)" \ - "2)" "Manual Configuration (Advance)" 3>&2 2>&1 1>&3 + "2)" "Manual Configuration (Advance)" \ + "3)" "Removing service" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") From b0b3d6155252334d2c0349be760c21eefdd1c3ca Mon Sep 17 00:00:00 2001 From: JKTUNING <jktuned.crypto@gmail.com> Date: Fri, 14 Oct 2022 12:01:04 -0400 Subject: [PATCH 0753/1176] Trap Exit Function Disable bash histroy on script entry Re-enable on exit or ctrl-c int Will need some review to see if ctrl_c trap can just call exit to clean branch variable --- multitoolbox.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 609aa8fe..a1dc5628 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,7 +1,9 @@ #!/bin/bash trap ctrl_c INT +trap toolbox_close EXIT +# could possibly remove the cleaning branch and put it all in exit function since it should get called function ctrl_c() { echo -e "" echo -e " Cleaning branch variable..." @@ -11,6 +13,21 @@ function ctrl_c() { exit } +function toolbox_close(){ + echo -e "" + echo -e " Cleaning branch variable..." + echo -e "" + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCE + echo -e "" + echo -e " Enabling history" + echo -e "" + set -o history +} + +#disable bash history +set +o history + if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" From b5790c7a8a7d314f38ad9aa2f759a84f5c973b94 Mon Sep 17 00:00:00 2001 From: JKTUNING <jktuned.crypto@gmail.com> Date: Fri, 14 Oct 2022 12:38:06 -0400 Subject: [PATCH 0754/1176] Move exit trap to flux_common to catch all --- flux_common.sh | 15 +++++++++++++++ multitoolbox.sh | 17 ----------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index d6845cf9..9b2b1dbe 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1,4 +1,19 @@ #!/bin/bash +#trap EXIT call and unset vars and enable history +trap toolbox_close EXIT +function toolbox_close(){ + echo -e "" + echo -e " Cleaning branch variable..." + echo -e "" + unset ROOT_BRANCH + unset BRANCH_ALREADY_REFERENCE + echo -e "" + echo -e " Enabling history" + echo -e "" + set -o history +} +#disable bash history +set +o history # Collection of common vars and functions used throughout multitoolbox. #color codes RED='\033[1;31m' diff --git a/multitoolbox.sh b/multitoolbox.sh index a1dc5628..8c5f4f8d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,8 +1,6 @@ #!/bin/bash trap ctrl_c INT -trap toolbox_close EXIT - # could possibly remove the cleaning branch and put it all in exit function since it should get called function ctrl_c() { echo -e "" @@ -13,21 +11,6 @@ function ctrl_c() { exit } -function toolbox_close(){ - echo -e "" - echo -e " Cleaning branch variable..." - echo -e "" - unset ROOT_BRANCH - unset BRANCH_ALREADY_REFERENCE - echo -e "" - echo -e " Enabling history" - echo -e "" - set -o history -} - -#disable bash history -set +o history - if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" From 3bffc00068666a56062c7b5bee093d4015fdea00 Mon Sep 17 00:00:00 2001 From: JKTUNING <jktuned.crypto@gmail.com> Date: Fri, 14 Oct 2022 13:12:05 -0400 Subject: [PATCH 0755/1176] disable history on toolbox entry --- multitoolbox.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8c5f4f8d..dd1e066f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1,4 +1,6 @@ #!/bin/bash +#disable bash history +set +o history trap ctrl_c INT # could possibly remove the cleaning branch and put it all in exit function since it should get called @@ -18,6 +20,7 @@ if ! [[ -z $1 ]]; then bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED + set -o history exit fi else From 306b008e8c9777db05fdc2f0eaf7d032d93034b0 Mon Sep 17 00:00:00 2001 From: JKTUNING <jktuned.crypto@gmail.com> Date: Sun, 16 Oct 2022 21:58:41 -0400 Subject: [PATCH 0756/1176] Move ctrl_c func to common --- flux_common.sh | 9 +++++++-- multitoolbox.sh | 11 ----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 9b2b1dbe..1065b172 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1,4 +1,6 @@ #!/bin/bash +#disable bash history +set +o history #trap EXIT call and unset vars and enable history trap toolbox_close EXIT function toolbox_close(){ @@ -12,8 +14,11 @@ function toolbox_close(){ echo -e "" set -o history } -#disable bash history -set +o history +trap ctrl_c INT +# exit on ctl_c and call toolbox close from EXIT trap +function ctrl_c() { + exit +} # Collection of common vars and functions used throughout multitoolbox. #color codes RED='\033[1;31m' diff --git a/multitoolbox.sh b/multitoolbox.sh index dd1e066f..f1f7ac27 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -2,17 +2,6 @@ #disable bash history set +o history -trap ctrl_c INT -# could possibly remove the cleaning branch and put it all in exit function since it should get called -function ctrl_c() { - echo -e "" - echo -e " Cleaning branch variable..." - echo -e "" - unset ROOT_BRANCH - unset BRANCH_ALREADY_REFERENCE - exit -} - if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" From 59fcf85101be3f5eeddcd79f423a5b9d84404251 Mon Sep 17 00:00:00 2001 From: JKTUNING <jktuned.crypto@gmail.com> Date: Sun, 16 Oct 2022 23:07:26 -0400 Subject: [PATCH 0757/1176] make alias in current terminal for immediate use --- multitoolbox.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index f1f7ac27..895b1e0c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1012,6 +1012,8 @@ fi if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc + alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)' + alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)' source /etc/bash.bashrc fi From 757f107f09592ee0f08f635ad43813c5a6e54657 Mon Sep 17 00:00:00 2001 From: JKTUNING <jktuned.crypto@gmail.com> Date: Sat, 22 Oct 2022 14:50:03 -0400 Subject: [PATCH 0758/1176] update exit function - check for history off --- flux_common.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 1065b172..97c9ac65 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1,18 +1,14 @@ #!/bin/bash #disable bash history set +o history -#trap EXIT call and unset vars and enable history +#trap EXIT call and unset vars and enable history if history if off trap toolbox_close EXIT function toolbox_close(){ - echo -e "" - echo -e " Cleaning branch variable..." - echo -e "" unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCE - echo -e "" - echo -e " Enabling history" - echo -e "" - set -o history + if [[ $(set -o | grep history) == *"off"* ]]; then + set -o history + fi } trap ctrl_c INT # exit on ctl_c and call toolbox close from EXIT trap From 0e81bd4b26d65a2803424ba4f1232d1d584c7673 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 26 Oct 2022 12:50:49 +0200 Subject: [PATCH 0759/1176] added second apt --- install_pro.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_pro.sh b/install_pro.sh index 3aad4bbf..c3c5c5f6 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -583,6 +583,7 @@ function install_daemon() { else sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 key_counter=0 From 57bcb25b44232eb4336b2568750fdb57f1581960 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 1 Nov 2022 19:26:28 +0100 Subject: [PATCH 0760/1176] description correction --- nodeanalizerandfixer.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 0e2fe9bf..ca5300be 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -437,8 +437,8 @@ if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" if [[ "$node_status" != "CONFIRMED" ]]; then if whiptail --yesno "Would you like to verify $CONFIG_FILE Y/N?" 8 60; then ZELCONF="1" - zelnodeprivkey="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" - zelnodeoutpoint="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Output TX ID" 8 72 3>&1 1>&2 2>&3)" + zelnodeprivkey="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" + zelnodeoutpoint="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3)" zelnodeindex="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" fi fi @@ -793,4 +793,4 @@ if [[ "$REPLACE" == "1" ]]; then echo -e "" fi fi -echo -e "" \ No newline at end of file +echo -e "" From fed8900899b80a0457a9efcdbe16e3f18831146c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 1 Nov 2022 20:08:09 +0100 Subject: [PATCH 0761/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 97c9ac65..6b134e47 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1136,7 +1136,7 @@ function start_install() { zelnodeprivkey="$prvkey" echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint="$outpoint" - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex="$index" echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$ZELID" != "" ]]; then From bd9a09c36eeb7668c99c8b07e1641dcbc0472d8b Mon Sep 17 00:00:00 2001 From: JKTUNING <john@j-k-tuning.com> Date: Mon, 14 Nov 2022 22:41:41 -0500 Subject: [PATCH 0762/1176] Consistent Verbiage for Collateral Details (#76) * Consistent Verbiage for Collateral Info Replaced any instance of private key with Identity key Format Flux Node Collateral TX ID to be the same when prompted or displayed Format Flux Node Output Index to be the same when prompted or displayed * gui port fix when enabling upnp during opt 2 Co-authored-by: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> --- flux_common.sh | 21 +++++++++++---------- install_pro.sh | 4 ++-- install_pro_testnet.sh | 16 ++++++++-------- multitoolbox_testnet.sh | 16 ++++++++-------- nodeanalizerandfixer.sh | 2 +- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 6b134e47..00644e72 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -653,15 +653,15 @@ function daemon_reconfiguration(){ sleep 1 if [[ "$zelnodeprivkey" == "" ]]; then skip_change=$((skip_change-1)) - echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Replace FluxNode Identity Key skipped....................[${CHECK_MARK}${CYAN}]${NC}" fi if [[ "$zelnodeoutpoint" == "" ]]; then skip_change=$((skip_change-1)) - echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Replace FluxNode Collateral TX ID skipped ..................[${CHECK_MARK}${CYAN}]${NC}" fi if [[ "$zelnodeindex" == "" ]]; then skip_change=$((skip_change-1)) - echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Replace FluxNode Output Index skipped......................[${CHECK_MARK}${CYAN}]${NC}" fi if [[ "$skip_change" == "0" ]]; then echo -e "${ARROW} ${YELLOW}All fields are empty changes skipped...${NC}" @@ -673,33 +673,33 @@ function daemon_reconfiguration(){ sudo fuser -k 16125/tcp > /dev/null 2>&1 if [[ "$zelnodeprivkey" != "" ]]; then if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}Replace FluxNode identity key skipped....................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Replace FluxNode Identity Key skipped....................[${CHECK_MARK}${CYAN}]${NC}" else sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode identity key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}FluxNode Identity Key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" fi fi fi if [[ "$zelnodeoutpoint" != "" ]]; then if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Replace FluxNode Collateral TX ID outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" else sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode outpoint replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}FluxNode Collateral TX ID replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" fi fi fi if [[ "$zelnodeindex" != "" ]]; then if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}Replace FluxNode Output Index skipped......................[${CHECK_MARK}${CYAN}]${NC}" else sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" + echo -e "${ARROW} ${CYAN}FluxNode Output Index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" fi fi fi @@ -1555,7 +1555,8 @@ function upnp_enable() { if [[ "$error_check" == "" ]]; then echo -e "" LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') - echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${LOCAL_IP}:$(($FLUX_PORT-1))${NC}" + ZELFRONTPORT=$(($FLUX_PORT-1)) + echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${LOCAL_IP}:$ZELFRONTPORT${NC}" echo -e "" else echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" diff --git a/install_pro.sh b/install_pro.sh index c3c5c5f6..d9f38dda 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -533,8 +533,8 @@ function create_conf() { fi if [[ "$IMPORT_ZELCONF" == "0" ]]; then zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) - zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) - zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) + zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3) + zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Output Index usually a 0/1" 8 60 3>&1 1>&2 2>&3) fi mkdir /home/$USER/$CONFIG_DIR > /dev/null 2>&1 flux_daemon_conf_create diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 746595a9..833503bd 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -60,11 +60,11 @@ if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Collateral Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 if [[ "$OLD_CONFIG" == "1" ]]; then CONFIG_DIR='.flux' @@ -104,9 +104,9 @@ else echo echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//') - echo -e "${PIN}${CYAN} Private Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" && sleep 1 zelnodeoutpoint=$(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - echo -e "${PIN}${CYAN} Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 + echo -e "${PIN}${CYAN} Collateral Output TX ID = ${GREEN}$zelnodeoutpoint${NC}" && sleep 1 zelnodeindex=$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" && sleep 1 @@ -646,9 +646,9 @@ function create_conf() { if [[ "$IMPORT_ZELCONF" == "0" ]] then - zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Privkey generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) - zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral txid" 8 72 3>&1 1>&2 2>&3) - zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode collateral output index usually a 0/1" 8 60 3>&1 1>&2 2>&3) + zelnodeprivkey=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3) + zelnodeoutpoint=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3) + zelnodeindex=$(whiptail --title "Flux daemon configuration" --inputbox "Enter your FluxNode Output Index usually a 0/1" 8 60 3>&1 1>&2 2>&3) fi diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 00d92122..5025afec 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -391,9 +391,9 @@ zelid="" kda_address="" else -prvkey=$(whiptail --inputbox "Enter your FluxNode Private Key from Zelcore" 8 65 3>&1 1>&2 2>&3) +prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) sleep 1 -outpoint=$(whiptail --inputbox "Enter your FluxNode Output TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) +outpoint=$(whiptail --inputbox "Enter your FluxNode Collateral Output TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) sleep 1 index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) sleep 1 @@ -1061,28 +1061,28 @@ echo echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" sleep 4 skip_change='3' -zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Private Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" +zelnodeprivkey="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" sleep 1 -zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output TX ID" 8 72 3>&1 1>&2 2>&3)" +zelnodeoutpoint="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3)" sleep 1 -zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" +zelnodeindex="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode Output Index usually a 0/1" 8 60 3>&1 1>&2 2>&3)" sleep 1 #externalip="$(whiptail --title "Flux daemon reconfiguration" --inputbox "Enter your FluxNode IP" 8 60 3>&1 1>&2 2>&3)" #sleep 1 if [[ "$zelnodeprivkey" == "" ]]; then skip_change=$((skip_change-1)) -echo -e "${ARROW} ${CYAN}Replace FluxNode privkey skipped....................[${CHECK_MARK}${CYAN}]${NC}" +echo -e "${ARROW} ${CYAN}Replace FluxNode Identity skipped....................[${CHECK_MARK}${CYAN}]${NC}" fi if [[ "$zelnodeoutpoint" == "" ]]; then skip_change=$((skip_change-1)) -echo -e "${ARROW} ${CYAN}Replace FluxNode outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" +echo -e "${ARROW} ${CYAN}Replace FluxNode Collateral TX ID skipped ..................[${CHECK_MARK}${CYAN}]${NC}" fi if [[ "$zelnodeindex" == "" ]]; then skip_change=$((skip_change-1)) -echo -e "${ARROW} ${CYAN}Replace FluxNode index skipped......................[${CHECK_MARK}${CYAN}]${NC}" +echo -e "${ARROW} ${CYAN}Replace FluxNode Output Index skipped......................[${CHECK_MARK}${CYAN}]${NC}" fi #if [[ "$externalip" == "" ]]; then diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index ca5300be..9fdc620f 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -439,7 +439,7 @@ if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ZELCONF="1" zelnodeprivkey="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Identity Key generated by your Zelcore" 8 72 3>&1 1>&2 2>&3)" zelnodeoutpoint="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Collateral TX ID" 8 72 3>&1 1>&2 2>&3)" - zelnodeindex="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Output Index" 8 60 3>&1 1>&2 2>&3)" + zelnodeindex="$(whiptail --title "Deamon configuration" --inputbox "Enter your FluxNode Output Index usually a 0/1" 8 60 3>&1 1>&2 2>&3)" fi fi flux_communication=$(curl -SsL -m 10 http://"$WANIP":"$FluxAPI"/flux/checkcommunication 2>/dev/null | jq -r .data.message 2>/dev/null) From 8fb6c1dded409bf8fd7b34c72290d7f4a07b6ed9 Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Mon, 14 Nov 2022 22:28:03 -0600 Subject: [PATCH 0763/1176] Adding docker username var detection --- multitoolbox_testnet.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 5025afec..474ba011 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -956,8 +956,12 @@ if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then fi -usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" -usernew=$(awk '{print tolower($0)}' <<< "$usernew") +if [[ -z "$usernew" ]]; then + usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" + usernew=$(awk '{print tolower($0)}' <<< "$usernew") +else + echo -e "${PIN}${CYAN} Import docker user '$usernew' from environment variable............[${CHECK_MARK}${CYAN}]${NC}" +fi echo -e "${ARROW} ${CYAN}New User: ${GREEN}${usernew}${NC}" adduser --gecos "" "$usernew" usermod -aG sudo "$usernew" > /dev/null 2>&1 From 24c313a61c2f3dda337d42d49063ff9e1458a89f Mon Sep 17 00:00:00 2001 From: Matthew DeGarmo <matthewjdegarmo@gmail.com> Date: Mon, 14 Nov 2022 22:30:23 -0600 Subject: [PATCH 0764/1176] version bump --- multitoolbox_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 474ba011..607dee46 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -36,7 +36,7 @@ FLUX_DIR='zelflux' FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' -dversion="v6.0" +dversion="v6.1" PM2_INSTALL="0" zelflux_setting_import="0" From 5c5ea1106a5c61a1412f9ee1e1de14a9ce0bfc79 Mon Sep 17 00:00:00 2001 From: JKTUNING <john@j-k-tuning.com> Date: Tue, 15 Nov 2022 17:44:53 -0500 Subject: [PATCH 0765/1176] Invalid OS Version Prompts (#79) * Consistent Verbiage for Collateral Info Replaced any instance of private key with Identity key Format Flux Node Collateral TX ID to be the same when prompted or displayed Format Flux Node Output Index to be the same when prompted or displayed * gui port fix when enabling upnp during opt 2 * Prompt user of invalid OS and suggest version --- install_pro.sh | 4 ++-- install_pro_testnet.sh | 2 +- multitoolbox.sh | 12 ++++++++---- multitoolbox_testnet.sh | 28 +++++++++++++++------------- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index d9f38dda..491ad426 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -714,7 +714,7 @@ function install_process() { elif [[ $(lsb_release -d) = *Ubuntu* ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 else - echo -e "${WORNING} ${RED}OS type not supported..${NC}" + echo -e "${WORNING} ${RED}OS type $(lsb_release -si) not supported..${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit @@ -726,7 +726,7 @@ function install_process() { elif [[ $(lsb_release -d) = *Ubuntu* ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 else - echo -e "${WORNING} ${RED}OS type not supported..${NC}" + echo -e "${WORNING} ${RED}OS type $(lsb_release -si) not supported..${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index 833503bd..b8487b9f 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1084,7 +1084,7 @@ function install_process() { else - echo -e "${WORNING} ${RED}OS type not supported..${NC}" + echo -e "${WORNING} ${RED}OS type $(lsb_release -si) - $(lsb_release -cs) not supported..${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit diff --git a/multitoolbox.sh b/multitoolbox.sh index 895b1e0c..db295e03 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -718,13 +718,15 @@ function install_node(){ exit fi if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) not supported${NC}" + eecho -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit fi if [[ $(lsb_release -cs) == "jammy" ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" + echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit @@ -748,13 +750,15 @@ function install_docker(){ exit fi if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) not supported${NC}" + echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit fi if [[ $(lsb_release -cs) == "jammy" ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" + echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 5025afec..7cebadd5 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -900,19 +900,20 @@ echo -e "${GREEN}Module: Install FluxNode${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit fi if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) not supported${NC}" + echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit fi @@ -949,10 +950,11 @@ fi if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version not supported${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) not supported${NC}" + echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit fi From 5d710829f57882dc5c843b5a2dab2681d807344f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 28 Nov 2022 20:32:50 +0100 Subject: [PATCH 0766/1176] updated mongodb purge instruction --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index db295e03..7aef6301 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -916,7 +916,7 @@ function mongod_db_fix() { #echo -e "${ARROW} ${CYAN}Backuping Database... ${NC}" #mongodump --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing MongoDB... ${NC}" - sudo apt-get purge mongodb-org -y > /dev/null 2>&1 + sudo apt-get purge mongodb-org* -y > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing Database... ${NC}" sudo rm -r /var/log/mongodb > /dev/null 2>&1 sudo rm -r /var/lib/mongodb > /dev/null 2>&1 From 5b5035787de9ab24c0402a5b436f9fe679925fa0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 28 Nov 2022 20:37:53 +0100 Subject: [PATCH 0767/1176] added mongodb status in soft fix --- multitoolbox.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7aef6301..709fbfe6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -905,6 +905,10 @@ function mongod_db_fix() { sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting mongod service ${NC}" sudo systemctl start mongod + if mongod --version > /dev/null 2>&1; then + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo -e "${ARROW} ${CYAN}Service status:${SEA} $(sudo systemctl status mongod | grep -w 'Active' | sed -e 's/^[ \t]*//')${NC}" + fi echo -e "" ;; "2)") From d516c60dfecb4b39186884fb486bb96e898104f5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 28 Nov 2022 23:30:53 +0100 Subject: [PATCH 0768/1176] added smart config function --- flux_common.sh | 151 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 00644e72..3ba046bb 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -256,6 +256,157 @@ function install_conf_create(){ } EOF } + + +###### SMART CONFIG +function padding() { +msg="$1" +padding=".................................................................................................................." +echo -e "$(printf "%s%s %s\n" "$msg" "${CYAN}${padding:${#msg}}" "${CYAN}[$2${CYAN}]${NC}")" +} + +function insert() { + local file="$1" line="$2" newText="$3" + sudo sed -i -e "/$line/i"$'\\\n'"$newText"$'\n' "$file" +} + + +function config_builder() { + + if [[ "$4" == "fluxos" ]]; then + + if [[ "$1" == "" || "$2" == "" ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + return + fi + + key="$1" + value="$2" + if [[ "$1" == "kadena" ]]; then + if [[ $( grep "chainid" <<< "$2") == "" ]]; then + value="kadena:$2?chainid=0" + fi + fi + + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then + insert "/home/$USER/$FLUX_DIR//config/userconfig.js" "testnet" " $key: '$value'," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" + return + fi + + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key: '$value'") != "" ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 skipped${NC}" "${X_MARK}" + return + fi + + if [[ $(cat /home/$USER/$FLUX_DIR//config/userconfig.js | grep "$key") != "" ]]; then + sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: '$value',/" /home/$USER/$FLUX_DIR/config/userconfig.js + if [[ $(grep -w $value /home/$USER/$FLUX_DIR/config/userconfig.js) != "" ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" + fi + fi + fi + if [[ "$4" == "daemon" ]]; then + if [[ "$1" == "" || "$2" == "" ]]; then + padding "${ARROW}${GREEN} [Daemon] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + return + fi + + if [[ "$1=$2" == $(grep -w $1 ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 skipped${NC}" "${X_MARK}" + else + sed -i "s/$(grep -e $1 ~/$CONFIG_DIR/$CONFIG_FILE)/$1=$2/" ~/$CONFIG_DIR/$CONFIG_FILE + if [[ "$1=$2" == $(grep -w $1 ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 replaced successful${NC}" "${CHECK_MARK}" + fi + fi + + fi + + if [[ "$4" == "watchdog" ]]; then + + if [[ "$1" == "" || "$2" == "" ]]; then + padding "${ARROW}${GREEN} [Daemon] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + return + fi + + if [[ $(cat /home/$USER/watchdog/config.js | grep "$1: '$2'") != "" ]]; then + padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 skipped${NC}" "${X_MARK}" + return + fi + if [[ $(cat /home/$USER/watchdog/config.js | grep "$1") != "" ]]; then + sed -i "s/$(grep -e $1 /home/$USER/watchdog/config.js)/ $1: '$2',/" /home/$USER/watchdog/config.js + if [[ $(grep -w $2 /home/$USER/watchdog/config.js) != "" ]]; then + padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" + fi + fi + fi +} + + +function smart_reconfiguration(){ + +watchdog_settings_list=("label", "tier_eps_min", "zelflux_update", "zelcash_update", "zelbench_update", "action", "ping", "web_hook_url", "telegram_alert", "telegram_bot_token", "telegram_chat_id") +fluxos_settings_list=("kadena", "zelid", "apiport", "ipaddress") +daemon_settings_list=("zelnodeprivkey", "zelnodeoutpoint", "zelnodeindex") + +config_list=$(cat <<-END + { + "prvkey": [{"key": "zelnodeprivkey", "label": "Identity key"}], + "outpoint": [{"key": "zelnodeoutpoint", "label": "Collateral TX ID"}], + "index": [{"key": "zelnodeindex", "label": "Output Index"}], + "node_label": [{"key": "label", "label": "Node Label"}], + "kda_address": [{"key": "kadena", "label": "Kadena Address"}], + "upnp_port": [{"key": "apiport", "label": "UPnP Port"}] + } +END +) + +install_settings=($(jq -r 'keys | @sh' install_conf.json)) +for i in "${install_settings[@]}" +do + +install_key=$(echo $i | tr -d "'") +key=$(jq -r .$install_key[].key 2> /dev/null <<< "$config_list") +if [[ "$key" == "" ]]; then +key=$install_key +fi + +label=$(jq -r .$install_key[].label 2> /dev/null <<< "$config_list") +if [[ "$label" == "" ]]; then +label=${install_key^} +fi + +if [[ $(echo ${daemon_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then + config="daemon" + value=$(jq -r .$install_key install_conf.json) + config_builder "$key" "$value" "$label" "$config" +fi + +if [[ $(echo ${fluxos_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then + config="fluxos" + value=$(jq -r .$install_key install_conf.json) + config_builder "$key" "$value" "$label" "$config" +fi + +if [[ $(echo ${watchdog_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then + config="watchdog" + value=$(jq -r .$install_key install_conf.json) + config_builder "$key" "$value" "$label" "$config" +fi + +done + +} + +function smart_install_conf(){ + if [[ ! -f /home/$USER/install_conf.json ]]; then + echo "{}" > install_conf.json + fi + echo "$(jq -r --arg key "$key"--arg value "$value" '.[$key]=$value' install_conf.json)" > install_conf.json +} + + ###### HELPERS SECTION function round() { printf "%.${2}f" "${1}" From c991933d96ccd5279283f5ee4fec882937d2308f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 28 Nov 2022 23:39:28 +0100 Subject: [PATCH 0769/1176] fix arg --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 3ba046bb..b9bdb317 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -403,7 +403,7 @@ function smart_install_conf(){ if [[ ! -f /home/$USER/install_conf.json ]]; then echo "{}" > install_conf.json fi - echo "$(jq -r --arg key "$key"--arg value "$value" '.[$key]=$value' install_conf.json)" > install_conf.json + echo "$(jq -r --arg key "$1"--arg value "$2" '.[$key]=$value' install_conf.json)" > install_conf.json } From adc6846e88b03503ec014f9c5b7a8c737e3f7801 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Nov 2022 00:25:16 +0100 Subject: [PATCH 0770/1176] added config_smart_create and update config list --- flux_common.sh | 156 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 146 insertions(+), 10 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index b9bdb317..4050fa30 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -350,16 +350,20 @@ watchdog_settings_list=("label", "tier_eps_min", "zelflux_update", "zelcash_upda fluxos_settings_list=("kadena", "zelid", "apiport", "ipaddress") daemon_settings_list=("zelnodeprivkey", "zelnodeoutpoint", "zelnodeindex") -config_list=$(cat <<-END - { - "prvkey": [{"key": "zelnodeprivkey", "label": "Identity key"}], - "outpoint": [{"key": "zelnodeoutpoint", "label": "Collateral TX ID"}], - "index": [{"key": "zelnodeindex", "label": "Output Index"}], - "node_label": [{"key": "label", "label": "Node Label"}], - "kda_address": [{"key": "kadena", "label": "Kadena Address"}], - "upnp_port": [{"key": "apiport", "label": "UPnP Port"}] - } -END + config_list=$(cat <<-END + { + "prvkey": [{"key": "zelnodeprivkey", "label": "Identity Key"}], + "outpoint": [{"key": "zelnodeoutpoint", "label": "Collateral TX ID"}], + "index": [{"key": "zelnodeindex", "label": "Output Index"}], + "node_label": [{"key": "label", "label": "Node Label"}], + "kda_address": [{"key": "kadena", "label": "Kadena Address"}], + "ping": [{"key": "ping", "label": "Discord Nick Ping"}], + "zelflux_update": [{"key": "zelflux_update", "label": "FluxOS Auto Update"}], + "zelcash_update": [{"key": "zelcash_update", "label": "Daemon Auto Update"}], + "zelbench_update": [{"key": "zelbench_update", "label": "Benchmark Auto Update"}], + "upnp_port": [{"key": "apiport", "label": "UPnP Port"}] + } + END ) install_settings=($(jq -r 'keys | @sh' install_conf.json)) @@ -406,6 +410,138 @@ function smart_install_conf(){ echo "$(jq -r --arg key "$1"--arg value "$2" '.[$key]=$value' install_conf.json)" > install_conf.json } +function config_smart_create() { + + rm -rf /home/$USER/install_conf.json + #daemon + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported daemon settings:${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" + smart_install_conf "prvkey" "$zelnodeprivkey" + zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" + smart_install_conf "outpoint" "$zelnodeoutpoint" + zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" + smart_install_conf "index" "$zelnodeindex" + fi + #fluxOS + if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported fluxOS settings:${NC}" + ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" + smart_install_conf "zelid" "$ZELID" + fi + KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" + smart_install_conf "kda_address" "$KDA_A" + fi + upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | sed -e 's/.\{2\}$//') + if [[ "$upnp_port" != "" ]]; then + gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" + echo -e "${PIN}${CYAN} Gateway IP = ${GREEN}$gateway_ip${NC}" + smart_install_conf "upnp_port" "$upnp_port" + smart_install_conf "gateway_ip" "$gateway_ip" + fi + fi + #watchdog + if [[ -f /home/$USER/watchdog/config.js ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" + smart_install_conf "node_label" "$node_label" + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" + fi + + eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + smart_install_conf "eps_limit" "$eps_limit" + fi + + discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + smart_install_conf "discord" "$discord" + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" + fi + ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord nick ping = ${GREEN}Enabled${NC}" + smart_install_conf "ping" "$ping" + else + echo -e "${PIN}${CYAN} Discord nick ping = ${RED}Disabled${NC}" + fi + fi + telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" + smart_install_conf "telegram_alert" "$telegram_alert" + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" + smart_install_conf "telegram_alert" "0" + fi + + telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_bot_token${NC}" + smart_install_conf "telegram_bot_token" "$telegram_bot_token" + fi + + telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" + smart_install_conf "telegram_chat_id" "$telegram_chat_id" + fi + + zelflux_update=$(grep -w zelflux_update /home/$USER/watchdog/config.js | sed -e 's/.*zelflux_update: .//' | egrep -o '[0-9]') + if [[ "$zelflux_update" == "1" ]]; then + echo -e "${PIN}${CYAN} FluxOS auto update = ${GREEN}Enabled${NC}" + smart_install_conf "zelflux_update" "1" + else + echo -e "${PIN}${CYAN} FluxOS auto update = ${GREEN}Disabled${NC}" + smart_install_conf "zelflux_update" "0" + fi + + zelcash_update=$(grep -w zelcash_update /home/$USER/watchdog/config.js | sed -e 's/.*zelcash_update: .//' | egrep -o '[0-9]') + if [[ "$zelcash_update" == "1" ]]; then + echo -e "${PIN}${CYAN} Daemon auto update = ${GREEN}Enabled${NC}" + smart_install_conf "zelcash_update" "1" + else + echo -e "${PIN}${CYAN} Daemon auto update = ${GREEN}Disabled${NC}" + smart_install_conf "zelcash_update" "0" + fi + + zelbench_update=$(grep -w zelbench_update /home/$USER/watchdog/config.js | sed -e 's/.*zelbench_update: .//' | egrep -o '[0-9]') + if [[ "$zelbench_update" == "1" ]]; then + echo -e "${PIN}${CYAN} Benchmark auto update = ${GREEN}Enabled${NC}" + smart_install_conf "zelbench_update" "1" + else + echo -e "${PIN}${CYAN} Benchmark auto update = ${GREEN}Disabled${NC}" + smart_install_conf "zelbench_update" "0" + fi + + action=$(grep -w action /home/$USER/watchdog/config.js | sed -e 's/.*action: .//' | egrep -o '[0-9]') + if [[ "$action" == "1" ]]; then + echo -e "${PIN}${CYAN} Fix action = ${GREEN}Enabled${NC}" + smart_install_conf "action" "1" + else + echo -e "${PIN}${CYAN} Fix action = ${GREEN}Disabled${NC}" + smart_install_conf "action" "0" + fi + fi +} ###### HELPERS SECTION function round() { From d594323eb2fd64330f4ad7efea09b3fa4eae557f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Nov 2022 00:28:51 +0100 Subject: [PATCH 0771/1176] fix path --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 4050fa30..21c04445 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -428,7 +428,7 @@ function config_smart_create() { smart_install_conf "index" "$zelnodeindex" fi #fluxOS - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then + if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then echo -e "" echo -e "${ARROW} ${YELLOW}Imported fluxOS settings:${NC}" ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') From d432e2296f6d1ed13f441afec4f104155bc05620 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Nov 2022 13:45:17 +0100 Subject: [PATCH 0772/1176] added fluxos_clean --- flux_common.sh | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 21c04445..6fd3486e 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -542,8 +542,40 @@ function config_smart_create() { fi fi } - ###### HELPERS SECTION +function fluxos_clean(){ + docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) + resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) + if [[ $docker_check != 0 ]]; then + echo -e "${ARROW} ${CYAN}Removing containers...${NC}" + sudo service docker restart > /dev/null 2>&1 && sleep 2 + docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | + while read line; do + sudo docker stop $line > /dev/null 2>&1 && sleep 2 + sudo docker rm $line > /dev/null 2>&1 && sleep 2 + done + fi + if [[ $resource_check != 0 ]]; then + echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 + df | egrep 'flux' | awk '{ print $1}' | + while read line; do + sudo umount -l $line && sleep 1 + done + fi + if [[ -d /home/$USER/zelflux/ZelApps ]]; then + echo -e "${ARROW} ${CYAN}Removing FluxApps directory...${NC}" && sleep 1 + APPS_LIST=($(find /home/$USER/zelflux/ZelApps -maxdepth 1 -mindepth 1 -type d -printf '%P\n')) + LENGTH=${#APPS_LIST[@]} + for (( j=0; j<${LENGTH}; j++ )); + do + if [[ "${APPS_LIST[$j]}" != "ZelShare" && "${APPS_LIST[$j]}" != "" ]]; then + echo -e "${ARROW} ${CYAN}Apps directory removed, path: ${GREEN}/home/$USER/zelflux/ZelApps/${APPS_LIST[$j]}${NC}" + rm -rf /home/$USER/zelflux/ZelApps/${APPS_LIST[$j]} + fi + done + fi +} + function round() { printf "%.${2}f" "${1}" } From 4a72a56a136a7a2755a16784053df5e27fc72027 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Nov 2022 13:48:56 +0100 Subject: [PATCH 0773/1176] added fluxos_clean diuring mongod hard fix --- multitoolbox.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 709fbfe6..bafcb3cf 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -918,7 +918,7 @@ function mongod_db_fix() { sudo systemctl stop mongod #sudo rm -rf /home/$USER/mongoDB_backup.gz > /dev/null 2>&1 #echo -e "${ARROW} ${CYAN}Backuping Database... ${NC}" - #mongodump --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 + #mongodump --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing MongoDB... ${NC}" sudo apt-get purge mongodb-org* -y > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing Database... ${NC}" @@ -932,7 +932,8 @@ function mongod_db_fix() { sudo chown -R mongodb:mongodb /var/log/mongodb > /dev/null 2>&1 sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 - #echo -e "${ARROW} ${CYAN}Restoring Database... ${NC}" + fluxos_clean + #echo -e "${ARROW} ${CYAN}Restoring Database... ${NC}" #mongorestore --drop --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" sudo systemctl start mongod From e78a57bd9b05b3fb140026d2dea49308b5038b81 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Nov 2022 14:06:05 +0100 Subject: [PATCH 0774/1176] config_list correction --- flux_common.sh | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 6fd3486e..f6d3c8f6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -349,21 +349,20 @@ function smart_reconfiguration(){ watchdog_settings_list=("label", "tier_eps_min", "zelflux_update", "zelcash_update", "zelbench_update", "action", "ping", "web_hook_url", "telegram_alert", "telegram_bot_token", "telegram_chat_id") fluxos_settings_list=("kadena", "zelid", "apiport", "ipaddress") daemon_settings_list=("zelnodeprivkey", "zelnodeoutpoint", "zelnodeindex") - - config_list=$(cat <<-END - { - "prvkey": [{"key": "zelnodeprivkey", "label": "Identity Key"}], - "outpoint": [{"key": "zelnodeoutpoint", "label": "Collateral TX ID"}], - "index": [{"key": "zelnodeindex", "label": "Output Index"}], - "node_label": [{"key": "label", "label": "Node Label"}], - "kda_address": [{"key": "kadena", "label": "Kadena Address"}], - "ping": [{"key": "ping", "label": "Discord Nick Ping"}], - "zelflux_update": [{"key": "zelflux_update", "label": "FluxOS Auto Update"}], - "zelcash_update": [{"key": "zelcash_update", "label": "Daemon Auto Update"}], - "zelbench_update": [{"key": "zelbench_update", "label": "Benchmark Auto Update"}], - "upnp_port": [{"key": "apiport", "label": "UPnP Port"}] - } - END +config_list=$(cat <<-END +{ + "prvkey": [{"key": "zelnodeprivkey", "label": "Identity Key"}], + "outpoint": [{"key": "zelnodeoutpoint", "label": "Collateral TX ID"}], + "index": [{"key": "zelnodeindex", "label": "Output Index"}], + "node_label": [{"key": "label", "label": "Node Label"}], + "kda_address": [{"key": "kadena", "label": "Kadena Address"}], + "ping": [{"key": "ping", "label": "Discord Nick Ping"}], + "zelflux_update": [{"key": "zelflux_update", "label": "FluxOS Auto Update"}], + "zelcash_update": [{"key": "zelcash_update", "label": "Daemon Auto Update"}], + "zelbench_update": [{"key": "zelbench_update", "label": "Benchmark Auto Update"}], + "upnp_port": [{"key": "apiport", "label": "UPnP Port"}] + } +END ) install_settings=($(jq -r 'keys | @sh' install_conf.json)) From 9be2a9145beaf39dacdaae65cfec7ff0ac053511 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Nov 2022 14:13:41 +0100 Subject: [PATCH 0775/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f6d3c8f6..5016c819 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -562,7 +562,7 @@ function fluxos_clean(){ done fi if [[ -d /home/$USER/zelflux/ZelApps ]]; then - echo -e "${ARROW} ${CYAN}Removing FluxApps directory...${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Cleaning FluxOS Apps directory...${NC}" && sleep 1 APPS_LIST=($(find /home/$USER/zelflux/ZelApps -maxdepth 1 -mindepth 1 -type d -printf '%P\n')) LENGTH=${#APPS_LIST[@]} for (( j=0; j<${LENGTH}; j++ )); From b0fe2414785fd87ca7c5538d5ddf857cb6a28314 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Nov 2022 14:40:42 +0100 Subject: [PATCH 0776/1176] added benchmark_settings_list --- flux_common.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 5016c819..1c1e1a7d 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -349,6 +349,7 @@ function smart_reconfiguration(){ watchdog_settings_list=("label", "tier_eps_min", "zelflux_update", "zelcash_update", "zelbench_update", "action", "ping", "web_hook_url", "telegram_alert", "telegram_bot_token", "telegram_chat_id") fluxos_settings_list=("kadena", "zelid", "apiport", "ipaddress") daemon_settings_list=("zelnodeprivkey", "zelnodeoutpoint", "zelnodeindex") +benchmark_settings_list=("fluxport", "thunder", "speedtestserverid") config_list=$(cat <<-END { "prvkey": [{"key": "zelnodeprivkey", "label": "Identity Key"}], @@ -360,6 +361,9 @@ config_list=$(cat <<-END "zelflux_update": [{"key": "zelflux_update", "label": "FluxOS Auto Update"}], "zelcash_update": [{"key": "zelcash_update", "label": "Daemon Auto Update"}], "zelbench_update": [{"key": "zelbench_update", "label": "Benchmark Auto Update"}], + "fluxport": [{"key": "zelbench_update", "label": "Multi Node Port"}], + "thunder": [{"key": "zelbench_update", "label": "Thunder Mode"}], + "speedtestserverid": [{"key": "zelbench_update", "label": "Speed Test Server ID"}], "upnp_port": [{"key": "apiport", "label": "UPnP Port"}] } END From da3b85998717ec225e4702bd8a6cba713b99f457 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Nov 2022 16:34:15 +0100 Subject: [PATCH 0777/1176] fix memory flage --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 1c1e1a7d..fcf4ac36 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1550,7 +1550,7 @@ function pm2_install(){ } function finalizing() { cd - pm2 start /home/$USER/$FLUX_DIR/start.sh --max_memory_restart 2G --restart-delay 30000 --max-restarts 40 --name flux --time > /dev/null 2>&1 + pm2 start /home/$USER/$FLUX_DIR/start.sh --max-memory-restart 2G --restart-delay 30000 --max-restarts 40 --name flux --time > /dev/null 2>&1 pm2 save > /dev/null 2>&1 #sleep 120 #cd /home/$USER/zelflux From 0c05323556a4098310f9a612935bcefcf767150b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 30 Nov 2022 12:26:16 +0100 Subject: [PATCH 0778/1176] more strict conditional --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index fcf4ac36..8433467e 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -565,7 +565,7 @@ function fluxos_clean(){ sudo umount -l $line && sleep 1 done fi - if [[ -d /home/$USER/zelflux/ZelApps ]]; then + if [[ -d /home/$USER/zelflux/ZelApps && $(find /home/$USER/zelflux/ZelApps -maxdepth 1 -mindepth 1 -type d | wc -l) -gt 1 ]]; then echo -e "${ARROW} ${CYAN}Cleaning FluxOS Apps directory...${NC}" && sleep 1 APPS_LIST=($(find /home/$USER/zelflux/ZelApps -maxdepth 1 -mindepth 1 -type d -printf '%P\n')) LENGTH=${#APPS_LIST[@]} From 3d182e25d5e1dd26f4b98f45d2bcb83b2d362969 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 30 Nov 2022 13:13:49 +0100 Subject: [PATCH 0779/1176] Delete remote_call.sh --- remote_call.sh | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 remote_call.sh diff --git a/remote_call.sh b/remote_call.sh deleted file mode 100644 index f7434c54..00000000 --- a/remote_call.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -echo -echo "# arguments called with ----> ${@} " -echo "# \$0 ----------------------> $0 " -echo "# \$1 ----------------------> $1 " -echo "# \$2 ----------------------> $2 " -echo "# path to me ---------------> ${0} " -echo "# parent path --------------> ${0%/*} " -echo "# my name ------------------> ${0##*/} " -echo -exit From 3ef5a96bef8b5132bb86cd46119acb5b88727286 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 30 Nov 2022 17:36:16 +0100 Subject: [PATCH 0780/1176] smart builder improvements - added full benchmark config support --- flux_common.sh | 147 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 52 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 8433467e..7efa97d5 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -270,16 +270,17 @@ function insert() { sudo sed -i -e "/$line/i"$'\\\n'"$newText"$'\n' "$file" } - function config_builder() { - + ######################################################## if [[ "$4" == "fluxos" ]]; then - + if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + return + fi if [[ "$1" == "" || "$2" == "" ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" return fi - key="$1" value="$2" if [[ "$1" == "kadena" ]]; then @@ -287,18 +288,15 @@ function config_builder() { value="kadena:$2?chainid=0" fi fi - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then insert "/home/$USER/$FLUX_DIR//config/userconfig.js" "testnet" " $key: '$value'," padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return fi - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key: '$value'") != "" ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 skipped${NC}" "${X_MARK}" return fi - if [[ $(cat /home/$USER/$FLUX_DIR//config/userconfig.js | grep "$key") != "" ]]; then sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: '$value',/" /home/$USER/$FLUX_DIR/config/userconfig.js if [[ $(grep -w $value /home/$USER/$FLUX_DIR/config/userconfig.js) != "" ]]; then @@ -306,30 +304,73 @@ function config_builder() { fi fi fi + ##################################################### if [[ "$4" == "daemon" ]]; then + if [[ ! -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + padding "${ARROW}${GREEN} [Daemon] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + return + fi if [[ "$1" == "" || "$2" == "" ]]; then padding "${ARROW}${GREEN} [Daemon] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" return fi - - if [[ "$1=$2" == $(grep -w $1 ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + if [[ ! $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) && -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + echo "$1=$2" >> /home/$USER/$CONFIG_DIR/$CONFIG_FILE + if [[ "$1=$2" == $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) ]]; then + padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 added successful${NC}" "${CHECK_MARK}" + return + fi + fi + if [[ "$1=$2" == $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) ]]; then padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 skipped${NC}" "${X_MARK}" + return else - sed -i "s/$(grep -e $1 ~/$CONFIG_DIR/$CONFIG_FILE)/$1=$2/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "$1=$2" == $(grep -w $1 ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + sed -i "s/$(grep -e $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE)/$1=$2/" /home/$USER/$CONFIG_DIR/$CONFIG_FILE + if [[ "$1=$2" == $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) ]]; then padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 replaced successful${NC}" "${CHECK_MARK}" fi fi - fi - + ################################################### + if [[ "$4" == "benchmark" ]]; then + if [[ "$1" == "" || "$2" == "" ]]; then + padding "${ARROW}${GREEN} [BenchD] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + return + fi + if [[ ! -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + mkdir -p /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 + echo "$1=$2" >> /home/$USER/.fluxbenchmark/fluxbench.conf + if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successful${NC}" "${CHECK_MARK}" + return + fi + fi + if [[ ! $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then + echo "$1=$2" >> /home/$USER/.fluxbenchmark/fluxbench.conf + if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successful${NC}" "${CHECK_MARK}" + return + fi + fi + if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 skipped${NC}" "${X_MARK}" + else + sed -i "s/$(grep -e $1 /home/$USER/.fluxbenchmark/fluxbench.conf)/$1=$2/" /home/$USER/.fluxbenchmark/fluxbench.conf + if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 replaced successful${NC}" "${CHECK_MARK}" + fi + fi + fi + ################################################### if [[ "$4" == "watchdog" ]]; then - + if [[ ! -f /home/$USER/watchdog/config.js ]]; then + padding "${ARROW}${GREEN} [WatchD] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + return + fi if [[ "$1" == "" || "$2" == "" ]]; then - padding "${ARROW}${GREEN} [Daemon] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + padding "${ARROW}${GREEN} [WatchD] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" return fi - if [[ $(cat /home/$USER/watchdog/config.js | grep "$1: '$2'") != "" ]]; then padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 skipped${NC}" "${X_MARK}" return @@ -343,14 +384,12 @@ function config_builder() { fi } - function smart_reconfiguration(){ - -watchdog_settings_list=("label", "tier_eps_min", "zelflux_update", "zelcash_update", "zelbench_update", "action", "ping", "web_hook_url", "telegram_alert", "telegram_bot_token", "telegram_chat_id") -fluxos_settings_list=("kadena", "zelid", "apiport", "ipaddress") -daemon_settings_list=("zelnodeprivkey", "zelnodeoutpoint", "zelnodeindex") -benchmark_settings_list=("fluxport", "thunder", "speedtestserverid") -config_list=$(cat <<-END + watchdog_settings_list=("label", "tier_eps_min", "zelflux_update", "zelcash_update", "zelbench_update", "action", "ping", "web_hook_url", "telegram_alert", "telegram_bot_token", "telegram_chat_id") + fluxos_settings_list=("kadena", "zelid", "apiport", "ipaddress") + daemon_settings_list=("zelnodeprivkey", "zelnodeoutpoint", "zelnodeindex") + benchmark_settings_list=("fluxport", "thunder", "speedtestserverid") + config_list=$(cat <<-END { "prvkey": [{"key": "zelnodeprivkey", "label": "Identity Key"}], "outpoint": [{"key": "zelnodeoutpoint", "label": "Collateral TX ID"}], @@ -369,41 +408,45 @@ config_list=$(cat <<-END END ) -install_settings=($(jq -r 'keys | @sh' install_conf.json)) -for i in "${install_settings[@]}" -do + install_settings=($(jq -r 'keys | @sh' install_conf.json)) + for i in "${install_settings[@]}" + do -install_key=$(echo $i | tr -d "'") -key=$(jq -r .$install_key[].key 2> /dev/null <<< "$config_list") -if [[ "$key" == "" ]]; then -key=$install_key -fi - -label=$(jq -r .$install_key[].label 2> /dev/null <<< "$config_list") -if [[ "$label" == "" ]]; then -label=${install_key^} -fi + install_key=$(echo $i | tr -d "'") + key=$(jq -r .$install_key[].key 2> /dev/null <<< "$config_list") + if [[ "$key" == "" ]]; then + key=$install_key + fi -if [[ $(echo ${daemon_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then - config="daemon" - value=$(jq -r .$install_key install_conf.json) - config_builder "$key" "$value" "$label" "$config" -fi + label=$(jq -r .$install_key[].label 2> /dev/null <<< "$config_list") + if [[ "$label" == "" ]]; then + label=${install_key^} + fi -if [[ $(echo ${fluxos_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then - config="fluxos" - value=$(jq -r .$install_key install_conf.json) - config_builder "$key" "$value" "$label" "$config" -fi + if [[ $(echo ${daemon_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then + config="daemon" + value=$(jq -r .$install_key install_conf.json) + config_builder "$key" "$value" "$label" "$config" + fi -if [[ $(echo ${watchdog_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then - config="watchdog" - value=$(jq -r .$install_key install_conf.json) - config_builder "$key" "$value" "$label" "$config" -fi + if [[ $(echo ${benchmark_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then + config="benchmark" + value=$(jq -r .$install_key install_conf.json) + config_builder "$key" "$value" "$label" "$config" + fi -done + if [[ $(echo ${fluxos_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then + config="fluxos" + value=$(jq -r .$install_key install_conf.json) + config_builder "$key" "$value" "$label" "$config" + fi + if [[ $(echo ${watchdog_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then + config="watchdog" + value=$(jq -r .$install_key install_conf.json) + config_builder "$key" "$value" "$label" "$config" + fi + done } function smart_install_conf(){ From 4e5dcd9c35d6eeaba3fe099f9c98ba3ff87b5e69 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 30 Nov 2022 17:57:38 +0100 Subject: [PATCH 0781/1176] improvements config_smart_create -added benchmark config import --- flux_common.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 7efa97d5..6ee1bd2c 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -473,6 +473,26 @@ function config_smart_create() { echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" smart_install_conf "index" "$zelnodeindex" fi + #Benchmark + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported Benchmark settings:${NC}" + thunder=$(grep -Po "(?<=thunder=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) + if [[ "$thunder" == "1" ]]; then + echo -e "${PIN}${CYAN} Thunder Mode = ${GREEN}$ENABLED${NC}" + smart_install_conf "thunder" "$thunder" + fi + speedtestserverid=$(grep -Po "(?<=speedtestserverid=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) + if [[ "$speedtestserverid" != "" ]]; then + echo -e "${PIN}${CYAN} SpeedTest Server ID = ${GREEN}$speedtestserverid${NC}" + smart_install_conf "speedtestserverid" "$speedtestserverid" + fi + fluxport=$(grep -Po "(?<=fluxport=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) + if [[ "$fluxport" != "" ]]; then + echo -e "${PIN}${CYAN} Flux Port = ${GREEN}$fluxport${NC}" + smart_install_conf "fluxport" "$fluxport" + fi + fi #fluxOS if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then echo -e "" From 10ecf78e30e608a3e33badc5a77463d3560f765c Mon Sep 17 00:00:00 2001 From: John K <john@j-k-tuning.com> Date: Sun, 4 Dec 2022 02:08:03 -0500 Subject: [PATCH 0782/1176] Fix error with ip_check script --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 6b134e47..4f0aa8f8 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1748,8 +1748,8 @@ function selfhosting() { echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot /home/$USER/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * /home/$USER/ip_check.sh ip_check") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=$LOGNAME ~/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=$LOGNAME ~/ip_check.sh ip_check") | crontab - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" else echo -e "${ARROW} ${CYAN}Cron jobs already exists, skipped... ${NC}" From 8a367d5c67f341cc19d0753f332067531e4da219 Mon Sep 17 00:00:00 2001 From: John K <john@j-k-tuning.com> Date: Sun, 4 Dec 2022 08:12:01 -0500 Subject: [PATCH 0783/1176] use $HOME instead of ~ --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 4f0aa8f8..5168f6bd 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1748,8 +1748,8 @@ function selfhosting() { echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=$LOGNAME ~/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=$LOGNAME ~/ip_check.sh ip_check") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=$LOGNAME $HOME/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=$LOGNAME $HOME/ip_check.sh ip_check") | crontab - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" else echo -e "${ARROW} ${CYAN}Cron jobs already exists, skipped... ${NC}" From c7bf408dd4823f90163d3c31020fb9fbf9f7eb7a Mon Sep 17 00:00:00 2001 From: John K <john@j-k-tuning.com> Date: Sun, 4 Dec 2022 10:10:54 -0500 Subject: [PATCH 0784/1176] update to use variable in crontab file --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 5168f6bd..f1e1dc24 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1748,8 +1748,8 @@ function selfhosting() { echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=$LOGNAME $HOME/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=$LOGNAME $HOME/ip_check.sh ip_check") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=\$LOGNAME \$HOME/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=\$LOGNAME \$HOME/ip_check.sh ip_check") | crontab - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" else echo -e "${ARROW} ${CYAN}Cron jobs already exists, skipped... ${NC}" From 7b3f05248888fac8e174d5d1c273a238f53ac865 Mon Sep 17 00:00:00 2001 From: John K <john@j-k-tuning.com> Date: Mon, 5 Dec 2022 22:15:00 -0500 Subject: [PATCH 0785/1176] check for kinetic Ubuntu 22.10 --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index db295e03..ed82e8cd 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -724,7 +724,7 @@ function install_node(){ echo exit fi - if [[ $(lsb_release -cs) == "jammy" ]]; then + if [[ $(lsb_release -cs) == "jammy" || $(lsb_release -cs) == "kinetic" ]]; then echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" @@ -756,7 +756,7 @@ function install_docker(){ echo exit fi - if [[ $(lsb_release -cs) == "jammy" ]]; then + if [[ $(lsb_release -cs) == "jammy" || $(lsb_release -cs) == "kinetic" ]]; then echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" From 48eeb3969e8362cb3cd2933892143cd95ea830de Mon Sep 17 00:00:00 2001 From: John K <john@j-k-tuning.com> Date: Tue, 27 Dec 2022 23:21:22 -0500 Subject: [PATCH 0786/1176] Only output to ip_history if IP has changed --- flux_common.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 62b8fcbb..6f9ed3c1 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2095,10 +2095,8 @@ function selfhosting() { function get_device_name(){ if [[ -f /home/$USER/device_conf.json ]]; then device_name=$(jq -r .device_name /home/$USER/device_conf.json) - echo -e "Device from config, name: $device_name" >> /home/$USER/ip_history.log else device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - echo -e "Device auto detection, name $device_name" >> /home/$USER/ip_history.log fi } @@ -2109,7 +2107,7 @@ function selfhosting() { get_device_name if [[ "$device_name" != "" && "$WANIP" != "" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + echo -e "New IP detected, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log sudo ip addr add $WANIP dev $device_name && sleep 2 fi fi @@ -2124,7 +2122,7 @@ function selfhosting() { if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then if [[ "$WANIP" != "$confirmed_ip" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added at $date_timestamp" >> /home/$USER/ip_history.log + echo -e "New IP detected, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log sudo ip addr add $WANIP dev $device_name && sleep 2 fi fi From 1d02ac1ce04b9995c9aa26f51a5d1d28f80d8797 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 10:42:27 +0100 Subject: [PATCH 0787/1176] added create config menu - manual - auto --- multitoolbox.sh | 257 +++++------------------------------------------- 1 file changed, 22 insertions(+), 235 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 1ebde9ba..10324544 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -242,17 +242,20 @@ function install_flux() { fi fi } + + function create_config() { - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${GREEN}Module: Create FluxNode installation config file${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit - fi - echo -e "${GREEN}Module: Create FluxNode installation config file${NC}" - echo -e "${YELLOW}================================================================${NC}" - if jq --version > /dev/null 2>&1; then + fi + + if jq --version > /dev/null 2>&1; then sleep 0.2 else echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" @@ -268,240 +271,24 @@ function create_config() { exit fi fi - skip_zelcash_config='0' - skip_bootstrap='0' - if [[ -d /home/$USER/$CONFIG_DIR ]]; then - if whiptail --yesno "Would you like import old settings from daemon and Flux?" 8 65; then - import_settings='1' - skip_zelcash_config='1' - sleep 1 - else - import_settings='0' - sleep 1 - fi - if whiptail --yesno "Would you like use exist Flux chain?" 8 65; then - use_old_chain='1' - skip_bootstrap='1' - sleep 1 - else - use_old_chain='0' - sleep 1 - fi - fi - if [[ "$skip_zelcash_config" == "1" ]]; then - prvkey="" - outpoint="" - index="" - zelid="" - kda_address="" - node_label="0" - fix_action="1" - eps_limit="0" - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - else - prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) - sleep 1 - outpoint=$(whiptail --inputbox "Enter your FluxNode Collateral TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) - sleep 1 - index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) - sleep 1 - while true - do - zel_id=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) - if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then - echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" - break - else - echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" - sleep 4 - fi - done - sleep 1 - while true - do - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - KDA_A=$(grep -Eo "^k:[0-9a-z]{64}\b" <<< "$KDA_A") - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - kda_address="kadena:$KDA_A?chainid=0" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - sleep 1 - if whiptail --yesno "Would you like enable autoupdate?" 8 65; then - zelflux_update='1' - zelcash_update='1' - zelbench_update='1' - else - zelflux_update='0' - zelcash_update='0' - zelbench_update='0' - fi - if whiptail --yesno "Would you like enable alert notification?" 8 65; then - whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 - sleep 1 - CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ - "1" "Discord notification " ON \ - "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) - if [[ -z "$CHOICES" ]]; then - echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" - sleep 1 - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - node_label="0" - else - for CHOICE in $CHOICES; do - case "$CHOICE" in - "1") - discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) - sleep 1 - if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - while true - do - ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) - if [[ $ping == ?(-)+([0-9]) ]]; then - string_limit_check_mark "UserID is valid..........................................." - break - else - string_limit_x_mark "UserID is not valid try again............................." - sleep 1 - fi - done - sleep 1 - else - ping="0" - sleep 1 - fi - ;; - "2") - telegram_alert="1" - while true - do - telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) - if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then - string_limit_check_mark "Bot token is valid..........................................." - break - else - string_limit_x_mark "Bot token is not valid try again............................." - sleep 1 - fi - done - sleep 1 - while true - do - telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) - if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then - string_limit_check_mark "Chat ID is valid..........................................." - break - else - string_limit_x_mark "Chat ID is not valid try again............................." - sleep 1 - fi - done - sleep 1 - ;; - esac - done - fi - while true - do - node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - string_limit_check_mark "Node name is valid..........................................." - break - else - string_limit_x_mark "Node name is not valid try again............................." - sleep 1 - fi - done - else - discord="0" - ping="0" - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - node_label="0" - sleep 1 - fi + CHOICE=$( + whiptail --title "Create FluxNode installation config" --menu "Make your choice" 15 65 8 \ + "1)" "Manualy - fill questions list" \ + "2)" "Auto - import exists settings" 3>&2 2>&1 1>&3 + ) + case $CHOICE in + "1)") + manual_build + ;; + "2)") + config_smart_create + ;; + esac - if [[ "$discord" == 0 ]]; then - ping="0" - fi +} - if [[ "$telegram_alert" == 0 || "$telegram_alert" == "" ]]; then - telegram_alert="0" - telegram_bot_token="0" - telegram_chat_id="0" - fi - index_from_file="$index" - tx_from_file="$outpoint" - stak_info=$(curl -sSL -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -sSL -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') - fi - if [[ $stak_info == ?(-)+([0-9]) ]]; then - case $stak_info in - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; - esac - else - eps_limit=0; - fi - fi - if [[ "$skip_bootstrap" == "0" ]]; then - if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then - bootstrap_url="" - sleep 1 - else - bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) - sleep 1 - fi - if whiptail --yesno "Would you like keep bootstrap archive file localy?" 8 65; then - bootstrap_zip_del='0' - sleep 1 - else - bootstrap_zip_del='1' - sleep 1 - fi - fi - if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then - router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) - gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router: $router_ip)" 8 85 3>&1 1>&2 2>&3) - upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ - "Use the UP/DOWN arrows to highlight the port you want. Press Spacebar on the port you want to select, THEN press ENTER." 17 50 8 \ - "16127" "" ON \ - "16137" "" OFF \ - "16147" "" OFF \ - "16157" "" OFF \ - "16167" "" OFF \ - "16177" "" OFF \ - "16187" "" OFF \ - "16197" "" OFF 3>&1 1>&2 2>&3) - else - gateway_ip="" - upnp_port="" - fi - firewall_disable='1' - swapon='1' - rm /home/$USER/install_conf.json > /dev/null 2>&1 - install_conf_create - config_file - echo -e -} function install_watchdog() { if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" From 5744b5d75a93e452fa7ecfd03fdff6575902ce89 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 10:44:26 +0100 Subject: [PATCH 0788/1176] added manual_build --- flux_common.sh | 236 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 236 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 6f9ed3c1..9a911afd 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -608,6 +608,242 @@ function config_smart_create() { fi fi } + +function manual_build(){ + skip_zelcash_config='0' + skip_bootstrap='0' + if [[ -d /home/$USER/$CONFIG_DIR ]]; then + if whiptail --yesno "Would you like import old settings from daemon and Flux?" 8 65; then + import_settings='1' + skip_zelcash_config='1' + sleep 1 + else + import_settings='0' + sleep 1 + fi + if whiptail --yesno "Would you like use exist Flux chain?" 8 65; then + use_old_chain='1' + skip_bootstrap='1' + sleep 1 + else + use_old_chain='0' + sleep 1 + fi + fi + + if [[ "$skip_zelcash_config" == "1" ]]; then + prvkey="" + outpoint="" + index="" + zelid="" + kda_address="" + node_label="0" + fix_action="1" + eps_limit="0" + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + else + prvkey=$(whiptail --inputbox "Enter your FluxNode Identity Key from Zelcore" 8 65 3>&1 1>&2 2>&3) + sleep 1 + outpoint=$(whiptail --inputbox "Enter your FluxNode Collateral TX ID from Zelcore" 8 72 3>&1 1>&2 2>&3) + sleep 1 + index=$(whiptail --inputbox "Enter your FluxNode Output Index from Zelcore" 8 65 3>&1 1>&2 2>&3) + sleep 1 + while true + do + zel_id=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) + if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then + echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" + break + else + echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" + sleep 4 + fi + done + sleep 1 + while true + do + KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) + KDA_A=$(grep -Eo "^k:[0-9a-z]{64}\b" <<< "$KDA_A") + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + kda_address="kadena:$KDA_A?chainid=0" + sleep 2 + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + sleep 1 + if whiptail --yesno "Would you like enable autoupdate?" 8 65; then + zelflux_update='1' + zelcash_update='1' + zelbench_update='1' + else + zelflux_update='0' + zelcash_update='0' + zelbench_update='0' + fi + if whiptail --yesno "Would you like enable alert notification?" 8 65; then + whiptail --msgbox "Info: to select/deselect item use 'space' ...to switch to OK/Cancel use 'tab' " 10 60 + sleep 1 + CHOICES=$(whiptail --title "Choose options: " --separate-output --checklist "Choose options: " 10 45 5 \ + "1" "Discord notification " ON \ + "2" "Telegram notification " OFF 3>&1 1>&2 2>&3 ) + if [[ -z "$CHOICES" ]]; then + echo -e "${ARROW} ${CYAN}No option was selected...Alert notification disabled! ${NC}" + sleep 1 + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" + else + for CHOICE in $CHOICES; do + case "$CHOICE" in + "1") + discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) + sleep 1 + if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then + while true + do + ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) + if [[ $ping == ?(-)+([0-9]) ]]; then + string_limit_check_mark "UserID is valid..........................................." + break + else + string_limit_x_mark "UserID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + else + ping="0" + sleep 1 + fi + ;; + "2") + telegram_alert="1" + while true + do + telegram_bot_token=$(whiptail --inputbox "Enter telegram bot token from BotFather" 8 65 3>&1 1>&2 2>&3) + if [[ $(grep ':' <<< "$telegram_bot_token") != "" ]]; then + string_limit_check_mark "Bot token is valid..........................................." + break + else + string_limit_x_mark "Bot token is not valid try again............................." + sleep 1 + fi + done + sleep 1 + while true + do + telegram_chat_id=$(whiptail --inputbox "Enter your chat id from GetIDs Bot" 8 60 3>&1 1>&2 2>&3) + if [[ $telegram_chat_id == ?(-)+([0-9]) ]]; then + string_limit_check_mark "Chat ID is valid..........................................." + break + else + string_limit_x_mark "Chat ID is not valid try again............................." + sleep 1 + fi + done + sleep 1 + ;; + esac + done + fi + while true + do + node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + string_limit_check_mark "Node name is valid..........................................." + break + else + string_limit_x_mark "Node name is not valid try again............................." + sleep 1 + fi + done + else + discord="0" + ping="0" + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + node_label="0" + sleep 1 + fi + + if [[ "$discord" == 0 ]]; then + ping="0" + fi + + if [[ "$telegram_alert" == 0 || "$telegram_alert" == "" ]]; then + telegram_alert="0" + telegram_bot_token="0" + telegram_chat_id="0" + fi + + index_from_file="$index" + tx_from_file="$outpoint" + stak_info=$(curl -sSL -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -sSL -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + fi + if [[ $stak_info == ?(-)+([0-9]) ]]; then + case $stak_info in + "1000") eps_limit=90 ;; + "12500") eps_limit=180 ;; + "40000") eps_limit=300 ;; + esac + else + eps_limit=0; + fi + fi + if [[ "$skip_bootstrap" == "0" ]]; then + if whiptail --yesno "Would you like use Flux bootstrap from script source?" 8 65; then + bootstrap_url="" + sleep 1 + else + bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3) + sleep 1 + fi + if whiptail --yesno "Would you like keep bootstrap archive file localy?" 8 65; then + bootstrap_zip_del='0' + sleep 1 + else + bootstrap_zip_del='1' + sleep 1 + fi + fi + if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then + router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router: $router_ip)" 8 85 3>&1 1>&2 2>&3) + upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ + "Use the UP/DOWN arrows to highlight the port you want. Press Spacebar on the port you want to select, THEN press ENTER." 17 50 8 \ + "16127" "" ON \ + "16137" "" OFF \ + "16147" "" OFF \ + "16157" "" OFF \ + "16167" "" OFF \ + "16177" "" OFF \ + "16187" "" OFF \ + "16197" "" OFF 3>&1 1>&2 2>&3) + else + gateway_ip="" + upnp_port="" + fi + firewall_disable='1' + swapon='1' + rm /home/$USER/install_conf.json > /dev/null 2>&1 + install_conf_create + config_file + echo -e +} ###### HELPERS SECTION function fluxos_clean(){ docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) From c8ca5e61890df8f91a19aacaf38ba25fbbe15cc4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 10:51:07 +0100 Subject: [PATCH 0789/1176] fix smart_install_conf --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 9a911afd..86d7a29b 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -453,7 +453,7 @@ function smart_install_conf(){ if [[ ! -f /home/$USER/install_conf.json ]]; then echo "{}" > install_conf.json fi - echo "$(jq -r --arg key "$1"--arg value "$2" '.[$key]=$value' install_conf.json)" > install_conf.json + echo "$(jq -r --arg key "$1" --arg value "$2" '.[$key]=$value' install_conf.json)" > install_conf.json } function config_smart_create() { From dcd7a7326613295ee4ca2589ed709bbcc5e72b12 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 11:12:07 +0100 Subject: [PATCH 0790/1176] added null check --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 86d7a29b..abb3be9d 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1536,7 +1536,7 @@ function bootstrap_new() { fi fi - if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then + if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" || "$bootstrap_url" == "null" ]]; then cdn_speedtest "0" "6" if [[ "$server_offline" == "1" ]]; then echo -e "${WORNING} ${CYAN}All Bootstrap server offline, operation aborted.. ${NC}" && sleep 1 From 291a9a0c1a5ca6dfa0d4d5426fb6e4e67a8be3db Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 11:30:45 +0100 Subject: [PATCH 0791/1176] added null check --- flux_common.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index abb3be9d..b9bdeb3d 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1098,7 +1098,7 @@ function import_config_file() { if [[ "$use_old_chain" == "1" ]]; then echo -e "${PIN}${CYAN} Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else - if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" ]]; then + if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" || $bootstrap_url == "null" ]]; then echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from source build in script............[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else echo -e "${PIN}${CYAN} Use Flux daemon bootstrap from own source........................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 @@ -1110,8 +1110,10 @@ function import_config_file() { fi fi - if [[ ! -z "$gateway_ip" && ! -z "$upnp_port" ]]; then - echo -e "${PIN}${CYAN} Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" + if [[ ! -z "$gateway_ip" && ! -z "$upnp_port" ]]; then + if [[ $upnp_port !== "null" ]]; then + echo -e "${PIN}${CYAN} Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" + fi fi if [[ "$discord" != "" && "$discord" != "0" ]] || [[ "$telegram_alert" == '1' ]]; then From 3f3bf8ec4a5427bade2ee5df8f960d006e3f6806 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 11:35:31 +0100 Subject: [PATCH 0792/1176] fix conditional --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index b9bdeb3d..5f3eb8c6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1111,7 +1111,7 @@ function import_config_file() { fi if [[ ! -z "$gateway_ip" && ! -z "$upnp_port" ]]; then - if [[ $upnp_port !== "null" ]]; then + if [[ "$upnp_port" != "null" ]]; then echo -e "${PIN}${CYAN} Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" fi fi From af2df9906372bfb7a2825d42a682f494f6d1d402 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 12:35:41 +0100 Subject: [PATCH 0793/1176] added upnp check fix --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 491ad426..35d92478 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -822,7 +822,7 @@ basic_security status_loop install_watchdog finalizing -if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]]; then +if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]] && [[ "$upnp_port" != "null" ]] ; then upnp_enable fi display_banner From 4be5ae6c6dd99a9c322e9b064e29b53dd10df047 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:14:23 +0100 Subject: [PATCH 0794/1176] added additional info --- flux_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 5f3eb8c6..d5e8abbb 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -607,6 +607,9 @@ function config_smart_create() { smart_install_conf "action" "0" fi fi + echo -e "" + echo -e "${HOT}${CYAN} Config file created, path: ${GREEN}/home/$USER/install_conf.json" + echo -e "" } function manual_build(){ From 3d14669e5c6477e9bafd318d00e09d529c32c0cf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:25:19 +0100 Subject: [PATCH 0795/1176] cleanup --- multitoolbox.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 10324544..70756dd1 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -253,9 +253,9 @@ function create_config() { echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit - fi + fi - if jq --version > /dev/null 2>&1; then + if jq --version > /dev/null 2>&1; then sleep 0.2 else echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" @@ -272,11 +272,9 @@ function create_config() { fi fi - CHOICE=$( - whiptail --title "Create FluxNode installation config" --menu "Make your choice" 15 65 8 \ + CHOICE=$(whiptail --title "Create FluxNode installation config" --menu "Make your choice" 15 65 8 \ "1)" "Manualy - fill questions list" \ - "2)" "Auto - import exists settings" 3>&2 2>&1 1>&3 - ) + "2)" "Auto - import exists settings" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") manual_build @@ -284,7 +282,7 @@ function create_config() { "2)") config_smart_create ;; - esac + esac } From bbe37630a1ecde2eb39375c8bc1d8d46a4a8a1ba Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:30:31 +0100 Subject: [PATCH 0796/1176] Update multitoolbox.sh --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 70756dd1..729e19e6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -245,7 +245,7 @@ function install_flux() { function create_config() { - echo -e "${GREEN}Module: Create FluxNode installation config file${NC}" + echo -e "${GREEN}Module: Create FluxNode installation config file...${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" From ac2d4a5ca29ebbdacbb8a52927dfd6bbdd742305 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:36:59 +0100 Subject: [PATCH 0797/1176] fix color --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index d5e8abbb..ba97ab28 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -608,7 +608,7 @@ function config_smart_create() { fi fi echo -e "" - echo -e "${HOT}${CYAN} Config file created, path: ${GREEN}/home/$USER/install_conf.json" + echo -e "${HOT}${CYAN} Config file created, path: ${GREEN}/home/$USER/install_conf.json${NC}" echo -e "" } From 1f20d07401e1fc33359ee199f48ffb00688d61ca Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 16:03:13 +0100 Subject: [PATCH 0798/1176] added old cron jobs cleanup --- flux_common.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index ba97ab28..d7e87e58 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2372,14 +2372,15 @@ function selfhosting() { sudo chmod +x /home/$USER/ip_check.sh echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 - if [[ "$crontab_check" == "0" ]]; then - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=\$LOGNAME \$HOME/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=\$LOGNAME \$HOME/ip_check.sh ip_check") | crontab - - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" - else - echo -e "${ARROW} ${CYAN}Cron jobs already exists, skipped... ${NC}" - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" + + if [[ "$crontab_check" != "0" ]]; then + echo -e "${ARROW} ${CYAN}Removing old cron jobs...${NC}" + crontab -u $USER -l | grep -v 'ip_check' | crontab -u $USER - fi + + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=\$LOGNAME \$HOME/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=\$LOGNAME \$HOME/ip_check.sh ip_check") | crontab - + echo -e "${ARROW} ${CYAN}Script installed! ${NC}" echo -e "" } function multinode(){ From c692a6fb3f5920aae8b8c73e72bca730855a17d5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 4 Jan 2023 16:05:54 +0100 Subject: [PATCH 0799/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index d7e87e58..e8d9dd9e 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2370,7 +2370,6 @@ function selfhosting() { fi EOF sudo chmod +x /home/$USER/ip_check.sh - echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 if [[ "$crontab_check" != "0" ]]; then @@ -2378,6 +2377,7 @@ function selfhosting() { crontab -u $USER -l | grep -v 'ip_check' | crontab -u $USER - fi + echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=\$LOGNAME \$HOME/ip_check.sh restart") | crontab - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=\$LOGNAME \$HOME/ip_check.sh ip_check") | crontab - echo -e "${ARROW} ${CYAN}Script installed! ${NC}" From 1172134955d0c4f96cf5968d4dce85107e6dfaef Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 19:05:59 +0100 Subject: [PATCH 0800/1176] fix upnp overwrite problem --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index e8d9dd9e..b416e090 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2102,9 +2102,9 @@ function upnp_enable() { fi if [[ ! -d /home/$USER/.fluxbenchmark ]]; then sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null - echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + echo "fluxport=$FLUX_PORT" >> "/home/$USER/.fluxbenchmark/fluxbench.conf" else - echo "fluxport=$FLUX_PORT" | sudo tee "/home/$USER/.fluxbenchmark/fluxbench.conf" > /dev/null + echo "fluxport=$FLUX_PORT" >> "/home/$USER/.fluxbenchmark/fluxbench.conf" fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" From c647941694ed642030a109b99d79022f4d5e7878 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 19:24:20 +0100 Subject: [PATCH 0801/1176] added import mode for config_smart_create --- flux_common.sh | 68 +++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index b416e090..9181c903 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -450,6 +450,11 @@ END } function smart_install_conf(){ + + if [[ "$3" == "import" ]]; then + return + fi + if [[ ! -f /home/$USER/install_conf.json ]]; then echo "{}" > install_conf.json fi @@ -458,20 +463,22 @@ function smart_install_conf(){ function config_smart_create() { - rm -rf /home/$USER/install_conf.json + if [[ "$1" != "import" ]]; then + rm -rf /home/$USER/install_conf.json + fi #daemon if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then echo -e "" echo -e "${ARROW} ${YELLOW}Imported daemon settings:${NC}" zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - smart_install_conf "prvkey" "$zelnodeprivkey" + smart_install_conf "prvkey" "$zelnodeprivkey" "$1" zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - smart_install_conf "outpoint" "$zelnodeoutpoint" + smart_install_conf "outpoint" "$zelnodeoutpoint" "$1" zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" - smart_install_conf "index" "$zelnodeindex" + smart_install_conf "index" "$zelnodeindex" "$1" fi #Benchmark if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then @@ -480,17 +487,17 @@ function config_smart_create() { thunder=$(grep -Po "(?<=thunder=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) if [[ "$thunder" == "1" ]]; then echo -e "${PIN}${CYAN} Thunder Mode = ${GREEN}$ENABLED${NC}" - smart_install_conf "thunder" "$thunder" + smart_install_conf "thunder" "$thunder" "$1" fi speedtestserverid=$(grep -Po "(?<=speedtestserverid=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) if [[ "$speedtestserverid" != "" ]]; then echo -e "${PIN}${CYAN} SpeedTest Server ID = ${GREEN}$speedtestserverid${NC}" - smart_install_conf "speedtestserverid" "$speedtestserverid" + smart_install_conf "speedtestserverid" "$speedtestserverid" "$1" fi fluxport=$(grep -Po "(?<=fluxport=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) if [[ "$fluxport" != "" ]]; then echo -e "${PIN}${CYAN} Flux Port = ${GREEN}$fluxport${NC}" - smart_install_conf "fluxport" "$fluxport" + smart_install_conf "fluxport" "$fluxport" "$1" fi fi #fluxOS @@ -500,20 +507,20 @@ function config_smart_create() { ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') if [[ "$ZELID" != "" ]]; then echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" - smart_install_conf "zelid" "$ZELID" + smart_install_conf "zelid" "$ZELID" "$1" fi KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" - smart_install_conf "kda_address" "$KDA_A" + smart_install_conf "kda_address" "$KDA_A" "$1" fi upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | sed -e 's/.\{2\}$//') if [[ "$upnp_port" != "" ]]; then gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" echo -e "${PIN}${CYAN} Gateway IP = ${GREEN}$gateway_ip${NC}" - smart_install_conf "upnp_port" "$upnp_port" - smart_install_conf "gateway_ip" "$gateway_ip" + smart_install_conf "upnp_port" "$upnp_port" "$1" + smart_install_conf "gateway_ip" "$gateway_ip" "$1" fi fi #watchdog @@ -523,7 +530,7 @@ function config_smart_create() { node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') if [[ "$node_label" != "" && "$node_label" != "0" ]]; then echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" - smart_install_conf "node_label" "$node_label" + smart_install_conf "node_label" "$node_label" "$1" else echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" fi @@ -531,13 +538,13 @@ function config_smart_create() { eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - smart_install_conf "eps_limit" "$eps_limit" + smart_install_conf "eps_limit" "$eps_limit" "$1" fi discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') if [[ "$discord" != "" && "$discord" != "0" ]]; then echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" - smart_install_conf "discord" "$discord" + smart_install_conf "discord" "$discord" "$1" else echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" fi @@ -545,7 +552,7 @@ function config_smart_create() { if [[ "$ping" != "" && "$ping" != "0" ]]; then if [[ "$discord" != "" && "$discord" != "0" ]]; then echo -e "${PIN}${CYAN} Discord nick ping = ${GREEN}Enabled${NC}" - smart_install_conf "ping" "$ping" + smart_install_conf "ping" "$ping" "$1" else echo -e "${PIN}${CYAN} Discord nick ping = ${RED}Disabled${NC}" fi @@ -553,63 +560,66 @@ function config_smart_create() { telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" - smart_install_conf "telegram_alert" "$telegram_alert" + smart_install_conf "telegram_alert" "$telegram_alert" "$1" else echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" - smart_install_conf "telegram_alert" "0" + smart_install_conf "telegram_alert" "0" "$1" fi telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') if [[ "$telegram_alert" == "1" ]]; then echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_bot_token${NC}" - smart_install_conf "telegram_bot_token" "$telegram_bot_token" + smart_install_conf "telegram_bot_token" "$telegram_bot_token" "$1" fi telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') if [[ "$telegram_alert" == "1" ]]; then echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" - smart_install_conf "telegram_chat_id" "$telegram_chat_id" + smart_install_conf "telegram_chat_id" "$telegram_chat_id" "$1" fi zelflux_update=$(grep -w zelflux_update /home/$USER/watchdog/config.js | sed -e 's/.*zelflux_update: .//' | egrep -o '[0-9]') if [[ "$zelflux_update" == "1" ]]; then echo -e "${PIN}${CYAN} FluxOS auto update = ${GREEN}Enabled${NC}" - smart_install_conf "zelflux_update" "1" + smart_install_conf "zelflux_update" "1" "$1" else echo -e "${PIN}${CYAN} FluxOS auto update = ${GREEN}Disabled${NC}" - smart_install_conf "zelflux_update" "0" + smart_install_conf "zelflux_update" "0" "$1" fi zelcash_update=$(grep -w zelcash_update /home/$USER/watchdog/config.js | sed -e 's/.*zelcash_update: .//' | egrep -o '[0-9]') if [[ "$zelcash_update" == "1" ]]; then echo -e "${PIN}${CYAN} Daemon auto update = ${GREEN}Enabled${NC}" - smart_install_conf "zelcash_update" "1" + smart_install_conf "zelcash_update" "1" "$1" else echo -e "${PIN}${CYAN} Daemon auto update = ${GREEN}Disabled${NC}" - smart_install_conf "zelcash_update" "0" + smart_install_conf "zelcash_update" "0" "$1" fi zelbench_update=$(grep -w zelbench_update /home/$USER/watchdog/config.js | sed -e 's/.*zelbench_update: .//' | egrep -o '[0-9]') if [[ "$zelbench_update" == "1" ]]; then echo -e "${PIN}${CYAN} Benchmark auto update = ${GREEN}Enabled${NC}" - smart_install_conf "zelbench_update" "1" + smart_install_conf "zelbench_update" "1" "$1" else echo -e "${PIN}${CYAN} Benchmark auto update = ${GREEN}Disabled${NC}" - smart_install_conf "zelbench_update" "0" + smart_install_conf "zelbench_update" "0" "$1" fi action=$(grep -w action /home/$USER/watchdog/config.js | sed -e 's/.*action: .//' | egrep -o '[0-9]') if [[ "$action" == "1" ]]; then echo -e "${PIN}${CYAN} Fix action = ${GREEN}Enabled${NC}" - smart_install_conf "action" "1" + smart_install_conf "action" "1" "$1" else echo -e "${PIN}${CYAN} Fix action = ${GREEN}Disabled${NC}" - smart_install_conf "action" "0" + smart_install_conf "action" "0" "$1" fi fi + echo -e "" - echo -e "${HOT}${CYAN} Config file created, path: ${GREEN}/home/$USER/install_conf.json${NC}" - echo -e "" + if [[ "$1" != "import"]]; then + echo -e "${HOT}${CYAN} Config file created, path: ${GREEN}/home/$USER/install_conf.json${NC}" + echo -e "" + fi } function manual_build(){ From 31d897a32190b5259b65d544641b0677b348c255 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 19:42:50 +0100 Subject: [PATCH 0802/1176] remove only upnp entry --- multinode.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multinode.sh b/multinode.sh index 460dd68e..939ae340 100644 --- a/multinode.sh +++ b/multinode.sh @@ -7,10 +7,10 @@ function upnp_disable() { echo -e "" exit fi - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Removing FluxOS UPnP configuration.....${NC}" - sudo rm -rf /home/$USER/.fluxbenchmark/fluxbench.conf + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]] && [[ $(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Removing FluxOS UPnP configuration.....${NC}" + sed -i "/$(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 else echo -e "${ARROW} ${CYAN}UPnP Mode is already disabled...${NC}" echo -e "" From 7da407aa123db4d90e49613e00766a833a1449e6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 19:44:45 +0100 Subject: [PATCH 0803/1176] fix config_list --- flux_common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 9181c903..fc9de0dc 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -400,9 +400,9 @@ function smart_reconfiguration(){ "zelflux_update": [{"key": "zelflux_update", "label": "FluxOS Auto Update"}], "zelcash_update": [{"key": "zelcash_update", "label": "Daemon Auto Update"}], "zelbench_update": [{"key": "zelbench_update", "label": "Benchmark Auto Update"}], - "fluxport": [{"key": "zelbench_update", "label": "Multi Node Port"}], - "thunder": [{"key": "zelbench_update", "label": "Thunder Mode"}], - "speedtestserverid": [{"key": "zelbench_update", "label": "Speed Test Server ID"}], + "fluxport": [{"key": "fluxport", "label": "Multi Node Port"}], + "thunder": [{"key": "thunder", "label": "Thunder Mode"}], + "speedtestserverid": [{"key": "speedtestserverid", "label": "Speed Test Server ID"}], "upnp_port": [{"key": "apiport", "label": "UPnP Port"}] } END From af58b2effcb130f647f09153cf270103ade5db44 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:15:42 +0100 Subject: [PATCH 0804/1176] added tunder mode --- flux_common.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index fc9de0dc..5d6026b0 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1396,6 +1396,18 @@ function replace_zelid() { fi fi } + +function thunder_mode(){ + if [[ $(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]]; then + echo -e "" + config_builder "thunder" "1" "Thunder Mode Enabled" "benchmark" + else + sed -i "/$(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 + "${ARROW}${GREEN} [BenchD] ${CYAN}Thunder mode disabled successful${NC}" "${CHECK_MARK}" + echo -e "" + fi +} + function fluxos_reconfiguration { echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1414,7 +1426,8 @@ function fluxos_reconfiguration { CHOICE=$( whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ "1)" "Replace ZELID" \ - "2)" "Add/Replace kadena address" 3>&2 2>&1 1>&3 + "2)" "Add/Replace kadena address" \ + "3)" "Enable/Disable thunder mode" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") @@ -1423,6 +1436,10 @@ function fluxos_reconfiguration { "2)") replace_kadena ;; + "3)") + thunder_mode + ;; + esac } ######### BOOTSTRAP SECTION ############################ From ed2dd5dc01e36759f4a1ba970384a15674a35be0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:21:25 +0100 Subject: [PATCH 0805/1176] fix missing space --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 5d6026b0..66c6db2b 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -616,7 +616,7 @@ function config_smart_create() { fi echo -e "" - if [[ "$1" != "import"]]; then + if [[ "$1" != "import" ]]; then echo -e "${HOT}${CYAN} Config file created, path: ${GREEN}/home/$USER/install_conf.json${NC}" echo -e "" fi From 34ca7d729c3e75934e3718da969250da7d7b3c58 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:29:20 +0100 Subject: [PATCH 0806/1176] thunder mode fix --- flux_common.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 66c6db2b..657014e4 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1398,14 +1398,20 @@ function replace_zelid() { } function thunder_mode(){ - if [[ $(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]]; then - echo -e "" - config_builder "thunder" "1" "Thunder Mode Enabled" "benchmark" - else - sed -i "/$(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 - "${ARROW}${GREEN} [BenchD] ${CYAN}Thunder mode disabled successful${NC}" "${CHECK_MARK}" - echo -e "" - fi + + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + echo -e "" + if [[ $(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]]; then + config_builder "thunder" "1" "Thunder Mode Enabled" "benchmark" + else + sed -i "/$(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 + "${ARROW}${GREEN} [BenchD] ${CYAN}Thunder mode disabled successful${NC}" "${CHECK_MARK}" + fi + else + echo -e "" + config_builder "thunder" "1" "Thunder Mode Enabled" "benchmark" + fi + echo -e "" } function fluxos_reconfiguration { From 6242331c86305b571866e0e85f0e3d1ac8cf389d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:34:57 +0100 Subject: [PATCH 0807/1176] fix config_builder --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 657014e4..c6815bce 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -338,7 +338,7 @@ function config_builder() { return fi if [[ ! -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - mkdir -p /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 + mkdir -p /home/$USER/.fluxbenchmark > /dev/null 2>&1 echo "$1=$2" >> /home/$USER/.fluxbenchmark/fluxbench.conf if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successful${NC}" "${CHECK_MARK}" From 09877418ed8d1ec3b30958ad787d49f75aeb2a2c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:43:05 +0100 Subject: [PATCH 0808/1176] fix conditional --- flux_common.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index c6815bce..54c9f071 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1398,18 +1398,15 @@ function replace_zelid() { } function thunder_mode(){ - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - echo -e "" - if [[ $(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]]; then - config_builder "thunder" "1" "Thunder Mode Enabled" "benchmark" + if [[ $(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf) == "" ]]; then + config_builder "thunder" "1" "Thunder Mode enabled/" "benchmark" else sed -i "/$(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 "${ARROW}${GREEN} [BenchD] ${CYAN}Thunder mode disabled successful${NC}" "${CHECK_MARK}" fi else - echo -e "" - config_builder "thunder" "1" "Thunder Mode Enabled" "benchmark" + config_builder "thunder" "1" "Thunder Mode enabled/" "benchmark" fi echo -e "" } From 57354705877001cee09b83fb221a081dc5408a83 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:49:25 +0100 Subject: [PATCH 0809/1176] fix missing echo --- flux_common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 54c9f071..a39d2c6b 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1400,13 +1400,13 @@ function replace_zelid() { function thunder_mode(){ if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then if [[ $(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf) == "" ]]; then - config_builder "thunder" "1" "Thunder Mode enabled/" "benchmark" + config_builder "thunder" "1" "Thunder Mode" "benchmark" else sed -i "/$(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 - "${ARROW}${GREEN} [BenchD] ${CYAN}Thunder mode disabled successful${NC}" "${CHECK_MARK}" + echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Thunder Mode disabled successful${NC}" "${CHECK_MARK}" fi else - config_builder "thunder" "1" "Thunder Mode enabled/" "benchmark" + config_builder "thunder" "1" "Thunder Mode" "benchmark" fi echo -e "" } From 7a962b1927f66fe2825053ba2392e445d513b408 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 21:03:58 +0100 Subject: [PATCH 0810/1176] removed duble echo --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index a39d2c6b..f0764291 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1404,11 +1404,11 @@ function thunder_mode(){ else sed -i "/$(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Thunder Mode disabled successful${NC}" "${CHECK_MARK}" + echo -e "" fi else config_builder "thunder" "1" "Thunder Mode" "benchmark" fi - echo -e "" } function fluxos_reconfiguration { From b26c31da5cddf23c41a765f3cc94c046040b9c94 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 21:15:41 +0100 Subject: [PATCH 0811/1176] added restart benchmark --- flux_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index f0764291..bf989c79 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1409,6 +1409,9 @@ function thunder_mode(){ else config_builder "thunder" "1" "Thunder Mode" "benchmark" fi + sudo systemctl restart zelcash > /dev/null 2>&1 + echo -e "${ARROW}${CYAN} Restarting Benchmark... ${NC}" "${CHECK_MARK}" + sleep 5 } function fluxos_reconfiguration { From 303c9e3bad43649b537c1df937d14b6c9e5b125a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 21:20:35 +0100 Subject: [PATCH 0812/1176] Minor edits --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index bf989c79..54687dad 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1409,8 +1409,8 @@ function thunder_mode(){ else config_builder "thunder" "1" "Thunder Mode" "benchmark" fi + echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Restarting service... ${NC}" sudo systemctl restart zelcash > /dev/null 2>&1 - echo -e "${ARROW}${CYAN} Restarting Benchmark... ${NC}" "${CHECK_MARK}" sleep 5 } From 1aca195eb17d6e3e5c7b71c7d7a4380888089380 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 21:25:19 +0100 Subject: [PATCH 0813/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 54687dad..f6d19135 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1404,13 +1404,13 @@ function thunder_mode(){ else sed -i "/$(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Thunder Mode disabled successful${NC}" "${CHECK_MARK}" - echo -e "" fi else config_builder "thunder" "1" "Thunder Mode" "benchmark" fi echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Restarting service... ${NC}" sudo systemctl restart zelcash > /dev/null 2>&1 + echo -e "" sleep 5 } From 7fc24d093a2254164ba228c0e355465c5aff6f2c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 21:29:29 +0100 Subject: [PATCH 0814/1176] removed sleep --- flux_common.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index f6d19135..e38e13e5 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1410,8 +1410,6 @@ function thunder_mode(){ fi echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Restarting service... ${NC}" sudo systemctl restart zelcash > /dev/null 2>&1 - echo -e "" - sleep 5 } function fluxos_reconfiguration { From 4e1efacdf5779915cf275e904ae3f02c75431e90 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 21:50:47 +0100 Subject: [PATCH 0815/1176] upnp_disable conditional correction --- multinode.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/multinode.sh b/multinode.sh index 939ae340..26299119 100644 --- a/multinode.sh +++ b/multinode.sh @@ -7,15 +7,23 @@ function upnp_disable() { echo -e "" exit fi - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]] && [[ $(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Removing FluxOS UPnP configuration.....${NC}" - sed -i "/$(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 - else + + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + if [[ $(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]] + echo -e "" + echo -e "${ARROW} ${YELLOW}Removing FluxOS UPnP configuration.....${NC}" + sed -i "/$(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 + else echo -e "${ARROW} ${CYAN}UPnP Mode is already disabled...${NC}" echo -e "" exit + fi + else + echo -e "${ARROW} ${CYAN}UPnP Mode is already disabled...${NC}" + echo -e "" + exit fi + if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep 'apiport' | wc -l) == "1" ]]; then cat /home/$USER/zelflux/config/userconfig.js | sed '/apiport/d' | sudo tee "/home/$USER/zelflux/config/userconfig.js" > /dev/null fi From a1d79ab19fcf41c66721aa7a8002173ccf5e3697 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 22:00:36 +0100 Subject: [PATCH 0816/1176] fixed thunder import display --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index e38e13e5..7d42b649 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -486,7 +486,7 @@ function config_smart_create() { echo -e "${ARROW} ${YELLOW}Imported Benchmark settings:${NC}" thunder=$(grep -Po "(?<=thunder=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) if [[ "$thunder" == "1" ]]; then - echo -e "${PIN}${CYAN} Thunder Mode = ${GREEN}$ENABLED${NC}" + echo -e "${PIN}${CYAN} Thunder Mode = ${GREEN}ENABLED${NC}" smart_install_conf "thunder" "$thunder" "$1" fi speedtestserverid=$(grep -Po "(?<=speedtestserverid=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) From 03436bd155b01da4dc5e44b1cdd1b90b68f04d22 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 8 Jan 2023 22:08:52 +0100 Subject: [PATCH 0817/1176] fixed missing then --- multinode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index 26299119..a02a3f67 100644 --- a/multinode.sh +++ b/multinode.sh @@ -9,7 +9,7 @@ function upnp_disable() { fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - if [[ $(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]] + if [[ $(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]]; then echo -e "" echo -e "${ARROW} ${YELLOW}Removing FluxOS UPnP configuration.....${NC}" sed -i "/$(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 From 59417f8aab54ebcf8c1e8a0ed9c545c57bdc778f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 9 Jan 2023 10:46:09 +0100 Subject: [PATCH 0818/1176] disabled ip addr output --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 7d42b649..7b8eadaf 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2341,7 +2341,7 @@ function selfhosting() { if [[ "$device_name" != "" && "$WANIP" != "" ]]; then echo -e "${ARROW} ${CYAN}Detected IP: ${GREEN}$WANIP ${NC}" - sudo ip addr add $WANIP dev $device_name + sudo ip addr add $WANIP dev $device_name > /dev/null 2>&1 else echo -e "${WORNING} ${CYAN}Problem detected operation aborted! ${NC}" && sleep 1 echo -e "" From 35aa456f57030f212ffffab7f99dace940403af2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 9 Jan 2023 16:01:56 +0100 Subject: [PATCH 0819/1176] added permission fix --- flux_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 7b8eadaf..3ec50dc6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1398,6 +1398,9 @@ function replace_zelid() { } function thunder_mode(){ + if [[ -d $HOME/.fluxbenchmark ]]; then + sudo chown -R $USER:$USER $HOME/.fluxbenchmark > /dev/null 2>&1 + fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then if [[ $(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf) == "" ]]; then config_builder "thunder" "1" "Thunder Mode" "benchmark" From 9361a6836afb9f05bd21a0372c39a1984084b2ae Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 9 Jan 2023 16:15:40 +0100 Subject: [PATCH 0820/1176] added config_builder in upnp_enable --- flux_common.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 3ec50dc6..bb550cef 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2136,12 +2136,11 @@ function upnp_enable() { fi if [[ ! -d /home/$USER/.fluxbenchmark ]]; then sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null - echo "fluxport=$FLUX_PORT" >> "/home/$USER/.fluxbenchmark/fluxbench.conf" + config_builder "fluxport" "$FLUX_PORT" "MultiPort Mode" "benchmark" else - echo "fluxport=$FLUX_PORT" >> "/home/$USER/.fluxbenchmark/fluxbench.conf" + config_builder "fluxport" "$FLUX_PORT" "MultiPort Mode" "benchmark" fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - echo -e "${ARROW} ${CYAN}Fluxbench port set successfully.....................[${CHECK_MARK}${CYAN}]${NC}" echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark.....${NC}" #API PORT sudo ufw allow $FLUX_PORT > /dev/null 2>&1 From 110bf77e15b15355872b0d8657470bfca44c240d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 9 Jan 2023 16:41:10 +0100 Subject: [PATCH 0821/1176] added config_builder for apiport --- flux_common.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index bb550cef..db12ff10 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2125,15 +2125,16 @@ function upnp_enable() { fi fi done - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then - sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" - fi - else - insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," - echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" - fi + #if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then + #sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js + #if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + #echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" + #fi + #else + #insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," + #echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" + #fi + config_builder "apiport" "$FLUX_PORT" "MultiPort Mode" "fluxos" if [[ ! -d /home/$USER/.fluxbenchmark ]]; then sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null config_builder "fluxport" "$FLUX_PORT" "MultiPort Mode" "benchmark" From c0f2a177f8d43418b71d0e2240d9bc1454dc2248 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 9 Jan 2023 16:51:20 +0100 Subject: [PATCH 0822/1176] spelling correction --- flux_common.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index db12ff10..e8c74aa4 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -290,7 +290,7 @@ function config_builder() { fi if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then insert "/home/$USER/$FLUX_DIR//config/userconfig.js" "testnet" " $key: '$value'," - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" return fi if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key: '$value'") != "" ]]; then @@ -300,7 +300,7 @@ function config_builder() { if [[ $(cat /home/$USER/$FLUX_DIR//config/userconfig.js | grep "$key") != "" ]]; then sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: '$value',/" /home/$USER/$FLUX_DIR/config/userconfig.js if [[ $(grep -w $value /home/$USER/$FLUX_DIR/config/userconfig.js) != "" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was replaced successfully${NC}" "${CHECK_MARK}" fi fi fi @@ -317,7 +317,7 @@ function config_builder() { if [[ ! $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) && -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then echo "$1=$2" >> /home/$USER/$CONFIG_DIR/$CONFIG_FILE if [[ "$1=$2" == $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) ]]; then - padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 added successful${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" return fi fi @@ -327,7 +327,7 @@ function config_builder() { else sed -i "s/$(grep -e $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE)/$1=$2/" /home/$USER/$CONFIG_DIR/$CONFIG_FILE if [[ "$1=$2" == $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) ]]; then - padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 replaced successful${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 was replaced successfully${NC}" "${CHECK_MARK}" fi fi fi @@ -341,14 +341,14 @@ function config_builder() { mkdir -p /home/$USER/.fluxbenchmark > /dev/null 2>&1 echo "$1=$2" >> /home/$USER/.fluxbenchmark/fluxbench.conf if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successful${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 was added successful${NC}" "${CHECK_MARK}" return fi fi if [[ ! $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then echo "$1=$2" >> /home/$USER/.fluxbenchmark/fluxbench.conf if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successful${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" return fi fi @@ -357,7 +357,7 @@ function config_builder() { else sed -i "s/$(grep -e $1 /home/$USER/.fluxbenchmark/fluxbench.conf)/$1=$2/" /home/$USER/.fluxbenchmark/fluxbench.conf if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 replaced successful${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 was replaced successfully${NC}" "${CHECK_MARK}" fi fi fi @@ -378,7 +378,7 @@ function config_builder() { if [[ $(cat /home/$USER/watchdog/config.js | grep "$1") != "" ]]; then sed -i "s/$(grep -e $1 /home/$USER/watchdog/config.js)/ $1: '$2',/" /home/$USER/watchdog/config.js if [[ $(grep -w $2 /home/$USER/watchdog/config.js) != "" ]]; then - padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 was replaced successfully${NC}" "${CHECK_MARK}" fi fi fi From b828d7275cfafcfedaa4fa094126e58baff766bc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 9 Jan 2023 17:00:17 +0100 Subject: [PATCH 0823/1176] fix typo --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index e8c74aa4..c8c38b0e 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -341,7 +341,7 @@ function config_builder() { mkdir -p /home/$USER/.fluxbenchmark > /dev/null 2>&1 echo "$1=$2" >> /home/$USER/.fluxbenchmark/fluxbench.conf if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 was added successful${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" return fi fi From 5333eac72ad80c56c7519f0d178136b49bc1339f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 10 Jan 2023 02:56:40 +0100 Subject: [PATCH 0824/1176] path fix --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index c8c38b0e..a6280ab1 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -289,7 +289,7 @@ function config_builder() { fi fi if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then - insert "/home/$USER/$FLUX_DIR//config/userconfig.js" "testnet" " $key: '$value'," + insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: '$value'," padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" return fi @@ -297,7 +297,7 @@ function config_builder() { padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 skipped${NC}" "${X_MARK}" return fi - if [[ $(cat /home/$USER/$FLUX_DIR//config/userconfig.js | grep "$key") != "" ]]; then + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") != "" ]]; then sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: '$value',/" /home/$USER/$FLUX_DIR/config/userconfig.js if [[ $(grep -w $value /home/$USER/$FLUX_DIR/config/userconfig.js) != "" ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was replaced successfully${NC}" "${CHECK_MARK}" From 7eed55c7aa6d6ce04fe124345d37a26a584e552b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 10 Jan 2023 03:11:44 +0100 Subject: [PATCH 0825/1176] added permission fix for option 14 --- flux_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index a6280ab1..de2dd8c3 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2094,6 +2094,9 @@ function log_rotate() { } #### UPnP function upnp_enable() { + if [[ -d $HOME/.fluxbenchmark ]]; then + sudo chown -R $USER:$USER $HOME/.fluxbenchmark > /dev/null 2>&1 + fi try="0" echo -e "" echo -e "${ARROW}${YELLOW} Creating UPnP configuration...${NC}" From 0f2e9b4e9994bd3cd60b5159871e3d7505325226 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:11:43 +0100 Subject: [PATCH 0826/1176] added development and decryptionkey to userconfig --- flux_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index de2dd8c3..e34c8dac 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -89,6 +89,8 @@ function fluxos_conf_create(){ ipaddress: '${WANIP}', zelid: '${ZELID}', kadena: '${KDA_A}', + development: false, + decryptionkey: '', testnet: $testnet } } From 0ddd3411d20e0a8f7e2681962021e6c94eac8908 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:24:33 +0100 Subject: [PATCH 0827/1176] updated config_list for smart_reconfiguration --- flux_common.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index e34c8dac..c07341c1 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -388,7 +388,7 @@ function config_builder() { function smart_reconfiguration(){ watchdog_settings_list=("label", "tier_eps_min", "zelflux_update", "zelcash_update", "zelbench_update", "action", "ping", "web_hook_url", "telegram_alert", "telegram_bot_token", "telegram_chat_id") - fluxos_settings_list=("kadena", "zelid", "apiport", "ipaddress") + fluxos_settings_list=("kadena", "zelid", "apiport", "ipaddress", "development", "decryptionkey") daemon_settings_list=("zelnodeprivkey", "zelnodeoutpoint", "zelnodeindex") benchmark_settings_list=("fluxport", "thunder", "speedtestserverid") config_list=$(cat <<-END @@ -405,7 +405,9 @@ function smart_reconfiguration(){ "fluxport": [{"key": "fluxport", "label": "Multi Node Port"}], "thunder": [{"key": "thunder", "label": "Thunder Mode"}], "speedtestserverid": [{"key": "speedtestserverid", "label": "Speed Test Server ID"}], - "upnp_port": [{"key": "apiport", "label": "UPnP Port"}] + "upnp_port": [{"key": "apiport", "label": "UPnP Port"}], + "development": [{"key": "development", "label": "Development Mode"}], + "decryptionkey": [{"key": "decryptionkey", "label": "Encryption Mode"}] } END ) From 6e7bd2176c70d962d62165c3e93b3bc3b2ef21d6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 23 Jan 2023 21:51:13 +0100 Subject: [PATCH 0828/1176] added OS_FLAGE --- multitoolbox.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 729e19e6..022eafda 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -6,7 +6,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH $2 unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED set -o history @@ -15,6 +15,8 @@ if ! [[ -z $1 ]]; then else export ROOT_BRANCH='master' fi + + source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' @@ -30,6 +32,7 @@ COIN_NAME='zelcash' dversion="v7.4" PM2_INSTALL="0" zelflux_setting_import="0" +OS_FLAGE="$2" function config_veryfity(){ if [[ -f /home/$USER/.flux/flux.conf ]]; then @@ -502,6 +505,7 @@ function install_node(){ echo -e "${NC}" exit fi + if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) not supported${NC}" eecho -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" @@ -509,13 +513,17 @@ function install_node(){ echo exit fi - if [[ $(lsb_release -cs) == "jammy" || $(lsb_release -cs) == "kinetic" ]]; then + + if [[ "$OS_FLAGE" == "" ]]; then + if [[ $(lsb_release -cs) == "jammy" || $(lsb_release -cs) == "kinetic" ]]; then echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" - echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" + echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit + fi fi + if sudo docker run hello-world > /dev/null 2>&1; then echo -e "" else From 125c828d5a1ec6576620cf0af50b4fb25f0fd0a0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 25 Jan 2023 10:35:01 +0100 Subject: [PATCH 0829/1176] added development mode --- flux_common.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index c07341c1..415c8d45 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -302,7 +302,7 @@ function config_builder() { if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") != "" ]]; then sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: '$value',/" /home/$USER/$FLUX_DIR/config/userconfig.js if [[ $(grep -w $value /home/$USER/$FLUX_DIR/config/userconfig.js) != "" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was replaced successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was changed successfully${NC}" "${CHECK_MARK}" fi fi fi @@ -1419,6 +1419,17 @@ function thunder_mode(){ sudo systemctl restart zelcash > /dev/null 2>&1 } + +function development_mode(){ + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "development: 'false'") != "" ]] || [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "development: false") ]]; then + "${ARROW}${GREEN} [FluxOS] ${CYAN}Enabling development mode... ${NC}" + config_builder "development" "true" "Development Mode" "fluxos" + else + "${ARROW}${GREEN} [FluxOS] ${CYAN}Disabling development mode... ${NC}" + config_builder "development" "false" "Development Mode" "fluxos" + fi +} + function fluxos_reconfiguration { echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1438,7 +1449,8 @@ function fluxos_reconfiguration { whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ "1)" "Replace ZELID" \ "2)" "Add/Replace kadena address" \ - "3)" "Enable/Disable thunder mode" 3>&2 2>&1 1>&3 + "3)" "Enable/Disable thunder mode" \ + "4)" "Enable/Disable development mode" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") @@ -1450,6 +1462,9 @@ function fluxos_reconfiguration { "3)") thunder_mode ;; + "4)") + development_mode + ;; esac } From 46d98753d10d18364a2eb7eec59450ae534f5e49 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 25 Jan 2023 11:57:52 +0100 Subject: [PATCH 0830/1176] fix echo --- flux_common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 415c8d45..b262dc9f 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1422,11 +1422,11 @@ function thunder_mode(){ function development_mode(){ if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "development: 'false'") != "" ]] || [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "development: false") ]]; then - "${ARROW}${GREEN} [FluxOS] ${CYAN}Enabling development mode... ${NC}" + echo -e "${ARROW}${GREEN} [FluxOS] ${CYAN}Enabling development mode... ${NC}" config_builder "development" "true" "Development Mode" "fluxos" else - "${ARROW}${GREEN} [FluxOS] ${CYAN}Disabling development mode... ${NC}" - config_builder "development" "false" "Development Mode" "fluxos" + echo -e "${ARROW}${GREEN} [FluxOS] ${CYAN}Disabling development mode... ${NC}" + config_builder "development" "false" "Development Mode" "fluxos" fi } From d6d70552e31e3820a4b2f54dd5c2922ce421cdd7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 25 Jan 2023 12:35:08 +0100 Subject: [PATCH 0831/1176] bootstrap variable fix --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index b262dc9f..6e56cc12 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1584,7 +1584,7 @@ function bootstrap_new() { else if [[ ! -f /home/$USER/install_conf.json ]]; then bootstrap_manual - if [[ "$Mode" != "install" && "$Server_offline" == "0" ]]; then + if [[ "$Mode" != "install" && "$server_offline" == "0" ]]; then start_service if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then sudo rm -rf $FILE_PATH /dev/null 2>&1 && sleep 2 From 0f3ab1c9d8c15ec0e905ff06dc42eb0375cdcf03 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 25 Jan 2023 15:11:19 +0100 Subject: [PATCH 0832/1176] added boolean support in fluxos config builder --- flux_common.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 6e56cc12..d78b662b 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -291,16 +291,26 @@ function config_builder() { fi fi if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then - insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: '$value'," - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" - return + if [[ "$value" == "false" || "$value" == "true" ]]; then + insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" + return + else + insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: '$value'," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" + return + fi fi if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key: '$value'") != "" ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 skipped${NC}" "${X_MARK}" return fi if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") != "" ]]; then - sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: '$value',/" /home/$USER/$FLUX_DIR/config/userconfig.js + if [[ "$value" == "false" || "$value" == "true" ]]; then + sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: $value,/" /home/$USER/$FLUX_DIR/config/userconfig.js + else + sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: '$value',/" /home/$USER/$FLUX_DIR/config/userconfig.js + fi if [[ $(grep -w $value /home/$USER/$FLUX_DIR/config/userconfig.js) != "" ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was changed successfully${NC}" "${CHECK_MARK}" fi From dbebf3d6a5e3b181c97b134e928d99703c0d0462 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 25 Jan 2023 20:53:28 +0100 Subject: [PATCH 0833/1176] added os_check --- flux_common.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index d78b662b..4e025d4d 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -872,6 +872,25 @@ function manual_build(){ echo -e } ###### HELPERS SECTION +function os_check(){ + BLACK_LIST=( "kinetic" ) + avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) + if [[ "$avx_check" == "" ]]; then + BLACK_LIST+=( "jammy" ) + fi + LIST_LENGTH=${#BLACK_LIST[@]} + for (( p=0; p<${LIST_LENGTH}; p++ )); + do + if [[ $(lsb_release -cs) == ${BLACK_LIST[$p]} ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" + echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + done +} + function fluxos_clean(){ docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) From 55b8ed751356214f30fb2ea5c35c604a7b03d02f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 26 Jan 2023 14:37:37 +0100 Subject: [PATCH 0834/1176] added os_check --- multitoolbox.sh | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 022eafda..7f8c3f26 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -515,13 +515,7 @@ function install_node(){ fi if [[ "$OS_FLAGE" == "" ]]; then - if [[ $(lsb_release -cs) == "jammy" || $(lsb_release -cs) == "kinetic" ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" - echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi + os_check fi if sudo docker run hello-world > /dev/null 2>&1; then @@ -549,13 +543,11 @@ function install_docker(){ echo exit fi - if [[ $(lsb_release -cs) == "jammy" || $(lsb_release -cs) == "kinetic" ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" - echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit + + if [[ "$OS_FLAGE" == "" ]]; then + os_check fi + if [[ -z "$usernew" ]]; then usernew="$(whiptail --title "MULTITOOLBOX $dversion" --inputbox "Enter your username" 8 72 3>&1 1>&2 2>&3)" usernew=$(awk '{print tolower($0)}' <<< "$usernew") From d7b6f438cf06311c150bd60a20b5f4573f1d8990 Mon Sep 17 00:00:00 2001 From: John K <john@j-k-tuning.com> Date: Thu, 26 Jan 2023 21:28:07 -0500 Subject: [PATCH 0835/1176] More detailed error message for os_check --- flux_common.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 4e025d4d..f22b195f 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -90,7 +90,7 @@ function fluxos_conf_create(){ zelid: '${ZELID}', kadena: '${KDA_A}', development: false, - decryptionkey: '', + decryptionkey: '', testnet: $testnet } } @@ -882,11 +882,14 @@ function os_check(){ for (( p=0; p<${LIST_LENGTH}; p++ )); do if [[ $(lsb_release -cs) == ${BLACK_LIST[$p]} ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" - echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" + if [[ "$avx_check" == "" && $(lsb_release -cs) == "jammy" ]]; then + echo -e "${WORNING} ${CYNA}AVX CPU instruction set not found and is required to use MongoDB on $(lsb_release -cs)${NC}" + fi + echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit fi done } From 84b0bdcba9148e3682a0c398a22df59d8402b101 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 27 Jan 2023 10:49:14 +0100 Subject: [PATCH 0836/1176] update message format --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f22b195f..7cb9a1b1 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -886,7 +886,7 @@ function os_check(){ if [[ "$avx_check" == "" && $(lsb_release -cs) == "jammy" ]]; then echo -e "${WORNING} ${CYNA}AVX CPU instruction set not found and is required to use MongoDB on $(lsb_release -cs)${NC}" fi - echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation" + echo -e "${WORNING} ${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit From b72a6344b975cb02ca76d2b04fb865aa119b843e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Jan 2023 14:42:56 +0100 Subject: [PATCH 0837/1176] added sudo --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 7cb9a1b1..85fc15ac 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -921,7 +921,7 @@ function fluxos_clean(){ do if [[ "${APPS_LIST[$j]}" != "ZelShare" && "${APPS_LIST[$j]}" != "" ]]; then echo -e "${ARROW} ${CYAN}Apps directory removed, path: ${GREEN}/home/$USER/zelflux/ZelApps/${APPS_LIST[$j]}${NC}" - rm -rf /home/$USER/zelflux/ZelApps/${APPS_LIST[$j]} + sudo rm -rf /home/$USER/zelflux/ZelApps/${APPS_LIST[$j]} fi done fi From 6791aac57e602ab2027e2eeb24764620152c6096 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Feb 2023 20:18:16 +0100 Subject: [PATCH 0838/1176] added config_smart_create in import mode --- install_pro.sh | 175 ++++--------------------------------------------- 1 file changed, 12 insertions(+), 163 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 35d92478..d087e666 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -42,173 +42,22 @@ function config_veryfity(){ fi } function import_date() { - if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE || -f /home/$USER/.zelcash/zelcash.conf ]]; then + if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then if [[ -z "$import_settings" ]]; then if whiptail --yesno "Would you like to import data from Flux config files Y/N?" 8 60; then - OLD_CONFIG=0 - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - OLD_CONFIG=1 - fi - IMPORT_ZELCONF="1" - echo - echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" - if [[ "$OLD_CONFIG" == "1" ]]; then - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' - fi - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" - IMPORT_ZELID="1" - fi - KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" - fi - upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | sed -e 's/.\{2\}$//') - if [[ "$upnp_port" != "" ]]; then - gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) - echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" - echo -e "${PIN}${CYAN} Gateway IP = ${GREEN}$gateway_ip${NC}" - fi - fi - if [[ -f /home/$USER/watchdog/config.js ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" - fi - - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - fi - - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" - fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" - fi - fi - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" - fi - - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" - fi - - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" - fi - fi + config_smart_create "import" + IMPORT_ZELCONF="1" + if [[ "$ZELID" != "" ]]; then + IMPORT_ZELID="1" + fi fi else - if [[ "$import_settings" == "1" ]]; then - OLD_CONFIG=0 - if [[ -d /home/$USER/.zelcash ]]; then - CONFIG_DIR='.zelcash' - CONFIG_FILE='zelcash.conf' - OLD_CONFIG=1 - fi - IMPORT_ZELCONF="1" - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" - if [[ "$OLD_CONFIG" == "1" ]]; then - CONFIG_DIR='.flux' - CONFIG_FILE='flux.conf' - fi - if [[ -f ~/$FLUX_DIR/config/userconfig.js ]]; then - ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" - IMPORT_ZELID="1" - fi - KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" - fi - upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | sed -e 's/.\{2\}$//') - if [[ "$upnp_port" != "" ]]; then - gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) - echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" - echo -e "${PIN}${CYAN} Gateway IP = ${GREEN}$gateway_ip${NC}" - fi - fi - if [[ -f /home/$USER/watchdog/config.js ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" - fi - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - fi - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" - fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord ping = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Discord ping = ${RED}Disabled${NC}" - fi - fi - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" - fi - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_alert${NC}" - fi - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" - fi - fi + if [[ "$import_settings" == "1" ]]; then + config_smart_create "import" + IMPORT_ZELCONF="1" + if [[ "$ZELID" != "" ]]; then + IMPORT_ZELID="1" + fi fi fi fi From d9767bd6b6b53984f36609794604bdbe7679ebd2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Feb 2023 20:28:44 +0100 Subject: [PATCH 0839/1176] improved thunder_mode --- flux_common.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 85fc15ac..9b02f1a8 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -254,7 +254,8 @@ function install_conf_create(){ "telegram_chat_id": "${telegram_chat_id}", "eps_limit": "${eps_limit}", "upnp_port": "${upnp_port}", - "gateway_ip": "${gateway_ip}" + "gateway_ip": "${gateway_ip}", + "thunder": "${thunder:-0}" } EOF } @@ -1434,9 +1435,13 @@ function replace_zelid() { } function thunder_mode(){ + if [[ -d $HOME/.fluxbenchmark ]]; then sudo chown -R $USER:$USER $HOME/.fluxbenchmark > /dev/null 2>&1 + else + mkdir -p $HOME/.fluxbenchmark > /dev/null 2>&1 fi + if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then if [[ $(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf) == "" ]]; then config_builder "thunder" "1" "Thunder Mode" "benchmark" @@ -1447,8 +1452,11 @@ function thunder_mode(){ else config_builder "thunder" "1" "Thunder Mode" "benchmark" fi - echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Restarting service... ${NC}" - sudo systemctl restart zelcash > /dev/null 2>&1 + if [[ "$1" == "" ]]; then + echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Restarting service... ${NC}" + sudo systemctl restart zelcash > /dev/null 2>&1 + fi + } From 1f18f29da562d89f28020803211c7d85baff5e76 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Feb 2023 20:40:49 +0100 Subject: [PATCH 0840/1176] added thunder in import_config_file --- flux_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 9b02f1a8..62de84cf 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1119,6 +1119,8 @@ function import_config_file() { #FluxOS ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + #Benchmark + thunder=$(cat /home/$USER/install_conf.json | jq -r '.thunder') #WatchDog fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') From c0cba35a8319b20390b36e8b8997c30764ca53ce Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Feb 2023 20:42:52 +0100 Subject: [PATCH 0841/1176] added thunder_mode --- install_pro.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index d087e666..553f1bad 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -670,6 +670,9 @@ log_rotate "Docker" "docker_debug_log" "/var/lib/docker/containers/*/*.log" "dai basic_security status_loop install_watchdog +if [[ "$thunder" == "1" ]]; then + thunder_mode "install" +fi finalizing if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]] && [[ "$upnp_port" != "null" ]] ; then upnp_enable From a5f08de501f6760bec288693dab0f908bde4cb92 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Feb 2023 21:25:51 +0100 Subject: [PATCH 0842/1176] added thunde mode in manual_build --- flux_common.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 62de84cf..e69f3bd6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -867,6 +867,11 @@ function manual_build(){ fi firewall_disable='1' swapon='1' + + if whiptail --yesno "Would you like enable thunder mode?" 8 60; then + thunder='1' + fi + rm /home/$USER/install_conf.json > /dev/null 2>&1 install_conf_create config_file From bfd3d6f0307d3c743484836856199aef66a9fe6a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 8 Feb 2023 11:28:04 +0100 Subject: [PATCH 0843/1176] added thunder mode notification --- flux_common.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index e69f3bd6..311b31e1 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1178,8 +1178,12 @@ function import_config_file() { else echo -e "${PIN}${CYAN} Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 fi + + if [[ "$thunder" == "1" ]]; then + echo -e "${PIN}${CYAN} Enable thunder mode..............................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi fi - fi } function get_ip() { WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') From bd09717d2391381d8f4b24c4c6b00095afd50dae Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 8 Feb 2023 13:17:46 +0100 Subject: [PATCH 0844/1176] Minor edits --- install_pro.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index 553f1bad..c4b6c43d 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -671,6 +671,8 @@ basic_security status_loop install_watchdog if [[ "$thunder" == "1" ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Thunder Mode configuration...${NC}" thunder_mode "install" fi finalizing From cc82b8dea11531fe7e96f6bc0f77da9d7838ffc7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 8 Feb 2023 16:43:57 +0100 Subject: [PATCH 0845/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 311b31e1..d72519cf 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -544,7 +544,7 @@ function config_smart_create() { echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}Enabled${NC}" + echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" smart_install_conf "node_label" "$node_label" "$1" else echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" From afaa9476d4dbd2fcc700a454676f7b0da0f7af04 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Feb 2023 18:44:34 +0100 Subject: [PATCH 0846/1176] removed duplicate --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index d72519cf..210c51ae 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2356,7 +2356,7 @@ function selfhosting_creator(){ "2)") echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" #device_setup=$(whiptail --inputbox "Enter your device name" 8 60 3>&1 1>&2 2>&3) - deviceList=($(route -n | awk '{ if ($8 != "" && $8 != "Iface" && $8 != "docker0" ) printf("%s\n", $8); }')) + deviceList=($(route -n | awk '{ if ($8 != "" && $8 != "Iface" && $8 != "docker0" ) printf("%s\n", $8); }'| sort | uniq)) elements=${#deviceList[@]} choices=(); for (( i=0;i<$elements;i++)); do From 8b967ad4251bfb56742b93b8775a20b60a68c5d5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Feb 2023 19:05:56 +0100 Subject: [PATCH 0847/1176] added sudo --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 210c51ae..1fb4035f 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2356,7 +2356,7 @@ function selfhosting_creator(){ "2)") echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" #device_setup=$(whiptail --inputbox "Enter your device name" 8 60 3>&1 1>&2 2>&3) - deviceList=($(route -n | awk '{ if ($8 != "" && $8 != "Iface" && $8 != "docker0" ) printf("%s\n", $8); }'| sort | uniq)) + deviceList=($(sudo route -n | awk '{ if ($8 != "" && $8 != "Iface" && $8 != "docker0" ) printf("%s\n", $8); }'| sort | uniq)) elements=${#deviceList[@]} choices=(); for (( i=0;i<$elements;i++)); do From bbb2dcb693e990e2432ff5d521fc382deaf843bf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Feb 2023 19:35:01 +0100 Subject: [PATCH 0848/1176] Minior edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 1fb4035f..0cb1b2ac 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2356,7 +2356,7 @@ function selfhosting_creator(){ "2)") echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" #device_setup=$(whiptail --inputbox "Enter your device name" 8 60 3>&1 1>&2 2>&3) - deviceList=($(sudo route -n | awk '{ if ($8 != "" && $8 != "Iface" && $8 != "docker0" ) printf("%s\n", $8); }'| sort | uniq)) + deviceList=($(sudo route -n | awk '{ if ($8 != "" && $8 != "Iface" && $8 != "docker0" ) printf("%s\n", $8); }' | sort | uniq)) elements=${#deviceList[@]} choices=(); for (( i=0;i<$elements;i++)); do From 8f23b2259ea498f40f67be674bfe47d474b5ca0a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Feb 2023 22:02:32 +0100 Subject: [PATCH 0849/1176] only uniq --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 0cb1b2ac..5d92d435 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2354,9 +2354,9 @@ function selfhosting_creator(){ selfhosting ;; "2)") - echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" + echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate.....${NC}" #device_setup=$(whiptail --inputbox "Enter your device name" 8 60 3>&1 1>&2 2>&3) - deviceList=($(sudo route -n | awk '{ if ($8 != "" && $8 != "Iface" && $8 != "docker0" ) printf("%s\n", $8); }' | sort | uniq)) + deviceList=($(sudo route -n | awk '{ if ($8 != "" && $8 != "Iface" && $8 != "docker0" ) printf("%s\n", $8); }' | uniq)) elements=${#deviceList[@]} choices=(); for (( i=0;i<$elements;i++)); do From 71cd11351d477b9bbb136a44aeff16c55de1bfe3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:37:28 +0100 Subject: [PATCH 0850/1176] fixed confirmed_ip - prevent add new ip when confirmed_ip return null or error --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 5d92d435..b5beabbb 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2466,8 +2466,8 @@ function selfhosting() { if [[ "$api_port" == "" ]]; then api_port="16127" fi - confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info | jq -r .data.node.status.ip | sed -r 's/:.+//') - if [[ "$WANIP" != "" && "$confirmed_ip" != "" ]]; then + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info 2>/dev/null | jq -r .data.node.status.ip | sed -r 's/:.+//') + if [[ "$WANIP" != "" && "$confirmed_ip" != "" && "$confirmed_ip" != "null" ]]; then if [[ "$WANIP" != "$confirmed_ip" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') echo -e "New IP detected, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log From 0a457bd718e62f2e3097aefad7f125605ba421c7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:27:19 +0100 Subject: [PATCH 0851/1176] added upnp in install_flux --- multitoolbox.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7f8c3f26..78177043 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -157,6 +157,12 @@ function install_flux() { echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" fi echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" + + upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | sed -e 's/.\{2\}$//') + if [[ "$upnp_port" != "" ]]; then + echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" + fi + echo -e "" echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 @@ -216,7 +222,10 @@ function install_flux() { done fi fluxos_conf_create - if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + if [[ "$upnp_port" != "" ]]; then + config_builder "apiport" "$upnp_port" "UPnP Port" "fluxos" + fi string_limit_check_mark "FluxOS configuration successfull..........................................." else string_limit_x_mark "FluxOS installation failed, missing config file..........................................." From c162f51dc5e52cf19289227a14f5d83ba343ee4a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:51:39 +0100 Subject: [PATCH 0852/1176] left trim --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 78177043..add7fbe2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -160,7 +160,7 @@ function install_flux() { upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | sed -e 's/.\{2\}$//') if [[ "$upnp_port" != "" ]]; then - echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" + echo -e "${PIN}${CYAN}UPnP port = ${GREEN}$upnp_port${NC}" fi echo -e "" From d71a47c547b37bfacc6ad84828da39cc17282b7a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 20 Feb 2023 12:08:26 +0100 Subject: [PATCH 0853/1176] added number regex --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index add7fbe2..738629bf 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -158,7 +158,7 @@ function install_flux() { fi echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" - upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | sed -e 's/.\{2\}$//') + upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | egrep -o '[0-9]+') if [[ "$upnp_port" != "" ]]; then echo -e "${PIN}${CYAN}UPnP port = ${GREEN}$upnp_port${NC}" fi From fdc0baf48dc91b30575359181a486b302877af46 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 20 Feb 2023 13:01:38 +0100 Subject: [PATCH 0854/1176] removed sed --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 738629bf..c09d2aee 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -158,7 +158,7 @@ function install_flux() { fi echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" - upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | egrep -o '[0-9]+') + upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | egrep -o '[0-9]+') if [[ "$upnp_port" != "" ]]; then echo -e "${PIN}${CYAN}UPnP port = ${GREEN}$upnp_port${NC}" fi From 1b61732c8661ddedc9fc94eeedbcb5206ca9ad78 Mon Sep 17 00:00:00 2001 From: John K <john@j-k-tuning.com> Date: Tue, 21 Feb 2023 21:45:30 -0500 Subject: [PATCH 0855/1176] Discord User ID Exit --- install_pro.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index c4b6c43d..c3c400c1 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -132,7 +132,7 @@ function install_watchdog() { discord=$(whiptail --inputbox "Enter your discord server webhook url" 8 65 3>&1 1>&2 2>&3) sleep 1 if whiptail --yesno "Would you like enable nick ping on discord?" 8 60; then - + try="0" while true do ping=$(whiptail --inputbox "Enter your discord user id" 8 60 3>&1 1>&2 2>&3) @@ -142,6 +142,13 @@ function install_watchdog() { else string_limit_x_mark "UserID is not valid try again............................." sleep 1 + try=$(($try+1)) + if [[ "$try" -gt "3" ]]; then + echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" + echo -e "${WORNING} ${CYAN}Disabling ping but continue watchdog install ...${NC}" + ping=0; + break + fi fi done sleep 1 From 8d1795eb0f46512349f0e72069aa305942819eb8 Mon Sep 17 00:00:00 2001 From: John K <john@j-k-tuning.com> Date: Wed, 22 Feb 2023 21:24:27 -0500 Subject: [PATCH 0856/1176] Show which ip_check added new ip --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index b5beabbb..b58001d6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2455,7 +2455,7 @@ function selfhosting() { get_device_name if [[ "$device_name" != "" && "$WANIP" != "" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log + echo -e "New IP detected during $1, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log sudo ip addr add $WANIP dev $device_name && sleep 2 fi fi @@ -2470,7 +2470,7 @@ function selfhosting() { if [[ "$WANIP" != "" && "$confirmed_ip" != "" && "$confirmed_ip" != "null" ]]; then if [[ "$WANIP" != "$confirmed_ip" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log + echo -e "New IP detected during $1, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log sudo ip addr add $WANIP dev $device_name && sleep 2 fi fi From 03c03ca17f595a7c55ba5e0082898a7c2e1de534 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 26 Feb 2023 14:32:19 +0100 Subject: [PATCH 0857/1176] added check for arm --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index c3c400c1..88de5a7e 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -563,7 +563,7 @@ function install_process() { avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) # AVX instruction flag not found - so install 4.4 # else install newest version 6.0 - if [[ "$avx_check" == "" ]]; then + if [[ "$avx_check" == "" || "$(dpkg --print-architecture)" = *arm* ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 if [[ $(lsb_release -d) = *Debian* ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 From 9955472cbed419561d65b6916ba498d1ff0d0828 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 26 Feb 2023 14:36:34 +0100 Subject: [PATCH 0858/1176] update os_check --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index b58001d6..58d04aa5 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -881,7 +881,7 @@ function manual_build(){ function os_check(){ BLACK_LIST=( "kinetic" ) avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) - if [[ "$avx_check" == "" ]]; then + if [[ "$avx_check" == "" || "$(dpkg --print-architecture)" = *arm* ]]; then BLACK_LIST+=( "jammy" ) fi LIST_LENGTH=${#BLACK_LIST[@]} From a57cceaaf446fa5d27c44a625b4b38c03d959d08 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 26 Feb 2023 14:55:57 +0100 Subject: [PATCH 0859/1176] revert check --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 88de5a7e..c3c400c1 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -563,7 +563,7 @@ function install_process() { avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) # AVX instruction flag not found - so install 4.4 # else install newest version 6.0 - if [[ "$avx_check" == "" || "$(dpkg --print-architecture)" = *arm* ]]; then + if [[ "$avx_check" == "" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 if [[ $(lsb_release -d) = *Debian* ]]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 From cf77d6ab901539090f1a4dc50b23d058901696a9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 26 Feb 2023 14:56:44 +0100 Subject: [PATCH 0860/1176] revert check --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 58d04aa5..b58001d6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -881,7 +881,7 @@ function manual_build(){ function os_check(){ BLACK_LIST=( "kinetic" ) avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) - if [[ "$avx_check" == "" || "$(dpkg --print-architecture)" = *arm* ]]; then + if [[ "$avx_check" == "" ]]; then BLACK_LIST+=( "jammy" ) fi LIST_LENGTH=${#BLACK_LIST[@]} From ffab33a8740aa5ab3dfdb860347a5da96e4d32a1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 26 Feb 2023 15:06:04 +0100 Subject: [PATCH 0861/1176] set hardcoded mongod version - install 4.4.18 when avx check failed, block update --- flux_common.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index b58001d6..5740e784 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1776,7 +1776,17 @@ function install_mongod() { sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" sudo apt-get update -y > /dev/null 2>&1 - sudo apt-get install mongodb-org -y > /dev/null 2>&1 && sleep 2 + avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) + if [[ "$avx_check" == "" ]]; then + sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 + echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 && sleep 2 + echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-shell hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 + else + sudo apt install -y mongodb-org > /dev/null 2>&1 + fi sudo systemctl enable mongod > /dev/null 2>&1 sudo systemctl start mongod > /dev/null 2>&1 if mongod --version > /dev/null 2>&1; then From 58e4c8b484c09e726c0bc2cb7c3853a3b3309f61 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 26 Feb 2023 15:08:16 +0100 Subject: [PATCH 0862/1176] removed sleep --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 5740e784..439f7d99 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1779,7 +1779,7 @@ function install_mongod() { avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) if [[ "$avx_check" == "" ]]; then sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 - echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 && sleep 2 + echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 echo "mongodb-org-shell hold" | sudo dpkg --set-selections > /dev/null 2>&1 echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 From 41d69fa57ac0697b9623a558dd4969b79511018c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 26 Feb 2023 15:26:13 +0100 Subject: [PATCH 0863/1176] added avx check for mongod hard repair --- multitoolbox.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index c09d2aee..97dea932 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -719,7 +719,17 @@ function mongod_db_fix() { sudo rm -r /var/log/mongodb > /dev/null 2>&1 sudo rm -r /var/lib/mongodb > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing MongoDB... ${NC}" - sudo apt install mongodb-org -y > /dev/null 2>&1 + avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) + if [[ "$avx_check" == "" ]]; then + sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 + echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 && sleep 2 + echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-shell hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 + else + sudo apt install -y mongodb-org > /dev/null 2>&1 + fi sudo mkdir -p /var/log/mongodb > /dev/null 2>&1 sudo mkdir -p /var/lib/mongodb > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Settings privilege... ${NC}" From 7d93bd46d9288677dd3a3fe0540123bcb7fa8a26 Mon Sep 17 00:00:00 2001 From: JKTUNING <john@j-k-tuning.com> Date: Tue, 28 Feb 2023 20:22:50 -0500 Subject: [PATCH 0864/1176] UPnP Enable before starting Flux during option 2 (#95) * Install UPNP before starting flux - Adding install argument to enable_upnp function - Move upnp enable above finalizing function in installpro * remove dup finalizing --- flux_common.sh | 31 ++++++++++++++++++------------- install_pro.sh | 4 ++-- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 439f7d99..6ad4aa95 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2290,20 +2290,25 @@ function upnp_enable() { sudo ufw allow from $router_ip to any proto udp > /dev/null 2>&1 fi fi - sudo systemctl restart zelcash > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 - sleep 150 - echo -e "${ARROW}${CYAN} Checking FluxOS logs... ${NC}" - error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") - if [[ "$error_check" == "" ]]; then - echo -e "" - LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') - ZELFRONTPORT=$(($FLUX_PORT-1)) - echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${LOCAL_IP}:$ZELFRONTPORT${NC}" - echo -e "" + if [[ "$1" != "install" ]]; then + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + sleep 150 + echo -e "${ARROW}${CYAN} Checking FluxOS logs... ${NC}" + error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") + if [[ "$error_check" == "" ]]; then + echo -e "" + LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') + ZELFRONTPORT=$(($FLUX_PORT-1)) + echo -e "${PIN} ${CYAN}To access your FluxOS use this url: ${SEA}http://${LOCAL_IP}:$ZELFRONTPORT${NC}" + echo -e "" + else + echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" + echo -e "" + fi else - echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" - echo -e "" + LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') + ZELFRONTPORT=$(($FLUX_PORT-1)) fi } #### TESTNET diff --git a/install_pro.sh b/install_pro.sh index c3c400c1..cffca5a8 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -682,8 +682,8 @@ if [[ "$thunder" == "1" ]]; then echo -e "${ARROW} ${YELLOW}Thunder Mode configuration...${NC}" thunder_mode "install" fi -finalizing if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]] && [[ "$upnp_port" != "null" ]] ; then - upnp_enable + upnp_enable "install" fi +finalizing display_banner From 3cb0209ba50d532588b2303c5f3849704dcdf4f9 Mon Sep 17 00:00:00 2001 From: source_code <11710298+saad-akhtar@users.noreply.github.com> Date: Tue, 28 Feb 2023 19:33:27 -0600 Subject: [PATCH 0865/1176] Function Cleanup (#88) removed redundant spinning_timer() --- flux_common.sh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 6ad4aa95..29a62a46 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1007,20 +1007,6 @@ function string_limit_check_mark() { fi echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" } -function spinning_timer() { - animation=( ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ) - end=$((SECONDS+NUM)) - while [ $SECONDS -lt $end ]; - do - for i in "${animation[@]}"; - do - echo -e "" - echo -ne "${RED}\r\033[1A\033[0K$i ${CYAN}${MSG1}${NC}" - sleep 0.1 - done - done - echo -ne "${MSG2}" -} function integration_check() { FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) ELEMENTS=${#FILE_ARRAY[@]} From 55936a03d8034a13d9a43f4a07253af9db928c24 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 1 Mar 2023 08:51:14 +0100 Subject: [PATCH 0866/1176] added upnp error check in finalizing --- flux_common.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 29a62a46..087f7008 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1967,6 +1967,15 @@ function finalizing() { MSG2="${CYAN}.............[${CHECK_MARK}${CYAN}]${NC}" echo && spinning_timer echo + + if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]] && [[ "$upnp_port" != "null" ]] ; then + error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") + if [[ "$error_check" == "" ]]; then + echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" + echo -e "" + fi + fi + $BENCH_CLI restartnodebenchmarks > /dev/null 2>&1 NUM='300' MSG1='Restarting benchmark...' From cba919baa2eeb6384f8837bd4d291e4a9e050a0f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 1 Mar 2023 08:53:51 +0100 Subject: [PATCH 0867/1176] conditional fix --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 087f7008..7a9bf44f 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1970,7 +1970,7 @@ function finalizing() { if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]] && [[ "$upnp_port" != "null" ]] ; then error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") - if [[ "$error_check" == "" ]]; then + if [[ "$error_check" != "" ]]; then echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down...${NC}" echo -e "" fi From 3971d1c0ff8104fe230a372bc00870cdc43f168d Mon Sep 17 00:00:00 2001 From: John K <john@j-k-tuning.com> Date: Wed, 1 Mar 2023 08:40:00 -0500 Subject: [PATCH 0868/1176] upnp move restart flux to install conditional --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 7a9bf44f..039751b5 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2220,7 +2220,6 @@ function upnp_enable() { config_builder "fluxport" "$FLUX_PORT" "MultiPort Mode" "benchmark" fi if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark.....${NC}" #API PORT sudo ufw allow $FLUX_PORT > /dev/null 2>&1 #HOME UI PORT @@ -2286,6 +2285,7 @@ function upnp_enable() { fi fi if [[ "$1" != "install" ]]; then + echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark.....${NC}" sudo systemctl restart zelcash > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 sleep 150 From 40c2392b73b69e22fd7036358990fe6596288f6a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 18 Apr 2023 13:12:35 +0200 Subject: [PATCH 0869/1176] fix typo --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 97dea932..1e2f5a5d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -517,7 +517,7 @@ function install_node(){ if [[ $(lsb_release -d) != *Debian* && $(lsb_release -d) != *Ubuntu* ]]; then echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) not supported${NC}" - eecho -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" + echo -e "${CYNA}Ubuntu 20.04 LTS is the recommended OS version .. please re-image and retry installation" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo exit From 8aaf6d32d8f4fce654316d28cf1973a09248b813 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Sat, 6 May 2023 17:29:14 +0100 Subject: [PATCH 0870/1176] Update Testnet --- multitoolbox_testnet.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index cedfc1f0..244e4357 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -1193,13 +1193,13 @@ echo -e "" && echo -e "" if [[ $(dpkg --print-architecture) = *amd* ]]; then echo -e "${ARROW} ${CYAN}Downloading file...${NC}" - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/Testnet/Flux-amd64-v6.2.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-amd64-v6.2.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-Linux-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/Testnet/Fluxbench-Linux-v3.9.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.9.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 sudo rm -rf /tmp/flux* 2>&1 && sleep 2 @@ -1208,13 +1208,13 @@ if [[ $(dpkg --print-architecture) = *amd* ]]; then else echo -e "${ARROW} ${CYAN}Downloading file...${NC}" - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Flux-arm64-halving.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/Testnet/Flux-arm-6.2.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-arm-6.2.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-arm-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/Testnet/Fluxbench-arm-v3.9.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.9.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 sudo rm -rf /tmp/flux* 2>&1 && sleep 2 From 1099e2ffa31c5f936c8174ddcdddeba0b15cc21a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 May 2023 11:41:20 +0200 Subject: [PATCH 0871/1176] update install_daemon --- install_pro_testnet.sh | 101 +++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index b8487b9f..f0aaac09 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -688,72 +688,75 @@ EOF } function install_daemon() { - sudo rm /etc/apt/sources.list.d/zelcash.list > /dev/null 2>&1 sudo rm /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Configuring daemon repository and importing public GPG Key${NC}" sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 - -if [[ "$(lsb_release -cs)" == "xenial" ]]; then - - echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - - if ! gpg --list-keys Zel > /dev/null; then - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 - fi - flux_package && sleep 2 -else - # cleaning - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - sudo rm /usr/share/keyrings/zelcash-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - # downloading key && save it as keyring - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://na.pool.sks-keyservers.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - echo -e "${YELLOW}Last keyserver also failed will try one last keyserver.${NC}" - sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 - fi - if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then - flux_package && sleep 2 + sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 + if [[ "$(lsb_release -cs)" == "xenial" ]]; then + echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + if ! gpg --list-keys Zel > /dev/null; then + gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 + fi + flux_package && sleep 2 else - echo - echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi -fi + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + # downloading key && save it as keyring + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + key_counter=0 + until [ $key_counter -gt 5 ] + do + if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + break + fi + echo -e "${CYAN}Retrieve keys failed will try again...${NC}" + sleep 5 + sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 + ((key_counter++)) + done + + if gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then + flux_package && sleep 2 + else + echo -e "" + echo -e "${WORNING} ${RED}Importing public GPG Key failed...${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo -e "" + exit + fi + fi sudo rm -rf /tmp/*lux* 2>&1 && sleep 2 if [[ $(dpkg --print-architecture) = *amd* ]]; then - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-Linux-halving.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Flux-Linux-halving.tar.gz -C /tmp > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Downloading testnet file...${NC}" + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/Testnet/Flux-amd64-v6.2.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-amd64-v6.2.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-Linux-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-Linux-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/Testnet/Fluxbench-Linux-v3.9.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-Linux-v3.9.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + sudo rm -rf /tmp/flux* 2>&1 && sleep 2 + sudo rm -rf /tmp/Flux* 2>&1 && sleep 2 else - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Flux-arm64-halving.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Flux-arm64-halving.tar.gz -C /tmp > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Downloading testnet file...${NC}" + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/Testnet/Flux-arm-6.2.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Flux-arm-6.2.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/flux-cli /usr/local/bin > /dev/null 2>&1 - sudo wget https://github.com/RunOnFlux/fluxd/releases/download/halving-test-2/Fluxbench-arm-v3.3.0.tar.gz -P /tmp > /dev/null 2>&1 - sudo tar xzvf /tmp/Fluxbench-arm-v3.3.0.tar.gz -C /tmp > /dev/null 2>&1 + sudo wget https://github.com/RunOnFlux/fluxd/releases/download/Testnet/Fluxbench-arm-v3.9.0.tar.gz -P /tmp > /dev/null 2>&1 + sudo tar xzvf /tmp/Fluxbench-arm-v3.9.0.tar.gz -C /tmp > /dev/null 2>&1 sudo mv /tmp/fluxbenchd /usr/local/bin > /dev/null 2>&1 sudo mv /tmp/fluxbench-cli /usr/local/bin > /dev/null 2>&1 + sudo rm -rf /tmp/flux* 2>&1 && sleep 2 + sudo rm -rf /tmp/Flux* 2>&1 && sleep 2 fi - sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 } From eeac43cde84bcb06acb6b8cec70aafa689370065 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 27 Jun 2023 14:28:55 +0200 Subject: [PATCH 0872/1176] added ethid check --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 039751b5..edac2e7f 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1413,7 +1413,7 @@ function replace_zelid() { while true do new_zelid="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ]; then + if [ $(printf "%s" "$new_zelid" | wc -c) -eq "34" ] || [ $(printf "%s" "$new_zelid" | wc -c) -eq "33" ] || [ $(grep -Eo "^0x[a-fA-F0-9]{40}$" <<< "$new_zelid") ]; then string_limit_check_mark "Zel ID is valid..........................................." break else From 7ce4868d60d4d41452d7527f9bd3ebb6c0e5c3cb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 27 Jun 2023 14:32:06 +0200 Subject: [PATCH 0873/1176] added ethid check --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 1e2f5a5d..e719c563 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -198,7 +198,7 @@ function install_flux() { while true do ZELID="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then + if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ] || [ $(grep -Eo "^0x[a-fA-F0-9]{40}$" <<< "$ZELID") ]; then string_limit_check_mark "Zel ID is valid..........................................." break else From 68fc40e04ec9c0feb5f134798379677affeb95a0 Mon Sep 17 00:00:00 2001 From: John K <john@j-k-tuning.com> Date: Wed, 28 Jun 2023 00:00:00 -0400 Subject: [PATCH 0874/1176] Additional ethid checks - Allow for ehtid in insatll conf setup Added .editorconfig file for use with shell-format vscode extension. This would be a really nice add to keep the formatting consistent. The formatter can also be ran by simply running /usr/local/bin/shfmt https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format --- .editorconfig | 23 +++++++++++++++++++++++ flux_common.sh | 2 +- install_pro.sh | 2 +- install_pro_testnet.sh | 2 +- multitoolbox_testnet.sh | 2 +- 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..3bbe1f22 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,23 @@ +# Top-most EditorConfig file +root = true + +# Unix-style end-of-line characters +[*] +end_of_line = LF + +# Use UTF-8 encoding +[*.{sh,bash}] +charset = utf-8 + +# Indentation settings +[*.{sh,bash}] +indent_style = space +indent_size = 2 + +# Trailing whitespace +[*.{sh,bash}] +trim_trailing_whitespace = true + +# Insert final newline +[*.{sh,bash}] +insert_final_newline = true diff --git a/flux_common.sh b/flux_common.sh index edac2e7f..796abbde 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -683,7 +683,7 @@ function manual_build(){ while true do zel_id=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) - if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then + if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ] || [ $(grep -Eo "^0x[a-fA-F0-9]{40}$" <<< "$zel_id") ]; then echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" break else diff --git a/install_pro.sh b/install_pro.sh index cffca5a8..1e1345cb 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -398,7 +398,7 @@ function create_conf() { while true do ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) - if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then + if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ] || [ $(grep -Eo "^0x[a-fA-F0-9]{40}$" <<< "$ZELID") ]; then echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" break else diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh index f0aaac09..088621d3 100644 --- a/install_pro_testnet.sh +++ b/install_pro_testnet.sh @@ -1170,7 +1170,7 @@ if [[ "$IMPORT_ZELID" == "0" ]]; then while true do ZELID=$(whiptail --title "Flux Configuration" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3) - if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ]; then + if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ] || [ $(grep -Eo "^0x[a-fA-F0-9]{40}$" <<< "$ZELID") ]; then echo -e "${ARROW} ${CYAN}Zel ID is valid${CYAN}.........................[${CHECK_MARK}${CYAN}]${NC}" break else diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index 244e4357..ca011698 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -236,7 +236,7 @@ ip_confirm while true do zel_id="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ]; then + if [ $(printf "%s" "$zel_id" | wc -c) -eq "34" ] || [ $(printf "%s" "$zel_id" | wc -c) -eq "33" ] || [ $(grep -Eo "^0x[a-fA-F0-9]{40}$" <<< "$zel_id") ]; then string_limit_check_mark "Zel ID is valid..........................................." break else From 18a211768bcee6198ca67e157c431c1887efc901 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 3 Jul 2023 11:31:32 +0200 Subject: [PATCH 0875/1176] cleanup --- flux_common.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 796abbde..336b53d0 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -90,7 +90,6 @@ function fluxos_conf_create(){ zelid: '${ZELID}', kadena: '${KDA_A}', development: false, - decryptionkey: '', testnet: $testnet } } @@ -399,7 +398,7 @@ function config_builder() { function smart_reconfiguration(){ watchdog_settings_list=("label", "tier_eps_min", "zelflux_update", "zelcash_update", "zelbench_update", "action", "ping", "web_hook_url", "telegram_alert", "telegram_bot_token", "telegram_chat_id") - fluxos_settings_list=("kadena", "zelid", "apiport", "ipaddress", "development", "decryptionkey") + fluxos_settings_list=("kadena", "zelid", "apiport", "ipaddress", "development") daemon_settings_list=("zelnodeprivkey", "zelnodeoutpoint", "zelnodeindex") benchmark_settings_list=("fluxport", "thunder", "speedtestserverid") config_list=$(cat <<-END @@ -417,8 +416,7 @@ function smart_reconfiguration(){ "thunder": [{"key": "thunder", "label": "Thunder Mode"}], "speedtestserverid": [{"key": "speedtestserverid", "label": "Speed Test Server ID"}], "upnp_port": [{"key": "apiport", "label": "UPnP Port"}], - "development": [{"key": "development", "label": "Development Mode"}], - "decryptionkey": [{"key": "decryptionkey", "label": "Encryption Mode"}] + "development": [{"key": "development", "label": "Development Mode"}] } END ) From b5cf177501f4447e4ecd1f18e956c012e3a20da5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:29:36 +0200 Subject: [PATCH 0876/1176] disabled default deny outgoing --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 1e1345cb..523ee529 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -486,7 +486,7 @@ function basic_security() { sudo ufw allow out to any port 53 > /dev/null 2>&1 #FluxOS communication sudo ufw allow 16100:16199/tcp > /dev/null 2>&1 - sudo ufw default deny outgoing > /dev/null 2>&1 + #sudo ufw default deny outgoing > /dev/null 2>&1 sudo ufw limit OpenSSH > /dev/null 2>&1 echo "y" | sudo ufw enable > /dev/null 2>&1 sudo ufw reload > /dev/null 2>&1 From a8146673a1c5f53c60fc8d617fbee131498f996d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Aug 2023 18:31:04 +0200 Subject: [PATCH 0877/1176] Create hardwarebench.sh added hardware benchmark --- hardwarebench.sh | 358 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 358 insertions(+) create mode 100644 hardwarebench.sh diff --git a/hardwarebench.sh b/hardwarebench.sh new file mode 100644 index 00000000..177947c3 --- /dev/null +++ b/hardwarebench.sh @@ -0,0 +1,358 @@ +#!/usr/bin/env bash +SSD=0 +HDD=0 +LC_ALL="en_US.UTF-8" +LC_NUMERIC="en_US.UTF-8" +LANG="en_US.UTF-8" +LANGUAGE="en_US:en" +########## +command_exists() +{ + command -v "$@" > /dev/null 2>&1 +} + +Bps_to_MiBps() +{ + awk '{ printf "%.2f\n", $0 / 1024 / 1024 } END { if (NR == 0) { print "error" } }' +} + +B_to_MiB() +{ + awk '{ printf "%.0f MiB\n", $0 / 1024 / 1024 } END { if (NR == 0) { print "error" } }' +} + +finish() +{ + printf '\n' + sudo rm -f test_$$ + exit +} + +trap finish EXIT INT TERM + +dd_benchmark() +{ + cd $HOME && sudo LC_ALL=C timeout 30s dd if=/dev/zero of=$1/test_$$ bs=64k count=16k conv=fdatasync 2>&1 | \ + awk -F, ' + { + io=$NF + } + END { + if (io ~ /TB\/s/) {printf("%.0f\n", 1000*1000*1000*1000*io)} + else if (io ~ /GB\/s/) {printf("%.0f\n", 1000*1000*1000*io)} + else if (io ~ /MB\/s/) {printf("%.0f\n", 1000*1000*io)} + else if (io ~ /KB\/s/) {printf("%.0f\n", 1000*io)} + else { printf("%.0f", 1*io)} + }' + sudo rm -f $1/test_* +} + +if ! command_exists dd; then + printf '%s\n' 'This script requires dd, but it could not be found.' 1>&2 + exit 1 +fi + + +if [[ "$(sysbench --version)" == "" ]]; then + curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sudo bash > /dev/null 2>&1 + sudo apt -y install sysbench > /dev/null 2>&1 +fi + +vcore=$(getconf _NPROCESSORS_ONLN) +ram=$(LC_ALL=C free -b 2> /dev/null | awk 'NR==2 {print $2}' | grep -Eo '[0-9]+'| printf "%.2fGB\n" $(awk '{ print $1/1024/1024/1024 }')) +core=$(awk -F: '/cpu cores/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \\t]*//;s/[ \\t]*$//') + +echo -e "" +echo -e "-------------------------" +echo -e "| MEMORY BENCHMARK" +echo -e "-------------------------" +echo -e "| RAM: $ram" +echo -e "-------------------------" +echo -e "| CPU BENCHMARK" +echo -e "-------------------------" +eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk -v cpu=$vcore '{print $4*cpu}') + +if [[ "${ram%%.*}" -ge 7 ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]] && [[ "${eps%%.*}" -ge 240 ]]; then + status="CUMULUS" +fi + +if [[ "${ram%%.*}" -ge 31 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]] && [[ "${eps%%.*}" -ge 640 ]]; then + status="NIMBUS" +fi + +if [[ "${ram%%.*}" -ge 62 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]] && [[ "${eps%%.*}" -ge 1520 ]]; then + status="STRATUS" +fi + +if [[ "$status" == "" ]]; then + status="FAILED" +fi + +echo -e "| CPU vcores: $vcore" +echo -e "| CPU cores: $core" +echo -e "| EPS: $eps" + +outputdiskbench="Disks Bench:"; +#checking loop for lxc only if mount == '/' +loop_mount=$(cd $HOME && LC_ALL=C lsblk -l -b -n | grep ' loop' | awk '{ if ($7 == "/") printf("%.2f\n", $4/(1024*1024*1024))}') +if [[ "$loop_mount" != "" ]]; then + + #echo -e "Device type: loop" + mount_path="/" + io1=$( dd_benchmark "$mount_path" ) + io2=$( dd_benchmark "$mount_path" ) + io3=$( dd_benchmark "$mount_path" ) + + if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) + elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) + else + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) + fi + + outputdiskbench+=" loop $loop_mount $ioavg" + if [[ "${ioavg%%.*}" -ge "180" ]]; then + SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$loop_mount"')}') + else + HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$loop_mount"')}') + fi +fi +if [[ $outputdiskbench == "Disks Bench:" ]]; then + + lvm_mount="" + raid_list=() + disc__array=($(cd $HOME && LC_ALL=C lsblk -o NAME,SIZE,TYPE -b -n | grep ' disk' | awk '{ if ($2 > 2147483648 && $1 != "mmcblk0" && $1 != "mmcblk0p1") print $1}')) + for((i=0;i<${#disc__array[@]};i++)); + do + + #checking if disk structure is accessable + cd $HOME && lsblk -l -b -n /dev/${disc__array[i]} > /dev/null 2>&1 + if [ $? != 0 ]; then + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Error: Can't grab device stucture... device skipped!" + #echo -e "-----------------------------" + continue + fi + #checking direct mount + disk_mount_check=$(cd $HOME && LC_ALL=C lsblk -l -b -n /dev/${disc__array[i]} | grep ' disk' | awk '{ if ( $7 == "") print "no"; else print "yes"}') + #echo -e "Direct mount: $disk_mount_check" + if [[ "$disk_mount_check" == "no" ]]; then + #checking lvm mount + lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) + lvm_name=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $1 }' ) + if [[ "$lvm_name" != "" ]]; then + count=$(echo ${mount_list[@]} | tr ' ' '\n' | awk '$1 == "'"$lvm_mount"'"{print $0}' | wc -l) + if [[ "$count" == "0" ]]; then + mount_list+=("$lvm_mount") + else + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Error: Mount point already checked... device skipped!" + #echo -e "-----------------------------" + continue + fi + fi + + if [[ "$lvm_name" != "" && "$lvm_mount" == "" ]]; then + if [[ ! -d /.benchmark_test ]]; then + sudo mkdir /.benchmark_test + fi + sudo mount /dev/mapper/$lvm_name /.benchmark_test + fi + + lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) + if [[ "$lvm_mount" != "" ]]; then + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{print $1 " " $4/(1024*10 24*1024) }') + else + #checking if disk partition type is LVM2_member + part_type_check=$(cd $HOME && LC_ALL=C lsblk -o NAME,TYPE,FSTYPE,SIZE -b -n /dev/${disc__array[i]} --sort SIZE | egrep ' part' | egrep 'LVM2_member' | tail -n1 | wc -l) + if [[ "$part_type_check" != "0" ]]; then + #skipp disk + partition_name=$(awk '{print $1}' <<< $part_type_check) + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Error: LVM2_member partition detected... device skipped!" + #echo -e "-----------------------------" + continue + fi + + #checking raid + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' raid' | tail -n1 | awk '{print $1 " " $4/(1024*1024* 1024) }') + if [[ "$partition_output" == "" ]]; then + #checking part ( when not lvm and raid ) + #echo -e "Checking partition on device: /dev/${disc__array[i]}" + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' part' | tail -n1 | awk '{print $1 " " $4/(1024*102 4*1024) }') + #echo -e "$partition_output" + #echo -e "-----------------------------" + else + partition_name=$(awk '{print $1}' <<< $partition_output) + #add raid name to skip list + if [[ ! " ${raid_list[@]} " =~ " ${partition_name} " ]]; then + raid_list+=("$partition_name") + else + #skipped raid already tested + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Info: Disk skipped - raid already tested!" + #echo -e "-----------------------------" + continue + fi + fi + fi + + else + #echo -e "Checking partition on device: /dev/${disc__array[i]} (STEP2)..." + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') + #echo -e "$partition_output" + #echo -e "" + fi + + partition_name=$(awk '{print $1}' <<< $partition_output) + partition_size=$(awk '{printf("%.2f",$2)}' <<< $partition_output) + if [[ "$lvm_mount" == "" && "$raid_list" == "" ]]; then + disk_size=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --noheadings | head -n1 | awk '{printf("%.2f",$4/(1024*1024*1024))}') + else + disk_size=$partition_size + fi + + if [[ "$lvm_mount" == "" ]]; then + if [[ ! -d /.benchmark_test ]]; then + sudo mkdir /.benchmark_test + fi + sudo mount /dev/$partition_name /.benchmark_test + available_space=$(LC_ALL=C df /dev/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else prin t "null"}') + else + available_space=$(LC_ALL=C df /dev/mapper/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); el se print "null"}') + fi + + if [[ "$available_space" != "null" && "$available_space" != "" ]]; then + + if [[ "$lvm_mount" == "" ]]; then + mount_path="/.benchmark_test" + else + mount_path="$lvm_mount" + fi + + #echo -e "Mount point: $mount_path" + io1=$( dd_benchmark "$mount_path" ) + io2=$( dd_benchmark "$mount_path" ) + io3=$( dd_benchmark "$mount_path" ) + + if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) + elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) + else + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) + fi + + outputdiskbench+=" ${disc__array[i]} $disk_size $ioavg" + if [[ "${ioavg%%.*}" -ge "180" ]]; then + SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$disk_size"')}') + else + HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$disk_size"')}') + fi + + if [[ "$lvm_mount" == "" ]]; then + sudo umount /.benchmark_test + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + echo -e "" + else + sudo rm -rf /.benchmark_test + fi + fi + + #check if test point mounted if exist unmount it LVM case + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + sudo umount /.benchmark_test + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + echo -e "" + else + sudo rm -rf /.benchmark_test + fi + fi + + else + + #echo -e "Error: space not enough... write test skipped!" + #echo -e "-----------------------------" + if [[ "$lvm_mount" == "" ]]; then + + sudo umount /.benchmark_test + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + echo -e "" + else + sudo rm -rf /.benchmark_test + fi + fi + fi + + done + + if [[ "$outputdiskbench" == "Disks Bench:" ]]; then + # lsblk failed checking direct mount from df + df_direct_mount=$(LC_ALL=C df --output=source,fstype,size,avail,target | grep 'dev' | awk '{ if ($5 == "/") printf("%s %.2f %.2f\n", $1,$3/(1024*1024),$4/ (1024*1024))}') + if [[ df_direct_mount != "" ]]; then + device_name=$(awk '{print $1}' <<< $df_direct_mount) + partition_size=$(awk '{print $2}' <<< $df_direct_mount) + mount_path="/" + io1=$( dd_benchmark "$mount_path" ) + io2=$( dd_benchmark "$mount_path" ) + io3=$( dd_benchmark "$mount_path" ) + if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) + elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) + else + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) + fi + + outputdiskbench+=" $device_name $partition_size $ioavg" + if [[ "${ioavg%%.*}" -ge "180" ]]; then + SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$partition_size"')}') + else + HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$partition_size"')}') + fi + fi + + fi + +fi + +echo -e "-------------------------" +echo -e "| DISK INFO" +echo -e "-------------------------" +echo -e "| SSD: $SSD" +echo -e "| HDD: $HDD" +echo -e "-------------------------" + +score=0 +if [[ $status == "CUMULUS" ]]; then + score=1 +fi + +if [[ $status == "NIMBUS" ]]; then + score=2 +fi + +if [[ $status == "STRATUS" ]]; then + score=3 +fi + + +if [[ "$SSD" -lt 220 ]] || [[ "$score" == 0 ]] ; then + status="FAILED" +fi + +if [[ "$SSD" -ge 220 ]] && [[ "$score" -ge 1 ]]; then + status="CUMULUS" +fi + +if [[ "$SSD" -ge 440 ]] && [[ "$score" -ge 2 ]]; then + status="NIMBUS" +fi + +if [[ "$SSD" -ge 880 ]] && [[ "$score" -ge 3 ]] ; then + status="STRATUS" +fi + +echo -e "| Benchmark: $status" +echo -e "-------------------------" From 5b44de348f43d419b8fde2d944bd586d89bf0af8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 5 Aug 2023 18:35:14 +0200 Subject: [PATCH 0878/1176] Update multitoolbox.sh update menu --- multitoolbox.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index e719c563..03d30684 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -859,6 +859,7 @@ echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${CYAN}13 - MongoDB FiX action${NC}" echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Router with UPNP support) ${NC}" echo -e "${CYAN}15 - Node reconfiguration from install config${NC}" +echo -e "${CYAN}16 - Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" read -rp "Pick an option and hit ENTER: " @@ -953,6 +954,20 @@ case "$REPLY" in node_reconfiguration echo -e "" ;; + 16) + clear + sleep 1 + echo -e "${GREEN}Module: Hardware benchmark${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/hardwarebench.sh) + ;; esac # USED FOR CLEANUP AT END OF SCRIPT unset ROOT_BRANCH From 64b810f7be6a0ee1e035d99c72459379b33e39eb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Aug 2023 08:45:26 +0200 Subject: [PATCH 0879/1176] ram cauculation correction --- hardwarebench.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index 177947c3..b6aa1eac 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -59,28 +59,28 @@ if [[ "$(sysbench --version)" == "" ]]; then fi vcore=$(getconf _NPROCESSORS_ONLN) -ram=$(LC_ALL=C free -b 2> /dev/null | awk 'NR==2 {print $2}' | grep -Eo '[0-9]+'| printf "%.2fGB\n" $(awk '{ print $1/1024/1024/1024 }')) +ram=$(LC_ALL=C free -b 2> /dev/null | awk 'NR==2 {print $2}' | grep -Eo '[0-9]+'| printf "%.0f\n" $(awk '{ print $1/1024/1024/1024 }')) core=$(awk -F: '/cpu cores/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \\t]*//;s/[ \\t]*$//') echo -e "" echo -e "-------------------------" echo -e "| MEMORY BENCHMARK" echo -e "-------------------------" -echo -e "| RAM: $ram" +echo -e "| RAM: ${ram}GB" echo -e "-------------------------" echo -e "| CPU BENCHMARK" echo -e "-------------------------" eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk -v cpu=$vcore '{print $4*cpu}') -if [[ "${ram%%.*}" -ge 7 ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]] && [[ "${eps%%.*}" -ge 240 ]]; then +if [[ "$ram" -ge 7 ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]] && [[ "${eps%%.*}" -ge 240 ]]; then status="CUMULUS" fi -if [[ "${ram%%.*}" -ge 31 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]] && [[ "${eps%%.*}" -ge 640 ]]; then +if [[ "$ram" -ge 31 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]] && [[ "${eps%%.*}" -ge 640 ]]; then status="NIMBUS" fi -if [[ "${ram%%.*}" -ge 62 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]] && [[ "${eps%%.*}" -ge 1520 ]]; then +if [[ "$ram" -ge 62 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]] && [[ "${eps%%.*}" -ge 1520 ]]; then status="STRATUS" fi From 0396ea403b613af13061f4c0c2a79a554ee18650 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 6 Aug 2023 22:50:58 +0200 Subject: [PATCH 0880/1176] fix --- hardwarebench.sh | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index b6aa1eac..cd391863 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -1,11 +1,6 @@ #!/usr/bin/env bash SSD=0 HDD=0 -LC_ALL="en_US.UTF-8" -LC_NUMERIC="en_US.UTF-8" -LANG="en_US.UTF-8" -LANGUAGE="en_US:en" -########## command_exists() { command -v "$@" > /dev/null 2>&1 @@ -122,7 +117,7 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then lvm_mount="" raid_list=() - disc__array=($(cd $HOME && LC_ALL=C lsblk -o NAME,SIZE,TYPE -b -n | grep ' disk' | awk '{ if ($2 > 2147483648 && $1 != "mmcblk0" && $1 != "mmcblk0p1") print $1}')) + disc__array=($(cd $HOME && LC_ALL=C lsblk -o NAME,SIZE,TYPE -b -n | grep ' disk' | awk '{ if ($2 > 2147483648 && $1 != "mmcblk0" && $1 != "mmcblk0p1") print $1}')) for((i=0;i<${#disc__array[@]};i++)); do @@ -162,10 +157,10 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) if [[ "$lvm_mount" != "" ]]; then - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{print $1 " " $4/(1024*10 24*1024) }') + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') else #checking if disk partition type is LVM2_member - part_type_check=$(cd $HOME && LC_ALL=C lsblk -o NAME,TYPE,FSTYPE,SIZE -b -n /dev/${disc__array[i]} --sort SIZE | egrep ' part' | egrep 'LVM2_member' | tail -n1 | wc -l) + part_type_check=$(cd $HOME && LC_ALL=C lsblk -o NAME,TYPE,FSTYPE,SIZE -b -n /dev/${disc__array[i]} --sort SIZE | egrep ' part' | egrep 'LVM2_member' | tail -n1 | wc -l) if [[ "$part_type_check" != "0" ]]; then #skipp disk partition_name=$(awk '{print $1}' <<< $part_type_check) @@ -176,11 +171,11 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then fi #checking raid - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' raid' | tail -n1 | awk '{print $1 " " $4/(1024*1024* 1024) }') + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' raid' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') if [[ "$partition_output" == "" ]]; then #checking part ( when not lvm and raid ) #echo -e "Checking partition on device: /dev/${disc__array[i]}" - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' part' | tail -n1 | awk '{print $1 " " $4/(1024*102 4*1024) }') + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' part' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') #echo -e "$partition_output" #echo -e "-----------------------------" else @@ -218,9 +213,9 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then sudo mkdir /.benchmark_test fi sudo mount /dev/$partition_name /.benchmark_test - available_space=$(LC_ALL=C df /dev/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else prin t "null"}') + available_space=$(LC_ALL=C df /dev/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else print "null"}') else - available_space=$(LC_ALL=C df /dev/mapper/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); el se print "null"}') + available_space=$(LC_ALL=C df /dev/mapper/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else print "null"}') fi if [[ "$available_space" != "null" && "$available_space" != "" ]]; then @@ -289,7 +284,7 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then if [[ "$outputdiskbench" == "Disks Bench:" ]]; then # lsblk failed checking direct mount from df - df_direct_mount=$(LC_ALL=C df --output=source,fstype,size,avail,target | grep 'dev' | awk '{ if ($5 == "/") printf("%s %.2f %.2f\n", $1,$3/(1024*1024),$4/ (1024*1024))}') + df_direct_mount=$(LC_ALL=C df --output=source,fstype,size,avail,target | grep 'dev' | awk '{ if ($5 == "/") printf("%s %.2f %.2f\n", $1,$3/(1024*1024),$4/(1024*1024))}') if [[ df_direct_mount != "" ]]; then device_name=$(awk '{print $1}' <<< $df_direct_mount) partition_size=$(awk '{print $2}' <<< $df_direct_mount) From 9b6fdd33871e6c5a3e1171c22bf520b53c6c182b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Aug 2023 10:56:53 +0200 Subject: [PATCH 0881/1176] cleanup --- hardwarebench.sh | 69 +++++++++--------------------------------------- 1 file changed, 13 insertions(+), 56 deletions(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index cd391863..d2e2263a 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash SSD=0 HDD=0 +SCORE=0 +GREEN='\033[1;32m' +NC='\033[0m' command_exists() { command -v "$@" > /dev/null 2>&1 @@ -41,22 +44,17 @@ dd_benchmark() }' sudo rm -f $1/test_* } - if ! command_exists dd; then printf '%s\n' 'This script requires dd, but it could not be found.' 1>&2 exit 1 fi - - if [[ "$(sysbench --version)" == "" ]]; then curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sudo bash > /dev/null 2>&1 sudo apt -y install sysbench > /dev/null 2>&1 fi - vcore=$(getconf _NPROCESSORS_ONLN) ram=$(LC_ALL=C free -b 2> /dev/null | awk 'NR==2 {print $2}' | grep -Eo '[0-9]+'| printf "%.0f\n" $(awk '{ print $1/1024/1024/1024 }')) core=$(awk -F: '/cpu cores/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \\t]*//;s/[ \\t]*$//') - echo -e "" echo -e "-------------------------" echo -e "| MEMORY BENCHMARK" @@ -66,38 +64,30 @@ echo -e "-------------------------" echo -e "| CPU BENCHMARK" echo -e "-------------------------" eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk -v cpu=$vcore '{print $4*cpu}') - if [[ "$ram" -ge 7 ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]] && [[ "${eps%%.*}" -ge 240 ]]; then status="CUMULUS" fi - if [[ "$ram" -ge 31 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]] && [[ "${eps%%.*}" -ge 640 ]]; then status="NIMBUS" fi - if [[ "$ram" -ge 62 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]] && [[ "${eps%%.*}" -ge 1520 ]]; then status="STRATUS" fi - if [[ "$status" == "" ]]; then status="FAILED" fi - echo -e "| CPU vcores: $vcore" echo -e "| CPU cores: $core" echo -e "| EPS: $eps" - outputdiskbench="Disks Bench:"; #checking loop for lxc only if mount == '/' loop_mount=$(cd $HOME && LC_ALL=C lsblk -l -b -n | grep ' loop' | awk '{ if ($7 == "/") printf("%.2f\n", $4/(1024*1024*1024))}') if [[ "$loop_mount" != "" ]]; then - #echo -e "Device type: loop" mount_path="/" io1=$( dd_benchmark "$mount_path" ) io2=$( dd_benchmark "$mount_path" ) io3=$( dd_benchmark "$mount_path" ) - if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then @@ -105,7 +95,6 @@ if [[ "$loop_mount" != "" ]]; then else ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi - outputdiskbench+=" loop $loop_mount $ioavg" if [[ "${ioavg%%.*}" -ge "180" ]]; then SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$loop_mount"')}') @@ -114,13 +103,11 @@ if [[ "$loop_mount" != "" ]]; then fi fi if [[ $outputdiskbench == "Disks Bench:" ]]; then - lvm_mount="" raid_list=() disc__array=($(cd $HOME && LC_ALL=C lsblk -o NAME,SIZE,TYPE -b -n | grep ' disk' | awk '{ if ($2 > 2147483648 && $1 != "mmcblk0" && $1 != "mmcblk0p1") print $1}')) for((i=0;i<${#disc__array[@]};i++)); do - #checking if disk structure is accessable cd $HOME && lsblk -l -b -n /dev/${disc__array[i]} > /dev/null 2>&1 if [ $? != 0 ]; then @@ -147,14 +134,12 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then continue fi fi - if [[ "$lvm_name" != "" && "$lvm_mount" == "" ]]; then if [[ ! -d /.benchmark_test ]]; then sudo mkdir /.benchmark_test fi sudo mount /dev/mapper/$lvm_name /.benchmark_test fi - lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) if [[ "$lvm_mount" != "" ]]; then partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') @@ -169,7 +154,6 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then #echo -e "-----------------------------" continue fi - #checking raid partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' raid' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') if [[ "$partition_output" == "" ]]; then @@ -192,14 +176,12 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then fi fi fi - else #echo -e "Checking partition on device: /dev/${disc__array[i]} (STEP2)..." partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') #echo -e "$partition_output" #echo -e "" fi - partition_name=$(awk '{print $1}' <<< $partition_output) partition_size=$(awk '{printf("%.2f",$2)}' <<< $partition_output) if [[ "$lvm_mount" == "" && "$raid_list" == "" ]]; then @@ -207,7 +189,6 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then else disk_size=$partition_size fi - if [[ "$lvm_mount" == "" ]]; then if [[ ! -d /.benchmark_test ]]; then sudo mkdir /.benchmark_test @@ -219,18 +200,15 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then fi if [[ "$available_space" != "null" && "$available_space" != "" ]]; then - if [[ "$lvm_mount" == "" ]]; then mount_path="/.benchmark_test" else mount_path="$lvm_mount" fi - #echo -e "Mount point: $mount_path" io1=$( dd_benchmark "$mount_path" ) io2=$( dd_benchmark "$mount_path" ) io3=$( dd_benchmark "$mount_path" ) - if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then @@ -238,7 +216,6 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then else ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi - outputdiskbench+=" ${disc__array[i]} $disk_size $ioavg" if [[ "${ioavg%%.*}" -ge "180" ]]; then SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$disk_size"')}') @@ -254,7 +231,6 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then sudo rm -rf /.benchmark_test fi fi - #check if test point mounted if exist unmount it LVM case if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then sudo umount /.benchmark_test @@ -264,13 +240,10 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then sudo rm -rf /.benchmark_test fi fi - else - #echo -e "Error: space not enough... write test skipped!" #echo -e "-----------------------------" if [[ "$lvm_mount" == "" ]]; then - sudo umount /.benchmark_test if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then echo -e "" @@ -279,9 +252,7 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then fi fi fi - done - if [[ "$outputdiskbench" == "Disks Bench:" ]]; then # lsblk failed checking direct mount from df df_direct_mount=$(LC_ALL=C df --output=source,fstype,size,avail,target | grep 'dev' | awk '{ if ($5 == "/") printf("%s %.2f %.2f\n", $1,$3/(1024*1024),$4/(1024*1024))}') @@ -299,7 +270,6 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then else ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi - outputdiskbench+=" $device_name $partition_size $ioavg" if [[ "${ioavg%%.*}" -ge "180" ]]; then SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$partition_size"')}') @@ -307,47 +277,34 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$partition_size"')}') fi fi - fi - fi - echo -e "-------------------------" echo -e "| DISK INFO" echo -e "-------------------------" echo -e "| SSD: $SSD" echo -e "| HDD: $HDD" echo -e "-------------------------" - -score=0 if [[ $status == "CUMULUS" ]]; then - score=1 + SCORE=1 fi - if [[ $status == "NIMBUS" ]]; then - score=2 + SCORE=2 fi - if [[ $status == "STRATUS" ]]; then - score=3 + SCORE=3 fi - - -if [[ "$SSD" -lt 220 ]] || [[ "$score" == 0 ]] ; then +if [[ "$SSD" -lt 220 ]] || [[ "$SCORE" == 0 ]] ; then status="FAILED" fi - -if [[ "$SSD" -ge 220 ]] && [[ "$score" -ge 1 ]]; then - status="CUMULUS" +if [[ "$SSD" -ge 220 ]] && [[ "$SCORE" -ge 1 ]]; then + status="${GREEN}CUMULUS${NC}" fi - -if [[ "$SSD" -ge 440 ]] && [[ "$score" -ge 2 ]]; then - status="NIMBUS" +if [[ "$SSD" -ge 440 ]] && [[ "$SCORE" -ge 2 ]]; then + status="${GREEN}NIMBUS${NC}" fi - -if [[ "$SSD" -ge 880 ]] && [[ "$score" -ge 3 ]] ; then - status="STRATUS" +if [[ "$SSD" -ge 880 ]] && [[ "$SCORE" -ge 3 ]] ; then + status="${GREEN}STRATUS${NC}" fi - echo -e "| Benchmark: $status" echo -e "-------------------------" From b78a696cab4d3ee393cb15d17e0f10bb6d7c5bd2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Aug 2023 11:01:31 +0200 Subject: [PATCH 0882/1176] disabled ram error output --- hardwarebench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index d2e2263a..4d4a3a2e 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -53,7 +53,7 @@ if [[ "$(sysbench --version)" == "" ]]; then sudo apt -y install sysbench > /dev/null 2>&1 fi vcore=$(getconf _NPROCESSORS_ONLN) -ram=$(LC_ALL=C free -b 2> /dev/null | awk 'NR==2 {print $2}' | grep -Eo '[0-9]+'| printf "%.0f\n" $(awk '{ print $1/1024/1024/1024 }')) +ram=$(LC_ALL=C free -b 2> /dev/null | awk 'NR==2 {print $2}' | grep -Eo '[0-9]+'| printf "%.0f\n" $(awk '{ print $1/1024/1024/1024 }' 2> /dev/null )) core=$(awk -F: '/cpu cores/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \\t]*//;s/[ \\t]*$//') echo -e "" echo -e "-------------------------" From 2143c46a3cdec1cd7eceaf77d46f0a57bc1df093 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Aug 2023 11:06:22 +0200 Subject: [PATCH 0883/1176] fix ram printf error --- hardwarebench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index 4d4a3a2e..d4207c91 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -53,7 +53,7 @@ if [[ "$(sysbench --version)" == "" ]]; then sudo apt -y install sysbench > /dev/null 2>&1 fi vcore=$(getconf _NPROCESSORS_ONLN) -ram=$(LC_ALL=C free -b 2> /dev/null | awk 'NR==2 {print $2}' | grep -Eo '[0-9]+'| printf "%.0f\n" $(awk '{ print $1/1024/1024/1024 }' 2> /dev/null )) +ram=$(LC_ALL=C free -b 2> /dev/null | awk 'NR==2 {print $2}' | grep -Eo '[0-9]+'| printf "%.0f\n" $(awk '{ print $1/1024/1024/1024 }') 2> /dev/null ) core=$(awk -F: '/cpu cores/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \\t]*//;s/[ \\t]*$//') echo -e "" echo -e "-------------------------" From a6826f8432b2e7940e74f8983796366f32ecefe8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Aug 2023 13:17:26 +0200 Subject: [PATCH 0884/1176] Minor edits --- hardwarebench.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index d4207c91..da51bd02 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -4,6 +4,7 @@ HDD=0 SCORE=0 GREEN='\033[1;32m' NC='\033[0m' +CYAN='\033[1;36m' command_exists() { command -v "$@" > /dev/null 2>&1 @@ -59,7 +60,7 @@ echo -e "" echo -e "-------------------------" echo -e "| MEMORY BENCHMARK" echo -e "-------------------------" -echo -e "| RAM: ${ram}GB" +echo -e "| RAM: ${CYAN}${ram}GB${NC}" echo -e "-------------------------" echo -e "| CPU BENCHMARK" echo -e "-------------------------" @@ -76,9 +77,9 @@ fi if [[ "$status" == "" ]]; then status="FAILED" fi -echo -e "| CPU vcores: $vcore" -echo -e "| CPU cores: $core" -echo -e "| EPS: $eps" +echo -e "| CPU vcores: ${CYAN}${vcore}${NC}" +echo -e "| CPU cores: ${CYAN}${core}${NC}" +echo -e "| EPS: ${CYAN}${eps}${NC}" outputdiskbench="Disks Bench:"; #checking loop for lxc only if mount == '/' loop_mount=$(cd $HOME && LC_ALL=C lsblk -l -b -n | grep ' loop' | awk '{ if ($7 == "/") printf("%.2f\n", $4/(1024*1024*1024))}') @@ -280,10 +281,10 @@ if [[ $outputdiskbench == "Disks Bench:" ]]; then fi fi echo -e "-------------------------" -echo -e "| DISK INFO" +echo -e "| DISK BENCHMARK" echo -e "-------------------------" -echo -e "| SSD: $SSD" -echo -e "| HDD: $HDD" +echo -e "| SSD: ${CYAN}${SSD}${NC}" +echo -e "| HDD: ${CYAN}${HDD}${NC}" echo -e "-------------------------" if [[ $status == "CUMULUS" ]]; then SCORE=1 From 149bb7bc502791bd5675b6dacb85ce0a5dbe617c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Aug 2023 14:22:14 +0200 Subject: [PATCH 0885/1176] update userconfig --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 336b53d0..2bf1cbeb 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -90,7 +90,7 @@ function fluxos_conf_create(){ zelid: '${ZELID}', kadena: '${KDA_A}', development: false, - testnet: $testnet + testnet: $testnet, } } EOF From 5a7098ae16ada8a0ec46e47838ded7527c736792 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:32:37 +0200 Subject: [PATCH 0886/1176] added blockedPorts --- flux_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/flux_common.sh b/flux_common.sh index 2bf1cbeb..3900bbf9 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -90,6 +90,7 @@ function fluxos_conf_create(){ zelid: '${ZELID}', kadena: '${KDA_A}', development: false, + blockedPorts: [], testnet: $testnet, } } From f8cb150fb0a4be6e55303f85e62a1b23d061026b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:34:01 +0200 Subject: [PATCH 0887/1176] ram value correction --- hardwarebench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index da51bd02..1b56af51 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -71,7 +71,7 @@ fi if [[ "$ram" -ge 31 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]] && [[ "${eps%%.*}" -ge 640 ]]; then status="NIMBUS" fi -if [[ "$ram" -ge 62 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]] && [[ "${eps%%.*}" -ge 1520 ]]; then +if [[ "$ram" -ge 61 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]] && [[ "${eps%%.*}" -ge 1520 ]]; then status="STRATUS" fi if [[ "$status" == "" ]]; then From 7af29b525908c363c0e60f78be6806bd8dbe6b1b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:43:17 +0200 Subject: [PATCH 0888/1176] removed metric --- hardwarebench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index 1b56af51..d049a93d 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -60,7 +60,7 @@ echo -e "" echo -e "-------------------------" echo -e "| MEMORY BENCHMARK" echo -e "-------------------------" -echo -e "| RAM: ${CYAN}${ram}GB${NC}" +echo -e "| RAM: ${CYAN}${ram}${NC}" echo -e "-------------------------" echo -e "| CPU BENCHMARK" echo -e "-------------------------" From 2e4970846b1e54ec65743d3e0ee799abea05cef2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 7 Aug 2023 18:11:49 +0200 Subject: [PATCH 0889/1176] ram correction --- hardwarebench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index d049a93d..11c75873 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -68,7 +68,7 @@ eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | g if [[ "$ram" -ge 7 ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]] && [[ "${eps%%.*}" -ge 240 ]]; then status="CUMULUS" fi -if [[ "$ram" -ge 31 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]] && [[ "${eps%%.*}" -ge 640 ]]; then +if [[ "$ram" -ge 30 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]] && [[ "${eps%%.*}" -ge 640 ]]; then status="NIMBUS" fi if [[ "$ram" -ge 61 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]] && [[ "${eps%%.*}" -ge 1520 ]]; then From 7f334654813ff234f6bdf1087018b6458f9484d7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Aug 2023 09:28:56 +0200 Subject: [PATCH 0890/1176] Added Blocked Ports Management --- flux_common.sh | 100 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 97 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 3900bbf9..9b0adc45 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1466,6 +1466,97 @@ function development_mode(){ fi } +function builBlockedList() { + if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + exit + fi + if [[ "$1" == "" || "$2" == "" ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + exit + fi + key="$1" + value="$2" + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then + insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3${NC}" "${CHECK_MARK}" + return + fi +} + +function CreateBlockedList() { + ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) + NumberCheck=$(sed 's/,/1/g' <<< $ADD) + ADD=$(sed 's/,/ /g' <<< $ADD) + if ! [[ "$NumberCheck" =~ ^[0-9]+$ ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Input contains non numerical value${NC}" "${X_MARK}" + exit + fi + array=($ADD) + sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + printf -v joined '%s,' "${sorted_unique_ids[@]}" + if [[ "${joined%,}" != "" ]]; then + string="\[${joined%,}\]" + display="${joined%,}" + fi +} + +function AddBlockedPorts() { + string=$(grep "blockedPorts" $HOME/zelflux/config/userconfig.js | awk -F'[][]' '{print $2}' ) + delimiter="," + declare -a array=($(echo $string | tr "$delimiter" " ")) + ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) + NumberCheck=$(sed 's/,/1/g' <<< $ADD) + ADD=$(sed 's/,/ /g' <<< $ADD) + if ! [[ "$NumberCheck" =~ ^[0-9]+$ ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Input contains non numerical value${NC}" "${X_MARK}" + exit + fi + array+=($ADD) + sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + printf -v joined '%s,' "${sorted_unique_ids[@]}" + string="\[${joined%,}\]" + display="${joined%,}" + +} + +function ClearBlockedPortsList() { + string="\[\]" + display="" +} + +function RemoveLine(){ + sed -i "/$1/d" /home/$USER/zelflux/config/userconfig.js +} + +function blocked_ports(){ + CHOICE=$( + whiptail --title "FluxOS Blocked Ports Management" --menu "Make your choice" 15 40 6 \ + "1)" "Create new list" \ + "2)" "Add ports" \ + "3)" "Clear list" 3>&2 2>&1 1>&3 ) + + case $CHOICE in + "1)") + CreateBlockedList + echo -e "${ARROW}${GREEN} BlockedPorts: [$display]${NC}" + RemoveLine "blockedPorts" + builBlockedList " blockedPorts" "$string" "Blocked ports list crated successful!" "fluxos" + ;; + "2)") + AddBlockedPorts + echo -e "${ARROW}${GREEN} BlockedPorts: [$display]${NC}" + RemoveLine "blockedPorts" + builBlockedList " blockedPorts" "$string" "Blocked ports list updated successful!" "fluxos" + ;; + "3)") + ClearBlockedPortsList + RemoveLine "blockedPorts" + builBlockedList " blockedPorts" "$string" "Blocked ports list cleared successful!" "fluxos" + ;; + esac +} + function fluxos_reconfiguration { echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1486,7 +1577,8 @@ function fluxos_reconfiguration { "1)" "Replace ZELID" \ "2)" "Add/Replace kadena address" \ "3)" "Enable/Disable thunder mode" \ - "4)" "Enable/Disable development mode" 3>&2 2>&1 1>&3 + "4)" "Enable/Disable development mode" \ + "5)" "Blocked Ports Management" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") @@ -1498,10 +1590,12 @@ function fluxos_reconfiguration { "3)") thunder_mode ;; - "4)") + "4)") development_mode ;; - + "5)") + blocked_ports + ;; esac } ######### BOOTSTRAP SECTION ############################ From bcbe9efe99d0549bb069d4c43903a2a94437f481 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Aug 2023 09:48:23 +0200 Subject: [PATCH 0891/1176] Minor edits --- flux_common.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 9b0adc45..4c9780db 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1486,6 +1486,11 @@ function builBlockedList() { function CreateBlockedList() { ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) + if [[ $? == 1 ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" + echo -e "" + exit + fi NumberCheck=$(sed 's/,/1/g' <<< $ADD) ADD=$(sed 's/,/ /g' <<< $ADD) if ! [[ "$NumberCheck" =~ ^[0-9]+$ ]]; then @@ -1506,6 +1511,11 @@ function AddBlockedPorts() { delimiter="," declare -a array=($(echo $string | tr "$delimiter" " ")) ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) + if [[ $? == 1 ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" + echo -e "" + exit + fi NumberCheck=$(sed 's/,/1/g' <<< $ADD) ADD=$(sed 's/,/ /g' <<< $ADD) if ! [[ "$NumberCheck" =~ ^[0-9]+$ ]]; then From e22b7c6779345e482b844777f4c556997f5f7208 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 10 Aug 2023 09:58:25 +0200 Subject: [PATCH 0892/1176] bump version --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 03d30684..2062ba05 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -29,7 +29,7 @@ fi FLUX_DIR='zelflux' FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' -dversion="v7.4" +dversion="v7.5" PM2_INSTALL="0" zelflux_setting_import="0" OS_FLAGE="$2" From 615b3ab6aeb42dd1be023d803619b3b78380fa81 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Aug 2023 03:14:19 +0200 Subject: [PATCH 0893/1176] added Jetson and Thunder --- hardwarebench.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index 11c75873..2bafa2d9 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -65,7 +65,14 @@ echo -e "-------------------------" echo -e "| CPU BENCHMARK" echo -e "-------------------------" eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk -v cpu=$vcore '{print $4*cpu}') -if [[ "$ram" -ge 7 ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]] && [[ "${eps%%.*}" -ge 240 ]]; then + +if [[ "$(dpkg --print-architecture)" = *"Jetson"* ]]; then + cumulus_ram=3 +else + cumulus_ram=7 +fi + +if [[ "$ram" -ge "$cumulus_ram" ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]] && [[ "${eps%%.*}" -ge 240 ]]; then status="CUMULUS" fi if [[ "$ram" -ge 30 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]] && [[ "${eps%%.*}" -ge 640 ]]; then @@ -295,12 +302,17 @@ fi if [[ $status == "STRATUS" ]]; then SCORE=3 fi + + if [[ "$SSD" -lt 220 ]] || [[ "$SCORE" == 0 ]] ; then status="FAILED" fi if [[ "$SSD" -ge 220 ]] && [[ "$SCORE" -ge 1 ]]; then status="${GREEN}CUMULUS${NC}" fi +if [[ "$HDD" -ge 9200 ]] && [[ "$SCORE" -ge 1 ]]; then + status="${GREEN}THUNDER${NC}" +fi if [[ "$SSD" -ge 440 ]] && [[ "$SCORE" -ge 2 ]]; then status="${GREEN}NIMBUS${NC}" fi From 1f5979239eae61976677a756d41ec99e20e61ea5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:29:42 +0200 Subject: [PATCH 0894/1176] fix eps check --- multitoolbox.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 2062ba05..a48b2c04 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -463,16 +463,16 @@ function install_watchdog() { if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://explorer.zelcash.online/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi fi if [[ $stak_info == ?(-)+([0-9]) ]]; then case $stak_info in - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; + "1000") eps_limit=240 ;; + "12500") eps_limit=640 ;; + "40000") eps_limit=1520 ;; esac else eps_limit=0; From acbba1218540766842f7e6285d7d0da938676d3b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Aug 2023 22:41:10 +0200 Subject: [PATCH 0895/1176] added routerIP --- flux_common.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 4c9780db..76874a37 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2345,6 +2345,8 @@ function upnp_enable() { is_correct="0" fi if [[ "$is_correct" == "0" ]]; then + RemoveLine "routerIP" + builBlockedList " routerIP" "\'$router_ip\'" "RouterIP added successful!" "fluxos" sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 @@ -2364,6 +2366,8 @@ function upnp_enable() { fi done + RemoveLine "routerIP" + builBlockedList " routerIP" "\'$router_ip\'" "RouterIP added successful!" "fluxos" sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 @@ -2381,6 +2385,8 @@ function upnp_enable() { sleep 1 fi done + RemoveLine "routerIP" + builBlockedList " routerIP" "\'$router_ip\'" "RouterIP added successful!" "fluxos" sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 From 7fdd236b6d3652feb1f01df33a2ee86bf54f4d5c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Aug 2023 23:01:33 +0200 Subject: [PATCH 0896/1176] added RemoveLine --- multinode.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index a02a3f67..5d641423 100644 --- a/multinode.sh +++ b/multinode.sh @@ -25,7 +25,8 @@ function upnp_disable() { fi if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep 'apiport' | wc -l) == "1" ]]; then - cat /home/$USER/zelflux/config/userconfig.js | sed '/apiport/d' | sudo tee "/home/$USER/zelflux/config/userconfig.js" > /dev/null + RemoveLine "routerIP" + RemoveLine "apiport" fi echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark.....${NC}" echo -e "" From 0f6c07ff427e70561c399178f7f47c1546626fb0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Aug 2023 23:17:04 +0200 Subject: [PATCH 0897/1176] Minor edits --- flux_common.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 76874a37..878b8c21 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -294,11 +294,11 @@ function config_builder() { if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then if [[ "$value" == "false" || "$value" == "true" ]]; then insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return else insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: '$value'," - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return fi fi @@ -313,7 +313,7 @@ function config_builder() { sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: '$value',/" /home/$USER/$FLUX_DIR/config/userconfig.js fi if [[ $(grep -w $value /home/$USER/$FLUX_DIR/config/userconfig.js) != "" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 was changed successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 changed successfully${NC}" "${CHECK_MARK}" fi fi fi @@ -330,7 +330,7 @@ function config_builder() { if [[ ! $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) && -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then echo "$1=$2" >> /home/$USER/$CONFIG_DIR/$CONFIG_FILE if [[ "$1=$2" == $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) ]]; then - padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return fi fi @@ -340,7 +340,7 @@ function config_builder() { else sed -i "s/$(grep -e $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE)/$1=$2/" /home/$USER/$CONFIG_DIR/$CONFIG_FILE if [[ "$1=$2" == $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) ]]; then - padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 was replaced successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" fi fi fi @@ -354,14 +354,14 @@ function config_builder() { mkdir -p /home/$USER/.fluxbenchmark > /dev/null 2>&1 echo "$1=$2" >> /home/$USER/.fluxbenchmark/fluxbench.conf if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return fi fi if [[ ! $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then echo "$1=$2" >> /home/$USER/.fluxbenchmark/fluxbench.conf if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 was added successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return fi fi @@ -370,7 +370,7 @@ function config_builder() { else sed -i "s/$(grep -e $1 /home/$USER/.fluxbenchmark/fluxbench.conf)/$1=$2/" /home/$USER/.fluxbenchmark/fluxbench.conf if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 was replaced successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" fi fi fi @@ -391,7 +391,7 @@ function config_builder() { if [[ $(cat /home/$USER/watchdog/config.js | grep "$1") != "" ]]; then sed -i "s/$(grep -e $1 /home/$USER/watchdog/config.js)/ $1: '$2',/" /home/$USER/watchdog/config.js if [[ $(grep -w $2 /home/$USER/watchdog/config.js) != "" ]]; then - padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 was replaced successfully${NC}" "${CHECK_MARK}" + padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" fi fi fi From da5160e0bdec0c44c7a18cb1a7ad37bb13b0d88d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Aug 2023 22:12:41 +0200 Subject: [PATCH 0898/1176] update config_builder --- flux_common.sh | 92 ++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 51 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 878b8c21..ad5fb741 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -273,49 +273,46 @@ function insert() { sudo sed -i -e "/$line/i"$'\\\n'"$newText"$'\n' "$file" } +function RemoveLine(){ + sed -i "/$1/d" /home/$USER/zelflux/config/userconfig.js +} + function config_builder() { ######################################################## if [[ "$4" == "fluxos" ]]; then - if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" - return - fi - if [[ "$1" == "" || "$2" == "" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" - return - fi - key="$1" + key="$1" + if [[ "$value" == "false" || "$value" == "true" || "$value" =~ "^[0-9]+$" ]]; value="$2" - if [[ "$1" == "kadena" ]]; then - if [[ $( grep "chainid" <<< "$2") == "" ]]; then - value="kadena:$2?chainid=0" - fi - fi - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then - if [[ "$value" == "false" || "$value" == "true" ]]; then - insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" - return - else - insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: '$value'," - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" - return - fi - fi - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key: '$value'") != "" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 skipped${NC}" "${X_MARK}" - return - fi - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") != "" ]]; then - if [[ "$value" == "false" || "$value" == "true" ]]; then - sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: $value,/" /home/$USER/$FLUX_DIR/config/userconfig.js - else - sed -i "s/$(grep -e $key /home/$USER/$FLUX_DIR/config/userconfig.js)/ $key: '$value',/" /home/$USER/$FLUX_DIR/config/userconfig.js - fi - if [[ $(grep -w $value /home/$USER/$FLUX_DIR/config/userconfig.js) != "" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 changed successfully${NC}" "${CHECK_MARK}" - fi + else + value="\'$2\'" + fi + if [[ "$1" == "kadena" ]]; then + if [[ $( grep "chainid" <<< "$2") == "" ]]; then + value="\'kadena:$2?chainid=0\'" fi + fi + if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + return + fi + if [[ "$1" == "" || "$2" == "" ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + return + fi + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then + insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" + return + fi + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key: $value") != "" ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 skipped${NC}" "${X_MARK}" + return + fi + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") != "" ]]; then + RemoveLine "$key" + insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 changed successfully${NC}" "${CHECK_MARK}" + fi fi ##################################################### if [[ "$4" == "daemon" ]]; then @@ -1535,10 +1532,6 @@ function ClearBlockedPortsList() { display="" } -function RemoveLine(){ - sed -i "/$1/d" /home/$USER/zelflux/config/userconfig.js -} - function blocked_ports(){ CHOICE=$( whiptail --title "FluxOS Blocked Ports Management" --menu "Make your choice" 15 40 6 \ @@ -2272,9 +2265,9 @@ function log_rotate() { } #### UPnP function upnp_enable() { - if [[ -d $HOME/.fluxbenchmark ]]; then - sudo chown -R $USER:$USER $HOME/.fluxbenchmark > /dev/null 2>&1 - fi + if [[ -d $HOME/.fluxbenchmark ]]; then + sudo chown -R $USER:$USER $HOME/.fluxbenchmark > /dev/null 2>&1 + fi try="0" echo -e "" echo -e "${ARROW}${YELLOW} Creating UPnP configuration...${NC}" @@ -2345,8 +2338,7 @@ function upnp_enable() { is_correct="0" fi if [[ "$is_correct" == "0" ]]; then - RemoveLine "routerIP" - builBlockedList " routerIP" "\'$router_ip\'" "RouterIP added successful!" "fluxos" + config_builder "routerIP" "$router_ip" "RouterIP" "fluxos" sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 @@ -2366,8 +2358,7 @@ function upnp_enable() { fi done - RemoveLine "routerIP" - builBlockedList " routerIP" "\'$router_ip\'" "RouterIP added successful!" "fluxos" + config_builder "routerIP" "$router_ip" "RouterIP" "fluxos" sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 @@ -2385,8 +2376,7 @@ function upnp_enable() { sleep 1 fi done - RemoveLine "routerIP" - builBlockedList " routerIP" "\'$router_ip\'" "RouterIP added successful!" "fluxos" + config_builder "routerIP" "$router_ip" "RouterIP" "fluxos" sudo ufw allow out from any to 239.255.255.250 port 1900 proto udp > /dev/null 2>&1 sudo ufw allow from $router_ip port 1900 to any proto udp > /dev/null 2>&1 sudo ufw allow out from any to $router_ip proto tcp > /dev/null 2>&1 From ce41ebc1189df110978084f15621efb029c47d65 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Aug 2023 22:16:58 +0200 Subject: [PATCH 0899/1176] fix missing then --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index ad5fb741..9e25f6a7 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -281,7 +281,7 @@ function config_builder() { ######################################################## if [[ "$4" == "fluxos" ]]; then key="$1" - if [[ "$value" == "false" || "$value" == "true" || "$value" =~ "^[0-9]+$" ]]; + if [[ "$value" == "false" || "$value" == "true" || "$value" =~ "^[0-9]+$" ]]; then value="$2" else value="\'$2\'" From 96222077d5a5cba8af506dec8956effd31fda094 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Aug 2023 22:23:33 +0200 Subject: [PATCH 0900/1176] fix value --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 9e25f6a7..87061c62 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -282,7 +282,7 @@ function config_builder() { if [[ "$4" == "fluxos" ]]; then key="$1" if [[ "$value" == "false" || "$value" == "true" || "$value" =~ "^[0-9]+$" ]]; then - value="$2" + value=$2 else value="\'$2\'" fi From ce7cbfd81ba7d75f8eb5be9629e7bcf745edf88f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Aug 2023 22:27:53 +0200 Subject: [PATCH 0901/1176] added logs --- flux_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/flux_common.sh b/flux_common.sh index 87061c62..757fd88a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -283,6 +283,7 @@ function config_builder() { key="$1" if [[ "$value" == "false" || "$value" == "true" || "$value" =~ "^[0-9]+$" ]]; then value=$2 + echo -e "IS NUMBER" else value="\'$2\'" fi From ff245c2af0832b8b11f5be69cad76dd08cc2fe61 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Aug 2023 22:31:21 +0200 Subject: [PATCH 0902/1176] added more logs --- flux_common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 757fd88a..cad2c195 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -281,11 +281,12 @@ function config_builder() { ######################################################## if [[ "$4" == "fluxos" ]]; then key="$1" - if [[ "$value" == "false" || "$value" == "true" || "$value" =~ "^[0-9]+$" ]]; then + if [[ "$2" == "false" || "$2" == "true" || "$2" =~ "^[0-9]+$" ]]; then value=$2 echo -e "IS NUMBER" else value="\'$2\'" + echo -e "IS NOT NUMBER" fi if [[ "$1" == "kadena" ]]; then if [[ $( grep "chainid" <<< "$2") == "" ]]; then From a0049a71261b1badab2a561cd62af7a06205422a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Aug 2023 22:35:50 +0200 Subject: [PATCH 0903/1176] fix conditional --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index cad2c195..229ae6c7 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -281,7 +281,7 @@ function config_builder() { ######################################################## if [[ "$4" == "fluxos" ]]; then key="$1" - if [[ "$2" == "false" || "$2" == "true" || "$2" =~ "^[0-9]+$" ]]; then + if [[ "$2" == "false" || "$2" == "true" || "$2" =~ ^[0-9]+$ ]]; then value=$2 echo -e "IS NUMBER" else From f07210020590c7154e5e426d6ab5f5da3e2c3645 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Aug 2023 22:50:41 +0200 Subject: [PATCH 0904/1176] Update fluxos reconfiguration --- flux_common.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 229ae6c7..df8819ad 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -283,10 +283,8 @@ function config_builder() { key="$1" if [[ "$2" == "false" || "$2" == "true" || "$2" =~ ^[0-9]+$ ]]; then value=$2 - echo -e "IS NUMBER" else value="\'$2\'" - echo -e "IS NOT NUMBER" fi if [[ "$1" == "kadena" ]]; then if [[ $( grep "chainid" <<< "$2") == "" ]]; then @@ -1398,13 +1396,9 @@ function replace_kadena { fi kda_address="kadena:$KDA_A?chainid=0" if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then - sed -i "s/$(grep -e kadena /home/$USER/zelflux/config/userconfig.js)/kadena: '$kda_address',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $KDA_A /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}Kadena address replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" - fi - else - insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "kadena: '$kda_address'," - echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" + config_builder "kadena" "$kda_address" "Kadena address" "fluxos" + ##insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" " kadena: '$kda_address'," + ##echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" fi } function replace_zelid() { @@ -1419,13 +1413,15 @@ function replace_zelid() { sleep 2 fi done + + if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" else - sed -i "s/$(grep -e zelid /home/$USER/zelflux/config/userconfig.js)/zelid:'$new_zelid',/" /home/$USER/zelflux/config/userconfig.js - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" - fi + config_builder "zelid" "$new_zelid" "ZEL ID" "fluxos" + #if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + #echo -e "${ARROW} ${CYAN}ZEL ID replaced successful........................[${CHECK_MARK}${CYAN}]${NC}" + #fi fi } From 65464b189cc825c18bdcb77098f77e4a6a2791bd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Aug 2023 23:41:26 +0200 Subject: [PATCH 0905/1176] added routerIP import for re-install fluxos --- multitoolbox.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a48b2c04..a38c7272 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -160,9 +160,14 @@ function install_flux() { upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | egrep -o '[0-9]+') if [[ "$upnp_port" != "" ]]; then - echo -e "${PIN}${CYAN}UPnP port = ${GREEN}$upnp_port${NC}" - fi - + echo -e "${PIN}${CYAN}UPnP port = ${GREEN}$upnp_port${NC}" + fi + + router_ip=$(grep -w routerIP /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*routerIP: .//' | sed -e 's/.\{2\}$//') + if [[ "$router_ip" != "" ]]; then + echo -e "${PIN}${CYAN}Router IP = ${GREEN}$router_ip${NC}" + fi + echo -e "" echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 @@ -223,8 +228,11 @@ function install_flux() { fi fluxos_conf_create if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then - if [[ "$upnp_port" != "" ]]; then - config_builder "apiport" "$upnp_port" "UPnP Port" "fluxos" + if [[ "$upnp_port" != "" ]]; then + config_builder "apiport" "$upnp_port" "UPnP Port" "fluxos" + fi + if [[ "$router_ip" != "" ]]; then + config_builder "routerIP" "$router_ip" "Router IP" "fluxos" fi string_limit_check_mark "FluxOS configuration successfull..........................................." else From 39e29aa4f4570a4244e8658a9f5683f92dda9596 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 09:39:25 +0200 Subject: [PATCH 0906/1176] fix watchdog parse --- install_pro.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index 523ee529..7cceef88 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -217,17 +217,17 @@ function install_watchdog() { if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') - stak_info=$(curl -s -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -s -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -s -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -s -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi fi if [[ $stak_info == ?(-)+([0-9]) ]]; then case $stak_info in - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; + "1000") eps_limit=240 ;; + "12500") eps_limit=640 ;; + "40000") eps_limit=1520 ;; esac else eps_limit=0; From c805c4886f14f17aeaf648825b56788f093de8cf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 09:41:48 +0200 Subject: [PATCH 0907/1176] fix eps and parse --- flux_common.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index df8819ad..0a4139d9 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -814,15 +814,15 @@ function manual_build(){ index_from_file="$index" tx_from_file="$outpoint" - stak_info=$(curl -sSL -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/nul | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -sSL -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/nul | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi if [[ $stak_info == ?(-)+([0-9]) ]]; then case $stak_info in - "1000") eps_limit=90 ;; - "12500") eps_limit=180 ;; - "40000") eps_limit=300 ;; + "1000") eps_limit=240 ;; + "12500") eps_limit=640 ;; + "40000") eps_limit=1520 ;; esac else eps_limit=0; From 4a755781874d0bc4cca9191631eeaaca8cb3ee27 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:47:18 +0200 Subject: [PATCH 0908/1176] Minor edits --- flux_common.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 0a4139d9..b068f1a1 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -86,12 +86,12 @@ function fluxos_conf_create(){ cat <<- EOF > /home/$USER/$FLUX_DIR/config/userconfig.js module.exports = { initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - kadena: '${KDA_A}', - development: false, - blockedPorts: [], - testnet: $testnet, + ipaddress: '${WANIP}', + zelid: '${ZELID}', + kadena: '${KDA_A}', + development: false, + blockedPorts: [], + testnet: $testnet, } } EOF From fd58d3e7855747c0491b792bf77907f607f39507 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:52:36 +0200 Subject: [PATCH 0909/1176] Minor edits --- flux_common.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index b068f1a1..b13c38ee 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -86,12 +86,12 @@ function fluxos_conf_create(){ cat <<- EOF > /home/$USER/$FLUX_DIR/config/userconfig.js module.exports = { initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - kadena: '${KDA_A}', - development: false, + ipaddress: '${WANIP}', + zelid: '${ZELID}', + kadena: '${KDA_A}', + development: false, blockedPorts: [], - testnet: $testnet, + testnet: $testnet, } } EOF From 3410a609216b9fe9aaceb3c8a48d8021e4768f5f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 13:05:23 +0200 Subject: [PATCH 0910/1176] fluxos_conf_create format change --- flux_common.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index b13c38ee..22c7147a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -84,17 +84,17 @@ function fluxos_conf_create(){ touch /home/$USER/$FLUX_DIR/config/userconfig.js cat <<- EOF > /home/$USER/$FLUX_DIR/config/userconfig.js - module.exports = { - initial: { - ipaddress: '${WANIP}', - zelid: '${ZELID}', - kadena: '${KDA_A}', - development: false, - blockedPorts: [], - testnet: $testnet, - } +module.exports = { + initial: { + ipaddress: '${WANIP}', + zelid: '${ZELID}', + kadena: '${KDA_A}', + development: false, + blockedPorts: [], + testnet: $testnet, } - EOF +} +EOF } function flux_daemon_conf_create() { RPCUSER=$(pwgen -1 8 -n) From 1605eef7d1728cbfe518f38337a5318e74ba0b36 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 13:07:46 +0200 Subject: [PATCH 0911/1176] formating --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 22c7147a..93ebdb15 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -92,7 +92,7 @@ module.exports = { development: false, blockedPorts: [], testnet: $testnet, - } + } } EOF } From d2d09bbafba5027240610f337e45a5bbac598c59 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 13:57:01 +0200 Subject: [PATCH 0912/1176] fix upnp_port --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 93ebdb15..1e032e3a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -525,7 +525,7 @@ function config_smart_create() { echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" smart_install_conf "kda_address" "$KDA_A" "$1" fi - upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*apiport: .//' | sed -e 's/.\{2\}$//') + upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | grep -o '[[:digit:]]*') if [[ "$upnp_port" != "" ]]; then gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" From 5675439b7bc2c349cc465fbc428296a9f864bed6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 14:20:39 +0200 Subject: [PATCH 0913/1176] added upnp_enable --- flux_common.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 1e032e3a..dab6deb6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1121,6 +1121,11 @@ function import_config_file() { telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') #UPnP + if [[ $(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]]; then + upnp_enable=true + else + upnp_enable=false + fi upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') if [[ "$1" != "silent" ]]; then From eb3e16531688766d123377da61c6efb537ca9bdc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 18:57:13 +0200 Subject: [PATCH 0914/1176] added upnp_enable conditional --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 7cceef88..6b1ad8e3 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -682,7 +682,7 @@ if [[ "$thunder" == "1" ]]; then echo -e "${ARROW} ${YELLOW}Thunder Mode configuration...${NC}" thunder_mode "install" fi -if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]] && [[ "$upnp_port" != "null" ]] ; then +if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]] && [[ "$upnp_port" != "null" ]] && [[ "$upnp_enable" == "true" ]] ; then upnp_enable "install" fi finalizing From fe48bf4b33f62e296c516c748071685df81f5272 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:09:00 +0200 Subject: [PATCH 0915/1176] Update install_conf_create --- flux_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index dab6deb6..dd090d43 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -255,6 +255,7 @@ function install_conf_create(){ "eps_limit": "${eps_limit}", "upnp_port": "${upnp_port}", "gateway_ip": "${gateway_ip}", + "upnp_enable": "${upnp_enable}" "thunder": "${thunder:-0}" } EOF @@ -507,6 +508,7 @@ function config_smart_create() { fi fluxport=$(grep -Po "(?<=fluxport=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) if [[ "$fluxport" != "" ]]; then + upnp_enable=true echo -e "${PIN}${CYAN} Flux Port = ${GREEN}$fluxport${NC}" smart_install_conf "fluxport" "$fluxport" "$1" fi From 372971e277e1ae122d7a744efa3e7e0a84de1e85 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:09:21 +0200 Subject: [PATCH 0916/1176] Minor edits --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index dd090d43..f530b1ee 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -255,7 +255,7 @@ function install_conf_create(){ "eps_limit": "${eps_limit}", "upnp_port": "${upnp_port}", "gateway_ip": "${gateway_ip}", - "upnp_enable": "${upnp_enable}" + "upnp_enable": "${upnp_enable}", "thunder": "${thunder:-0}" } EOF From 9eb856f652181fc89b01bb002c320e5af84e252f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:15:30 +0200 Subject: [PATCH 0917/1176] Update manual_build --- flux_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index f530b1ee..64265386 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -847,6 +847,7 @@ function manual_build(){ fi fi if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then + upnp_enable=true router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router: $router_ip)" 8 85 3>&1 1>&2 2>&3) upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ @@ -860,6 +861,7 @@ function manual_build(){ "16187" "" OFF \ "16197" "" OFF 3>&1 1>&2 2>&3) else + upnp_enable="" gateway_ip="" upnp_port="" fi From 81f0c753741f8e2df25164b4283b445c4d438b22 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:50:05 +0200 Subject: [PATCH 0918/1176] Update flux_common.sh --- flux_common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 64265386..8f0da004 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -511,7 +511,8 @@ function config_smart_create() { upnp_enable=true echo -e "${PIN}${CYAN} Flux Port = ${GREEN}$fluxport${NC}" smart_install_conf "fluxport" "$fluxport" "$1" - fi + smart_install_conf "upnp_enable" "$upnp_enable" "$1" + fi fi #fluxOS if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then From 11662e9d05380b0d03310d1c18ea7b9967b26914 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:53:58 +0200 Subject: [PATCH 0919/1176] Update flux_common.sh --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 8f0da004..31dec4dd 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -532,7 +532,7 @@ function config_smart_create() { if [[ "$upnp_port" != "" ]]; then gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" - echo -e "${PIN}${CYAN} Gateway IP = ${GREEN}$gateway_ip${NC}" + echo -e "${PIN}${CYAN} Router IP = ${GREEN}$gateway_ip${NC}" smart_install_conf "upnp_port" "$upnp_port" "$1" smart_install_conf "gateway_ip" "$gateway_ip" "$1" fi From 675a2633db408396497853d4bec492e19995e2d7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 20:57:42 +0200 Subject: [PATCH 0920/1176] added ImportBlockedPorts --- flux_common.sh | 155 +++++++++++++++++++++++++++---------------------- 1 file changed, 87 insertions(+), 68 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 31dec4dd..209cac0b 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -278,6 +278,85 @@ function RemoveLine(){ sed -i "/$1/d" /home/$USER/zelflux/config/userconfig.js } +function builBlockedList() { + if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + exit + fi + if [[ "$1" == "" || "$2" == "" ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + exit + fi + key="$1" + value="$2" + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then + insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3${NC}" "${CHECK_MARK}" + return + fi +} + +function CreateBlockedList() { + ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) + if [[ $? == 1 ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" + echo -e "" + exit + fi + NumberCheck=$(sed 's/,/1/g' <<< $ADD) + ADD=$(sed 's/,/ /g' <<< $ADD) + if ! [[ "$NumberCheck" =~ ^[0-9]+$ ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Input contains non numerical value${NC}" "${X_MARK}" + exit + fi + array=($ADD) + sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + printf -v joined '%s,' "${sorted_unique_ids[@]}" + if [[ "${joined%,}" != "" ]]; then + string="\[${joined%,}\]" + display="${joined%,}" + fi +} + +function AddBlockedPorts() { + string=$(grep "blockedPorts" $HOME/zelflux/config/userconfig.js | awk -F'[][]' '{print $2}' ) + delimiter="," + declare -a array=($(echo $string | tr "$delimiter" " ")) + ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) + if [[ $? == 1 ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" + echo -e "" + exit + fi + NumberCheck=$(sed 's/,/1/g' <<< $ADD) + ADD=$(sed 's/,/ /g' <<< $ADD) + if ! [[ "$NumberCheck" =~ ^[0-9]+$ ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Input contains non numerical value${NC}" "${X_MARK}" + exit + fi + array+=($ADD) + sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + printf -v joined '%s,' "${sorted_unique_ids[@]}" + string="\[${joined%,}\]" + display="${joined%,}" + +} + +function ClearBlockedPortsList() { + string="\[\]" + display="" +} + +function ImportBlockedPorts(){ + array=(grep -w blockedPorts /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + printf -v joined '%s,' "${sorted_unique_ids[@]}" + if [[ "${joined%,}" != "" ]]; then + string="\[${joined%,}\]" + display="${joined%,}" + fi +} + function config_builder() { ######################################################## if [[ "$4" == "fluxos" ]]; then @@ -536,6 +615,14 @@ function config_smart_create() { smart_install_conf "upnp_port" "$upnp_port" "$1" smart_install_conf "gateway_ip" "$gateway_ip" "$1" fi + + ImportBlockedPorts + if [[ "$string" != "" ]]; then + echo -e "${PIN}${CYAN} BlockedPorts: [$display]${NC}" + RemoveLine "blockedPorts" + builBlockedList " blockedPorts" "$string" "Blocked ports list crated successful!" "fluxos" + fi + fi #watchdog if [[ -f /home/$USER/watchdog/config.js ]]; then @@ -1471,74 +1558,6 @@ function development_mode(){ fi } -function builBlockedList() { - if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" - exit - fi - if [[ "$1" == "" || "$2" == "" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" - exit - fi - key="$1" - value="$2" - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then - insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3${NC}" "${CHECK_MARK}" - return - fi -} - -function CreateBlockedList() { - ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) - if [[ $? == 1 ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" - echo -e "" - exit - fi - NumberCheck=$(sed 's/,/1/g' <<< $ADD) - ADD=$(sed 's/,/ /g' <<< $ADD) - if ! [[ "$NumberCheck" =~ ^[0-9]+$ ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Input contains non numerical value${NC}" "${X_MARK}" - exit - fi - array=($ADD) - sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) - printf -v joined '%s,' "${sorted_unique_ids[@]}" - if [[ "${joined%,}" != "" ]]; then - string="\[${joined%,}\]" - display="${joined%,}" - fi -} - -function AddBlockedPorts() { - string=$(grep "blockedPorts" $HOME/zelflux/config/userconfig.js | awk -F'[][]' '{print $2}' ) - delimiter="," - declare -a array=($(echo $string | tr "$delimiter" " ")) - ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) - if [[ $? == 1 ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" - echo -e "" - exit - fi - NumberCheck=$(sed 's/,/1/g' <<< $ADD) - ADD=$(sed 's/,/ /g' <<< $ADD) - if ! [[ "$NumberCheck" =~ ^[0-9]+$ ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Input contains non numerical value${NC}" "${X_MARK}" - exit - fi - array+=($ADD) - sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) - printf -v joined '%s,' "${sorted_unique_ids[@]}" - string="\[${joined%,}\]" - display="${joined%,}" - -} - -function ClearBlockedPortsList() { - string="\[\]" - display="" -} function blocked_ports(){ CHOICE=$( From 94c5d4be7fa9c94e6adde649dbb2ab0711a25b97 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:09:43 +0200 Subject: [PATCH 0921/1176] Update flux_common.sh --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 209cac0b..cb06ec26 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -348,7 +348,7 @@ function ClearBlockedPortsList() { } function ImportBlockedPorts(){ - array=(grep -w blockedPorts /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + array=($(grep -w blockedPorts /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*')) sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) printf -v joined '%s,' "${sorted_unique_ids[@]}" if [[ "${joined%,}" != "" ]]; then From c2074c7a27f0fdc1295593542dbd5e17e25f8f36 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:16:41 +0200 Subject: [PATCH 0922/1176] Update flux_common.sh --- flux_common.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index cb06ec26..3e6ab370 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -615,13 +615,6 @@ function config_smart_create() { smart_install_conf "upnp_port" "$upnp_port" "$1" smart_install_conf "gateway_ip" "$gateway_ip" "$1" fi - - ImportBlockedPorts - if [[ "$string" != "" ]]; then - echo -e "${PIN}${CYAN} BlockedPorts: [$display]${NC}" - RemoveLine "blockedPorts" - builBlockedList " blockedPorts" "$string" "Blocked ports list crated successful!" "fluxos" - fi fi #watchdog From b7a22ad2e39346aa72cf5a09b7095f3d9456988a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:19:24 +0200 Subject: [PATCH 0923/1176] Update multitoolbox.sh --- multitoolbox.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index a38c7272..9d64d218 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -167,6 +167,11 @@ function install_flux() { if [[ "$router_ip" != "" ]]; then echo -e "${PIN}${CYAN}Router IP = ${GREEN}$router_ip${NC}" fi + + ImportBlockedPorts + if [[ "$string" != "" ]]; then + echo -e "${PIN}${CYAN} BlockedPorts: [$display]${NC}" + fi echo -e "" echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" From 193e82381e2ff564d6c3492b33356b80a3f5982b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:20:52 +0200 Subject: [PATCH 0924/1176] Update flux_common.sh --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 3e6ab370..acedd276 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -90,7 +90,7 @@ module.exports = { zelid: '${ZELID}', kadena: '${KDA_A}', development: false, - blockedPorts: [], + blockedPorts: [$string], testnet: $testnet, } } From b6249d8ac5cda047381e52ffa435ab5d2932f9f7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:23:11 +0200 Subject: [PATCH 0925/1176] Update flux_common.sh --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index acedd276..3e6ab370 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -90,7 +90,7 @@ module.exports = { zelid: '${ZELID}', kadena: '${KDA_A}', development: false, - blockedPorts: [$string], + blockedPorts: [], testnet: $testnet, } } From 77c84a9af6d61fdcb62a665552f5ecaecf414e49 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:46:55 +0200 Subject: [PATCH 0926/1176] Update flux_install --- multitoolbox.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9d64d218..0773bf51 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -239,6 +239,11 @@ function install_flux() { if [[ "$router_ip" != "" ]]; then config_builder "routerIP" "$router_ip" "Router IP" "fluxos" fi + if [[ "$string" != "" ]]; then + RemoveLine "blockedPorts" + builBlockedList " blockedPorts" "$string" "Blocked ports list crated successful!" "fluxos" + fi + string_limit_check_mark "FluxOS configuration successfull..........................................." else string_limit_x_mark "FluxOS installation failed, missing config file..........................................." From 0644478b333a09465f8e14c7ee007fc47277ca8d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:48:53 +0200 Subject: [PATCH 0927/1176] Update flux_common.sh --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 3e6ab370..116862db 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -352,7 +352,7 @@ function ImportBlockedPorts(){ sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) printf -v joined '%s,' "${sorted_unique_ids[@]}" if [[ "${joined%,}" != "" ]]; then - string="\[${joined%,}\]" + blockedPortsList="\[${joined%,}\]" display="${joined%,}" fi } From 72b5c076044271ce54ec167ccead4e9effeddaae Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:50:38 +0200 Subject: [PATCH 0928/1176] Update multitoolbox.sh --- multitoolbox.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 0773bf51..73caa908 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -169,7 +169,7 @@ function install_flux() { fi ImportBlockedPorts - if [[ "$string" != "" ]]; then + if [[ "$blockedPortsList" != "" ]]; then echo -e "${PIN}${CYAN} BlockedPorts: [$display]${NC}" fi @@ -239,11 +239,10 @@ function install_flux() { if [[ "$router_ip" != "" ]]; then config_builder "routerIP" "$router_ip" "Router IP" "fluxos" fi - if [[ "$string" != "" ]]; then + if [[ "$blockedPortsList" != "" ]]; then RemoveLine "blockedPorts" - builBlockedList " blockedPorts" "$string" "Blocked ports list crated successful!" "fluxos" + builBlockedList " blockedPorts" "$blockedPortsList" "Blocked ports list crated successful!" "fluxos" fi - string_limit_check_mark "FluxOS configuration successfull..........................................." else string_limit_x_mark "FluxOS installation failed, missing config file..........................................." From f2291c831a8e3a6b69334cd3d8e1ed121fd66711 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:53:14 +0200 Subject: [PATCH 0929/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 73caa908..aa3012b0 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -170,7 +170,7 @@ function install_flux() { ImportBlockedPorts if [[ "$blockedPortsList" != "" ]]; then - echo -e "${PIN}${CYAN} BlockedPorts: [$display]${NC}" + echo -e "${PIN}${CYAN}BlockedPorts: [$display]${NC}" fi echo -e "" From fc8597a2bc9f640ee95ca3685f6a9b50a59b4d62 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Aug 2023 22:17:47 +0200 Subject: [PATCH 0930/1176] fix typo --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index aa3012b0..0b071c58 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -241,7 +241,7 @@ function install_flux() { fi if [[ "$blockedPortsList" != "" ]]; then RemoveLine "blockedPorts" - builBlockedList " blockedPorts" "$blockedPortsList" "Blocked ports list crated successful!" "fluxos" + builBlockedList " blockedPorts" "$blockedPortsList" "Blocked ports list created successfully!" "fluxos" fi string_limit_check_mark "FluxOS configuration successfull..........................................." else From 1b1d1c86e52fe6f52e12ac40587c669af99c6001 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:17:47 +0200 Subject: [PATCH 0931/1176] added fluxosConfigBackup and fluxosConfigRestore --- flux_common.sh | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 116862db..6a831b31 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -261,7 +261,6 @@ function install_conf_create(){ EOF } - ###### SMART CONFIG function padding() { msg="$1" @@ -319,7 +318,7 @@ function CreateBlockedList() { } function AddBlockedPorts() { - string=$(grep "blockedPorts" $HOME/zelflux/config/userconfig.js | awk -F'[][]' '{print $2}' ) + string=$(grep "blockedPorts" $HOME/$FLUX_DIR/config/userconfig.js | awk -F'[][]' '{print $2}' ) delimiter="," declare -a array=($(echo $string | tr "$delimiter" " ")) ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) @@ -348,7 +347,7 @@ function ClearBlockedPortsList() { } function ImportBlockedPorts(){ - array=($(grep -w blockedPorts /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*')) + array=($(grep -w blockedPorts /home/$USER/$FLUX_DIR/config/userconfig.js | grep -o '[[:digit:]]*')) sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) printf -v joined '%s,' "${sorted_unique_ids[@]}" if [[ "${joined%,}" != "" ]]; then @@ -357,6 +356,31 @@ function ImportBlockedPorts(){ fi } + +function fluxosConfigBackup(){ + ConfigFile="/home/$USER/$FLUX_DIR/config/userconfig.js" + if [[ -f $ConfigFile ]]; then + cp -nf ConfigFile $HOME/userconfig.js.backup + if [[ -f $HOME/userconfig.js.backup ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js backup successfully${NC}" "${CHECK_MARK}" + else + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js backup failed${NC}" "${X_MARK}" + fi + fi +} + +function fluxosConfigRestore(){ + ConfigFile="/home/$USER/$FLUX_DIR/config/userconfig.js" + if [[ -f $HOME/userconfig.js.backup ][; then + cp -nf $HOME/userconfig.js.backup $ConfigFile + if [[ -f $ConfigFile ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js restored successfully${NC}" "${CHECK_MARK}" + else + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js restored failed${NC}" "${X_MARK}" + fi + fi +} + function config_builder() { ######################################################## if [[ "$4" == "fluxos" ]]; then From 591de14d050ebba45cff1cd9c245c2a15d7a0103 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:38:11 +0200 Subject: [PATCH 0932/1176] added sleep for debug --- multitoolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 0b071c58..e3d36a40 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -850,6 +850,7 @@ fi if ! wget --version > /dev/null 2>&1 ; then sudo apt install -y wget > /dev/null 2>&1 && sleep 2 fi +sleep 15 clear sleep 1 echo -e "${BLUE}" From e97951f5c8e0357d1c9988ce3d722f21d9b4b0d2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:41:46 +0200 Subject: [PATCH 0933/1176] fix bracket --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 6a831b31..1a09ff75 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -371,7 +371,7 @@ function fluxosConfigBackup(){ function fluxosConfigRestore(){ ConfigFile="/home/$USER/$FLUX_DIR/config/userconfig.js" - if [[ -f $HOME/userconfig.js.backup ][; then + if [[ -f $HOME/userconfig.js.backup ]]; then cp -nf $HOME/userconfig.js.backup $ConfigFile if [[ -f $ConfigFile ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js restored successfully${NC}" "${CHECK_MARK}" From bd8bf9382b29548cc624bce80169c8581e72ea1e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:44:44 +0200 Subject: [PATCH 0934/1176] chnaged sleep time --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e3d36a40..6271efd9 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -850,7 +850,7 @@ fi if ! wget --version > /dev/null 2>&1 ; then sudo apt install -y wget > /dev/null 2>&1 && sleep 2 fi -sleep 15 +sleep 5 clear sleep 1 echo -e "${BLUE}" From a112307e16238e78d9e52aa202174fcf0ceb6b1d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:17:40 +0200 Subject: [PATCH 0935/1176] added value_check --- flux_common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 1a09ff75..0c0fe3e1 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -385,6 +385,7 @@ function config_builder() { ######################################################## if [[ "$4" == "fluxos" ]]; then key="$1" + value_check=$2 if [[ "$2" == "false" || "$2" == "true" || "$2" =~ ^[0-9]+$ ]]; then value=$2 else @@ -408,7 +409,7 @@ function config_builder() { padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return fi - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key: $value") != "" ]]; then + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key" | grep "$value_check") != "" ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 skipped${NC}" "${X_MARK}" return fi From 43381a19d400e463224f44d8258e2de2dcba8a37 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:40:54 +0200 Subject: [PATCH 0936/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6271efd9..adeedac7 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -872,7 +872,7 @@ echo -e "${CYAN}7 - Re-install FluxOS${NC}" echo -e "${CYAN}8 - Flux Daemon Reconfiguration${NC}" echo -e "${CYAN}9 - Create Flux daemon service ( for old nodes )${NC}" echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" -echo -e "${CYAN}11 - FluxOS reconfiguration ${NC}" +echo -e "${CYAN}11 - FluxOS config management ${NC}" echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${CYAN}13 - MongoDB FiX action${NC}" echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Router with UPNP support) ${NC}" From fc78f4f89f0c79be53c1c882695d6cd8db64d087 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:50:15 +0200 Subject: [PATCH 0937/1176] improvements --- flux_common.sh | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 0c0fe3e1..edfcddb5 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -366,18 +366,26 @@ function fluxosConfigBackup(){ else padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js backup failed${NC}" "${X_MARK}" fi + else + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js file not exists${NC}" "${X_MARK}" fi } function fluxosConfigRestore(){ ConfigFile="/home/$USER/$FLUX_DIR/config/userconfig.js" - if [[ -f $HOME/userconfig.js.backup ]]; then - cp -nf $HOME/userconfig.js.backup $ConfigFile - if [[ -f $ConfigFile ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js restored successfully${NC}" "${CHECK_MARK}" + if [[ -d /home/$USER/$FLUX_DIR ]]; then + if [[ -f $HOME/userconfig.js.backup ]]; then + cp -nf $HOME/userconfig.js.backup $ConfigFile + if [[ -f $ConfigFile ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js restored successfully${NC}" "${CHECK_MARK}" + else + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js restored failed${NC}" "${X_MARK}" + fi else - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js restored failed${NC}" "${X_MARK}" + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js backup not exists${NC}" "${X_MARK}" fi + else + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs not installed${NC}" "${X_MARK}" fi } @@ -1626,7 +1634,9 @@ function fluxos_reconfiguration { "2)" "Add/Replace kadena address" \ "3)" "Enable/Disable thunder mode" \ "4)" "Enable/Disable development mode" \ - "5)" "Blocked Ports Management" 3>&2 2>&1 1>&3 + "5)" "Blocked Ports Management" \ + "6)" "FluxOS config backup" \ + "7)" "FluxOS config restore" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") @@ -1644,6 +1654,12 @@ function fluxos_reconfiguration { "5)") blocked_ports ;; + "6)") + blocked_ports + ;; + "7)") + blocked_ports + ;; esac } ######### BOOTSTRAP SECTION ############################ From 26efa3422959e3b0f76683fd77241e021dd9b3b9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:51:46 +0200 Subject: [PATCH 0938/1176] enabled config backup and restore --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index edfcddb5..b982db15 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1655,10 +1655,10 @@ function fluxos_reconfiguration { blocked_ports ;; "6)") - blocked_ports + fluxosConfigBackup ;; "7)") - blocked_ports + fluxosConfigRestore ;; esac } From d45a6964c63e28854e5490a18033f47c0acf1abb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:55:11 +0200 Subject: [PATCH 0939/1176] fix variable --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index b982db15..9dbcd166 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -360,7 +360,7 @@ function ImportBlockedPorts(){ function fluxosConfigBackup(){ ConfigFile="/home/$USER/$FLUX_DIR/config/userconfig.js" if [[ -f $ConfigFile ]]; then - cp -nf ConfigFile $HOME/userconfig.js.backup + cp -nf $ConfigFile $HOME/userconfig.js.backup if [[ -f $HOME/userconfig.js.backup ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js backup successfully${NC}" "${CHECK_MARK}" else From a210904b0b839242c31482a38cb4446adca432a8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Aug 2023 08:30:12 +0200 Subject: [PATCH 0940/1176] removed sleep --- multitoolbox.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index adeedac7..6d780a22 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -850,7 +850,6 @@ fi if ! wget --version > /dev/null 2>&1 ; then sudo apt install -y wget > /dev/null 2>&1 && sleep 2 fi -sleep 5 clear sleep 1 echo -e "${BLUE}" From 63c11b47030bf94db560548770c2eb1ad912e6e8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Aug 2023 08:36:10 +0200 Subject: [PATCH 0941/1176] update config_file - added upnp_enable - added thunder --- multitoolbox.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6d780a22..5461e796 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -63,6 +63,8 @@ function config_file() { kda_address=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') + upnp_enable=$(cat /home/$USER/install_conf.json | jq -r '.upnp_enable') + thunder=$(cat /home/$USER/install_conf.json | jq -r '.thunder') echo -e "${ARROW} ${YELLOW}Install config summary:" if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then @@ -94,7 +96,7 @@ function config_file() { echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" fi - if [[ ! -z $gateway_ip && ! -z $upnp_port ]]; then + if [[ ! -z $gateway_ip && ! -z $upnp_port ]] && [[ "$upnp_enable" == "true" ]] ; then echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" fi fi From 4deabc09ae44014b9da5f639701db3edef9a8e63 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Aug 2023 08:44:50 +0200 Subject: [PATCH 0942/1176] Minor edits --- flux_common.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 9dbcd166..d7321054 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -255,7 +255,7 @@ function install_conf_create(){ "eps_limit": "${eps_limit}", "upnp_port": "${upnp_port}", "gateway_ip": "${gateway_ip}", - "upnp_enable": "${upnp_enable}", + "upnp_enabled": "${upnp_enabled}", "thunder": "${thunder:-0}" } EOF @@ -620,10 +620,10 @@ function config_smart_create() { fi fluxport=$(grep -Po "(?<=fluxport=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) if [[ "$fluxport" != "" ]]; then - upnp_enable=true + upnp_enabled=true echo -e "${PIN}${CYAN} Flux Port = ${GREEN}$fluxport${NC}" smart_install_conf "fluxport" "$fluxport" "$1" - smart_install_conf "upnp_enable" "$upnp_enable" "$1" + smart_install_conf "upnp_enabled" "$upnp_enable" "$1" fi fi #fluxOS @@ -961,7 +961,7 @@ function manual_build(){ fi fi if whiptail --yesno "Would you like to enable UPnP for this node?" 8 65; then - upnp_enable=true + upnp_enabled=true router_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) gateway_ip=$(whiptail --inputbox "Enter your UPnP Gateway IP: (This is usually your router: $router_ip)" 8 85 3>&1 1>&2 2>&3) upnp_port=$(whiptail --title "Enter your FluxOS UPnP Port" --radiolist \ @@ -975,7 +975,7 @@ function manual_build(){ "16187" "" OFF \ "16197" "" OFF 3>&1 1>&2 2>&3) else - upnp_enable="" + upnp_enabled="" gateway_ip="" upnp_port="" fi @@ -1239,11 +1239,7 @@ function import_config_file() { telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') #UPnP - if [[ $(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]]; then - upnp_enable=true - else - upnp_enable=false - fi + upnp_enabled=$(cat /home/$USER/install_conf.json | jq -r '.upnp_enabled') upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') if [[ "$1" != "silent" ]]; then From bb5dd471f3d260bf738033c31b6d22da64121cb5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Aug 2023 08:45:30 +0200 Subject: [PATCH 0943/1176] update variable name --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 6b1ad8e3..ca7b2d22 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -682,7 +682,7 @@ if [[ "$thunder" == "1" ]]; then echo -e "${ARROW} ${YELLOW}Thunder Mode configuration...${NC}" thunder_mode "install" fi -if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]] && [[ "$upnp_port" != "null" ]] && [[ "$upnp_enable" == "true" ]] ; then +if [[ "$gateway_ip" != "" && "$upnp_port" != "" ]] && [[ "$upnp_port" != "null" ]] && [[ "$upnp_enabled" == "true" ]] ; then upnp_enable "install" fi finalizing From ec39ec5dfd5c359e764d1549b6ef7362e2a374a2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Aug 2023 08:48:03 +0200 Subject: [PATCH 0944/1176] Update variable name --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5461e796..438173db 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -63,7 +63,7 @@ function config_file() { kda_address=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') - upnp_enable=$(cat /home/$USER/install_conf.json | jq -r '.upnp_enable') + upnp_enabled=$(cat /home/$USER/install_conf.json | jq -r '.upnp_enabled') thunder=$(cat /home/$USER/install_conf.json | jq -r '.thunder') echo -e "${ARROW} ${YELLOW}Install config summary:" @@ -96,7 +96,7 @@ function config_file() { echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" fi - if [[ ! -z $gateway_ip && ! -z $upnp_port ]] && [[ "$upnp_enable" == "true" ]] ; then + if [[ ! -z $gateway_ip && ! -z $upnp_port ]] && [[ "$upnp_enabled" == "true" ]] ; then echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" fi fi From e82661d47ca5503e56fdb2a95ea738032013f378 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Aug 2023 09:48:40 +0200 Subject: [PATCH 0945/1176] fix value --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index d7321054..4ade36ba 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -623,7 +623,7 @@ function config_smart_create() { upnp_enabled=true echo -e "${PIN}${CYAN} Flux Port = ${GREEN}$fluxport${NC}" smart_install_conf "fluxport" "$fluxport" "$1" - smart_install_conf "upnp_enabled" "$upnp_enable" "$1" + smart_install_conf "upnp_enabled" "$upnp_enabled" "$1" fi fi #fluxOS From 720f5ce53f7f44f0edda62e320098d41161f76ae Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 19 Aug 2023 10:30:01 +0200 Subject: [PATCH 0946/1176] bump version --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 438173db..f7f234cd 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -29,7 +29,7 @@ fi FLUX_DIR='zelflux' FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' -dversion="v7.5" +dversion="v7.6" PM2_INSTALL="0" zelflux_setting_import="0" OS_FLAGE="$2" From 44e27e64e48958c12074a21599ac56f6bb8acdaf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Aug 2023 20:52:39 +0200 Subject: [PATCH 0947/1176] Update flux_common.sh --- flux_common.sh | 63 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 10 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 4ade36ba..51991ab9 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1909,23 +1909,66 @@ function start_service() { function install_mongod() { echo -e "" echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" - sudo systemctl stop mongod > /dev/null 2>&1 && sleep 1 - sudo apt remove mongod* -y > /dev/null 2>&1 && sleep 1 - sudo apt purge mongod* -y > /dev/null 2>&1 && sleep 1 - sudo apt autoremove -y > /dev/null 2>&1 && sleep 1 + sudo systemctl stop mongod > /dev/null 2>&1 + sudo apt remove mongod* -y > /dev/null 2>&1 + sudo apt purge mongod* -y > /dev/null 2>&1 + sudo apt autoremove -y > /dev/null 2>&1 + sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 + sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" + # check to see if cpu supports avx + avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) + # AVX instruction flag not found - so install 4.4 + # else install newest version 6.0 + if [[ "$avx_check" == "" ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + if [[ $(lsb_release -d) = *Debian* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + elif [[ $(lsb_release -d) = *Ubuntu* ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + else + echo -e "${WORNING} ${RED}OS type $(lsb_release -si) not supported..${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + else + if [[ $(lsb_release -d) = *Debian* ]]; then + if [[ "$(lsb_release -c)" == "bullseye" ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + else + curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + fi + elif [[ $(lsb_release -d) = *Ubuntu* ]]; then + if [[ "$(lsb_release -c)" == "jammy" || "$(lsb_release -c)" == "focal" ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + fi + else + echo -e "${WORNING} ${RED}OS type $(lsb_release -si) not supported..${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi + fi sudo apt-get update -y > /dev/null 2>&1 avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) - if [[ "$avx_check" == "" ]]; then + if [[ "$avx_check" == "" ]]; then sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 - echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 - echo "mongodb-org-shell hold" | sudo dpkg --set-selections > /dev/null 2>&1 - echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 - echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-shell hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 else - sudo apt install -y mongodb-org > /dev/null 2>&1 + DEBIAN_FRONTEND=noninteractive apt-get --yes install mongodb-org > /dev/null 2>&1 fi + sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 + sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 sudo systemctl enable mongod > /dev/null 2>&1 sudo systemctl start mongod > /dev/null 2>&1 if mongod --version > /dev/null 2>&1; then From e5126e6321c4a10e33bdbb4f8011f44b7ccc20d7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Aug 2023 20:54:11 +0200 Subject: [PATCH 0948/1176] cleanup --- install_pro.sh | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index ca7b2d22..a3b71899 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -556,39 +556,6 @@ function install_process() { sudo ufw allow $ZELFRONTPORT/tcp > /dev/null 2>&1 sudo ufw allow $LOCPORT/tcp > /dev/null 2>&1 sudo ufw allow $ZELNODEPORT/tcp > /dev/null 2>&1 - echo -e "${ARROW} ${YELLOW}Configuring service repositories...${NC}" - sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 - sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - # check to see if cpu supports avx - avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) - # AVX instruction flag not found - so install 4.4 - # else install newest version 6.0 - if [[ "$avx_check" == "" ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - if [[ $(lsb_release -d) = *Debian* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - else - echo -e "${WORNING} ${RED}OS type $(lsb_release -si) not supported..${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi - else - curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - if [[ $(lsb_release -d) = *Debian* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 - elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 - else - echo -e "${WORNING} ${RED}OS type $(lsb_release -si) not supported..${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi - fi - if ! sysbench --version > /dev/null 2>&1; then echo -e "" echo -e "${ARROW} ${YELLOW}Sysbench installing...${NC}" From ec41779ee0fbe06c2e7f40429357d48346acdf8f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Aug 2023 20:58:49 +0200 Subject: [PATCH 0949/1176] added keyring --- flux_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/flux_common.sh b/flux_common.sh index 51991ab9..b01fc856 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1946,6 +1946,7 @@ function install_mongod() { curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 else + curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 fi else From 20b808a4682e910220922f6069d8ac8616978691 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 27 Aug 2023 21:00:51 +0200 Subject: [PATCH 0950/1176] removed duplicate avx check --- flux_common.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index b01fc856..a905b47b 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1957,7 +1957,6 @@ function install_mongod() { fi fi sudo apt-get update -y > /dev/null 2>&1 - avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) if [[ "$avx_check" == "" ]]; then sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 From 3527f6394b25a03ee00e2f2e6e7834fc1f14e3f8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 28 Aug 2023 10:08:46 +0200 Subject: [PATCH 0951/1176] Update os_check --- flux_common.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index a905b47b..6c72a80c 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -996,16 +996,14 @@ function os_check(){ BLACK_LIST=( "kinetic" ) avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) if [[ "$avx_check" == "" ]]; then - BLACK_LIST+=( "jammy" ) + BLACK_LIST+=( "jammy" "bullseye" ) fi LIST_LENGTH=${#BLACK_LIST[@]} for (( p=0; p<${LIST_LENGTH}; p++ )); do if [[ $(lsb_release -cs) == ${BLACK_LIST[$p]} ]]; then echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" - if [[ "$avx_check" == "" && $(lsb_release -cs) == "jammy" ]]; then - echo -e "${WORNING} ${CYNA}AVX CPU instruction set not found and is required to use MongoDB on $(lsb_release -cs)${NC}" - fi + echo -e "${WORNING} ${CYNA}AVX CPU instruction set not found and is required to use MongoDB on $(lsb_release -cs)${NC}" echo -e "${WORNING} ${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation${NC}" echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo From 36ca26c5ccc7da9c2fce5c98535e4b7fdb085615 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 28 Aug 2023 11:26:14 +0200 Subject: [PATCH 0952/1176] use direct grep on /proc/cpuinfo https://github.com/RunOnFlux/fluxnode-multitool/commit/3527f6394b25a03ee00e2f2e6e7834fc1f14e3f8#r125689915 --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 6c72a80c..1f4560c3 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -994,7 +994,7 @@ function manual_build(){ ###### HELPERS SECTION function os_check(){ BLACK_LIST=( "kinetic" ) - avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) + avx_check=$(grep -o avx /proc/cpuinfo | head -n1) if [[ "$avx_check" == "" ]]; then BLACK_LIST+=( "jammy" "bullseye" ) fi From 6a1ffc470cb59c9e6292b65a912d3136f1e4df60 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 28 Aug 2023 20:29:44 +0200 Subject: [PATCH 0953/1176] added noninteractive --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 1f4560c3..f0531e3a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2217,7 +2217,7 @@ function zk_params() { function flux_package() { sudo apt-get update -y > /dev/null 2>&1 && sleep 2 echo -e "${ARROW} ${YELLOW}Flux Daemon && Benchmark installing...${NC}" - sudo apt install $COIN_NAME $BENCH_NAME -y > /dev/null 2>&1 && sleep 2 + DEBIAN_FRONTEND=noninteractive sudo apt-get --yes install $COIN_NAME $BENCH_NAME > /dev/null 2>&1 && sleep 2 sudo chmod 755 $COIN_PATH/* > /dev/null 2>&1 && sleep 2 integration_check } From 9ed214865e1026578733d24abffbdae91cbfd0b0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Aug 2023 09:08:40 +0200 Subject: [PATCH 0954/1176] Update mongod_db_fix --- multitoolbox.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f7f234cd..3fd08ce4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -738,17 +738,17 @@ function mongod_db_fix() { sudo rm -r /var/log/mongodb > /dev/null 2>&1 sudo rm -r /var/lib/mongodb > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing MongoDB... ${NC}" - avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) - if [[ "$avx_check" == "" ]]; then - sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 - echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 && sleep 2 - echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 - echo "mongodb-org-shell hold" | sudo dpkg --set-selections > /dev/null 2>&1 - echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 - echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 - else - sudo apt install -y mongodb-org > /dev/null 2>&1 - fi + avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) + if [[ "$avx_check" == "" ]]; then + sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 + echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 && sleep 2 + echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-shell hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 + else + DEBIAN_FRONTEND=noninteractive apt-get --yes install mongodb-org > /dev/null 2>&1 + fi sudo mkdir -p /var/log/mongodb > /dev/null 2>&1 sudo mkdir -p /var/lib/mongodb > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Settings privilege... ${NC}" From 01d0c1a9f742bf53a743525839364dfc46ee6962 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Aug 2023 09:18:41 +0200 Subject: [PATCH 0955/1176] fix missing sudo --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3fd08ce4..08b8a84f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -747,7 +747,7 @@ function mongod_db_fix() { echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 else - DEBIAN_FRONTEND=noninteractive apt-get --yes install mongodb-org > /dev/null 2>&1 + DEBIAN_FRONTEND=noninteractive sudo apt-get --yes install mongodb-org > /dev/null 2>&1 fi sudo mkdir -p /var/log/mongodb > /dev/null 2>&1 sudo mkdir -p /var/lib/mongodb > /dev/null 2>&1 From 6e3e07bd4807624bbb9f6f0dfbcfe9303ae7f29d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Aug 2023 09:19:52 +0200 Subject: [PATCH 0956/1176] added sudo --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f0531e3a..01877c18 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1963,7 +1963,7 @@ function install_mongod() { echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 else - DEBIAN_FRONTEND=noninteractive apt-get --yes install mongodb-org > /dev/null 2>&1 + DEBIAN_FRONTEND=noninteractive sudo apt-get --yes install mongodb-org > /dev/null 2>&1 fi sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 From 3aa8131bf42de590c601a7c4cb045caa702e4a0c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Aug 2023 12:34:31 +0200 Subject: [PATCH 0957/1176] added server_check --- install_pro.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index a3b71899..b79b1a48 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -428,7 +428,7 @@ function install_daemon() { sudo chown -R $USER:$USER /usr/share/keyrings > /dev/null 2>&1 sudo chown -R $USER:$USER /home/$USER/.gnupg > /dev/null 2>&1 if [[ "$(lsb_release -cs)" == "xenial" ]]; then - echo 'deb https://apt.fluxos.network/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + echo 'deb https://apt.runonflux.io/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B69CA27A986265D > /dev/null 2>&1 gpg --export 4B69CA27A986265D | sudo apt-key add - > /dev/null 2>&1 if ! gpg --list-keys Zel > /dev/null; then @@ -438,8 +438,12 @@ function install_daemon() { flux_package && sleep 2 else sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee --append /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + server_check=$(curl -s -m 20 https://apt.runonflux.io/pool/main/f/flux/ | grep -o '[0-9].[0-9].[0-9]' | head -n1) + if [[ $server_check == "" ]]; then + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.fluxos.network/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + else + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/flux-archive-keyring.gpg] https://apt.runonflux.io/ focal main" | sudo tee /etc/apt/sources.list.d/flux.list > /dev/null 2>&1 + fi # downloading key && save it as keyring gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 key_counter=0 From 0b9f3ba614e4d5e41e9351e4f2f0debbc76cf358 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:34:25 +0200 Subject: [PATCH 0958/1176] bump version --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 08b8a84f..e576ecd6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -29,7 +29,7 @@ fi FLUX_DIR='zelflux' FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' -dversion="v7.6" +dversion="v7.7" PM2_INSTALL="0" zelflux_setting_import="0" OS_FLAGE="$2" From 5ad86d5d87b241ba7090fe5252a823b2c09efce1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:54:49 +0200 Subject: [PATCH 0959/1176] sysbench fix --- install_pro.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index b79b1a48..9322297f 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -563,7 +563,8 @@ function install_process() { if ! sysbench --version > /dev/null 2>&1; then echo -e "" echo -e "${ARROW} ${YELLOW}Sysbench installing...${NC}" - curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh 2> /dev/null | sudo bash > /dev/null 2>&1 + #curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh 2> /dev/null | sudo bash > /dev/null 2>&1 + curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sed 's/dist=${dist}/dist=focal/g' | sudo bash > /dev/null 2>&1 sudo apt -y install sysbench > /dev/null 2>&1 if sysbench --version > /dev/null 2>&1; then string_limit_check_mark "Sysbench $(sysbench --version | awk '{print $2}') installed................................." "Sysbench ${GREEN}$(sysbench --version | awk '{print $2}')${CYAN} installed................................." From 424073ab38c97c8fb264fa9d1dcffddd3907a422 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:55:57 +0200 Subject: [PATCH 0960/1176] fix sysbench --- hardwarebench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index 2bafa2d9..1f65e733 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -50,7 +50,7 @@ if ! command_exists dd; then exit 1 fi if [[ "$(sysbench --version)" == "" ]]; then - curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sudo bash > /dev/null 2>&1 + curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sed 's/dist=${dist}/dist=focal/g' | sudo bash > /dev/null 2>&1 sudo apt -y install sysbench > /dev/null 2>&1 fi vcore=$(getconf _NPROCESSORS_ONLN) From 3bcc0060a6b3ea7eb63adabf0990b7947ba7e05a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:53:01 +0200 Subject: [PATCH 0961/1176] benchmark improvements --- hardwarebench.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hardwarebench.sh b/hardwarebench.sh index 1f65e733..a4bc6ff3 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -52,10 +52,24 @@ fi if [[ "$(sysbench --version)" == "" ]]; then curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sed 's/dist=${dist}/dist=focal/g' | sudo bash > /dev/null 2>&1 sudo apt -y install sysbench > /dev/null 2>&1 + if [[ "$(sysbench --version)" == "" ]]; then + echo -e "" + echo -e "-------------------------------------------" + echo -e "| HARDWARE BENCHMARK" + echo -e "-------------------------------------------" + echo -e "| Benchmark: FAILED" + echo -e "| Error: Sysbench installation failed..." + echo -e "-------------------------------------------" + echo -e "" + exit + fi fi vcore=$(getconf _NPROCESSORS_ONLN) ram=$(LC_ALL=C free -b 2> /dev/null | awk 'NR==2 {print $2}' | grep -Eo '[0-9]+'| printf "%.0f\n" $(awk '{ print $1/1024/1024/1024 }') 2> /dev/null ) core=$(awk -F: '/cpu cores/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \\t]*//;s/[ \\t]*$//') +if [[ "$core" == "" ]]; then + core=$(grep 'processor' /proc/cpuinfo | wc -l) +fi echo -e "" echo -e "-------------------------" echo -e "| MEMORY BENCHMARK" From 7c49be1a1d9285e09d2fa6d979340e440cd50298 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 13 Sep 2023 13:07:24 +0200 Subject: [PATCH 0962/1176] added fluxos restart --- multitoolbox.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index e576ecd6..53f54af7 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -722,7 +722,11 @@ function mongod_db_fix() { string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." echo -e "${ARROW} ${CYAN}Service status:${SEA} $(sudo systemctl status mongod | grep -w 'Active' | sed -e 's/^[ \t]*//')${NC}" fi - echo -e "" + echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark...${NC}" + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + sleep 5 + echo -e "" ;; "2)") echo -e "" @@ -756,7 +760,7 @@ function mongod_db_fix() { sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 fluxos_clean - #echo -e "${ARROW} ${CYAN}Restoring Database... ${NC}" + #echo -e "${ARROW} ${CYAN}Restoring Database... ${NC}" #mongorestore --drop --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" sudo systemctl start mongod @@ -766,6 +770,10 @@ function mongod_db_fix() { else string_limit_x_mark "MongoDB was not installed................................." fi + echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark...${NC}" + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + sleep 5 echo -e "" ;; esac From 85aedc01b3fbc90261d571655c8030df409e7b7d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:02:43 +0200 Subject: [PATCH 0963/1176] removed debian 11 from BLACK_LIST --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 01877c18..d860c1db 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -996,7 +996,7 @@ function os_check(){ BLACK_LIST=( "kinetic" ) avx_check=$(grep -o avx /proc/cpuinfo | head -n1) if [[ "$avx_check" == "" ]]; then - BLACK_LIST+=( "jammy" "bullseye" ) + BLACK_LIST+=( "jammy" ) fi LIST_LENGTH=${#BLACK_LIST[@]} for (( p=0; p<${LIST_LENGTH}; p++ )); From 619326f299b02a72ec0874fe80e036781726ea00 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:53:57 +0200 Subject: [PATCH 0964/1176] update nodejs version --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index d860c1db..c2a66e6c 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2001,7 +2001,7 @@ function install_nodejs() { . ~/.profile . ~/.bashrc sleep 1 - nvm install 16 > /dev/null 2>&1 + nvm install 20.8.0 > /dev/null 2>&1 if node -v > /dev/null 2>&1; then string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." echo From 4cc4d0774deb7067d872317eb45444facb12e9fb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 24 Oct 2023 22:45:51 +0200 Subject: [PATCH 0965/1176] disabled external log_rotate for docker --- install_pro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pro.sh b/install_pro.sh index 9322297f..c0095fd2 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -645,7 +645,7 @@ start_daemon log_rotate "Flux benchmark" "bench_debug_log" "/home/$USER/$BENCH_DIR_LOG/debug.log" "monthly" "2" log_rotate "Flux daemon" "daemon_debug_log" "/home/$USER/$CONFIG_DIR/debug.log" "daily" "7" log_rotate "MongoDB" "mongod_debug_log" "/var/log/mongodb/*.log" "daily" "14" -log_rotate "Docker" "docker_debug_log" "/var/lib/docker/containers/*/*.log" "daily" "7" +#log_rotate "Docker" "docker_debug_log" "/var/lib/docker/containers/*/*.log" "daily" "7" basic_security status_loop install_watchdog From a2fcbf3d1cb5807d256732be565d72e56df5f72d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 25 Oct 2023 10:31:12 +0200 Subject: [PATCH 0966/1176] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4beeaab..0c295cfe 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ https://fluxnodeservice.com <br> <b>Any donations are welcomed and appreciated. Thanks.</b> -<p>https://x4milx.coinrequest.io</p> +<p>https://kamil.coinrequest.io</p> ``` FLUX: t1f66kBo9xzpgPJV6wvzT7MY6unpm42kvST From 2ae8543cc2c241b599d4e420196b648e31520639 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:15:23 +0200 Subject: [PATCH 0967/1176] added Blocked Repositories Management --- flux_common.sh | 178 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 137 insertions(+), 41 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index c2a66e6c..00d924af 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -277,7 +277,12 @@ function RemoveLine(){ sed -i "/$1/d" /home/$USER/zelflux/config/userconfig.js } -function builBlockedList() { +function ClearList() { + string="\[\]" + display="" +} + +function buildBlockedList() { if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" exit @@ -341,11 +346,6 @@ function AddBlockedPorts() { } -function ClearBlockedPortsList() { - string="\[\]" - display="" -} - function ImportBlockedPorts(){ array=($(grep -w blockedPorts /home/$USER/$FLUX_DIR/config/userconfig.js | grep -o '[[:digit:]]*')) sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) @@ -356,6 +356,122 @@ function ImportBlockedPorts(){ fi } +function blocked_ports(){ + CHOICE=$( + whiptail --title "FluxOS Blocked Ports Management" --menu "Make your choice" 15 40 6 \ + "1)" "Create new list" \ + "2)" "Add ports" \ + "3)" "Clear list" 3>&2 2>&1 1>&3 ) + + case $CHOICE in + "1)") + CreateBlockedList + echo -e "${ARROW}${GREEN} BlockedPorts: [$display]${NC}" + RemoveLine "blockedPorts" + buildBlockedList " blockedPorts" "$string" "Blocked ports list crated successful!" "fluxos" + ;; + "2)") + AddBlockedPorts + echo -e "${ARROW}${GREEN} BlockedPorts: [$display]${NC}" + RemoveLine "blockedPorts" + buildBlockedList " blockedPorts" "$string" "Blocked ports list updated successful!" "fluxos" + ;; + "3)") + ClearList + RemoveLine "blockedPorts" + buildBlockedList " blockedPorts" "$string" "Blocked ports list cleared successful!" "fluxos" + ;; + esac +} + +function CreateBlockedRepositoryList() { + ADD=$(whiptail --inputbox "Enter the repositories to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) + if [[ $? == 1 ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" + echo -e "" + exit + fi + ADD=$(sed 's/,/ /g' <<< $ADD) + temp_array=($ADD) + for i in ${temp_array[@]} + do + array+=("'$i'") + done + sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + printf -v joined '%s,' "${sorted_unique_ids[@]}" + if [[ "${joined%,}" != "" ]]; then + string="\[${joined%,}\]" + display="${joined%,}" + fi +} + +function AddBlockedRepository() { + string=$(grep "" $HOME/$FLUX_DIR/config/userconfig.js | awk -F'[][]' '{print $2}' ) + delimiter="," + declare -a array=($(echo $string | tr "$delimiter" " ")) + ADD=$(whiptail --inputbox "Enter the repositories to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) + if [[ $? == 1 ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" + echo -e "" + exit + fi + ADD=$(sed 's/,/ /g' <<< $ADD) + temp_array=($ADD) + for i in ${temp_array[@]} + do + array+=("'$i'") + done + sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + printf -v joined '%s,' "${sorted_unique_ids[@]}" + string="\[${joined%,}\]" + display="${joined%,}" +} + +function buildBlockedRepositoryList() { + if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + exit + fi + if [[ "$1" == "" || "$2" == "" ]]; then + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + exit + fi + key="$1" + value="$2" + if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then + insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3${NC}" "${CHECK_MARK}" + return + fi +} + +function blocked_repositories(){ + CHOICE=$( + whiptail --title "FluxOS Blocked Repositories Management" --menu "Make your choice" 15 40 6 \ + "1)" "Create new list" \ + "2)" "Add Repositories" \ + "3)" "Clear list" 3>&2 2>&1 1>&3 ) + + case $CHOICE in + "1)") + CreateBlockedRepositoryList + echo -e "${ARROW}${GREEN} BlockedRepositories: [$display]${NC}" + RemoveLine "blockedRepositories" + buildBlockedRepositoryList " blockedRepositories" "$string" "Blocked repositories list crated successful!" "fluxos" + ;; + "2)") + AddBlockedRepository + echo -e "${ARROW}${GREEN} BlockedRepositories: [$display]${NC}" + RemoveLine "blockedRepositories" + buildBlockedRepositoryList " blockedRepositories" "$string" "Blocked repositories list updated successful!" "fluxos" + ;; + "3)") + ClearList + RemoveLine "blockedRepositories" + buildBlockedRepositoryList " blockedRepositories" "$string" "Blocked repositories list cleared successful!" "fluxos" + ;; + esac +} function fluxosConfigBackup(){ ConfigFile="/home/$USER/$FLUX_DIR/config/userconfig.js" @@ -1567,46 +1683,22 @@ function thunder_mode(){ } - function development_mode(){ if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "development: 'false'") != "" ]] || [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "development: false") ]]; then echo -e "${ARROW}${GREEN} [FluxOS] ${CYAN}Enabling development mode... ${NC}" config_builder "development" "true" "Development Mode" "fluxos" + cd $HOME/$FLUX_DIR + git checkout development > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 else echo -e "${ARROW}${GREEN} [FluxOS] ${CYAN}Disabling development mode... ${NC}" config_builder "development" "false" "Development Mode" "fluxos" + cd $HOME/$FLUX_DIR + git checkout master > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 fi } - -function blocked_ports(){ - CHOICE=$( - whiptail --title "FluxOS Blocked Ports Management" --menu "Make your choice" 15 40 6 \ - "1)" "Create new list" \ - "2)" "Add ports" \ - "3)" "Clear list" 3>&2 2>&1 1>&3 ) - - case $CHOICE in - "1)") - CreateBlockedList - echo -e "${ARROW}${GREEN} BlockedPorts: [$display]${NC}" - RemoveLine "blockedPorts" - builBlockedList " blockedPorts" "$string" "Blocked ports list crated successful!" "fluxos" - ;; - "2)") - AddBlockedPorts - echo -e "${ARROW}${GREEN} BlockedPorts: [$display]${NC}" - RemoveLine "blockedPorts" - builBlockedList " blockedPorts" "$string" "Blocked ports list updated successful!" "fluxos" - ;; - "3)") - ClearBlockedPortsList - RemoveLine "blockedPorts" - builBlockedList " blockedPorts" "$string" "Blocked ports list cleared successful!" "fluxos" - ;; - esac -} - function fluxos_reconfiguration { echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -1629,8 +1721,9 @@ function fluxos_reconfiguration { "3)" "Enable/Disable thunder mode" \ "4)" "Enable/Disable development mode" \ "5)" "Blocked Ports Management" \ - "6)" "FluxOS config backup" \ - "7)" "FluxOS config restore" 3>&2 2>&1 1>&3 + "6)" "Blocked Repositories Management" \ + "7)" "FluxOS config backup" \ + "8)" "FluxOS config restore" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") @@ -1647,11 +1740,14 @@ function fluxos_reconfiguration { ;; "5)") blocked_ports - ;; - "6)") + ;; + "6)") + blocked_repositories + ;; + "7)") fluxosConfigBackup ;; - "7)") + "8)") fluxosConfigRestore ;; esac From 2dc3e5dc06d18bf2524fae70541ddf98a718e671 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 25 Oct 2023 22:11:54 +0200 Subject: [PATCH 0968/1176] updated node to last lts --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 00d924af..33e3f080 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2097,7 +2097,7 @@ function install_nodejs() { . ~/.profile . ~/.bashrc sleep 1 - nvm install 20.8.0 > /dev/null 2>&1 + nvm install 20.9.0 > /dev/null 2>&1 if node -v > /dev/null 2>&1; then string_limit_check_mark "Nodejs $(node -v) installed................................." "Nodejs ${GREEN}$(node -v)${CYAN} installed................................." echo From 23e77c8988d5e61bd16c47d2f06699f264853343 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:28:31 +0100 Subject: [PATCH 0969/1176] Minor changes --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 33e3f080..e1b970cd 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -300,7 +300,7 @@ function buildBlockedList() { fi } -function CreateBlockedList() { +function CreateBlockedPortsList() { ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) if [[ $? == 1 ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" @@ -365,7 +365,7 @@ function blocked_ports(){ case $CHOICE in "1)") - CreateBlockedList + CreateBlockedPortsList echo -e "${ARROW}${GREEN} BlockedPorts: [$display]${NC}" RemoveLine "blockedPorts" buildBlockedList " blockedPorts" "$string" "Blocked ports list crated successful!" "fluxos" From 09d158767f59a20d84f7dfa1c991c490e999d949 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:37:25 +0100 Subject: [PATCH 0970/1176] added ImportBlockedRepository --- flux_common.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index e1b970cd..9880ff73 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -406,7 +406,7 @@ function CreateBlockedRepositoryList() { } function AddBlockedRepository() { - string=$(grep "" $HOME/$FLUX_DIR/config/userconfig.js | awk -F'[][]' '{print $2}' ) + string=$(grep "blockedRepositories" $HOME/$FLUX_DIR/config/userconfig.js | awk -F'[][]' '{print $2}' ) delimiter="," declare -a array=($(echo $string | tr "$delimiter" " ")) ADD=$(whiptail --inputbox "Enter the repositories to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) @@ -445,6 +445,16 @@ function buildBlockedRepositoryList() { fi } +function ImportBlockedRepository() { + string=$(grep "blockedRepositories" $HOME/$FLUX_DIR/config/userconfig.js | awk -F'[][]' '{print $2}' ) + delimiter="," + declare -a array=($(echo $string | tr "$delimiter" " ")) + sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + printf -v joined '%s,' "${sorted_unique_ids[@]}" + string="\[${joined%,}\]" + display="${joined%,}" +} + function blocked_repositories(){ CHOICE=$( whiptail --title "FluxOS Blocked Repositories Management" --menu "Make your choice" 15 40 6 \ From d0e96ac166558484d035983b521f4ed52c77dab3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:43:07 +0100 Subject: [PATCH 0971/1176] fix ImportBlockedRepository --- flux_common.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 9880ff73..b97932f6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -451,8 +451,10 @@ function ImportBlockedRepository() { declare -a array=($(echo $string | tr "$delimiter" " ")) sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) printf -v joined '%s,' "${sorted_unique_ids[@]}" - string="\[${joined%,}\]" - display="${joined%,}" + if [[ "${joined%,}" != "" ]]; then + blockedRepositoryList="\[${joined%,}\]" + display="${joined%,}" + fi } function blocked_repositories(){ From 9c36007b110e55b45906da58a80d3021bbd984a5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:50:17 +0100 Subject: [PATCH 0972/1176] function rename --- flux_common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index b97932f6..e2644dc6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -282,7 +282,7 @@ function ClearList() { display="" } -function buildBlockedList() { +function buildBlockedPortsList() { if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" exit @@ -368,18 +368,18 @@ function blocked_ports(){ CreateBlockedPortsList echo -e "${ARROW}${GREEN} BlockedPorts: [$display]${NC}" RemoveLine "blockedPorts" - buildBlockedList " blockedPorts" "$string" "Blocked ports list crated successful!" "fluxos" + buildBlockedPortsList " blockedPorts" "$string" "Blocked ports list crated successful!" "fluxos" ;; "2)") AddBlockedPorts echo -e "${ARROW}${GREEN} BlockedPorts: [$display]${NC}" RemoveLine "blockedPorts" - buildBlockedList " blockedPorts" "$string" "Blocked ports list updated successful!" "fluxos" + buildBlockedPortsList " blockedPorts" "$string" "Blocked ports list updated successful!" "fluxos" ;; "3)") ClearList RemoveLine "blockedPorts" - buildBlockedList " blockedPorts" "$string" "Blocked ports list cleared successful!" "fluxos" + buildBlockedPortsList " blockedPorts" "$string" "Blocked ports list cleared successful!" "fluxos" ;; esac } From b12c411fd5e644cc5bd1cb4e7e3e1092d8f8ae01 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:55:38 +0100 Subject: [PATCH 0973/1176] added ImportBlockedRepository --- multitoolbox.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 53f54af7..147f4a7e 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -174,6 +174,11 @@ function install_flux() { if [[ "$blockedPortsList" != "" ]]; then echo -e "${PIN}${CYAN}BlockedPorts: [$display]${NC}" fi + + ImportBlockedRepository + if [[ "$blockedRepositoryList" != "" ]]; then + echo -e "${PIN}${CYAN}BlockedRepositories: [$display]${NC}" + fi echo -e "" echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" @@ -243,7 +248,11 @@ function install_flux() { fi if [[ "$blockedPortsList" != "" ]]; then RemoveLine "blockedPorts" - builBlockedList " blockedPorts" "$blockedPortsList" "Blocked ports list created successfully!" "fluxos" + buildBlockedPortsList " blockedPorts" "$blockedPortsList" "Blocked ports list created successfully!" "fluxos" + fi + if [[ "$blockedRepositoryList" != "" ]]; then + RemoveLine "blockedRepositories" + buildBlockedRepositoryList " blockedRepositories" "$blockedRepositoryList" "Blocked repositories list created successfully!" "fluxos" fi string_limit_check_mark "FluxOS configuration successfull..........................................." else From d19a013dfbe20b45f0affb783ec486da8cda8bad Mon Sep 17 00:00:00 2001 From: YULIUS KURNIAWAN KRISTIANTO <yuliuskristianto9@gmail.com> Date: Sun, 3 Dec 2023 23:30:28 +0700 Subject: [PATCH 0974/1176] Update bug.yml --- .github/ISSUE_TEMPLATE/bug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index a0b059a8..b89cda64 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -61,7 +61,7 @@ body: required: true - label: You've checked that this [issue hasn't already been raised](https://github.com/RunOnFlux/fluxnode-multitool/issues?q=is%3Aissue) required: true - - label: You've checked the official [RunOnFlux Discord](https://discord.io/runonflux) Pinned messages and FAQ ![important](https://img.shields.io/badge/Important!-F6094E) + - label: You've checked the official [RunOnFlux Discord](https://discord.gg/runonflux) Pinned messages and FAQ ![important](https://img.shields.io/badge/Important!-F6094E) required: true - label: You agree to the [code of conduct](https://github.com/RunOnFlux/fluxnode-multitool/blob/master/.github/CODE_OF_CONDUCT.md) required: true From 4a77ecf2087fd16266d7e1e7973652138b102bb4 Mon Sep 17 00:00:00 2001 From: YULIUS KURNIAWAN KRISTIANTO <yuliuskristianto9@gmail.com> Date: Sun, 3 Dec 2023 23:31:11 +0700 Subject: [PATCH 0975/1176] Update question.yml --- .github/ISSUE_TEMPLATE/question.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 0fc69878..53ac4780 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -9,7 +9,7 @@ body: attributes: value: > Thanks for using multitoolbox! Questions are welcome. - Quick questions should be asked in the [Official RunOnFlux Discord](https://discord.io/runonflux) support channels, Please. :) + Quick questions should be asked in the [Official RunOnFlux Discord](https://discord.gg/runonflux) support channels, Please. :) validations: required: false @@ -59,7 +59,7 @@ body: required: true - label: You've checked that this [issue hasn't already been raised](https://github.com/RunOnFlux/fluxnode-multitool/issues?q=is%3Aissue) required: true - - label: You've checked the official [RunOnFlux Discord](https://discord.io/runonflux) Pinned messages and FAQ ![important](https://img.shields.io/badge/Important!-F6094E) + - label: You've checked the official [RunOnFlux Discord](https://discord.gg/runonflux) Pinned messages and FAQ ![important](https://img.shields.io/badge/Important!-F6094E) required: true - label: You agree to the [code of conduct](https://github.com/RunOnFlux/fluxnode-multitool/blob/master/.github/CODE_OF_CONDUCT.md) required: true From 0186be499e4c013f357600765210d84c5b732aa8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 22 Dec 2023 11:32:42 +0100 Subject: [PATCH 0976/1176] import display correction --- flux_common.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index e2644dc6..cf8ab85a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -771,8 +771,10 @@ function config_smart_create() { upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | grep -o '[[:digit:]]*') if [[ "$upnp_port" != "" ]]; then gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) - echo -e "${PIN}${CYAN} UPnP port = ${GREEN}$upnp_port${NC}" - echo -e "${PIN}${CYAN} Router IP = ${GREEN}$gateway_ip${NC}" + echo -e "${PIN}${CYAN} API Port = ${GREEN}$upnp_port${NC}" + if [[ "$upnp_enabled" === "true" ]]; then + echo -e "${PIN}${CYAN} Router IP = ${GREEN}$gateway_ip${NC}" + fi smart_install_conf "upnp_port" "$upnp_port" "$1" smart_install_conf "gateway_ip" "$gateway_ip" "$1" fi From 8d6f0c22905672ace27d9d1134c689b86786d046 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 22 Dec 2023 13:36:21 +0100 Subject: [PATCH 0977/1176] fix conditional --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index cf8ab85a..34155a74 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -772,7 +772,7 @@ function config_smart_create() { if [[ "$upnp_port" != "" ]]; then gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) echo -e "${PIN}${CYAN} API Port = ${GREEN}$upnp_port${NC}" - if [[ "$upnp_enabled" === "true" ]]; then + if [[ "$upnp_enabled" == "true" ]]; then echo -e "${PIN}${CYAN} Router IP = ${GREEN}$gateway_ip${NC}" fi smart_install_conf "upnp_port" "$upnp_port" "$1" From 73250e4fd80db16cbe4f4d775ee996d0183d79a9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 22 Dec 2023 23:01:27 +0100 Subject: [PATCH 0978/1176] improved MongoDB uninstall --- multitoolbox.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 147f4a7e..c2ee329d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -746,7 +746,9 @@ function mongod_db_fix() { #echo -e "${ARROW} ${CYAN}Backuping Database... ${NC}" #mongodump --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing MongoDB... ${NC}" - sudo apt-get purge mongodb-org* -y > /dev/null 2>&1 + sudo apt-get remove -f mongodb-org* -y > /dev/null 2>&1 + sudo apt-get purge --allow-change-held-packages mongodb-org* -y > /dev/null 2>&1 + sudo apt autoremove -y > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Removing Database... ${NC}" sudo rm -r /var/log/mongodb > /dev/null 2>&1 sudo rm -r /var/lib/mongodb > /dev/null 2>&1 From 88b4cf338f6f036432e956df80180991675738dd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 22 Dec 2023 23:04:27 +0100 Subject: [PATCH 0979/1176] improved MongoDB uninstall --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 34155a74..03c53581 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2018,8 +2018,8 @@ function install_mongod() { echo -e "" echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" sudo systemctl stop mongod > /dev/null 2>&1 - sudo apt remove mongod* -y > /dev/null 2>&1 - sudo apt purge mongod* -y > /dev/null 2>&1 + sudo apt remove -f mongod* -y > /dev/null 2>&1 + sudo apt purge --allow-change-held-packages mongod* -y > /dev/null 2>&1 sudo apt autoremove -y > /dev/null 2>&1 sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 From dfcf1081e2a8a7fa689c538d59313505bded1cbb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 26 Dec 2023 19:34:08 +0100 Subject: [PATCH 0980/1176] improved mongodb install - added pi 5 support --- flux_common.sh | 100 +++++++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 36 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 03c53581..7b1c40bd 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2015,6 +2015,7 @@ function start_service() { } ######### INSTALLATION SECTION ############################ function install_mongod() { + source_set=0 echo -e "" echo -e "${ARROW} ${YELLOW}Removing any instances of Mongodb...${NC}" sudo systemctl stop mongod > /dev/null 2>&1 @@ -2024,48 +2025,75 @@ function install_mongod() { sudo rm /etc/apt/sources.list.d/mongodb*.list > /dev/null 2>&1 sudo rm /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo -e "${ARROW} ${YELLOW}Mongodb installing...${NC}" - # check to see if cpu supports avx avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) - # AVX instruction flag not found - so install 4.4 - # else install newest version 6.0 - if [[ "$avx_check" == "" ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - if [[ $(lsb_release -d) = *Debian* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - else - echo -e "${WORNING} ${RED}OS type $(lsb_release -si) not supported..${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi - else - if [[ $(lsb_release -d) = *Debian* ]]; then - if [[ "$(lsb_release -c)" == "bullseye" ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + os_version=$(lsb_release -rs | tr -d '.') + architecture=$(dpkg --print-architecture) + + if [[ $(lsb_release -d) = *Debian* ]]; then + os_name="Debian" + fi + + if [[ $(lsb_release -d) = *Debian* ]]; then + os_name="Ubuntu" + fi + #Ubuntu MongoDB 4.4 + if [[ "$avx_check" == "" && "$os_name" == "Ubuntu" && "$architecture" == "amd64" && "$os_version" -le "2010" ]] || [[ "$os_name" == "Ubuntu" && "$architecture" == "arm64" && "$os_version" -le "2010" ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + source_set=2 + fi + #Debian MongoDB 4.4 + if [[ "$avx_check" == "" && "$os_name" == "Debian" && "$architecture" == "amd64" && "$os_version" -le "9" ]] || [[ "$os_name" == "Debian" && "$architecture" == "arm64" && "$os_version" -le "9" ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + source_set=2 + fi + #ARM MongoDB 7.0 + if [[ "$avx_check" == "" && "$architecture" == "arm64" ]]; then + if [[ "$os_name" == "Debian" && "$os_version" -ge "12" ]]; + curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + source_set=1 + fi + if [[ "$os_name" == "Ubuntu" && "$os_version" -ge "2304" ]]; + curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + source_set=1 + fi + fi + #AVX with AMD64 + if [[ "$avx_check" != "" && "$architecture" == "amd64" ]]; then + if [[ "$os_name" == "Ubuntu ]]; then + if [[ "$os_version" -ge "2004" ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + source_set=1 else - curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + source_set=1 fi - elif [[ $(lsb_release -d) = *Ubuntu* ]]; then - if [[ "$(lsb_release -c)" == "jammy" || "$(lsb_release -c)" == "focal" ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + fi + if [[ "$os_name" == "Debian ]]; then + if [[ "$os_version" -le "9" ]]; then + curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 + source_set=2 else - curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + source_set=1 fi - else - echo -e "${WORNING} ${RED}OS type $(lsb_release -si) not supported..${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit - fi - fi + fi + fi + if [[ "$source_set" == "0" ]]; then + echo -e "${WORNING} ${RED}OS type $(lsb_release -si) not supported..${NC}" + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi sudo apt-get update -y > /dev/null 2>&1 - if [[ "$avx_check" == "" ]]; then + if [[ "$source_set" == "2" ]]; then sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 From ddb8c507a73c19b9e3c7c6e4cc0bd02547014e1e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:06:40 +0100 Subject: [PATCH 0981/1176] update OS info --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index c2ee329d..6c6c6255 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -878,7 +878,7 @@ figlet -f slant "Multitoolbox" echo -e "${YELLOW}================================================================${NC}" echo -e "${GREEN}Version: $dversion${NC}" echo -e "${GREEN}Branch: $ROOT_BRANCH${NC}" -echo -e "${GREEN}OS: Ubuntu 16/18/19/20, Debian 9/10 ${NC}" +echo -e "${GREEN}OS: Ubuntu 20/22/23, Debian 10/11/12 (if hardware requirements are met.)${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" echo -e "${GREEN}Special thanks to dk808, CryptoWrench, jriggs28 && TechDufus${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -895,7 +895,7 @@ echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}11 - FluxOS config management ${NC}" echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" echo -e "${CYAN}13 - MongoDB FiX action${NC}" -echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Router with UPNP support) ${NC}" +echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" echo -e "${CYAN}15 - Node reconfiguration from install config${NC}" echo -e "${CYAN}16 - Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" From 2768a51bde7d3d35ac7481f7387c26ac19c42f1d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:14:34 +0100 Subject: [PATCH 0982/1176] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 0c295cfe..129656bc 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ Note: If you are having difficulties, try fastgit.org provider <b>4) BOOTSTRAP AUTODEPLOY SERVICE (ALWAYS FRESH COPY):</b> https://fluxnodeservice.com + + <b>5) HARDWARE REQUIREMENTS DEPEND ON MongoDB</b> + https://www.mongodb.com/docs/manual/administration/production-notes/#std-label-prod-notes-supported-platforms <br> <b>Any donations are welcomed and appreciated. Thanks.</b> From 01fe6e8bae8708ec409bb82e300006036fbb7681 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:15:36 +0100 Subject: [PATCH 0983/1176] minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 6c6c6255..f6d29a5d 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -878,7 +878,7 @@ figlet -f slant "Multitoolbox" echo -e "${YELLOW}================================================================${NC}" echo -e "${GREEN}Version: $dversion${NC}" echo -e "${GREEN}Branch: $ROOT_BRANCH${NC}" -echo -e "${GREEN}OS: Ubuntu 20/22/23, Debian 10/11/12 (if hardware requirements are met.)${NC}" +echo -e "${GREEN}OS: Ubuntu 20/22/23, Debian 10/11/12 (if hardware requirements are met)${NC}" echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" echo -e "${GREEN}Special thanks to dk808, CryptoWrench, jriggs28 && TechDufus${NC}" echo -e "${YELLOW}================================================================${NC}" From 43d196b8a43ca7bce8dae453f81191fd0734f0e2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:22:41 +0100 Subject: [PATCH 0984/1176] Add files via upload --- image/main.jpg | Bin 0 -> 123978 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 image/main.jpg diff --git a/image/main.jpg b/image/main.jpg new file mode 100644 index 0000000000000000000000000000000000000000..323d2f6f69b84eb09cb0ec959b01756ef4cac119 GIT binary patch literal 123978 zcmeFZ2UMF&vMwq|umR&hjyBmulQGdY1}rdOGKgfGD1^Y|jJ5+{vXKZTn;^0fK_EZ` zo18I8WH34BoS!`B+<RvBnZ0MvyqUA!y>EWhYiTW7QdL*gS6_Em_xa%Y55P@jMW7<! z!i5WfmxMpS`3OKBaPh*0pRfOXE?v3w^SOHY@}(<8SBZ#zHsWg}*NBO)6B7|#C%b-~ zgp}|QUAsX}MtbAt`=4L(^W#51MR<`C6A}OH@%KIFUjes>FRWesdg%fS;Nq<dmu_7+ zuLm##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z7+YMEv_WViJ_Wb{?t$j}IcI<JdFEqzk0=u^9<8b2XO~eIhfF0u+^{i~;QK!syI=rb z<k1S98-eETAG`X`RqB6|ZkH^YB}v^W5FtMKZa#_=Ik}AVubR&tnEjGvp^{#ld+fud z6Uu?_KOnq4_A6#OZQR&pD)CE$|7$ytx5=xpz*Rjj5sn>@uL<x2MY_YT{*G&t{mP~} zY2I_*$E}X#m(HCOy$vZm1oCrNh;|w(8Hu)^%Q%9_vrf1jDpylk^?AnRk0Pfl_m#tU b#Wst)^%XV`b%~L1rTywe{->T3_&ND+_jaim literal 0 HcmV?d00001 From f4f6eb1ec4a24700cf2f8980908f71bd91cdd017 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:23:33 +0100 Subject: [PATCH 0985/1176] updated menu pic --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 129656bc..36eaf45d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Note: If you are having difficulties, try fastgit.org provider ```bash -i <(curl -s https://raw.fastgit.org/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)``` <b>2) MENU:</b> -![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/development.jpg) +![screen1](https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/image/main.jpg) <b>3) HOW USE MULTITOOLBOX TO SETUP FLUXNODE:</b> https://medium.com/zelinsights/zelnode-setup-the-easy-peasy-lemon-squeezy-way-fd89706ea03c <br> From b3a2275f26e5e47011c21407c1ed7ea55ebba395 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:40:33 +0100 Subject: [PATCH 0986/1176] updated install_mongod --- flux_common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 7b1c40bd..76c1fd90 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2049,7 +2049,7 @@ function install_mongod() { source_set=2 fi #ARM MongoDB 7.0 - if [[ "$avx_check" == "" && "$architecture" == "arm64" ]]; then + if [[ "$architecture" == "arm64" ]]; then if [[ "$os_name" == "Debian" && "$os_version" -ge "12" ]]; curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 @@ -2077,8 +2077,8 @@ function install_mongod() { if [[ "$os_name" == "Debian ]]; then if [[ "$os_version" -le "9" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 - source_set=2 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 + source_set=1 else curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 From c8cfc59c8a62fdf4cde2eb19a3d4fc1dfa03cec8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:29:48 +0100 Subject: [PATCH 0987/1176] improved os_check --- flux_common.sh | 52 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 76c1fd90..1a57f78a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1123,23 +1123,49 @@ function manual_build(){ } ###### HELPERS SECTION function os_check(){ - BLACK_LIST=( "kinetic" ) - avx_check=$(grep -o avx /proc/cpuinfo | head -n1) - if [[ "$avx_check" == "" ]]; then - BLACK_LIST+=( "jammy" ) + passed=0 + avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) + os_version=$(lsb_release -rs | tr -d '.') + architecture=$(dpkg --print-architecture) + + if [[ $(lsb_release -d) = *Debian* ]]; then + if [[ "$os_version" -le "9" ]]; then + passed=1 + fi + if [[ "$os_version" -ge "10" && "$architecture" == "amd64" && "$avx_check" != "" ]]; then + passed=1 + fi + if [[ "$os_version" -ge "12" && "$architecture" == "arm64" ]]; then + passed=1 + fi fi - LIST_LENGTH=${#BLACK_LIST[@]} - for (( p=0; p<${LIST_LENGTH}; p++ )); - do - if [[ $(lsb_release -cs) == ${BLACK_LIST[$p]} ]]; then - echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" + + if [[ $(lsb_release -d) = *Ubuntu* ]]; then + if [[ "$os_version" -le "2010" ]]; then + passed=1 + fi + if [[ "$os_version" -ge "2204" && "$architecture" == "amd64" && "$avx_check" != "" ]]; then + passed=1 + fi + if [[ "$os_version" -ge "2310" && "$architecture" == "arm64" ]]; then + passed=1 + fi + fi + + if [[ "$passed" == "0" ]]; then + echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" + if [[ "$architecture" == "amd64" ]]; then echo -e "${WORNING} ${CYNA}AVX CPU instruction set not found and is required to use MongoDB on $(lsb_release -cs)${NC}" echo -e "${WORNING} ${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation${NC}" - echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" - echo - exit fi - done + if [[ "$architecture" == "arm64" ]]; then + echo -e "${WORNING} ${CYNA}ARMv8.2-A or later microarchitecture is required to use MongoDB on $(lsb_release -cs)${NC}" + echo -e "${WORNING} ${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation${NC}" + fi + echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" + echo + exit + fi } function fluxos_clean(){ From 8fba97d75bc60030db5eafe1fa8eb52a0ec63388 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 15:42:58 +0100 Subject: [PATCH 0988/1176] fix missing then --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 1a57f78a..e3ec47d3 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2081,7 +2081,7 @@ function install_mongod() { echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 source_set=1 fi - if [[ "$os_name" == "Ubuntu" && "$os_version" -ge "2304" ]]; + if [[ "$os_name" == "Ubuntu" && "$os_version" -ge "2304" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 source_set=1 From e06cdfbb68a239c537d5a199c5dfefdac2002b07 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 15:50:48 +0100 Subject: [PATCH 0989/1176] fix missing then --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index e3ec47d3..483773eb 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2076,7 +2076,7 @@ function install_mongod() { fi #ARM MongoDB 7.0 if [[ "$architecture" == "arm64" ]]; then - if [[ "$os_name" == "Debian" && "$os_version" -ge "12" ]]; + if [[ "$os_name" == "Debian" && "$os_version" -ge "12" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 source_set=1 From 7504a483074406d0cb83b45fe95246aed4e65257 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 15:55:19 +0100 Subject: [PATCH 0990/1176] fix --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 483773eb..6eba20e0 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2089,7 +2089,7 @@ function install_mongod() { fi #AVX with AMD64 if [[ "$avx_check" != "" && "$architecture" == "amd64" ]]; then - if [[ "$os_name" == "Ubuntu ]]; then + if [[ "$os_name" == "Ubuntu" ]]; then if [[ "$os_version" -ge "2004" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 @@ -2100,7 +2100,7 @@ function install_mongod() { source_set=1 fi fi - if [[ "$os_name" == "Debian ]]; then + if [[ "$os_name" == "Debian" ]]; then if [[ "$os_version" -le "9" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list > /dev/null 2>&1 From b35444572942875b5e90b54b70bbe3c1b4677804 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 16:50:06 +0100 Subject: [PATCH 0991/1176] fix os_name detection --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 6eba20e0..7ee3e157 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2059,7 +2059,7 @@ function install_mongod() { os_name="Debian" fi - if [[ $(lsb_release -d) = *Debian* ]]; then + if [[ $(lsb_release -d) = *Ubuntu* ]]; then os_name="Ubuntu" fi #Ubuntu MongoDB 4.4 From 358e47d7f4b03ef2f5426dbc6d7bfc7cb91da6e6 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 17:02:41 +0100 Subject: [PATCH 0992/1176] fix mongod_db_fix --- multitoolbox.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index c2ee329d..f0a40ca9 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -755,6 +755,7 @@ function mongod_db_fix() { echo -e "${ARROW} ${CYAN}Installing MongoDB... ${NC}" avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) if [[ "$avx_check" == "" ]]; then + sudo apt update -y > /dev/null 2>&1 sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 && sleep 2 echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 @@ -762,6 +763,7 @@ function mongod_db_fix() { echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 else + sudo apt update -y > /dev/null 2>&1 DEBIAN_FRONTEND=noninteractive sudo apt-get --yes install mongodb-org > /dev/null 2>&1 fi sudo mkdir -p /var/log/mongodb > /dev/null 2>&1 @@ -774,6 +776,7 @@ function mongod_db_fix() { #echo -e "${ARROW} ${CYAN}Restoring Database... ${NC}" #mongorestore --drop --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" + sudo systemctl enable mongod sudo systemctl start mongod if mongod --version > /dev/null 2>&1; then string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." From b01ec93d320f0bc3edf06d0048aaa36993eb0095 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 17:12:14 +0100 Subject: [PATCH 0993/1176] improved mongod_db_fix --- multitoolbox.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f0a40ca9..4fe1cbf2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -754,7 +754,24 @@ function mongod_db_fix() { sudo rm -r /var/lib/mongodb > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Installing MongoDB... ${NC}" avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) - if [[ "$avx_check" == "" ]]; then + os_version=$(lsb_release -rs | tr -d '.') + architecture=$(dpkg --print-architecture) + + if [[ $(lsb_release -d) = *Debian* ]]; then + os_name="Debian" + fi + if [[ $(lsb_release -d) = *Ubuntu* ]]; then + os_name="Ubuntu" + fi + #Ubuntu MongoDB 4.4 + if [[ "$avx_check" == "" && "$os_name" == "Ubuntu" && "$architecture" == "amd64" && "$os_version" -le "2010" ]] || [[ "$os_name" == "Ubuntu" && "$architecture" == "arm64" && "$os_version" -le "2010" ]]; then + install_mongod="4.4" + fi + #Debian MongoDB 4.4 + if [[ "$avx_check" == "" && "$os_name" == "Debian" && "$architecture" == "amd64" && "$os_version" -le "9" ]] || [[ "$os_name" == "Debian" && "$architecture" == "arm64" && "$os_version" -le "9" ]]; then + install_mongod="4.4" + fi + if [[ "$install_mongod" == "4.4" ]]; then sudo apt update -y > /dev/null 2>&1 sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 && sleep 2 From 8f251b9963029c1ecefc56b49f4b6c2b0e13c266 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 23:43:00 +0100 Subject: [PATCH 0994/1176] fix mongod for debian 12 arm --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 7ee3e157..aba2cb47 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2078,7 +2078,7 @@ function install_mongod() { if [[ "$architecture" == "arm64" ]]; then if [[ "$os_name" == "Debian" && "$os_version" -ge "12" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 1 source_set=1 fi if [[ "$os_name" == "Ubuntu" && "$os_version" -ge "2304" ]]; then From 9155808956db761c726be86b63a8d835afdaa2f9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 27 Dec 2023 23:45:26 +0100 Subject: [PATCH 0995/1176] minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index aba2cb47..b126c40b 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2078,7 +2078,7 @@ function install_mongod() { if [[ "$architecture" == "arm64" ]]; then if [[ "$os_name" == "Debian" && "$os_version" -ge "12" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 source_set=1 fi if [[ "$os_name" == "Ubuntu" && "$os_version" -ge "2304" ]]; then From 81fc842ff79e9c1f6c92c6e4c5cdf7ecac29363e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 28 Dec 2023 16:33:36 +0100 Subject: [PATCH 0996/1176] clean logrotate.d --- install_pro.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index c0095fd2..bd9edd9a 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -282,8 +282,9 @@ function wipe_clean() { echo -e "${ARROW} ${CYAN}Removing others files and scripts...${NC}" sudo rm -rf watchgod > /dev/null 2>&1 && sleep 1 sudo rm -rf $BENCH_DIR_LOG && sleep 1 - sudo rm -rf /etc/logrotate.d/mongolog > /dev/null 2>&1 - sudo rm -rf /etc/logrotate.d/zeldebuglog > /dev/null 2>&1 + sudo rm -rf /etc/logrotate.d/bench_debug_log > /dev/null 2>&1 + sudo rm -rf /etc/logrotate.d/daemon_debug_log > /dev/null 2>&1 + sudo rm -rf /etc/logrotate.d/docker_debug_log > /dev/null 2>&1 rm update.sh > /dev/null 2>&1 rm restart_zelflux.sh > /dev/null 2>&1 rm zelnodeupdate.sh > /dev/null 2>&1 From 135c1394e6159168411ea57a569a37f785b5bdf5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 28 Dec 2023 17:23:26 +0100 Subject: [PATCH 0997/1176] install_mongod correction --- flux_common.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index b126c40b..115d386a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2083,7 +2083,7 @@ function install_mongod() { fi if [[ "$os_name" == "Ubuntu" && "$os_version" -ge "2304" ]]; then curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 source_set=1 fi fi @@ -2091,8 +2091,13 @@ function install_mongod() { if [[ "$avx_check" != "" && "$architecture" == "amd64" ]]; then if [[ "$os_name" == "Ubuntu" ]]; then if [[ "$os_version" -ge "2004" ]]; then + if [[ "$os_version" == "2004" ]]; then + codename="focal" + else + codename="jammy" + fi curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu ${codename}/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 source_set=1 else curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 From 76b2c4b94559989de8a76a06f97317423c620510 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:04:31 +0100 Subject: [PATCH 0998/1176] fix noclobber --- flux_common.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 115d386a..66137c20 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -58,7 +58,7 @@ title=black, function watchdog_conf_create(){ sudo touch /home/$USER/watchdog/config.js sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat <<- EOF > /home/$USER/watchdog/config.js + cat <<- EOF >| /home/$USER/watchdog/config.js module.exports = { label: '${node_label}', tier_eps_min: '${eps_limit}', @@ -83,7 +83,7 @@ function fluxos_conf_create(){ fi touch /home/$USER/$FLUX_DIR/config/userconfig.js - cat <<- EOF > /home/$USER/$FLUX_DIR/config/userconfig.js + cat <<- EOF >| /home/$USER/$FLUX_DIR/config/userconfig.js module.exports = { initial: { ipaddress: '${WANIP}', @@ -100,7 +100,7 @@ function flux_daemon_conf_create() { RPCUSER=$(pwgen -1 8 -n) PASSWORD=$(pwgen -1 20 -n) touch /home/$USER/$CONFIG_DIR/$CONFIG_FILE - cat <<- EOF > /home/$USER/$CONFIG_DIR/$CONFIG_FILE + cat <<- EOF >| /home/$USER/$CONFIG_DIR/$CONFIG_FILE rpcuser=$RPCUSER rpcpassword=$PASSWORD rpcallowip=127.0.0.1 @@ -230,7 +230,7 @@ function flux_daemon_conf_create() { function install_conf_create(){ sudo touch /home/$USER/install_conf.json sudo chown $USER:$USER /home/$USER/install_conf.json - cat <<- EOF > /home/$USER/install_conf.json + cat <<- EOF >| /home/$USER/install_conf.json { "import_settings": "${import_settings}", "prvkey": "${prvkey}", @@ -708,9 +708,9 @@ function smart_install_conf(){ fi if [[ ! -f /home/$USER/install_conf.json ]]; then - echo "{}" > install_conf.json + echo "{}" >| install_conf.json fi - echo "$(jq -r --arg key "$1" --arg value "$2" '.[$key]=$value' install_conf.json)" > install_conf.json + echo "$(jq -r --arg key "$1" --arg value "$2" '.[$key]=$value' install_conf.json)" >| install_conf.json } function config_smart_create() { From 788205649fbd59618597e26844f2d5405e5f4d61 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 30 Dec 2023 13:06:55 +0100 Subject: [PATCH 0999/1176] fix eps --- hardwarebench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index a4bc6ff3..cf23f0a3 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -78,7 +78,7 @@ echo -e "| RAM: ${CYAN}${ram}${NC}" echo -e "-------------------------" echo -e "| CPU BENCHMARK" echo -e "-------------------------" -eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk -v cpu=$vcore '{print $4*cpu}') +eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk -v cpu=$core '{print $4*cpu}') if [[ "$(dpkg --print-architecture)" = *"Jetson"* ]]; then cumulus_ram=3 From 5cb21bf593bd8a58686c25ae1f20d7056e25febb Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 30 Dec 2023 17:05:23 +0100 Subject: [PATCH 1000/1176] fix benchmark --- hardwarebench.sh | 472 ++++++++++++++++++++++++++++------------------- 1 file changed, 287 insertions(+), 185 deletions(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index cf23f0a3..5a8dcb25 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash +LC_ALL="en_US.UTF-8" +LC_NUMERIC="en_US.UTF-8" +LANG="en_US.UTF-8" +LANGUAGE="en_US:en" SSD=0 HDD=0 SCORE=0 +RED='\033[1;31m' GREEN='\033[1;32m' NC='\033[0m' CYAN='\033[1;36m' @@ -31,7 +36,7 @@ trap finish EXIT INT TERM dd_benchmark() { - cd $HOME && sudo LC_ALL=C timeout 30s dd if=/dev/zero of=$1/test_$$ bs=64k count=16k conv=fdatasync 2>&1 | \ + cd $HOME && sudo LC_ALL=C timeout 25s dd if=/dev/zero of=$1/test_$$ bs=64k count=16k conv=fdatasync 2>&1 | \ awk -F, ' { io=$NF @@ -78,7 +83,7 @@ echo -e "| RAM: ${CYAN}${ram}${NC}" echo -e "-------------------------" echo -e "| CPU BENCHMARK" echo -e "-------------------------" -eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk -v cpu=$core '{print $4*cpu}') + if [[ "$(dpkg --print-architecture)" = *"Jetson"* ]]; then cumulus_ram=3 @@ -86,227 +91,290 @@ else cumulus_ram=7 fi -if [[ "$ram" -ge "$cumulus_ram" ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]] && [[ "${eps%%.*}" -ge 240 ]]; then +if [[ "$ram" -ge "$cumulus_ram" ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]]; then status="CUMULUS" fi -if [[ "$ram" -ge 30 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]] && [[ "${eps%%.*}" -ge 640 ]]; then +if [[ "$ram" -ge 30 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]]; then status="NIMBUS" fi -if [[ "$ram" -ge 61 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]] && [[ "${eps%%.*}" -ge 1520 ]]; then +if [[ "$ram" -ge 61 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]]; then status="STRATUS" fi if [[ "$status" == "" ]]; then status="FAILED" fi + + echo -e "| CPU vcores: ${CYAN}${vcore}${NC}" echo -e "| CPU cores: ${CYAN}${core}${NC}" -echo -e "| EPS: ${CYAN}${eps}${NC}" + + +if [[ "$ram" -ge "$cumulus_ram" ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]]; then + status="CUMULUS" +fi +if [[ "$ram" -ge 30 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]]; then + status="NIMBUS" +fi +if [[ "$ram" -ge 61 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]]; then + status="STRATUS" +fi +if [[ "$status" == "" ]]; then + status="FAILED" +fi + + outputdiskbench="Disks Bench:"; #checking loop for lxc only if mount == '/' -loop_mount=$(cd $HOME && LC_ALL=C lsblk -l -b -n | grep ' loop' | awk '{ if ($7 == "/") printf("%.2f\n", $4/(1024*1024*1024))}') +loop_mount=$(cd $HOME && LC_ALL=C lsblk -l -b -n | grep 'loop' | awk '{ if ($7 == "/") printf("%.2f\n", $4/(1024*1024*1024))}') if [[ "$loop_mount" != "" ]]; then - #echo -e "Device type: loop" - mount_path="/" - io1=$( dd_benchmark "$mount_path" ) - io2=$( dd_benchmark "$mount_path" ) - io3=$( dd_benchmark "$mount_path" ) - if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) - elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) - else - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) - fi - outputdiskbench+=" loop $loop_mount $ioavg" - if [[ "${ioavg%%.*}" -ge "180" ]]; then - SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$loop_mount"')}') - else - HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$loop_mount"')}') - fi -fi -if [[ $outputdiskbench == "Disks Bench:" ]]; then - lvm_mount="" - raid_list=() - disc__array=($(cd $HOME && LC_ALL=C lsblk -o NAME,SIZE,TYPE -b -n | grep ' disk' | awk '{ if ($2 > 2147483648 && $1 != "mmcblk0" && $1 != "mmcblk0p1") print $1}')) - for((i=0;i<${#disc__array[@]};i++)); - do - #checking if disk structure is accessable - cd $HOME && lsblk -l -b -n /dev/${disc__array[i]} > /dev/null 2>&1 - if [ $? != 0 ]; then - #echo -e "Disk name: ${disc__array[i]}" - #echo -e "Error: Can't grab device stucture... device skipped!" - #echo -e "-----------------------------" - continue + + #echo -e "Device type: loop" + #echo -e "" + mount_path="/" + io1=$( dd_benchmark "$mount_path" ) + #printf '1st run: %s\n' "$(printf '%d\n' "$io1" | Bps_to_MiBps)" + io2=$( dd_benchmark "$mount_path" ) + #printf '2nd run: %s\n' "$(printf '%d\n' "$io2" | Bps_to_MiBps)" + io3=$( dd_benchmark "$mount_path" ) + #printf '3rd run: %s\n' "$(printf '%d\n' "$io3" | Bps_to_MiBps)" + # Calculating avg I/O (better approach with awk for non int values) + + if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) + elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) + else + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi + + echo -e "-----------------------------" + outputdiskbench+=" loop $loop_mount $ioavg" + if [[ "${ioavg%%.*}" -ge "180" ]]; then + SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$loop_mount"')}') + else + HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$loop_mount"')}') + fi + echo -e "$outputdiskbench" + echo -e "" + exit +###In this case we exit no other partition will be tested + +fi +################################# +lvm_mount="" +raid_list=() +#create disk array ( check only disk > 2GB && name not mmcblk0/mmcblk0p1 to not run disk speed on microsd cards ) +disc__array=($(cd $HOME && LC_ALL=C lsblk -o NAME,SIZE,TYPE -b -n | grep ' disk' | awk '{ if ($2 > 2147483648 && $1 != "mmcblk0" && $1 != "mmcblk0p1") print $1}')) +#echo -e "" +#echo -e "Disk count: ${#disc__array[@]}" +#echo -e "-----------------------------" +for((i=0;i<${#disc__array[@]};i++)); +do + #checking if disk structure is accessable + cd $HOME && ./lsblk -l -b -n /dev/${disc__array[i]} > /dev/null 2>&1 + if [ $? != 0 ]; then + echo -e "Disk name: ${disc__array[i]}" + echo -e "Error: Can't grab device stucture... device skipped!" + echo -e "-----------------------------" + continue + fi #checking direct mount - disk_mount_check=$(cd $HOME && LC_ALL=C lsblk -l -b -n /dev/${disc__array[i]} | grep ' disk' | awk '{ if ( $7 == "") print "no"; else print "yes"}') - #echo -e "Direct mount: $disk_mount_check" + disk_mount_check=$(cd $HOME && LC_ALL=C lsblk -l -b -n /dev/${disc__array[i]} | egrep ' disk' | awk '{ if ( $7 == "") print "no"; else print "yes"}') if [[ "$disk_mount_check" == "no" ]]; then #checking lvm mount - lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) - lvm_name=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $1 }' ) - if [[ "$lvm_name" != "" ]]; then - count=$(echo ${mount_list[@]} | tr ' ' '\n' | awk '$1 == "'"$lvm_mount"'"{print $0}' | wc -l) - if [[ "$count" == "0" ]]; then - mount_list+=("$lvm_mount") - else - #echo -e "Disk name: ${disc__array[i]}" - #echo -e "Error: Mount point already checked... device skipped!" - #echo -e "-----------------------------" - continue - fi - fi + lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) + lvm_name=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $1 }' ) + + if [[ "$lvm_name" != "" ]]; then + count=$(echo ${mount_list[@]} | tr ' ' '\n' | awk '$1 == "'"$lvm_mount"'"{print $0}' | wc -l) + if [[ "$count" == "0" ]]; then + mount_list+=("$lvm_mount") + else + echo -e "Disk name: ${disc__array[i]}" + echo -e "Error: Mount point already checked... device skipped!" + echo -e "-----------------------------" + continue + fi + fi + if [[ "$lvm_name" != "" && "$lvm_mount" == "" ]]; then - if [[ ! -d /.benchmark_test ]]; then - sudo mkdir /.benchmark_test - fi - sudo mount /dev/mapper/$lvm_name /.benchmark_test - fi - lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) - if [[ "$lvm_mount" != "" ]]; then - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') - else - #checking if disk partition type is LVM2_member - part_type_check=$(cd $HOME && LC_ALL=C lsblk -o NAME,TYPE,FSTYPE,SIZE -b -n /dev/${disc__array[i]} --sort SIZE | egrep ' part' | egrep 'LVM2_member' | tail -n1 | wc -l) - if [[ "$part_type_check" != "0" ]]; then - #skipp disk - partition_name=$(awk '{print $1}' <<< $part_type_check) - #echo -e "Disk name: ${disc__array[i]}" - #echo -e "Error: LVM2_member partition detected... device skipped!" - #echo -e "-----------------------------" - continue - fi - #checking raid - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' raid' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') - if [[ "$partition_output" == "" ]]; then - #checking part ( when not lvm and raid ) - #echo -e "Checking partition on device: /dev/${disc__array[i]}" - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' part' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') - #echo -e "$partition_output" - #echo -e "-----------------------------" - else - partition_name=$(awk '{print $1}' <<< $partition_output) - #add raid name to skip list - if [[ ! " ${raid_list[@]} " =~ " ${partition_name} " ]]; then - raid_list+=("$partition_name") - else - #skipped raid already tested - #echo -e "Disk name: ${disc__array[i]}" - #echo -e "Info: Disk skipped - raid already tested!" - #echo -e "-----------------------------" - continue - fi - fi + + if [[ ! -d /.benchmark_test ]]; then + sudo mkdir /.benchmark_test + fi + sudo mount /dev/mapper/$lvm_name /.benchmark_test fi + + lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) + + if [[ "$lvm_mount" != "" ]]; then + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') + else + + #checking if disk partition type is LVM2_member + part_type_check=$(cd $HOME && LC_ALL=C lsblk -o NAME,TYPE,FSTYPE,SIZE -b -n /dev/${disc__array[i]} --sort SIZE | egrep ' part' | egrep 'LVM2_member' | tail -n1 | wc -l) + if [[ "$part_type_check" != "0" ]]; then + #skipp disk + partition_name=$(awk '{print $1}' <<< $part_type_check) + echo -e "Disk name: ${disc__array[i]}" + echo -e "Error: LVM2_member partition detected... device skipped!" + echo -e "-----------------------------" + continue + fi + + #checking raid + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' raid' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') + + if [[ "$partition_output" == "" ]]; then + #checking part ( when not lvm and raid ) + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' part' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') + else + + partition_name=$(awk '{print $1}' <<< $partition_output) + #add raid name to skip list + if [[ ! " ${raid_list[@]} " =~ " ${partition_name} " ]]; then + raid_list+=("$partition_name") + else + #skipped raid already tested + echo -e "Disk name: ${disc__array[i]}" + echo -e "Info: Disk skipped - raid already tested!" + echo -e "-----------------------------" + continue + fi + fi + fi + else - #echo -e "Checking partition on device: /dev/${disc__array[i]} (STEP2)..." - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') - #echo -e "$partition_output" - #echo -e "" + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') fi + partition_name=$(awk '{print $1}' <<< $partition_output) partition_size=$(awk '{printf("%.2f",$2)}' <<< $partition_output) - if [[ "$lvm_mount" == "" && "$raid_list" == "" ]]; then + + if [[ "$lvm_mount" == "" && "$raid_list" == "" ]]; then disk_size=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --noheadings | head -n1 | awk '{printf("%.2f",$4/(1024*1024*1024))}') - else - disk_size=$partition_size - fi - if [[ "$lvm_mount" == "" ]]; then + else + disk_size=$partition_size + fi + if [[ "$lvm_mount" == "" ]]; then if [[ ! -d /.benchmark_test ]]; then - sudo mkdir /.benchmark_test + sudo mkdir /.benchmark_test fi sudo mount /dev/$partition_name /.benchmark_test available_space=$(LC_ALL=C df /dev/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else print "null"}') + else + available_space=$(LC_ALL=C df /dev/mapper/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else print "null"}') + fi + #echo -e "Disk Name: ${disc__array[i]}" + #echo -e "Partition: /dev/$partition_name" + #echo -e "Size: $disk_size" + #echo -e "Available space: $available_space" + if [[ "$available_space" != "null" && "$available_space" != "" ]]; then + + if [[ "$lvm_mount" == "" ]]; then + mount_path="/.benchmark_test" + else + mount_path="$lvm_mount" + fi + #echo -e "Mount point: $mount_path" + io1=$( dd_benchmark "$mount_path" ) + #printf ' 1st run: %s\n' "$(printf '%d\n' "$io1" | Bps_to_MiBps)" + io2=$( dd_benchmark "$mount_path" ) + #printf ' 2nd run: %s\n' "$(printf '%d\n' "$io2" | Bps_to_MiBps)" + io3=$( dd_benchmark "$mount_path" ) + #printf ' 3rd run: %s\n' "$(printf '%d\n' "$io3" | Bps_to_MiBps)" + # Calculating avg I/O (better approach with awk for non int values) + if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) + elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) else - available_space=$(LC_ALL=C df /dev/mapper/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else print "null"}') + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi - if [[ "$available_space" != "null" && "$available_space" != "" ]]; then - if [[ "$lvm_mount" == "" ]]; then - mount_path="/.benchmark_test" - else - mount_path="$lvm_mount" - fi - #echo -e "Mount point: $mount_path" - io1=$( dd_benchmark "$mount_path" ) - io2=$( dd_benchmark "$mount_path" ) - io3=$( dd_benchmark "$mount_path" ) - if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) - elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) - else - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) - fi - outputdiskbench+=" ${disc__array[i]} $disk_size $ioavg" - if [[ "${ioavg%%.*}" -ge "180" ]]; then + outputdiskbench+=" ${disc__array[i]} $disk_size $ioavg" + if [[ "${ioavg%%.*}" -ge "180" ]]; then SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$disk_size"')}') - else + else HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$disk_size"')}') + fi + #echo -e "-----------------------------" + if [[ "$lvm_mount" == "" ]]; then + sudo umount /.benchmark_test + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + echo -e "" + else + sudo rm -rf /.benchmark_test fi - if [[ "$lvm_mount" == "" ]]; then - sudo umount /.benchmark_test - if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then - echo -e "" - else - sudo rm -rf /.benchmark_test - fi - fi - #check if test point mounted if exist unmount it LVM case + fi + #check if test point mounted if exist unmount it LVM case + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + sudo umount /.benchmark_test if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then - sudo umount /.benchmark_test - if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then - echo -e "" - else - sudo rm -rf /.benchmark_test - fi + echo -e "" + else + sudo rm -rf /.benchmark_test fi + fi + + else + + echo -e "Error: space not enough... write test skipped!" + echo -e "-----------------------------" + if [[ "$lvm_mount" == "" ]]; then + + sudo umount /.benchmark_test + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + echo -e "" + else + sudo rm -rf /.benchmark_test + fi + fi + fi + +done + +if [[ "$outputdiskbench" == "Disks Bench:" ]]; then + # lsblk failed checking direct mount from df + df_direct_mount=$(LC_ALL=C df --output=source,fstype,size,avail,target | grep 'dev' | awk '{ if ($5 == "/") printf("%s %.2f %.2f\n", $1,$3/(1024*1024),$4/(1024*1024))}') + + if [[ df_direct_mount != "" ]]; then + + device_name=$(awk '{print $1}' <<< $df_direct_mount) + partition_size=$(awk '{print $2}' <<< $df_direct_mount) + + #echo -e "Device name: $device_name" + #echo -e "Device size: $partition_size" + mount_path="/" + #echo -e "Mount point: $mount_path" + io1=$( dd_benchmark "$mount_path" ) + #printf ' 1st run: %s\n' "$(printf '%d\n' "$io1" | Bps_to_MiBps)" + io2=$( dd_benchmark "$mount_path" ) + #printf ' 2nd run: %s\n' "$(printf '%d\n' "$io2" | Bps_to_MiBps)" + io3=$( dd_benchmark "$mount_path" ) + #printf ' 3rd run: %s\n' "$(printf '%d\n' "$io3" | Bps_to_MiBps)" + # Calculating avg I/O (better approach with awk for non int values) + + if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) + elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) else - #echo -e "Error: space not enough... write test skipped!" - #echo -e "-----------------------------" - if [[ "$lvm_mount" == "" ]]; then - sudo umount /.benchmark_test - if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then - echo -e "" - else - sudo rm -rf /.benchmark_test - fi - fi + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi - done - if [[ "$outputdiskbench" == "Disks Bench:" ]]; then - # lsblk failed checking direct mount from df - df_direct_mount=$(LC_ALL=C df --output=source,fstype,size,avail,target | grep 'dev' | awk '{ if ($5 == "/") printf("%s %.2f %.2f\n", $1,$3/(1024*1024),$4/(1024*1024))}') - if [[ df_direct_mount != "" ]]; then - device_name=$(awk '{print $1}' <<< $df_direct_mount) - partition_size=$(awk '{print $2}' <<< $df_direct_mount) - mount_path="/" - io1=$( dd_benchmark "$mount_path" ) - io2=$( dd_benchmark "$mount_path" ) - io3=$( dd_benchmark "$mount_path" ) - if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) - elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) - else - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) - fi - outputdiskbench+=" $device_name $partition_size $ioavg" - if [[ "${ioavg%%.*}" -ge "180" ]]; then + + echo -e "-----------------------------" + outputdiskbench+=" $device_name $partition_size $ioavg" + if [[ "${ioavg%%.*}" -ge "180" ]]; then SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$partition_size"')}') - else + else HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$partition_size"')}') - fi fi + #echo -e "$outputdiskbench" + #echo -e "" fi fi -echo -e "-------------------------" -echo -e "| DISK BENCHMARK" -echo -e "-------------------------" -echo -e "| SSD: ${CYAN}${SSD}${NC}" -echo -e "| HDD: ${CYAN}${HDD}${NC}" -echo -e "-------------------------" if [[ $status == "CUMULUS" ]]; then SCORE=1 fi @@ -316,22 +384,56 @@ fi if [[ $status == "STRATUS" ]]; then SCORE=3 fi - - if [[ "$SSD" -lt 220 ]] || [[ "$SCORE" == 0 ]] ; then status="FAILED" fi if [[ "$SSD" -ge 220 ]] && [[ "$SCORE" -ge 1 ]]; then - status="${GREEN}CUMULUS${NC}" + status="CUMULUS" + eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk '{print $4*4}') fi if [[ "$HDD" -ge 9200 ]] && [[ "$SCORE" -ge 1 ]]; then - status="${GREEN}THUNDER${NC}" + status="THUNDER" + eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk '{print $4*4}') fi if [[ "$SSD" -ge 440 ]] && [[ "$SCORE" -ge 2 ]]; then - status="${GREEN}NIMBUS${NC}" + status="NIMBUS" + eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk '{print $4*8}') fi if [[ "$SSD" -ge 880 ]] && [[ "$SCORE" -ge 3 ]] ; then - status="${GREEN}STRATUS${NC}" + if [[ "${ioavg%%.*}" -ge "400" ]] && [[ "$(dpkg --print-architecture)" == "amd64" ]]; then + status="STRATUS" + eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk '{print $4*16}') + else + status="NIMBUS" + eps=$(LC_ALL=C sysbench cpu --cpu-max-prime=60000 --time=20 run 2> /dev/null | grep 'events per second' | awk '{print $4*8}') + fi +fi +if [[ "${eps%%.*}" -lt 240 ]]; then + status="FAILED" +fi +if [[ "${eps%%.*}" -ge 240 && "$status" == "THUNDER" ]]; then + status="THUNDER" +fi +if [[ "${eps%%.*}" -ge 240 && "$status" == "CUMULUS" ]]; then + status="CUMULUS" +fi +if [[ "${eps%%.*}" -ge 640 && "$status" == "NIMBUS" ]]; then + status="NIMBUS" +fi +if [[ "${eps%%.*}" -ge 1520 && "$status" == "STRATUS" ]]; then + status="STRATUS" +fi +echo -e "| EPS: ${CYAN}${eps}${NC}" +echo -e "-------------------------" +echo -e "| DISK BENCHMARK" +echo -e "-------------------------" +echo -e "| SSD: ${CYAN}${SSD}${NC}" +echo -e "| HDD: ${CYAN}${HDD}${NC}" +echo -e "| WRITESPEED: ${CYAN}${ioavg%%.*}${NC}" +echo -e "-------------------------" +if [[ "$status" != "FAILED" ]]; then +echo -e "| Benchmark: ${GREEN}$status${NC}" +else +echo -e "| Benchmark: ${RED}$status${NC}" fi -echo -e "| Benchmark: $status" echo -e "-------------------------" From e4245705e5089b69322b0ca7ac485c6055db102a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 31 Dec 2023 00:57:33 +0100 Subject: [PATCH 1001/1176] update os_check --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 66137c20..001a9e71 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1156,11 +1156,11 @@ function os_check(){ echo -e "${WORNING} ${CYAN}ERROR: ${RED}OS version $(lsb_release -si) - $(lsb_release -cs) not supported${NC}" if [[ "$architecture" == "amd64" ]]; then echo -e "${WORNING} ${CYNA}AVX CPU instruction set not found and is required to use MongoDB on $(lsb_release -cs)${NC}" - echo -e "${WORNING} ${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation${NC}" + echo -e "${WORNING} ${CYNA}The last version supporting CPUs without AVX is Ubuntu 20.04 LTS. Please re-image and retry installation.${NC}" fi if [[ "$architecture" == "arm64" ]]; then echo -e "${WORNING} ${CYNA}ARMv8.2-A or later microarchitecture is required to use MongoDB on $(lsb_release -cs)${NC}" - echo -e "${WORNING} ${CYNA}Ubuntu 20.04 LTS is the recommended OS version... please re-image and retry installation${NC}" + echo -e "${WORNING} ${CYNA}If you're using ARM architecture older than ARMv8.2-A, it's recommended to use Ubuntu 20.04 LTS. Please re-image and retry installation.${NC}" fi echo -e "${WORNING} ${CYAN}Installation stopped...${NC}" echo From c410f0a8dbbd1648ceb8020139d0ccb61be0028a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 31 Dec 2023 11:10:37 +0100 Subject: [PATCH 1002/1176] updated asc server --- flux_common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 001a9e71..19bb42e9 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2064,25 +2064,25 @@ function install_mongod() { fi #Ubuntu MongoDB 4.4 if [[ "$avx_check" == "" && "$os_name" == "Ubuntu" && "$architecture" == "amd64" && "$os_version" -le "2010" ]] || [[ "$os_name" == "Ubuntu" && "$architecture" == "arm64" && "$os_version" -le "2010" ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + curl -fsSL https://pgp.mongodb.com/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 source_set=2 fi #Debian MongoDB 4.4 if [[ "$avx_check" == "" && "$os_name" == "Debian" && "$architecture" == "amd64" && "$os_version" -le "9" ]] || [[ "$os_name" == "Debian" && "$architecture" == "arm64" && "$os_version" -le "9" ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + curl -fsSL https://pgp.mongodb.com/server-4.4.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list > /dev/null 2>&1 source_set=2 fi #ARM MongoDB 7.0 if [[ "$architecture" == "arm64" ]]; then if [[ "$os_name" == "Debian" && "$os_version" -ge "12" ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + curl -fsSL https://pgp.mongodb.com/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 source_set=1 fi if [[ "$os_name" == "Ubuntu" && "$os_version" -ge "2304" ]]; then - curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 + curl -fsSL https://pgp.mongodb.com/server-7.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-archive-keyring.gpg > /dev/null 2>&1 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list > /dev/null 2>&1 source_set=1 fi From 90804f6fead7a5361ff34827ec18f0e826c7ce6d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 31 Dec 2023 13:52:58 +0100 Subject: [PATCH 1003/1176] bump version --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4fe1cbf2..f6a63ab9 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -29,7 +29,7 @@ fi FLUX_DIR='zelflux' FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' -dversion="v7.7" +dversion="v7.8" PM2_INSTALL="0" zelflux_setting_import="0" OS_FLAGE="$2" From 39da2dfccd4ad178cd563d55fc692d7b7711120a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 6 Jan 2024 12:39:27 +0100 Subject: [PATCH 1004/1176] re-install fluxos improvement --- multitoolbox.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index bd0d0b2b..0a9f8e2a 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -162,7 +162,7 @@ function install_flux() { upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | egrep -o '[0-9]+') if [[ "$upnp_port" != "" ]]; then - echo -e "${PIN}${CYAN}UPnP port = ${GREEN}$upnp_port${NC}" + echo -e "${PIN}${CYAN}API port = ${GREEN}$upnp_port${NC}" fi router_ip=$(grep -w routerIP /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*routerIP: .//' | sed -e 's/.\{2\}$//') @@ -241,7 +241,7 @@ function install_flux() { fluxos_conf_create if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then if [[ "$upnp_port" != "" ]]; then - config_builder "apiport" "$upnp_port" "UPnP Port" "fluxos" + config_builder "apiport" "$upnp_port" "API Port" "fluxos" fi if [[ "$router_ip" != "" ]]; then config_builder "routerIP" "$router_ip" "Router IP" "fluxos" @@ -269,7 +269,7 @@ function install_flux() { echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" echo -e "" - pm2 start /home/$USER/$FLUX_DIR/start.sh --restart-delay=60000 --max-restarts=40 --name flux --time > /dev/null 2>&1 + pm2 start /home/$USER/$FLUX_DIR/start.sh --max-memory-restart 1500M --restart-delay 30000 --max-restarts 40 --name flux --time > /dev/null 2>&1 pm2 save > /dev/null 2>&1 pm2 list else From a47a9543b01077621b69fcf948b98c26c7c0b92c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 6 Jan 2024 12:41:18 +0100 Subject: [PATCH 1005/1176] max-memory-restart 1500M --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 19bb42e9..d016cede 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2317,7 +2317,7 @@ function pm2_install(){ } function finalizing() { cd - pm2 start /home/$USER/$FLUX_DIR/start.sh --max-memory-restart 2G --restart-delay 30000 --max-restarts 40 --name flux --time > /dev/null 2>&1 + pm2 start /home/$USER/$FLUX_DIR/start.sh --max-memory-restart 1500M --restart-delay 30000 --max-restarts 40 --name flux --time > /dev/null 2>&1 pm2 save > /dev/null 2>&1 #sleep 120 #cd /home/$USER/zelflux From ce25471405d2e1aa531b473e35eaa12bdbacc7d8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 6 Jan 2024 19:31:05 +0100 Subject: [PATCH 1006/1176] disabled disk logs --- hardwarebench.sh | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index 5a8dcb25..7ae558b8 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -147,7 +147,7 @@ if [[ "$loop_mount" != "" ]]; then ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi - echo -e "-----------------------------" + #echo -e "-----------------------------" outputdiskbench+=" loop $loop_mount $ioavg" if [[ "${ioavg%%.*}" -ge "180" ]]; then SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$loop_mount"')}') @@ -173,9 +173,9 @@ do #checking if disk structure is accessable cd $HOME && ./lsblk -l -b -n /dev/${disc__array[i]} > /dev/null 2>&1 if [ $? != 0 ]; then - echo -e "Disk name: ${disc__array[i]}" - echo -e "Error: Can't grab device stucture... device skipped!" - echo -e "-----------------------------" + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Error: Can't grab device stucture... device skipped!" + #echo -e "-----------------------------" continue fi #checking direct mount @@ -190,9 +190,9 @@ do if [[ "$count" == "0" ]]; then mount_list+=("$lvm_mount") else - echo -e "Disk name: ${disc__array[i]}" - echo -e "Error: Mount point already checked... device skipped!" - echo -e "-----------------------------" + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Error: Mount point already checked... device skipped!" + #echo -e "-----------------------------" continue fi fi @@ -216,9 +216,9 @@ do if [[ "$part_type_check" != "0" ]]; then #skipp disk partition_name=$(awk '{print $1}' <<< $part_type_check) - echo -e "Disk name: ${disc__array[i]}" - echo -e "Error: LVM2_member partition detected... device skipped!" - echo -e "-----------------------------" + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Error: LVM2_member partition detected... device skipped!" + #echo -e "-----------------------------" continue fi @@ -236,9 +236,9 @@ do raid_list+=("$partition_name") else #skipped raid already tested - echo -e "Disk name: ${disc__array[i]}" - echo -e "Info: Disk skipped - raid already tested!" - echo -e "-----------------------------" + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Info: Disk skipped - raid already tested!" + #echo -e "-----------------------------" continue fi fi @@ -320,8 +320,8 @@ do else - echo -e "Error: space not enough... write test skipped!" - echo -e "-----------------------------" + #echo -e "Error: space not enough... write test skipped!" + #echo -e "-----------------------------" if [[ "$lvm_mount" == "" ]]; then sudo umount /.benchmark_test @@ -364,7 +364,7 @@ if [[ "$outputdiskbench" == "Disks Bench:" ]]; then ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi - echo -e "-----------------------------" + #echo -e "-----------------------------" outputdiskbench+=" $device_name $partition_size $ioavg" if [[ "${ioavg%%.*}" -ge "180" ]]; then SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$partition_size"')}') @@ -423,7 +423,9 @@ fi if [[ "${eps%%.*}" -ge 1520 && "$status" == "STRATUS" ]]; then status="STRATUS" fi -echo -e "| EPS: ${CYAN}${eps}${NC}" +if [[ "$status" != "FAILED" ]]; then + echo -e "| EPS: ${CYAN}${eps}${NC}" +fi echo -e "-------------------------" echo -e "| DISK BENCHMARK" echo -e "-------------------------" From 976ba5a80b9784ece46f2feec618d43e0b4f6b28 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Jan 2024 00:45:28 +0100 Subject: [PATCH 1007/1176] added dynamic array handling for addnode --- flux_common.sh | 127 ++++++++++--------------------------------------- 1 file changed, 25 insertions(+), 102 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index d016cede..a9231d1c 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -97,6 +97,28 @@ module.exports = { EOF } function flux_daemon_conf_create() { + nodes=( + "80.211.207.17" "95.217.12.176" "89.58.3.209" "161.97.85.103" "194.163.176.185" + "explorer.flux.zelcore.io" "explorer.runonflux.io" "explorer.zelcash.online" "blockbook.runonflux.io" "202.61.202.21" + "89.58.40.172" "37.120.176.206" "66.119.15.83" "66.94.118.208" "99.48.162.169" + "97.120.40.143" "99.48.162.167" "108.30.50.162" "154.12.242.89" "67.43.96.139" + "66.94.107.219" "66.94.110.117" "154.12.225.203" "176.9.72.41" "65.108.198.119" + "65.108.200.110" "46.38.251.110" "95.214.55.47" "202.61.236.202" "65.108.141.153" + "178.170.46.91" "66.119.15.64" "65.108.46.178" "94.130.220.41" "178.170.48.110" + "78.35.147.57" "66.119.15.101" "66.119.15.96" "38.88.125.25" "66.119.15.110" + "103.13.31.149" "212.80.212.238" "212.80.213.172" "212.80.212.228" "121.112.224.186" + "114.181.141.16" "167.179.115.100" "153.226.219.80" "24.79.73.50" "76.68.219.102" + "70.52.20.8" "184.145.181.147" "68.150.72.135" "198.27.83.181" "167.114.82.63" + "24.76.166.6" "173.33.170.150" "99.231.229.245" "70.82.102.140" "192.95.30.188" + "75.158.245.77" "142.113.239.49" "66.70.176.241" "174.93.146.224" "216.232.124.38" + "207.34.248.197" "76.68.219.102" "149.56.25.82" "74.57.74.166" "142.169.180.47" + "70.67.210.148" "86.5.78.14" "87.244.105.94" "86.132.192.193" "86.27.168.85" + "86.31.168.107" "84.71.79.220" "154.57.235.104" "86.13.102.145" "86.31.168.107" + "86.13.68.100" "151.225.136.163" "5.45.110.123" "45.142.178.251" "89.58.5.234" + "45.136.30.81" "202.61.255.238" "89.58.7.2" "89.58.36.46" "89.58.32.76" "89.58.39.81" + "89.58.39.153" "202.61.244.71" "89.58.37.172" "89.58.36.118" "31.145.161.44" "217.131.61.221" + "80.28.72.254" "85.49.210.36" "84.77.69.203" "51.38.1.195" "51.38.1.194" + ) RPCUSER=$(pwgen -1 8 -n) PASSWORD=$(pwgen -1 20 -n) touch /home/$USER/$CONFIG_DIR/$CONFIG_FILE @@ -122,109 +144,10 @@ function flux_daemon_conf_create() { listen=1 externalip=$WANIP bind=0.0.0.0 - addnode=80.211.207.17 - addnode=95.217.12.176 - addnode=89.58.3.209 - addnode=161.97.85.103 - addnode=194.163.176.185 - addnode=explorer.flux.zelcore.io - addnode=explorer.runonflux.io - addnode=explorer.zelcash.online - addnode=blockbook.runonflux.io - addnode=202.61.202.21 - addnode=89.58.40.172 - addnode=37.120.176.206 - addnode=66.119.15.83 - addnode=66.94.118.208 - addnode=99.48.162.169 - addnode=97.120.40.143 - addnode=99.48.162.167 - addnode=108.30.50.162 - addnode=154.12.242.89 - addnode=67.43.96.139 - addnode=66.94.107.219 - addnode=66.94.110.117 - addnode=154.12.225.203 - addnode=176.9.72.41 - addnode=65.108.198.119 - addnode=65.108.200.110 - addnode=46.38.251.110 - addnode=95.214.55.47 - addnode=202.61.236.202 - addnode=65.108.141.153 - addnode=178.170.46.91 - addnode=66.119.15.64 - addnode=65.108.46.178 - addnode=94.130.220.41 - addnode=178.170.48.110 - addnode=78.35.147.57 - addnode=66.119.15.101 - addnode=66.119.15.96 - addnode=38.88.125.25 - addnode=66.119.15.110 - addnode=103.13.31.149 - addnode=212.80.212.238 - addnode=212.80.213.172 - addnode=212.80.212.228 - addnode=121.112.224.186 - addnode=114.181.141.16 - addnode=167.179.115.100 - addnode=153.226.219.80 - addnode=24.79.73.50 - addnode=76.68.219.102 - addnode=70.52.20.8 - addnode=184.145.181.147 - addnode=68.150.72.135 - addnode=198.27.83.181 - addnode=167.114.82.63 - addnode=24.76.166.6 - addnode=173.33.170.150 - addnode=99.231.229.245 - addnode=70.82.102.140 - addnode=192.95.30.188 - addnode=75.158.245.77 - addnode=142.113.239.49 - addnode=66.70.176.241 - addnode=174.93.146.224 - addnode=216.232.124.38 - addnode=207.34.248.197 - addnode=76.68.219.102 - addnode=149.56.25.82 - addnode=74.57.74.166 - addnode=142.169.180.47 - addnode=70.67.210.148 - addnode=86.5.78.14 - addnode=87.244.105.94 - addnode=86.132.192.193 - addnode=86.27.168.85 - addnode=86.31.168.107 - addnode=84.71.79.220 - addnode=154.57.235.104 - addnode=86.13.102.145 - addnode=86.31.168.107 - addnode=86.13.68.100 - addnode=151.225.136.163 - addnode=5.45.110.123 - addnode=45.142.178.251 - addnode=89.58.5.234 - addnode=45.136.30.81 - addnode=202.61.255.238 - addnode=89.58.7.2 - addnode=89.58.36.46 - addnode=89.58.32.76 - addnode=89.58.39.81 - addnode=89.58.39.153 - addnode=202.61.244.71 - addnode=89.58.37.172 - addnode=89.58.36.118 - addnode=31.145.161.44 - addnode=217.131.61.221 - addnode=80.28.72.254 - addnode=85.49.210.36 - addnode=84.77.69.203 - addnode=51.38.1.195 - addnode=51.38.1.194 maxconnections=256 + + #Addnode list + $(IFS=$'\n'; for nodes in "${nodes[@]}"; do echo "addnode=$nodes"; done) EOF } function install_conf_create(){ From eb99a2e0227f4949d7bc5f313784d2ee659f3531 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Jan 2024 13:07:57 +0100 Subject: [PATCH 1008/1176] improved addnode --- flux_common.sh | 94 +++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 51 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index a9231d1c..dbb98e7d 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -96,60 +96,52 @@ module.exports = { } EOF } + function flux_daemon_conf_create() { - nodes=( - "80.211.207.17" "95.217.12.176" "89.58.3.209" "161.97.85.103" "194.163.176.185" - "explorer.flux.zelcore.io" "explorer.runonflux.io" "explorer.zelcash.online" "blockbook.runonflux.io" "202.61.202.21" - "89.58.40.172" "37.120.176.206" "66.119.15.83" "66.94.118.208" "99.48.162.169" - "97.120.40.143" "99.48.162.167" "108.30.50.162" "154.12.242.89" "67.43.96.139" - "66.94.107.219" "66.94.110.117" "154.12.225.203" "176.9.72.41" "65.108.198.119" - "65.108.200.110" "46.38.251.110" "95.214.55.47" "202.61.236.202" "65.108.141.153" - "178.170.46.91" "66.119.15.64" "65.108.46.178" "94.130.220.41" "178.170.48.110" - "78.35.147.57" "66.119.15.101" "66.119.15.96" "38.88.125.25" "66.119.15.110" - "103.13.31.149" "212.80.212.238" "212.80.213.172" "212.80.212.228" "121.112.224.186" - "114.181.141.16" "167.179.115.100" "153.226.219.80" "24.79.73.50" "76.68.219.102" - "70.52.20.8" "184.145.181.147" "68.150.72.135" "198.27.83.181" "167.114.82.63" - "24.76.166.6" "173.33.170.150" "99.231.229.245" "70.82.102.140" "192.95.30.188" - "75.158.245.77" "142.113.239.49" "66.70.176.241" "174.93.146.224" "216.232.124.38" - "207.34.248.197" "76.68.219.102" "149.56.25.82" "74.57.74.166" "142.169.180.47" - "70.67.210.148" "86.5.78.14" "87.244.105.94" "86.132.192.193" "86.27.168.85" - "86.31.168.107" "84.71.79.220" "154.57.235.104" "86.13.102.145" "86.31.168.107" - "86.13.68.100" "151.225.136.163" "5.45.110.123" "45.142.178.251" "89.58.5.234" - "45.136.30.81" "202.61.255.238" "89.58.7.2" "89.58.36.46" "89.58.32.76" "89.58.39.81" - "89.58.39.153" "202.61.244.71" "89.58.37.172" "89.58.36.118" "31.145.161.44" "217.131.61.221" - "80.28.72.254" "85.49.210.36" "84.77.69.203" "51.38.1.195" "51.38.1.194" + explorers=( + "explorer.runonflux.io" + "explorer.zelcash.online" + "blockbook.runonflux.io" + "explorer.zelcash.online" ) - RPCUSER=$(pwgen -1 8 -n) - PASSWORD=$(pwgen -1 20 -n) - touch /home/$USER/$CONFIG_DIR/$CONFIG_FILE - cat <<- EOF >| /home/$USER/$CONFIG_DIR/$CONFIG_FILE - rpcuser=$RPCUSER - rpcpassword=$PASSWORD - rpcallowip=127.0.0.1 - rpcallowip=172.18.0.1 - rpcport=$RPCPORT - port=$PORT - zelnode=1 - zelnodeprivkey=$zelnodeprivkey - zelnodeoutpoint=$zelnodeoutpoint - zelnodeindex=$zelnodeindex - server=1 - daemon=1 - txindex=1 - addressindex=1 - timestampindex=1 - spentindex=1 - insightexplorer=1 - experimentalfeatures=1 - listen=1 - externalip=$WANIP - bind=0.0.0.0 - maxconnections=256 - - #Addnode list - $(IFS=$'\n'; for nodes in "${nodes[@]}"; do echo "addnode=$nodes"; done) - EOF + selected_ips=($(curl -s -m 20 https://api.runonflux.io/apps/enterprisenodes | jq -r '.data[] | select(.score >= 2200 and .score <= 3000) | .ip' 2>/dev/null | shuf -n 25)) + nodes=("${selected_ips[@]}" "${explorers[@]}") + RPCUSER=$(pwgen -1 8 -n) + PASSWORD=$(pwgen -1 20 -n) + touch /home/$USER/$CONFIG_DIR/$CONFIG_FILE + { + cat <<- EOF + rpcuser=$RPCUSER + rpcpassword=$PASSWORD + rpcallowip=127.0.0.1 + rpcallowip=172.18.0.1 + rpcport=$RPCPORT + port=$PORT + zelnode=1 + zelnodeprivkey=$zelnodeprivkey + zelnodeoutpoint=$zelnodeoutpoint + zelnodeindex=$zelnodeindex + server=1 + daemon=1 + txindex=1 + addressindex=1 + timestampindex=1 + spentindex=1 + insightexplorer=1 + experimentalfeatures=1 + listen=1 + externalip=$WANIP + bind=0.0.0.0 + maxconnections=256 + # Addnode list + EOF + IFS=$'\n' + for node in "${nodes[@]}"; do + echo "addnode=$node" + done + } | sed 's/^[[:space:]]*//' >| /home/$USER/$CONFIG_DIR/$CONFIG_FILE } + function install_conf_create(){ sudo touch /home/$USER/install_conf.json sudo chown $USER:$USER /home/$USER/install_conf.json From b2b22c39a67fc146216214e8a3b3ac720672b6a0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Jan 2024 13:42:30 +0100 Subject: [PATCH 1009/1176] fix --- flux_common.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index dbb98e7d..719c5719 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -74,14 +74,13 @@ function watchdog_conf_create(){ } EOF } -function fluxos_conf_create(){ +function fluxos_conf_create(){ if [[ "$1" == "true" ]]; then testnet=true else testnet=false fi - touch /home/$USER/$FLUX_DIR/config/userconfig.js cat <<- EOF >| /home/$USER/$FLUX_DIR/config/userconfig.js module.exports = { @@ -134,7 +133,7 @@ function flux_daemon_conf_create() { bind=0.0.0.0 maxconnections=256 # Addnode list - EOF +EOF IFS=$'\n' for node in "${nodes[@]}"; do echo "addnode=$node" From 6b357665e5142aa1bd4dc1844b03d12e899dc41b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 7 Jan 2024 13:53:12 +0100 Subject: [PATCH 1010/1176] removed duplication --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 719c5719..702139bc 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -101,7 +101,7 @@ function flux_daemon_conf_create() { "explorer.runonflux.io" "explorer.zelcash.online" "blockbook.runonflux.io" - "explorer.zelcash.online" + "explorer.flux.zelcore.io" ) selected_ips=($(curl -s -m 20 https://api.runonflux.io/apps/enterprisenodes | jq -r '.data[] | select(.score >= 2200 and .score <= 3000) | .ip' 2>/dev/null | shuf -n 25)) nodes=("${selected_ips[@]}" "${explorers[@]}") From 55245c1f356a357ea6d03cbbd180998461261ffa Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:39:33 +0100 Subject: [PATCH 1011/1176] added permission check in service start scripts --- flux_common.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 702139bc..1b300888 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2317,7 +2317,33 @@ function create_service_scripts() { #emoji codes BOOK="${RED}\xF0\x9F\x93\x8B${NC}" WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + directory="/usr/local/bin" + current_user="$USER" sleep 2 + # Check if the directory exists + if [ -d "$directory" ]; then + echo "Checking for files in $directory..." + # Use find to search for all files in the directory + all_files=$(find "$directory" -maxdepth 1) + if [ -n "$all_files" ]; then + # Identify files not owned by the current user + non_user_files=$(find "$directory" -maxdepth 1 ! -user "$current_user") + if [ -n "$non_user_files" ]; then + echo "Files not owned by $current_user found:" + echo "$non_user_files" + # Change ownership of non-user files to the current user + echo "Changing ownership to $current_user..." + sudo chown "$current_user":"$current_user" $non_user_files + echo "Ownership changed successfully." + else + echo "All files are owned by $current_user." + fi + else + echo "No files found in $directory." + fi + else + echo "Directory $directory does not exist." + fi echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" bench_status_pind=$(pgrep fluxbenchd) From 8d63c1004a18b9fa4cb7bb5fd54ee309fe6e282c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:15:17 +0100 Subject: [PATCH 1012/1176] fix round function --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 1b300888..d9895a97 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1116,7 +1116,7 @@ function fluxos_clean(){ } function round() { - printf "%.${2}f" "${1}" + LC_NUMERIC=C printf "%.${2}f" "${1}" } function insertAfter() { local file="$1" line="$2" newText="$3" From 9f6b26b8c7c61c766c1e22382d4af4d09368fca7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:57:27 +0100 Subject: [PATCH 1013/1176] fix formating --- flux_common.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index d9895a97..a85fd386 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2309,14 +2309,14 @@ function create_service_scripts() { sudo touch /home/$USER/start_daemon_service.sh sudo chown $USER:$USER /home/$USER/start_daemon_service.sh cat <<-'EOF' > /home/$USER/start_daemon_service.sh - #!/bin/bash - #color codes - RED='\033[1;31m' - CYAN='\033[1;36m' - NC='\033[0m' - #emoji codes - BOOK="${RED}\xF0\x9F\x93\x8B${NC}" - WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + #!/bin/bash + #color codes + RED='\033[1;31m' + CYAN='\033[1;36m' + NC='\033[0m' + #emoji codes + BOOK="${RED}\xF0\x9F\x93\x8B${NC}" + WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" directory="/usr/local/bin" current_user="$USER" sleep 2 @@ -2403,7 +2403,6 @@ function create_service_scripts() { sudo chmod +x /home/$USER/start_daemon_service.sh } function create_service() { - if [[ "$1" != "install" ]]; then echo -e "${GREEN}Module: Flux Daemon service creator${NC}" echo -e "${YELLOW}================================================================${NC}" From 3ee6ee20c10225414558d7059cba9b590f02f67b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:06:01 +0100 Subject: [PATCH 1014/1176] fix service creator --- multitoolbox.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 0a9f8e2a..4662e543 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -965,8 +965,17 @@ case "$REPLY" in 9) clear sleep 1 + echo -e "${GREEN}Module: Flux Daemon service creator${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi create_service_scripts - create_service + create_service "install" ;; 10) clear From 2d4490300a36b56626d88be323b362616a5e6d19 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:11:11 +0100 Subject: [PATCH 1015/1176] Minior edit --- multitoolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 4662e543..40ad265b 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -976,6 +976,7 @@ case "$REPLY" in fi create_service_scripts create_service "install" + echo -e "" ;; 10) clear From a3e3128e1698e8e2401d09dd87036aece1141b85 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:14:23 +0100 Subject: [PATCH 1016/1176] menu correction --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 40ad265b..76dfbb57 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -910,7 +910,7 @@ echo -e "${CYAN}5 - Restore Flux blockchain from bootstrap${NC}" echo -e "${CYAN}6 - Create FluxNode installation config file${NC}" echo -e "${CYAN}7 - Re-install FluxOS${NC}" echo -e "${CYAN}8 - Flux Daemon Reconfiguration${NC}" -echo -e "${CYAN}9 - Create Flux daemon service ( for old nodes )${NC}" +echo -e "${CYAN}9 - Create Flux daemon service${NC}" echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}11 - FluxOS config management ${NC}" echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" From 1bfb0dc479c6d1f07a2f92fd16c361d07a653d12 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:35:38 +0100 Subject: [PATCH 1017/1176] Create start_daemon_service.sh --- scripts/start_daemon_service.sh | 78 +++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 scripts/start_daemon_service.sh diff --git a/scripts/start_daemon_service.sh b/scripts/start_daemon_service.sh new file mode 100644 index 00000000..78cd2b7f --- /dev/null +++ b/scripts/start_daemon_service.sh @@ -0,0 +1,78 @@ +#!/bin/bash +#color codes +RED='\033[1;31m' +CYAN='\033[1;36m' +NC='\033[0m' +#emoji codes +BOOK="${RED}\xF0\x9F\x93\x8B${NC}" +WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" +directory="/usr/local/bin" +current_user="$USER" +sleep 2 +# Check if the directory exists +if [ -d "$directory" ]; then + echo "Checking for files in $directory..." + # Use find to search for all files in the directory + all_files=$(find "$directory" -maxdepth 1) + if [ -n "$all_files" ]; then + # Identify files not owned by the current user + non_user_files=$(find "$directory" -maxdepth 1 ! -user "$current_user") + if [ -n "$non_user_files" ]; then + echo "Files not owned by $current_user found:" + echo "$non_user_files" + # Change ownership of non-user files to the current user + echo "Changing ownership to $current_user..." + sudo chown "$current_user":"$current_user" $non_user_files + echo "Ownership changed successfully." + else + echo "All files are owned by $current_user." + fi + else + echo "No files found in $directory." + fi +else + echo "Directory $directory does not exist." +fi +echo -e "${BOOK} ${CYAN}Pre-start process starting...${NC}" +echo -e "${BOOK} ${CYAN}Checking if benchmark or daemon is running${NC}" +bench_status_pind=$(pgrep fluxbenchd) +daemon_status_pind=$(pgrep fluxd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then + echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else + if [[ "$bench_status_pind" != "" ]]; then + echo -e "${WORNING} Running benchmark process detected${NC}" + echo -e "${WORNING} Killing benchmark...${NC}" + sudo killall -9 fluxbenchd > /dev/null 2>&1 && sleep 2 + fi + if [[ "$daemon_status_pind" != "" ]]; then + echo -e "${WORNING} Running daemon process detected${NC}" + echo -e "${WORNING} Killing daemon...${NC}" + sudo killall -9 fluxd > /dev/null 2>&1 && sleep 2 + fi + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi +bench_status_pind=$(pgrep zelbenchd) +daemon_status_pind=$(pgrep zelcashd) +if [[ "$bench_status_pind" == "" && "$daemon_status_pind" == "" ]]; then + echo -e "${BOOK} ${CYAN}No running instance detected...${NC}" +else + if [[ "$bench_status_pind" != "" ]]; then + echo -e "${WORNING} Running benchmark process detected${NC}" + echo -e "${WORNING} Killing benchmark...${NC}" + sudo killall -9 zelbenchd > /dev/null 2>&1 && sleep 2 + fi + if [[ "$daemon_status_pind" != "" ]]; then + echo -e "${WORNING} Running daemon process detected${NC}" + echo -e "${WORNING} Killing daemon...${NC}" + sudo killall -9 zelcashd > /dev/null 2>&1 && sleep 2 + fi + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 +fi +if [[ -f /usr/local/bin/fluxd ]]; then +bash -c "fluxd" + exit +else + bash -c "zelcashd" + exit +fi From bc93e64a05a5fc043e8ddb0da3adf0211cffabcc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:37:25 +0100 Subject: [PATCH 1018/1176] Create stop_daemon_service.sh --- scripts/stop_daemon_service.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/stop_daemon_service.sh diff --git a/scripts/stop_daemon_service.sh b/scripts/stop_daemon_service.sh new file mode 100644 index 00000000..02e50b77 --- /dev/null +++ b/scripts/stop_daemon_service.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if [[ -f /usr/local/bin/flux-cli ]]; then + bash -c "flux-cli stop" +else + bash -c "zelcash-cli stop" +fi +exit From ccf4723dc712d540afe2ae866a34cc1fe99ab37a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:42:59 +0100 Subject: [PATCH 1019/1176] Create ip_check.sh --- scripts/ip_check.sh | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 scripts/ip_check.sh diff --git a/scripts/ip_check.sh b/scripts/ip_check.sh new file mode 100644 index 00000000..f0157d32 --- /dev/null +++ b/scripts/ip_check.sh @@ -0,0 +1,54 @@ +#!/bin/bash +url_array=( + "https://api4.my-ip.io/ip" + "https://checkip.amazonaws.com" + "https://api.ipify.org" +) + +function get_ip() { + for url in "$@"; do + WANIP=$(curl --silent -m 15 "$url" | tr -dc '[:alnum:].') + # Remove dots from the IP address + IP_NO_DOTS=$(echo "$WANIP" | tr -d '.') + # Check if the result is a valid number + if [[ "$IP_NO_DOTS" != "" && "$IP_NO_DOTS" =~ ^[0-9]+$ ]]; then + break + fi + done +} + +function get_device_name(){ + if [[ -f /home/$USER/device_conf.json ]]; then + device_name=$(jq -r .device_name /home/$USER/device_conf.json) + else + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + fi +} + +if [[ $1 == "restart" ]]; then + #give 3min to connect with internet + sleep 180 + get_ip "${url_array[@]}" + get_device_name + if [[ "$device_name" != "" && "$WANIP" != "" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected during $1, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name && sleep 2 + fi +fi +if [[ $1 == "ip_check" ]]; then + get_ip "${url_array[@]}" + get_device_name + api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + if [[ "$api_port" == "" ]]; then + api_port="16127" + fi + confirmed_ip=$(curl -SsL -m 10 http://localhost:$api_port/flux/info 2>/dev/null | jq -r .data.node.status.ip | sed -r 's/:.+//') + if [[ "$WANIP" != "" && "$confirmed_ip" != "" && "$confirmed_ip" != "null" ]]; then + if [[ "$WANIP" != "$confirmed_ip" ]]; then + date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') + echo -e "New IP detected during $1, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log + sudo ip addr add $WANIP dev $device_name && sleep 2 + fi + fi +fi From a53ec3d7fa6d26e14bcc9502d3d28e19a3de7827 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:01:57 +0100 Subject: [PATCH 1020/1176] Update flux_common.sh --- flux_common.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index a85fd386..68039791 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2305,22 +2305,22 @@ function flux_package() { integration_check } function create_service_scripts() { - echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 - sudo touch /home/$USER/start_daemon_service.sh - sudo chown $USER:$USER /home/$USER/start_daemon_service.sh - cat <<-'EOF' > /home/$USER/start_daemon_service.sh - #!/bin/bash - #color codes - RED='\033[1;31m' - CYAN='\033[1;36m' - NC='\033[0m' - #emoji codes - BOOK="${RED}\xF0\x9F\x93\x8B${NC}" - WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - directory="/usr/local/bin" - current_user="$USER" - sleep 2 - # Check if the directory exists + echo -e "${ARROW} ${YELLOW}Creating Flux daemon service scripts...${NC}" && sleep 1 + sudo touch /home/$USER/start_daemon_service.sh + sudo chown $USER:$USER /home/$USER/start_daemon_service.sh + cat <<-'EOF' > /home/$USER/start_daemon_service.sh + #!/bin/bash + #color codes + RED='\033[1;31m' + CYAN='\033[1;36m' + NC='\033[0m' + #emoji codes + BOOK="${RED}\xF0\x9F\x93\x8B${NC}" + WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + directory="/usr/local/bin" + current_user="$USER" + sleep 2 + # Check if the directory exists if [ -d "$directory" ]; then echo "Checking for files in $directory..." # Use find to search for all files in the directory From c4f612e66cc14ad6a092fd31f60e8168909e42a5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:12:58 +0100 Subject: [PATCH 1021/1176] fix service --- flux_common.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 68039791..948c6b99 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2309,18 +2309,18 @@ function create_service_scripts() { sudo touch /home/$USER/start_daemon_service.sh sudo chown $USER:$USER /home/$USER/start_daemon_service.sh cat <<-'EOF' > /home/$USER/start_daemon_service.sh - #!/bin/bash - #color codes - RED='\033[1;31m' - CYAN='\033[1;36m' - NC='\033[0m' - #emoji codes - BOOK="${RED}\xF0\x9F\x93\x8B${NC}" - WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" - directory="/usr/local/bin" - current_user="$USER" - sleep 2 - # Check if the directory exists + #!/bin/bash + #color codes + RED='\033[1;31m' + CYAN='\033[1;36m' + NC='\033[0m' + #emoji codes + BOOK="${RED}\xF0\x9F\x93\x8B${NC}" + WORNING="${RED}\xF0\x9F\x9A\xA8${NC}" + directory="/usr/local/bin" + current_user="$USER" + sleep 2 + # Check if the directory exists if [ -d "$directory" ]; then echo "Checking for files in $directory..." # Use find to search for all files in the directory From 721b2bd85bb54dbfa9d28e649832db3d8229ea9d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:05:49 +0100 Subject: [PATCH 1022/1176] fix lsblk --- hardwarebench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index 7ae558b8..c5c8770d 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -171,7 +171,7 @@ disc__array=($(cd $HOME && LC_ALL=C lsblk -o NAME,SIZE,TYPE -b -n | grep ' disk' for((i=0;i<${#disc__array[@]};i++)); do #checking if disk structure is accessable - cd $HOME && ./lsblk -l -b -n /dev/${disc__array[i]} > /dev/null 2>&1 + cd $HOME && lsblk -l -b -n /dev/${disc__array[i]} > /dev/null 2>&1 if [ $? != 0 ]; then #echo -e "Disk name: ${disc__array[i]}" #echo -e "Error: Can't grab device stucture... device skipped!" From a9b07b9495f39a3ec1bbdf841abc89b78d261a35 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:23:54 +0100 Subject: [PATCH 1023/1176] [ADD] backup keyring server for daemon --- install_pro.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_pro.sh b/install_pro.sh index bd9edd9a..c78326ff 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -459,6 +459,9 @@ function install_daemon() { gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 ((key_counter++)) done + if [[ -f /usr/share/keyrings/flux-archive-keyring.gpg ]]; then + curl -sSL "https://keys.openpgp.org/pks/lookup?op=get&search=0x4B69CA27A986265D" | gpg --import --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 + fi #if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then #echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" #sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 From f1f9cb6fd1c19e02bab611d8459abb25a45d665c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:35:34 +0100 Subject: [PATCH 1024/1176] revert --- install_pro.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index c78326ff..bd9edd9a 100644 --- a/install_pro.sh +++ b/install_pro.sh @@ -459,9 +459,6 @@ function install_daemon() { gpg --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B69CA27A986265D > /dev/null 2>&1 ((key_counter++)) done - if [[ -f /usr/share/keyrings/flux-archive-keyring.gpg ]]; then - curl -sSL "https://keys.openpgp.org/pks/lookup?op=get&search=0x4B69CA27A986265D" | gpg --import --no-default-keyring --keyring /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 - fi #if ! gpg -k --keyring /usr/share/keyrings/flux-archive-keyring.gpg Zel > /dev/null 2>&1; then #echo -e "${YELLOW}First attempt to retrieve keys failed will try a different keyserver.${NC}" #sudo rm /usr/share/keyrings/flux-archive-keyring.gpg > /dev/null 2>&1 From ab0c5d9ecaf181c2cf2679e2e8c200ab9c498cff Mon Sep 17 00:00:00 2001 From: David White <david.white@trustpower.co.nz> Date: Wed, 7 Feb 2024 16:22:35 +0000 Subject: [PATCH 1025/1176] Fix typo in /dev/null --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 948c6b99..b0fe71d9 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -974,9 +974,9 @@ function manual_build(){ index_from_file="$index" tx_from_file="$outpoint" - stak_info=$(curl -sSL -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/nul | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then - stak_info=$(curl -sSL -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/nul | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + stak_info=$(curl -sSL -m 5 https://$network_url_2/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') fi if [[ $stak_info == ?(-)+([0-9]) ]]; then case $stak_info in From 53c4f0944ac75d9682460049026b957795d1a363 Mon Sep 17 00:00:00 2001 From: 2nd Time Lucky Mining <108513481+2ndtlmining@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:26:01 +1100 Subject: [PATCH 1026/1176] Update multitoolbox_testnet.sh (#154) Updated for Goldies :) --- multitoolbox_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh index ca011698..768d75ed 100644 --- a/multitoolbox_testnet.sh +++ b/multitoolbox_testnet.sh @@ -85,7 +85,7 @@ echo -e "${PIN}${CYAN}Firewall enabled diuring installation..................... fi if [[ "$use_old_chain" == "1" ]]; then -echo -e "${PIN}${CYAN}Diuring re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 +echo -e "${PIN}${CYAN}During re-installation old chain will be use....................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 else From 51999a895b755371df2f967713da0df310155b9e Mon Sep 17 00:00:00 2001 From: David White <david@runonflux.io> Date: Sat, 13 Jul 2024 16:15:27 +0100 Subject: [PATCH 1027/1176] Add non gzipped bootstrap tar support --- flux_common.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index b0fe71d9..287ebff0 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1708,12 +1708,18 @@ function fluxos_reconfiguration { } ######### BOOTSTRAP SECTION ############################ function tar_file_unpack() { - echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" - pv $1 | tar -zx -C $2 + local TARFILE=$1 + local DEST_DIR=$2 + local MIME_TYPE=$(file -b --mime-type $TARFILE) + local GZIP="" + # tar is application/x-tar + [[ "$MIME_TYPE" == "application/gzip" ]] && GZIP="-z" + echo -e "${ARROW} ${CYAN}Unpacking daemon bootstrap please be patient...${NC}" + pv $TARFILE | tar $GZIP -x -C $DEST_DIR } function check_tar() { echo -e "${ARROW} ${CYAN}Checking file integrity...${NC}" - if gzip -t "$1" &>/dev/null; then + if tar -tf "$1" &>/dev/null; then echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" else echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" @@ -1917,9 +1923,12 @@ function bootstrap_manual() { esac } function bootstrap_local() { - BOOTSTRAP_FILE="flux_explorer_bootstrap.tar.gz" - FILE_PATH="/home/$USER/$BOOTSTRAP_FILE" - if [ -f "$FILE_PATH" ]; then + local BOOTSTRAP_STEM="flux_explorer_bootstrap" + local BOOTSTRAP_FILES=($(ls $BOOTSTRAP_STEM.{tar,tar.gz} 2>/dev/null)) + + if [ "$BOOTSTRAP_FILES" -a ${#BOOTSTRAP_FILES[@]} ]; then + # we take the first bootstrap file + FILE_PATH="/home/$USER/$BOOTSTRAP_FILES" echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" check_tar "$FILE_PATH" if [ -f "$FILE_PATH" ]; then From 6421fe391a985c25e6b7b816732be50194e6557a Mon Sep 17 00:00:00 2001 From: David White <david@runonflux.io> Date: Tue, 16 Jul 2024 19:54:45 +0100 Subject: [PATCH 1028/1176] Fix up bootstrap path --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 287ebff0..300d5406 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1924,7 +1924,7 @@ function bootstrap_manual() { } function bootstrap_local() { local BOOTSTRAP_STEM="flux_explorer_bootstrap" - local BOOTSTRAP_FILES=($(ls $BOOTSTRAP_STEM.{tar,tar.gz} 2>/dev/null)) + local BOOTSTRAP_FILES=($(ls /home/$USER/$BOOTSTRAP_STEM.{tar,tar.gz} 2>/dev/null)) if [ "$BOOTSTRAP_FILES" -a ${#BOOTSTRAP_FILES[@]} ]; then # we take the first bootstrap file From 897a8a06c9d105709bdc888742f5fbba7e388862 Mon Sep 17 00:00:00 2001 From: David White <david@runonflux.io> Date: Mon, 22 Jul 2024 14:24:58 +0100 Subject: [PATCH 1029/1176] Add zmq topics to fluxd default config --- flux_common.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 300d5406..4a21d015 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -132,6 +132,11 @@ function flux_daemon_conf_create() { externalip=$WANIP bind=0.0.0.0 maxconnections=256 + zmqpubhashtx=tcp://127.0.0.1:16123 + zmqpubhashblock=tcp://127.0.0.1:16123 + zmqpubrawblock=tcp://127.0.0.1:16123 + zmqpubrawtx=tcp://127.0.0.1:16123 + zmqpubsequence=tcp://127.0.0.1:16123 # Addnode list EOF IFS=$'\n' From b68fcb1a834cfb4d2d6788b74d179f2220418654 Mon Sep 17 00:00:00 2001 From: David White <david@runonflux.io> Date: Sat, 27 Jul 2024 17:22:09 +0100 Subject: [PATCH 1030/1176] Bugfix for local bootstrap, path is already absolute --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 4a21d015..5daa73c9 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1933,7 +1933,7 @@ function bootstrap_local() { if [ "$BOOTSTRAP_FILES" -a ${#BOOTSTRAP_FILES[@]} ]; then # we take the first bootstrap file - FILE_PATH="/home/$USER/$BOOTSTRAP_FILES" + FILE_PATH="$BOOTSTRAP_FILES" echo -e "${ARROW} ${CYAN}Local bootstrap file detected...${NC}" check_tar "$FILE_PATH" if [ -f "$FILE_PATH" ]; then From 79f4011e0f86b7083e6a6136c7a5569b7a6023e7 Mon Sep 17 00:00:00 2001 From: David White <david@runonflux.io> Date: Sun, 11 Aug 2024 10:23:42 +0100 Subject: [PATCH 1031/1176] Pull latest updates when changing branches --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 5daa73c9..592a17a2 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1647,13 +1647,13 @@ function development_mode(){ echo -e "${ARROW}${GREEN} [FluxOS] ${CYAN}Enabling development mode... ${NC}" config_builder "development" "true" "Development Mode" "fluxos" cd $HOME/$FLUX_DIR - git checkout development > /dev/null 2>&1 + git checkout development && git pull > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 else echo -e "${ARROW}${GREEN} [FluxOS] ${CYAN}Disabling development mode... ${NC}" config_builder "development" "false" "Development Mode" "fluxos" cd $HOME/$FLUX_DIR - git checkout master > /dev/null 2>&1 + git checkout master && git pull > /dev/null 2>&1 pm2 restart flux > /dev/null 2>&1 fi } From f432f887f4b1cf3a56bbf071019fbbe2109fabb1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:51:09 +0200 Subject: [PATCH 1032/1176] add logs --- flux_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 592a17a2..d574b14e 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1826,6 +1826,7 @@ function bootstrap_new() { if [[ "$Mode" != "install" ]]; then start_service if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + echo "Path: $FILE_PATH" sudo rm -rf $FILE_PATH > /dev/null 2>&1 && sleep 2 fi fi @@ -1836,6 +1837,7 @@ function bootstrap_new() { if [[ "$Mode" != "install" && "$server_offline" == "0" ]]; then start_service if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + echo "Path: $FILE_PATH" sudo rm -rf $FILE_PATH /dev/null 2>&1 && sleep 2 fi fi From cfce96446a77eea807dab8ba59d9656509c2e3b7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:12:24 +0200 Subject: [PATCH 1033/1176] test --- flux_common.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index d574b14e..03bc025e 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1826,7 +1826,6 @@ function bootstrap_new() { if [[ "$Mode" != "install" ]]; then start_service if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - echo "Path: $FILE_PATH" sudo rm -rf $FILE_PATH > /dev/null 2>&1 && sleep 2 fi fi @@ -1837,8 +1836,8 @@ function bootstrap_new() { if [[ "$Mode" != "install" && "$server_offline" == "0" ]]; then start_service if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - echo "Path: $FILE_PATH" - sudo rm -rf $FILE_PATH /dev/null 2>&1 && sleep 2 + echo "Path: /home/$USER/$BOOTSTRAP_FILE" + ## sudo rm -rf $FILE_PATH /dev/null 2>&1 && sleep 2 fi fi return From 6fd8554d7905b08ec37fc59a19102c46ba5cceed Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:59:01 +0200 Subject: [PATCH 1034/1176] [FIX] bootstrap path --- flux_common.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 03bc025e..3dc7d66f 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1836,8 +1836,7 @@ function bootstrap_new() { if [[ "$Mode" != "install" && "$server_offline" == "0" ]]; then start_service if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - echo "Path: /home/$USER/$BOOTSTRAP_FILE" - ## sudo rm -rf $FILE_PATH /dev/null 2>&1 && sleep 2 + sudo rm -rf /home/$USER/$BOOTSTRAP_FILE /dev/null 2>&1 && sleep 2 fi fi return From dc886f0a7c5089e4b64bfd6837b5392a1070e3bc Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 14 Aug 2024 18:02:15 +0200 Subject: [PATCH 1035/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 3dc7d66f..fce2619e 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1836,7 +1836,7 @@ function bootstrap_new() { if [[ "$Mode" != "install" && "$server_offline" == "0" ]]; then start_service if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - sudo rm -rf /home/$USER/$BOOTSTRAP_FILE /dev/null 2>&1 && sleep 2 + sudo rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 && sleep 2 fi fi return From 0f1899dc44026180b733f94620027ed5aa1daa8f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:30:10 +0200 Subject: [PATCH 1036/1176] [ADD] Remove Syncthing --- flux_common.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index fce2619e..7f356bba 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1088,17 +1088,23 @@ function os_check(){ } function fluxos_clean(){ - docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) - resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) - if [[ $docker_check != 0 ]]; then - echo -e "${ARROW} ${CYAN}Removing containers...${NC}" - sudo service docker restart > /dev/null 2>&1 && sleep 2 - docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | - while read line; do - sudo docker stop $line > /dev/null 2>&1 && sleep 2 - sudo docker rm $line > /dev/null 2>&1 && sleep 2 - done - fi + docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) + resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) + if [[ $docker_check != 0 ]]; then + echo -e "${ARROW} ${CYAN}Removing containers...${NC}" + sudo service docker restart > /dev/null 2>&1 && sleep 2 + docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | + while read line; do + sudo docker stop $line > /dev/null 2>&1 && sleep 2 + sudo docker rm $line > /dev/null 2>&1 && sleep 2 + done + fi + + echo -e "${ARROW} ${CYAN}Removing syncthing...${NC}" + sudo pkill -9 syncthing > /dev/null 2>&1 + sudo apt-get remove --purge syncthing > /dev/null 2>&1 + sudo apt-get autoremove > /dev/null 2>&1 + if [[ $resource_check != 0 ]]; then echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 df | egrep 'flux' | awk '{ print $1}' | From 5e4634d22ecda6c7dd83d6fc25b1563393c84b19 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:30:29 +0200 Subject: [PATCH 1037/1176] [ADD] Remove Syncthing --- multitoolbox.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 76dfbb57..457e7c53 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -119,6 +119,11 @@ function install_flux() { pm2 del flux > /dev/null 2>&1 pm2 save > /dev/null 2>&1 fi + + echo -e "${ARROW} ${CYAN}Removing syncthing...${NC}" + sudo pkill -9 syncthing > /dev/null 2>&1 + sudo apt-get remove --purge syncthing > /dev/null 2>&1 + sudo apt-get autoremove > /dev/null 2>&1 docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) From 55ec1d116e3b4329a90003ac42f1302fee84b41a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 20 Aug 2024 20:54:26 +0200 Subject: [PATCH 1038/1176] Fix hang on removing syncthing --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 457e7c53..92b75337 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -122,8 +122,8 @@ function install_flux() { echo -e "${ARROW} ${CYAN}Removing syncthing...${NC}" sudo pkill -9 syncthing > /dev/null 2>&1 - sudo apt-get remove --purge syncthing > /dev/null 2>&1 - sudo apt-get autoremove > /dev/null 2>&1 + sudo apt-get remove --purge syncthing -y > /dev/null 2>&1 + sudo apt-get autoremove -y > /dev/null 2>&1 docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) From 0857264b617780a2614694e2ca38165986d9248d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 20 Aug 2024 20:55:08 +0200 Subject: [PATCH 1039/1176] Fix hang on removing syncthing --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 7f356bba..e7d25d29 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1102,8 +1102,8 @@ function fluxos_clean(){ echo -e "${ARROW} ${CYAN}Removing syncthing...${NC}" sudo pkill -9 syncthing > /dev/null 2>&1 - sudo apt-get remove --purge syncthing > /dev/null 2>&1 - sudo apt-get autoremove > /dev/null 2>&1 + sudo apt-get remove --purge syncthing -y > /dev/null 2>&1 + sudo apt-get autoremove -y > /dev/null 2>&1 if [[ $resource_check != 0 ]]; then echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 From ab2b5c202bc3b578880ce038f2829b29a739755c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:14:54 +0100 Subject: [PATCH 1040/1176] Innitial --- flux_common.sh | 865 +++++++++++++++++++++++++------------------------ 1 file changed, 439 insertions(+), 426 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index e7d25d29..68f5bf9d 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -54,11 +54,31 @@ PORT=16125 export NEWT_COLORS=' title=black, ' +if [[ "$FLUXOS_VERSION" == "" ]]; then + FLUXOS_PATH="/home/$USER/zelflux" + FLUX_WATCHDOG_PATH="/home/$USER/watchdog" + FLUX_DAEMON_PATH="/home/$USER/.flux" + FLUX_BENCH_PATH="/home/$USER/.fluxbenchmark" + DATA_PATH="/home/$USER" + MONGODB_DATA_PATH="/var/lib/mongodb" + MONGODB_LOG_PATH="/var/log/mongodb" + FLUX_DAEMON_SERVICE="zelflux" +else + FLUXOS_PATH="/dat/usr/lib/fluxos" + FLUX_WATCHDOG_PATH="/dat/usr/lib/fluxwatchdog" + FLUX_DAEMON_PATH="/dat/var/lib/fluxd" + FLUX_BENCH_PATH="/dat/usr/lib/fluxbenchd" + DATA_PATH="/dat" + MONGODB_DATA_PATH="/dat/var/lib/mongodb" + MONGODB_LOG_PATH="/dat/var/log/mongodb" + FLUX_DAEMON_SERVICE="fluxd" +fi + ##### CONFIGS SECTION ###################################### function watchdog_conf_create(){ - sudo touch /home/$USER/watchdog/config.js - sudo chown $USER:$USER /home/$USER/watchdog/config.js - cat <<- EOF >| /home/$USER/watchdog/config.js + sudo touch $WATCHDOG_PATH/config.js + sudo chown $USER:$USER $WATCHDOG_PATH/config.js + cat <<- EOF >| $WATCHDOG_PATH/config.js module.exports = { label: '${node_label}', tier_eps_min: '${eps_limit}', @@ -81,8 +101,8 @@ function fluxos_conf_create(){ else testnet=false fi - touch /home/$USER/$FLUX_DIR/config/userconfig.js - cat <<- EOF >| /home/$USER/$FLUX_DIR/config/userconfig.js + touch $FLUXOS_PATH/config/userconfig.js + cat <<- EOF >| $FLUXOS_PATH/config/userconfig.js module.exports = { initial: { ipaddress: '${WANIP}', @@ -98,16 +118,16 @@ EOF function flux_daemon_conf_create() { explorers=( - "explorer.runonflux.io" - "explorer.zelcash.online" - "blockbook.runonflux.io" - "explorer.flux.zelcore.io" + "explorer.runonflux.io" + "explorer.zelcash.online" + "blockbook.runonflux.io" + "explorer.flux.zelcore.io" ) selected_ips=($(curl -s -m 20 https://api.runonflux.io/apps/enterprisenodes | jq -r '.data[] | select(.score >= 2200 and .score <= 3000) | .ip' 2>/dev/null | shuf -n 25)) nodes=("${selected_ips[@]}" "${explorers[@]}") RPCUSER=$(pwgen -1 8 -n) PASSWORD=$(pwgen -1 20 -n) - touch /home/$USER/$CONFIG_DIR/$CONFIG_FILE + touch $FLUX_DAEMON_PATH/$CONFIG_FILE { cat <<- EOF rpcuser=$RPCUSER @@ -143,13 +163,13 @@ EOF for node in "${nodes[@]}"; do echo "addnode=$node" done - } | sed 's/^[[:space:]]*//' >| /home/$USER/$CONFIG_DIR/$CONFIG_FILE + } | sed 's/^[[:space:]]*//' >| $FLUX_DAEMON_PATH/$CONFIG_FILE } function install_conf_create(){ - sudo touch /home/$USER/install_conf.json - sudo chown $USER:$USER /home/$USER/install_conf.json - cat <<- EOF >| /home/$USER/install_conf.json + sudo touch $DATA_PATH/install_conf.json + sudo chown $USER:$USER $DATA_PATH/install_conf.json + cat <<- EOF >| $DATA_PATH/install_conf.json { "import_settings": "${import_settings}", "prvkey": "${prvkey}", @@ -182,9 +202,9 @@ function install_conf_create(){ ###### SMART CONFIG function padding() { -msg="$1" -padding=".................................................................................................................." -echo -e "$(printf "%s%s %s\n" "$msg" "${CYAN}${padding:${#msg}}" "${CYAN}[$2${CYAN}]${NC}")" + msg="$1" + padding=".................................................................................................................." + echo -e "$(printf "%s%s %s\n" "$msg" "${CYAN}${padding:${#msg}}" "${CYAN}[$2${CYAN}]${NC}")" } function insert() { @@ -193,7 +213,7 @@ function insert() { } function RemoveLine(){ - sed -i "/$1/d" /home/$USER/zelflux/config/userconfig.js + sed -i "/$1/d" $FLUXOS_PATH/config/userconfig.js } function ClearList() { @@ -202,7 +222,7 @@ function ClearList() { } function buildBlockedPortsList() { - if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + if [[ ! -f $FLUXOS_PATH/config/userconfig.js ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" exit fi @@ -212,8 +232,8 @@ function buildBlockedPortsList() { fi key="$1" value="$2" - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then - insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," + if [[ $(cat "$FLUXOS_PATH/config/userconfig.js" | grep "$key") == "" ]]; then + insert "$FLUXOS_PATH/config/userconfig.js" "testnet" " $key: $value," padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3${NC}" "${CHECK_MARK}" return fi @@ -242,7 +262,7 @@ function CreateBlockedPortsList() { } function AddBlockedPorts() { - string=$(grep "blockedPorts" $HOME/$FLUX_DIR/config/userconfig.js | awk -F'[][]' '{print $2}' ) + string=$(grep "blockedPorts" $FLUXOS_PATH/config/userconfig.js | awk -F'[][]' '{print $2}' ) delimiter="," declare -a array=($(echo $string | tr "$delimiter" " ")) ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) @@ -266,7 +286,7 @@ function AddBlockedPorts() { } function ImportBlockedPorts(){ - array=($(grep -w blockedPorts /home/$USER/$FLUX_DIR/config/userconfig.js | grep -o '[[:digit:]]*')) + array=($(grep -w blockedPorts $FLUXOS_PATH/config/userconfig.js | grep -o '[[:digit:]]*')) sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) printf -v joined '%s,' "${sorted_unique_ids[@]}" if [[ "${joined%,}" != "" ]]; then @@ -325,7 +345,7 @@ function CreateBlockedRepositoryList() { } function AddBlockedRepository() { - string=$(grep "blockedRepositories" $HOME/$FLUX_DIR/config/userconfig.js | awk -F'[][]' '{print $2}' ) + string=$(grep "blockedRepositories" $FLUXOS_PATH/config/userconfig.js | awk -F'[][]' '{print $2}' ) delimiter="," declare -a array=($(echo $string | tr "$delimiter" " ")) ADD=$(whiptail --inputbox "Enter the repositories to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) @@ -347,7 +367,7 @@ function AddBlockedRepository() { } function buildBlockedRepositoryList() { - if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + if [[ ! -f "$FLUXOS_PATH/config/userconfig.js" ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" exit fi @@ -357,15 +377,15 @@ function buildBlockedRepositoryList() { fi key="$1" value="$2" - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then - insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," + if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "$key") == "" ]]; then + insert "$FLUXOS_PATH/config/userconfig.js" "testnet" " $key: $value," padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3${NC}" "${CHECK_MARK}" return fi } function ImportBlockedRepository() { - string=$(grep "blockedRepositories" $HOME/$FLUX_DIR/config/userconfig.js | awk -F'[][]' '{print $2}' ) + string=$(grep "blockedRepositories" $FLUXOS_PATH/config/userconfig.js | awk -F'[][]' '{print $2}' ) delimiter="," declare -a array=($(echo $string | tr "$delimiter" " ")) sorted_unique_ids=($(echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) @@ -405,10 +425,10 @@ function blocked_repositories(){ } function fluxosConfigBackup(){ - ConfigFile="/home/$USER/$FLUX_DIR/config/userconfig.js" + ConfigFile="$FLUXOS_PATH/config/userconfig.js" if [[ -f $ConfigFile ]]; then - cp -nf $ConfigFile $HOME/userconfig.js.backup - if [[ -f $HOME/userconfig.js.backup ]]; then + cp -nf $ConfigFile $DATA_PATH/userconfig.js.backup + if [[ -f $DATA_PATH/userconfig.js.backup ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js backup successfully${NC}" "${CHECK_MARK}" else padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js backup failed${NC}" "${X_MARK}" @@ -419,10 +439,10 @@ function fluxosConfigBackup(){ } function fluxosConfigRestore(){ - ConfigFile="/home/$USER/$FLUX_DIR/config/userconfig.js" - if [[ -d /home/$USER/$FLUX_DIR ]]; then - if [[ -f $HOME/userconfig.js.backup ]]; then - cp -nf $HOME/userconfig.js.backup $ConfigFile + ConfigFile="$FLUXOS_PATH/config/userconfig.js" + if [[ -d $FLUXOS_PATH ]]; then + if [[ -f $DATA_PATH/userconfig.js.backup ]]; then + cp -nf $DATA_PATH/userconfig.js.backup $ConfigFile if [[ -f $ConfigFile ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js restored successfully${NC}" "${CHECK_MARK}" else @@ -451,7 +471,7 @@ function config_builder() { value="\'kadena:$2?chainid=0\'" fi fi - if [[ ! -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then + if [[ ! -f $FLUXOS_PATH/config/userconfig.js ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" return fi @@ -459,24 +479,24 @@ function config_builder() { padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" return fi - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") == "" ]]; then - insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," + if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "$key") == "" ]]; then + insert "$FLUXOS_PATH/config/userconfig.js" "testnet" " $key: $value," padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return fi - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key" | grep "$value_check") != "" ]]; then + if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "$key" | grep "$value_check") != "" ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 skipped${NC}" "${X_MARK}" return fi - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "$key") != "" ]]; then + if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "$key") != "" ]]; then RemoveLine "$key" - insert "/home/$USER/$FLUX_DIR/config/userconfig.js" "testnet" " $key: $value," + insert "$FLUXOS_PATH/config/userconfig.js" "testnet" " $key: $value," padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 changed successfully${NC}" "${CHECK_MARK}" fi fi ##################################################### if [[ "$4" == "daemon" ]]; then - if [[ ! -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then + if [[ ! -f $FLUX_DAEMON_PATH/$CONFIG_FILE ]]; then padding "${ARROW}${GREEN} [Daemon] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" return fi @@ -484,19 +504,19 @@ function config_builder() { padding "${ARROW}${GREEN} [Daemon] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" return fi - if [[ ! $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) && -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - echo "$1=$2" >> /home/$USER/$CONFIG_DIR/$CONFIG_FILE - if [[ "$1=$2" == $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) ]]; then + if [[ ! $(grep -w $1 $FLUX_DAEMON_PATH/$CONFIG_FILE) && -f $FLUX_DAEMON_PATH/$CONFIG_FILE ]]; then + echo "$1=$2" >> $FLUX_DAEMON_PATH/$CONFIG_FILE + if [[ "$1=$2" == $(grep -w $1 $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return fi fi - if [[ "$1=$2" == $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) ]]; then + if [[ "$1=$2" == $(grep -w $1 $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 skipped${NC}" "${X_MARK}" return else - sed -i "s/$(grep -e $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE)/$1=$2/" /home/$USER/$CONFIG_DIR/$CONFIG_FILE - if [[ "$1=$2" == $(grep -w $1 /home/$USER/$CONFIG_DIR/$CONFIG_FILE) ]]; then + sed -i "s/$(grep -e $1 $FLUX_DAEMON_PATH/$CONFIG_FILE)/$1=$2/" $FLUX_DAEMON_PATH/$CONFIG_FILE + if [[ "$1=$2" == $(grep -w $1 $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" fi fi @@ -507,33 +527,33 @@ function config_builder() { padding "${ARROW}${GREEN} [BenchD] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" return fi - if [[ ! -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - mkdir -p /home/$USER/.fluxbenchmark > /dev/null 2>&1 - echo "$1=$2" >> /home/$USER/.fluxbenchmark/fluxbench.conf - if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then + if [[ ! -f "$FLUX_BENCH_PATH/fluxbench.conf" ]]; then + mkdir -p $FLUX_BENCH_PATH > /dev/null 2>&1 + echo "$1=$2" >> $FLUX_BENCH_PATH/fluxbench.conf + if [[ "$1=$2" == $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return fi fi - if [[ ! $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then - echo "$1=$2" >> /home/$USER/.fluxbenchmark/fluxbench.conf - if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then + if [[ ! $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then + echo "$1=$2" >> $FLUX_BENCH_PATH/fluxbench.conf + if [[ "$1=$2" == $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" return fi fi - if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then + if [[ "$1=$2" == $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 skipped${NC}" "${X_MARK}" else - sed -i "s/$(grep -e $1 /home/$USER/.fluxbenchmark/fluxbench.conf)/$1=$2/" /home/$USER/.fluxbenchmark/fluxbench.conf - if [[ "$1=$2" == $(grep -w $1 /home/$USER/.fluxbenchmark/fluxbench.conf) ]]; then + sed -i "s/$(grep -e $1 $FLUX_BENCH_PATH/fluxbench.conf)/$1=$2/" $FLUX_BENCH_PATH/fluxbench.conf + if [[ "$1=$2" == $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" fi fi fi ################################################### if [[ "$4" == "watchdog" ]]; then - if [[ ! -f /home/$USER/watchdog/config.js ]]; then + if [[ ! -f "$FLUX_WATCHDOG_PATH/config.js" ]]; then padding "${ARROW}${GREEN} [WatchD] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" return fi @@ -541,13 +561,13 @@ function config_builder() { padding "${ARROW}${GREEN} [WatchD] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" return fi - if [[ $(cat /home/$USER/watchdog/config.js | grep "$1: '$2'") != "" ]]; then + if [[ $(cat $FLUX_WATCHDOG_PATH/config.js | grep "$1: '$2'") != "" ]]; then padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 skipped${NC}" "${X_MARK}" return fi - if [[ $(cat /home/$USER/watchdog/config.js | grep "$1") != "" ]]; then - sed -i "s/$(grep -e $1 /home/$USER/watchdog/config.js)/ $1: '$2',/" /home/$USER/watchdog/config.js - if [[ $(grep -w $2 /home/$USER/watchdog/config.js) != "" ]]; then + if [[ $(cat $FLUX_WATCHDOG_PATH/config.js | grep "$1") != "" ]]; then + sed -i "s/$(grep -e $1 $FLUX_WATCHDOG_PATH/config.js)/ $1: '$2',/" $FLUX_WATCHDOG_PATH/config.js + if [[ $(grep -w $2 $FLUX_WATCHDOG_PATH/config.js) != "" ]]; then padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" fi fi @@ -579,7 +599,7 @@ function smart_reconfiguration(){ END ) - install_settings=($(jq -r 'keys | @sh' install_conf.json)) + install_settings=($(jq -r 'keys | @sh' $DATA_PATH/install_conf.json)) for i in "${install_settings[@]}" do @@ -596,204 +616,191 @@ END if [[ $(echo ${daemon_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then config="daemon" - value=$(jq -r .$install_key install_conf.json) + value=$(jq -r .$install_key $DATA_PATH/install_conf.json) config_builder "$key" "$value" "$label" "$config" fi if [[ $(echo ${benchmark_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then config="benchmark" - value=$(jq -r .$install_key install_conf.json) + value=$(jq -r .$install_key $DATA_PATH/install_conf.json) config_builder "$key" "$value" "$label" "$config" fi if [[ $(echo ${fluxos_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then config="fluxos" - value=$(jq -r .$install_key install_conf.json) + value=$(jq -r .$install_key $DATA_PATH/install_conf.json) config_builder "$key" "$value" "$label" "$config" fi if [[ $(echo ${watchdog_settings_list[@]} | grep -ow "$key" | wc -l) == "1" ]]; then config="watchdog" - value=$(jq -r .$install_key install_conf.json) + value=$(jq -r .$install_key $DATA_PATH/install_conf.json) config_builder "$key" "$value" "$label" "$config" fi done } function smart_install_conf(){ - - if [[ "$3" == "import" ]]; then + if [[ "$3" == "import" ]]; then return fi - - if [[ ! -f /home/$USER/install_conf.json ]]; then - echo "{}" >| install_conf.json - fi - echo "$(jq -r --arg key "$1" --arg value "$2" '.[$key]=$value' install_conf.json)" >| install_conf.json + if [[ ! -f $DATA_PATH/install_conf.json ]]; then + echo "{}" >| $DATA_PATH/install_conf.json + fi + echo "$(jq -r --arg key "$1" --arg value "$2" '.[$key]=$value' install_conf.json)" >| $DATA_PATH/install_conf.json } function config_smart_create() { - - if [[ "$1" != "import" ]]; then - rm -rf /home/$USER/install_conf.json - fi - #daemon - if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported daemon settings:${NC}" - zelnodeprivkey=$(grep -w zelnodeprivkey /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" - smart_install_conf "prvkey" "$zelnodeprivkey" "$1" - zelnodeoutpoint=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" - smart_install_conf "outpoint" "$zelnodeoutpoint" "$1" - zelnodeindex=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') - echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" - smart_install_conf "index" "$zelnodeindex" "$1" - fi + if [[ "$1" != "import" ]]; then + rm -rf $DATA_PATH/install_conf.json + fi + #daemon + if [[ -f $FLUX_DAEMON_PATH/$CONFIG_FILE ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported daemon settings:${NC}" + zelnodeprivkey=$(grep -w zelnodeprivkey $FLUX_DAEMON_PATH/$CONFIG_FILE | sed -e 's/zelnodeprivkey=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Identity Key = ${GREEN}$zelnodeprivkey${NC}" + smart_install_conf "prvkey" "$zelnodeprivkey" "$1" + zelnodeoutpoint=$(grep -w zelnodeoutpoint $FLUX_DAEMON_PATH/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Collateral TX ID = ${GREEN}$zelnodeoutpoint${NC}" + smart_install_conf "outpoint" "$zelnodeoutpoint" "$1" + zelnodeindex=$(grep -w zelnodeindex $FLUX_DAEMON_PATH/$CONFIG_FILE | sed -e 's/zelnodeindex=//' | sed 's/ //g') + echo -e "${PIN}${CYAN} Output Index = ${GREEN}$zelnodeindex${NC}" + smart_install_conf "index" "$zelnodeindex" "$1" + fi #Benchmark - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported Benchmark settings:${NC}" - thunder=$(grep -Po "(?<=thunder=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) - if [[ "$thunder" == "1" ]]; then - echo -e "${PIN}${CYAN} Thunder Mode = ${GREEN}ENABLED${NC}" - smart_install_conf "thunder" "$thunder" "$1" - fi - speedtestserverid=$(grep -Po "(?<=speedtestserverid=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) - if [[ "$speedtestserverid" != "" ]]; then - echo -e "${PIN}${CYAN} SpeedTest Server ID = ${GREEN}$speedtestserverid${NC}" - smart_install_conf "speedtestserverid" "$speedtestserverid" "$1" - fi - fluxport=$(grep -Po "(?<=fluxport=)\d+" /home/$USER/.fluxbenchmark/fluxbench.conf) - if [[ "$fluxport" != "" ]]; then - upnp_enabled=true - echo -e "${PIN}${CYAN} Flux Port = ${GREEN}$fluxport${NC}" - smart_install_conf "fluxport" "$fluxport" "$1" - smart_install_conf "upnp_enabled" "$upnp_enabled" "$1" - fi - fi - #fluxOS - if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported fluxOS settings:${NC}" - ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" - smart_install_conf "zelid" "$ZELID" "$1" - fi - KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" - smart_install_conf "kda_address" "$KDA_A" "$1" - fi - upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | grep -o '[[:digit:]]*') - if [[ "$upnp_port" != "" ]]; then - gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) - echo -e "${PIN}${CYAN} API Port = ${GREEN}$upnp_port${NC}" - if [[ "$upnp_enabled" == "true" ]]; then - echo -e "${PIN}${CYAN} Router IP = ${GREEN}$gateway_ip${NC}" - fi - smart_install_conf "upnp_port" "$upnp_port" "$1" - smart_install_conf "gateway_ip" "$gateway_ip" "$1" - fi - - fi - #watchdog - if [[ -f /home/$USER/watchdog/config.js ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" - node_label=$(grep -w label /home/$USER/watchdog/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') - if [[ "$node_label" != "" && "$node_label" != "0" ]]; then - echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" - smart_install_conf "node_label" "$node_label" "$1" - else - echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" - fi - - eps_limit=$(grep -w tier_eps_min /home/$USER/watchdog/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') - if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then - echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" - smart_install_conf "eps_limit" "$eps_limit" "$1" - fi - - discord=$(grep -w web_hook_url /home/$USER/watchdog/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" - smart_install_conf "discord" "$discord" "$1" - else - echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" - fi - ping=$(grep -w ping /home/$USER/watchdog/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') - if [[ "$ping" != "" && "$ping" != "0" ]]; then - if [[ "$discord" != "" && "$discord" != "0" ]]; then - echo -e "${PIN}${CYAN} Discord nick ping = ${GREEN}Enabled${NC}" - smart_install_conf "ping" "$ping" "$1" - else - echo -e "${PIN}${CYAN} Discord nick ping = ${RED}Disabled${NC}" - fi - fi - telegram_alert=$(grep -w telegram_alert /home/$USER/watchdog/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then - echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" - smart_install_conf "telegram_alert" "$telegram_alert" "$1" - else - echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" - smart_install_conf "telegram_alert" "0" "$1" - fi - - telegram_bot_token=$(grep -w telegram_bot_token /home/$USER/watchdog/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_bot_token${NC}" - smart_install_conf "telegram_bot_token" "$telegram_bot_token" "$1" - fi - - telegram_chat_id=$(grep -w telegram_chat_id /home/$USER/watchdog/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') - if [[ "$telegram_alert" == "1" ]]; then - echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" - smart_install_conf "telegram_chat_id" "$telegram_chat_id" "$1" - fi - - zelflux_update=$(grep -w zelflux_update /home/$USER/watchdog/config.js | sed -e 's/.*zelflux_update: .//' | egrep -o '[0-9]') - if [[ "$zelflux_update" == "1" ]]; then - echo -e "${PIN}${CYAN} FluxOS auto update = ${GREEN}Enabled${NC}" - smart_install_conf "zelflux_update" "1" "$1" - else - echo -e "${PIN}${CYAN} FluxOS auto update = ${GREEN}Disabled${NC}" - smart_install_conf "zelflux_update" "0" "$1" - fi - - zelcash_update=$(grep -w zelcash_update /home/$USER/watchdog/config.js | sed -e 's/.*zelcash_update: .//' | egrep -o '[0-9]') - if [[ "$zelcash_update" == "1" ]]; then - echo -e "${PIN}${CYAN} Daemon auto update = ${GREEN}Enabled${NC}" - smart_install_conf "zelcash_update" "1" "$1" - else - echo -e "${PIN}${CYAN} Daemon auto update = ${GREEN}Disabled${NC}" - smart_install_conf "zelcash_update" "0" "$1" - fi - - zelbench_update=$(grep -w zelbench_update /home/$USER/watchdog/config.js | sed -e 's/.*zelbench_update: .//' | egrep -o '[0-9]') - if [[ "$zelbench_update" == "1" ]]; then - echo -e "${PIN}${CYAN} Benchmark auto update = ${GREEN}Enabled${NC}" - smart_install_conf "zelbench_update" "1" "$1" - else - echo -e "${PIN}${CYAN} Benchmark auto update = ${GREEN}Disabled${NC}" - smart_install_conf "zelbench_update" "0" "$1" - fi - - action=$(grep -w action /home/$USER/watchdog/config.js | sed -e 's/.*action: .//' | egrep -o '[0-9]') - if [[ "$action" == "1" ]]; then - echo -e "${PIN}${CYAN} Fix action = ${GREEN}Enabled${NC}" - smart_install_conf "action" "1" "$1" - else - echo -e "${PIN}${CYAN} Fix action = ${GREEN}Disabled${NC}" - smart_install_conf "action" "0" "$1" - fi - fi - + if [[ -f $FLUX_BENCH_PATH/fluxbench.conf ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported Benchmark settings:${NC}" + thunder=$(grep -Po "(?<=thunder=)\d+" $FLUX_BENCH_PATH/fluxbench.conf) + if [[ "$thunder" == "1" ]]; then + echo -e "${PIN}${CYAN} Thunder Mode = ${GREEN}ENABLED${NC}" + smart_install_conf "thunder" "$thunder" "$1" + fi + speedtestserverid=$(grep -Po "(?<=speedtestserverid=)\d+" $FLUX_BENCH_PATH/fluxbench.conf) + if [[ "$speedtestserverid" != "" ]]; then + echo -e "${PIN}${CYAN} SpeedTest Server ID = ${GREEN}$speedtestserverid${NC}" + smart_install_conf "speedtestserverid" "$speedtestserverid" "$1" + fi + fluxport=$(grep -Po "(?<=fluxport=)\d+" $FLUX_BENCH_PATH/fluxbench.conf) + if [[ "$fluxport" != "" ]]; then + upnp_enabled=true + echo -e "${PIN}${CYAN} Flux Port = ${GREEN}$fluxport${NC}" + smart_install_conf "fluxport" "$fluxport" "$1" + smart_install_conf "upnp_enabled" "$upnp_enabled" "$1" + fi + fi + #fluxOS + if [[ -f $FLUXOS_PATH/config/userconfig.js ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported fluxOS settings:${NC}" + ZELID=$(grep -w zelid $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + if [[ "$ZELID" != "" ]]; then + echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" + smart_install_conf "zelid" "$ZELID" "$1" + fi + KDA_A=$(grep -w kadena $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" + smart_install_conf "kda_address" "$KDA_A" "$1" + fi + upnp_port=$(grep -w apiport $FLUXOS_PATH/config/userconfig.js | grep -o '[[:digit:]]*') + if [[ "$upnp_port" != "" ]]; then + gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) + echo -e "${PIN}${CYAN} API Port = ${GREEN}$upnp_port${NC}" + if [[ "$upnp_enabled" == "true" ]]; then + echo -e "${PIN}${CYAN} Router IP = ${GREEN}$gateway_ip${NC}" + fi + smart_install_conf "upnp_port" "$upnp_port" "$1" + smart_install_conf "gateway_ip" "$gateway_ip" "$1" + fi + fi + #watchdog + if [[ -f $FLUX_WATCHDOG_PATH/config.js ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Imported watchdog settings:${NC}" + node_label=$(grep -w label $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*label: .//' | sed -e 's/.\{2\}$//') + if [[ "$node_label" != "" && "$node_label" != "0" ]]; then + echo -e "${PIN}${CYAN} Label = ${GREEN}$node_label${NC}" + smart_install_conf "node_label" "$node_label" "$1" + else + echo -e "${PIN}${CYAN} Label = ${RED}Disabled${NC}" + fi + eps_limit=$(grep -w tier_eps_min $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*tier_eps_min: .//' | sed -e 's/.\{2\}$//') + if [[ "$eps_limit" != "" && "$eps_limit" != "0" ]]; then + echo -e "${PIN}${CYAN} Tier_eps_min = ${GREEN}$eps_limit${NC}" + smart_install_conf "eps_limit" "$eps_limit" "$1" + fi + discord=$(grep -w web_hook_url $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*web_hook_url: .//' | sed -e 's/.\{2\}$//') + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord alert = ${GREEN}Enabled${NC}" + smart_install_conf "discord" "$discord" "$1" + else + echo -e "${PIN}${CYAN} Discord alert = ${RED}Disabled${NC}" + fi + ping=$(grep -w ping $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*ping: .//' | sed -e 's/.\{2\}$//') + if [[ "$ping" != "" && "$ping" != "0" ]]; then + if [[ "$discord" != "" && "$discord" != "0" ]]; then + echo -e "${PIN}${CYAN} Discord nick ping = ${GREEN}Enabled${NC}" + smart_install_conf "ping" "$ping" "$1" + else + echo -e "${PIN}${CYAN} Discord nick ping = ${RED}Disabled${NC}" + fi + fi + telegram_alert=$(grep -w telegram_alert $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*telegram_alert: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" != "" && "$telegram_alert" != "0" ]]; then + echo -e "${PIN}${CYAN} Telegram alert = ${GREEN}Enabled${NC}" + smart_install_conf "telegram_alert" "$telegram_alert" "$1" + else + echo -e "${PIN}${CYAN} Telegram alert = ${RED}Disabled${NC}" + smart_install_conf "telegram_alert" "0" "$1" + fi + telegram_bot_token=$(grep -w telegram_bot_token $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*telegram_bot_token: .//' | sed -e 's/.\{2\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram bot token = ${GREEN}$telegram_bot_token${NC}" + smart_install_conf "telegram_bot_token" "$telegram_bot_token" "$1" + fi + telegram_chat_id=$(grep -w telegram_chat_id $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*telegram_chat_id: .//' | sed -e 's/.\{1\}$//') + if [[ "$telegram_alert" == "1" ]]; then + echo -e "${PIN}${CYAN} Telegram chat id = ${GREEN}$telegram_chat_id${NC}" + smart_install_conf "telegram_chat_id" "$telegram_chat_id" "$1" + fi + zelflux_update=$(grep -w zelflux_update $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*zelflux_update: .//' | egrep -o '[0-9]') + if [[ "$zelflux_update" == "1" ]]; then + echo -e "${PIN}${CYAN} FluxOS auto update = ${GREEN}Enabled${NC}" + smart_install_conf "zelflux_update" "1" "$1" + else + echo -e "${PIN}${CYAN} FluxOS auto update = ${GREEN}Disabled${NC}" + smart_install_conf "zelflux_update" "0" "$1" + fi + zelcash_update=$(grep -w zelcash_update $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*zelcash_update: .//' | egrep -o '[0-9]') + if [[ "$zelcash_update" == "1" ]]; then + echo -e "${PIN}${CYAN} Daemon auto update = ${GREEN}Enabled${NC}" + smart_install_conf "zelcash_update" "1" "$1" + else + echo -e "${PIN}${CYAN} Daemon auto update = ${GREEN}Disabled${NC}" + smart_install_conf "zelcash_update" "0" "$1" + fi + zelbench_update=$(grep -w zelbench_update $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*zelbench_update: .//' | egrep -o '[0-9]') + if [[ "$zelbench_update" == "1" ]]; then + echo -e "${PIN}${CYAN} Benchmark auto update = ${GREEN}Enabled${NC}" + smart_install_conf "zelbench_update" "1" "$1" + else + echo -e "${PIN}${CYAN} Benchmark auto update = ${GREEN}Disabled${NC}" + smart_install_conf "zelbench_update" "0" "$1" + fi + action=$(grep -w action $FLUX_WATCHDOG_PATH/config.js | sed -e 's/.*action: .//' | egrep -o '[0-9]') + if [[ "$action" == "1" ]]; then + echo -e "${PIN}${CYAN} Fix action = ${GREEN}Enabled${NC}" + smart_install_conf "action" "1" "$1" + else + echo -e "${PIN}${CYAN} Fix action = ${GREEN}Disabled${NC}" + smart_install_conf "action" "0" "$1" + fi + fi echo -e "" if [[ "$1" != "import" ]]; then - echo -e "${HOT}${CYAN} Config file created, path: ${GREEN}/home/$USER/install_conf.json${NC}" + echo -e "${HOT}${CYAN} Config file created, path: ${GREEN}$DATA_PATH/install_conf.json${NC}" echo -e "" fi } @@ -801,7 +808,7 @@ function config_smart_create() { function manual_build(){ skip_zelcash_config='0' skip_bootstrap='0' - if [[ -d /home/$USER/$CONFIG_DIR ]]; then + if [[ -d $FLUX_DAEMON_PATH ]]; then if whiptail --yesno "Would you like import old settings from daemon and Flux?" 8 65; then import_settings='1' skip_zelcash_config='1' @@ -976,7 +983,6 @@ function manual_build(){ telegram_bot_token="0" telegram_chat_id="0" fi - index_from_file="$index" tx_from_file="$outpoint" stak_info=$(curl -sSL -m 5 https://$network_url_1/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') @@ -1032,10 +1038,10 @@ function manual_build(){ swapon='1' if whiptail --yesno "Would you like enable thunder mode?" 8 60; then - thunder='1' - fi + thunder='1' + fi - rm /home/$USER/install_conf.json > /dev/null 2>&1 + rm $DATA_PATH/install_conf.json > /dev/null 2>&1 install_conf_create config_file echo -e @@ -1101,29 +1107,33 @@ function fluxos_clean(){ fi echo -e "${ARROW} ${CYAN}Removing syncthing...${NC}" - sudo pkill -9 syncthing > /dev/null 2>&1 - sudo apt-get remove --purge syncthing -y > /dev/null 2>&1 - sudo apt-get autoremove -y > /dev/null 2>&1 - - if [[ $resource_check != 0 ]]; then - echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 - df | egrep 'flux' | awk '{ print $1}' | - while read line; do - sudo umount -l $line && sleep 1 - done - fi - if [[ -d /home/$USER/zelflux/ZelApps && $(find /home/$USER/zelflux/ZelApps -maxdepth 1 -mindepth 1 -type d | wc -l) -gt 1 ]]; then - echo -e "${ARROW} ${CYAN}Cleaning FluxOS Apps directory...${NC}" && sleep 1 - APPS_LIST=($(find /home/$USER/zelflux/ZelApps -maxdepth 1 -mindepth 1 -type d -printf '%P\n')) - LENGTH=${#APPS_LIST[@]} - for (( j=0; j<${LENGTH}; j++ )); - do - if [[ "${APPS_LIST[$j]}" != "ZelShare" && "${APPS_LIST[$j]}" != "" ]]; then - echo -e "${ARROW} ${CYAN}Apps directory removed, path: ${GREEN}/home/$USER/zelflux/ZelApps/${APPS_LIST[$j]}${NC}" - sudo rm -rf /home/$USER/zelflux/ZelApps/${APPS_LIST[$j]} - fi - done - fi + if [[ "$FLUXOS_VERSION" == "" ]]; then + sudo pkill -9 syncthing > /dev/null 2>&1 + sudo apt-get remove --purge syncthing -y > /dev/null 2>&1 + sudo apt-get autoremove -y > /dev/null 2>&1 + else + sudo systemctl stop syncthing > /dev/null 2>&1 + sudo rm /dat/usr/lib/syncthing/config.xml > /dev/null 2>&1 + fi + if [[ $resource_check != 0 ]]; then + echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 + df | egrep 'flux' | awk '{ print $1}' | + while read line; do + sudo umount -l $line && sleep 1 + done + fi + if [[ -d $FLUXOS_PATH/ZelApps && $(find $FLUXOS_PATH/ZelApps -maxdepth 1 -mindepth 1 -type d | wc -l) -gt 1 ]]; then + echo -e "${ARROW} ${CYAN}Cleaning FluxOS Apps directory...${NC}" && sleep 1 + APPS_LIST=($(find $FLUXOS_PATH/ZelApps -maxdepth 1 -mindepth 1 -type d -printf '%P\n')) + LENGTH=${#APPS_LIST[@]} + for (( j=0; j<${LENGTH}; j++ )); + do + if [[ "${APPS_LIST[$j]}" != "ZelShare" && "${APPS_LIST[$j]}" != "" ]]; then + echo -e "${ARROW} ${CYAN}Apps directory removed, path: ${GREEN}$FLUXOS_PATH/ZelApps/${APPS_LIST[$j]}${NC}" + sudo rm -rf $FLUXOS_PATH/ZelApps/${APPS_LIST[$j]} + fi + done + fi } function round() { @@ -1291,36 +1301,36 @@ function status_loop() { } function import_config_file() { - if [[ -f /home/$USER/install_conf.json ]]; then - import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') + if [[ -f $DATA_PATH/install_conf.json ]]; then + import_settings=$(cat $DATA_PATH/install_conf.json | jq -r '.import_settings') #Daemon - bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') - bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') - use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') - prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') - outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') - index=$(cat /home/$USER/install_conf.json | jq -r '.index') + bootstrap_url=$(cat $DATA_PATH/install_conf.json | jq -r '.bootstrap_url') + bootstrap_zip_del=$(cat $DATA_PATH/install_conf.json | jq -r '.bootstrap_zip_del') + use_old_chain=$(cat $DATA_PATH/install_conf.json | jq -r '.use_old_chain') + prvkey=$(cat $DATA_PATH/install_conf.json | jq -r '.prvkey') + outpoint=$(cat $DATA_PATH/install_conf.json | jq -r '.outpoint') + index=$(cat $DATA_PATH/install_conf.json | jq -r '.index') #FluxOS - ZELID=$(cat /home/$USER/install_conf.json | jq -r '.zelid') - KDA_A=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') + ZELID=$(cat $DATA_PATH/install_conf.json | jq -r '.zelid') + KDA_A=$(cat $DATA_PATH/install_conf.json | jq -r '.kda_address') #Benchmark - thunder=$(cat /home/$USER/install_conf.json | jq -r '.thunder') + thunder=$(cat $DATA_PATH/install_conf.json | jq -r '.thunder') #WatchDog - fix_action=$(cat /home/$USER/install_conf.json | jq -r '.action') - flux_update=$(cat /home/$USER/install_conf.json | jq -r '.zelflux_update') - daemon_update=$(cat /home/$USER/install_conf.json | jq -r '.zelcash_update') - bench_update=$(cat /home/$USER/install_conf.json | jq -r '.zelbench_update') - node_label=$(cat /home/$USER/install_conf.json | jq -r '.node_label') - eps_limit=$(cat /home/$USER/install_conf.json | jq -r '.eps_limit') - discord=$(cat /home/$USER/install_conf.json | jq -r '.discord') - ping=$(cat /home/$USER/install_conf.json | jq -r '.ping') - telegram_alert=$(cat /home/$USER/install_conf.json | jq -r '.telegram_alert') - telegram_bot_token=$(cat /home/$USER/install_conf.json | jq -r '.telegram_bot_token') - telegram_chat_id=$(cat /home/$USER/install_conf.json | jq -r '.telegram_chat_id') + fix_action=$(cat $DATA_PATH/install_conf.json | jq -r '.action') + flux_update=$(cat $DATA_PATH/install_conf.json | jq -r '.zelflux_update') + daemon_update=$(cat $DATA_PATH/install_conf.json | jq -r '.zelcash_update') + bench_update=$(cat $DATA_PATH/install_conf.json | jq -r '.zelbench_update') + node_label=$(cat $DATA_PATH/install_conf.json | jq -r '.node_label') + eps_limit=$(cat $DATA_PATH/install_conf.json | jq -r '.eps_limit') + discord=$(cat $DATA_PATH/install_conf.json | jq -r '.discord') + ping=$(cat $DATA_PATH/install_conf.json | jq -r '.ping') + telegram_alert=$(cat $DATA_PATH/install_conf.json | jq -r '.telegram_alert') + telegram_bot_token=$(cat $DATA_PATH/install_conf.json | jq -r '.telegram_bot_token') + telegram_chat_id=$(cat $DATA_PATH/install_conf.json | jq -r '.telegram_chat_id') #UPnP - upnp_enabled=$(cat /home/$USER/install_conf.json | jq -r '.upnp_enabled') - upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') - gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') + upnp_enabled=$(cat $DATA_PATH/install_conf.json | jq -r '.upnp_enabled') + upnp_port=$(cat $DATA_PATH/install_conf.json | jq -r '.upnp_port') + gateway_ip=$(cat $DATA_PATH/install_conf.json | jq -r '.gateway_ip') if [[ "$1" != "silent" ]]; then echo -e "" echo -e "${ARROW} ${YELLOW}Install config:" @@ -1348,9 +1358,9 @@ function import_config_file() { fi if [[ ! -z "$gateway_ip" && ! -z "$upnp_port" ]]; then - if [[ "$upnp_port" != "null" ]]; then - echo -e "${PIN}${CYAN} Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" - fi + if [[ "$upnp_port" != "null" ]]; then + echo -e "${PIN}${CYAN} Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" + fi fi if [[ "$discord" != "" && "$discord" != "0" ]] || [[ "$telegram_alert" == '1' ]]; then @@ -1360,10 +1370,11 @@ function import_config_file() { fi if [[ "$thunder" == "1" ]]; then - echo -e "${PIN}${CYAN} Enable thunder mode..............................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 - fi - fi + echo -e "${PIN}${CYAN} Enable thunder mode..............................................[${CHECK_MARK}${CYAN}]${NC}" && sleep 1 + fi + fi + fi } function get_ip() { WANIP=$(curl --silent -m 15 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') @@ -1536,39 +1547,44 @@ function daemon_reconfiguration(){ sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 sudo fuser -k 16125/tcp > /dev/null 2>&1 if [[ "$zelnodeprivkey" != "" ]]; then - if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}Replace FluxNode Identity Key skipped....................[${CHECK_MARK}${CYAN}]${NC}" - else - sed -i "s/$(grep -e zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then - echo -e "${ARROW} ${CYAN}FluxNode Identity Key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" - fi + else + sed -i "s/$(grep -e zelnodeprivkey $FLUX_DAEMON_PATH/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" $FLUX_DAEMON_PATH/$CONFIG_FILE + if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then + echo -e "${ARROW} ${CYAN}FluxNode Identity Key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" + fi fi fi if [[ "$zelnodeoutpoint" != "" ]]; then - if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}Replace FluxNode Collateral TX ID outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" else - sed -i "s/$(grep -e zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + sed -i "s/$(grep -e zelnodeoutpoint $FLUX_DAEMON_PATH/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" $FLUX_DAEMON_PATH/$CONFIG_FILE + if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}FluxNode Collateral TX ID replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" fi fi fi if [[ "$zelnodeindex" != "" ]]; then - if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}Replace FluxNode Output Index skipped......................[${CHECK_MARK}${CYAN}]${NC}" else - sed -i "s/$(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" ~/$CONFIG_DIR/$CONFIG_FILE - if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex ~/$CONFIG_DIR/$CONFIG_FILE) ]]; then + sed -i "s/$(grep -w zelnodeindex $FLUX_DAEMON_PATH/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" $FLUX_DAEMON_PATH/$CONFIG_FILE + if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}FluxNode Output Index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" fi fi fi - pm2 restart flux > /dev/null 2>&1 - sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 + if [[ -z $FLUXOS_VERSION]]; then + pm2 restart flux > /dev/null 2>&1 + sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 + else + sudo systemctl start fluxos > /dev/null 2>&1 && sleep 2 + sudo systemctl start fluxd > /dev/null 2>&1 && sleep 2 + fi NUM='35' MSG1='Restarting daemon service...' MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" @@ -1593,7 +1609,7 @@ function replace_kadena { done fi kda_address="kadena:$KDA_A?chainid=0" - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "kadena") != "" ]]; then + if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "kadena") != "" ]]; then config_builder "kadena" "$kda_address" "Kadena address" "fluxos" ##insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" " kadena: '$kda_address'," ##echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" @@ -1613,7 +1629,7 @@ function replace_zelid() { done - if [[ $(grep -w $new_zelid /home/$USER/zelflux/config/userconfig.js) != "" ]]; then + if [[ $(grep -w $new_zelid $FLUXOS_PATH/config/userconfig.js) != "" ]]; then echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" else config_builder "zelid" "$new_zelid" "ZEL ID" "fluxos" @@ -1625,42 +1641,54 @@ function replace_zelid() { function thunder_mode(){ - if [[ -d $HOME/.fluxbenchmark ]]; then - sudo chown -R $USER:$USER $HOME/.fluxbenchmark > /dev/null 2>&1 + if [[ -d $FLUX_BENCH_PATH ]]; then + sudo chown -R $USER:$USER $FLUX_BENCH_PATH > /dev/null 2>&1 else - mkdir -p $HOME/.fluxbenchmark > /dev/null 2>&1 + mkdir -p $FLUX_BENCH_PATH > /dev/null 2>&1 fi - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - if [[ $(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf) == "" ]]; then + if [[ -f $FLUX_BENCH_PATH/fluxbench.conf ]]; then + if [[ $(grep -e "thunder" $FLUX_BENCH_PATH/fluxbench.conf) == "" ]]; then config_builder "thunder" "1" "Thunder Mode" "benchmark" else - sed -i "/$(grep -e "thunder" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 + sed -i "/$(grep -e "thunder" $FLUX_BENCH_PATH/fluxbench.conf)/d" $FLUX_BENCH_PATH/fluxbench.conf > /dev/null 2>&1 echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Thunder Mode disabled successful${NC}" "${CHECK_MARK}" fi else config_builder "thunder" "1" "Thunder Mode" "benchmark" fi if [[ "$1" == "" ]]; then - echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Restarting service... ${NC}" - sudo systemctl restart zelcash > /dev/null 2>&1 + echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Restarting service... ${NC}" + if [[ -z $FLUXOS_VERSION]]; then + sudo systemctl restart zelcash > /dev/null 2>&1 + else + sudo systemctl restart fluxd > /dev/null 2>&1 + fi fi } function development_mode(){ - if [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "development: 'false'") != "" ]] || [[ $(cat /home/$USER/$FLUX_DIR/config/userconfig.js | grep "development: false") ]]; then + if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "development: 'false'") != "" ]] || [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "development: false") ]]; then echo -e "${ARROW}${GREEN} [FluxOS] ${CYAN}Enabling development mode... ${NC}" config_builder "development" "true" "Development Mode" "fluxos" - cd $HOME/$FLUX_DIR + cd $FLUXOS_PATH git checkout development && git pull > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 + if [[ -z $FLUXOS_VERSION]]; then + pm2 restart flux > /dev/null 2>&1 + else + sudo systemctl restart fluxos > /dev/null 2>&1 + fi else echo -e "${ARROW}${GREEN} [FluxOS] ${CYAN}Disabling development mode... ${NC}" config_builder "development" "false" "Development Mode" "fluxos" - cd $HOME/$FLUX_DIR + cd $FLUXOS_PATH git checkout master && git pull > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 + if [[ -z $FLUXOS_VERSION]]; then + pm2 restart flux > /dev/null 2>&1 + else + sudo systemctl restart fluxos > /dev/null 2>&1 + fi fi } @@ -1674,7 +1702,7 @@ function fluxos_reconfiguration { echo -e "${NC}" exit fi - if ! [[ -f /home/$USER/zelflux/config/userconfig.js ]]; then + if ! [[ -f $FLUXOS_PATH/config/userconfig.js ]]; then echo -e "${WORNING} ${CYAN}FluxOS userconfig.js not exist, operation aborted${NC}" echo -e "" exit @@ -1837,12 +1865,12 @@ function bootstrap_new() { fi return else - if [[ ! -f /home/$USER/install_conf.json ]]; then + if [[ ! -f $DATA_PATH/install_conf.json ]]; then bootstrap_manual if [[ "$Mode" != "install" && "$server_offline" == "0" ]]; then start_service if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - sudo rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 && sleep 2 + sudo rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 && sleep 2 fi fi return @@ -1860,16 +1888,16 @@ function bootstrap_new() { stop_service fi echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" else if [[ "$Mode" != "install" ]]; then stop_service fi DOWNLOAD_URL="$bootstrap_url" echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" fi if [[ "$Mode" != "install" ]]; then @@ -1877,10 +1905,10 @@ function bootstrap_new() { fi if [[ -z "$bootstrap_zip_del" ]]; then - rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 + rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 else if [[ "$bootstrap_zip_del" == "1" ]]; then - rm -rf /home/$USER/$BOOTSTRAP_FILE > /dev/null 2>&1 + rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 fi fi } @@ -1908,26 +1936,26 @@ function bootstrap_manual() { echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" fi echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress if [[ "$Mode" != "install" ]]; then stop_service fi - tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" sleep 1 ;; "2)") DOWNLOAD_URL="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" BOOTSTRAP_FILE="${DOWNLOAD_URL##*/}" - wget --tries 5 -O $BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress if [[ "$Mode" != "install" ]]; then stop_service fi if [[ "$BOOTSTRAP_FILE" == *".zip"* ]]; then echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $BOOTSTRAP_FILE -d /home/$USER/$CONFIG_DIR > /dev/null 2>&1 + unzip -o $DATA_PATH/$BOOTSTRAP_FILE -d $FLUX_DAEMON_PATH > /dev/null 2>&1 else - tar_file_unpack "/home/$USER/$BOOTSTRAP_FILE" "/home/$USER/$CONFIG_DIR" + tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" sleep 1 fi ;; @@ -1935,7 +1963,7 @@ function bootstrap_manual() { } function bootstrap_local() { local BOOTSTRAP_STEM="flux_explorer_bootstrap" - local BOOTSTRAP_FILES=($(ls /home/$USER/$BOOTSTRAP_STEM.{tar,tar.gz} 2>/dev/null)) + local BOOTSTRAP_FILES=($(ls $DATA_PATH/$BOOTSTRAP_STEM.{tar,tar.gz} 2>/dev/null)) if [ "$BOOTSTRAP_FILES" -a ${#BOOTSTRAP_FILES[@]} ]; then # we take the first bootstrap file @@ -1946,32 +1974,47 @@ function bootstrap_local() { if [[ "$Mode" != "install" ]]; then stop_service fi - tar_file_unpack "$FILE_PATH" "/home/$USER/$CONFIG_DIR" + tar_file_unpack "$FILE_PATH" "$FLUX_DAEMON_PATH" fi fi } function flux_chain_date_wipe() { - if [[ -e ~/$CONFIG_DIR/blocks ]] && [[ -e ~/$CONFIG_DIR/chainstate ]]; then + if [[ -e $FLUX_DAEMON_PATH/blocks ]] && [[ -e $FLUX_DAEMON_PATH/chainstate ]]; then echo -e "${ARROW} ${CYAN}Removing blocks, chainstate, determ_zelnodes directories...${NC}" - rm -rf ~/$CONFIG_DIR/blocks ~/$CONFIG_DIR/chainstate ~/$CONFIG_DIR/determ_zelnodes > /dev/null 2>&1 + rm -rf $FLUX_DAEMON_PATH/blocks $FLUX_DAEMON_PATH/chainstate $FLUX_DAEMON_PATH/determ_zelnodes > /dev/null 2>&1 fi } function stop_service() { - pm2 stop watchdog > /dev/null 2>&1 && sleep 2 - echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" - sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 - sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + echo -e "${ARROW} ${CYAN}Stopping Flux daemon service${NC}" + if [[ -z $FLUXOS_VERSION ]]; then + pm2 stop watchdog > /dev/null 2>&1 && sleep 2 + sudo systemctl stop zelcash > /dev/null 2>&1 && sleep 2 + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + else + sudo systemctl stop flux-watchdog > /dev/null 2>&1 && sleep 2 + sudo systemctl stop fluxd > /dev/null 2>&1 && sleep 2 + sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 + fi flux_chain_date_wipe } function start_service() { - sudo systemctl start zelcash > /dev/null 2>&1 && sleep 2 + if [[ -z $FLUXOS_VERSION ]]; then + sudo systemctl start zelcash > /dev/null 2>&1 && sleep 2 + else + sudo systemctl start fluxd > /dev/null 2>&1 && sleep 2 + fi NUM='35' MSG1='Starting Flux daemon service...' MSG2="${CYAN}........................[${CHECK_MARK}${CYAN}]${NC}" spinning_timer echo -e "" && echo -e "" - pm2 restart flux > /dev/null 2>&1 && sleep 2 - pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 + if [[ -z $FLUXOS_VERSION ]]; then + pm2 restart flux > /dev/null 2>&1 && sleep 2 + pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 + else + sudo systemctl restart fluxos > /dev/null 2>&1 && sleep 2 + sudo systemctl start flux-watchdog > /dev/null 2>&1 && sleep 2 + fi } ######### INSTALLATION SECTION ############################ function install_mongod() { @@ -2491,13 +2534,13 @@ function log_rotate() { } #### UPnP function upnp_enable() { - if [[ -d $HOME/.fluxbenchmark ]]; then - sudo chown -R $USER:$USER $HOME/.fluxbenchmark > /dev/null 2>&1 + if [[ -d $FLUX_BENCH_PATH ]]; then + sudo chown -R $USER:$USER $FLUX_BENCH_PATH > /dev/null 2>&1 fi try="0" echo -e "" echo -e "${ARROW}${YELLOW} Creating UPnP configuration...${NC}" - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + if [[ ! -f $FLUXOS_PATH/config/userconfig.js ]]; then echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" echo -e "" return @@ -2525,23 +2568,14 @@ function upnp_enable() { fi fi done - #if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep "apiport") != "" ]]; then - #sed -i "s/$(grep -e apiport /home/$USER/zelflux/config/userconfig.js)/apiport: '$FLUX_PORT',/" /home/$USER/zelflux/config/userconfig.js - #if [[ $(grep -w $FLUX_PORT /home/$USER/zelflux/config/userconfig.js) != "" ]]; then - #echo -e "${ARROW} ${CYAN}FluxOS port replaced successfully...................[${CHECK_MARK}${CYAN}]${NC}" - #fi - #else - #insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" "apiport: '$FLUX_PORT'," - #echo -e "${ARROW} ${CYAN}FluxOS port set successfully........................[${CHECK_MARK}${CYAN}]${NC}" - #fi config_builder "apiport" "$FLUX_PORT" "MultiPort Mode" "fluxos" - if [[ ! -d /home/$USER/.fluxbenchmark ]]; then - sudo mkdir -p /home/$USER/.fluxbenchmark 2>/dev/null + if [[ ! -d $FLUX_BENCH_PATH ]]; then + sudo mkdir -p $FLUX_BENCH_PATH 2>/dev/null config_builder "fluxport" "$FLUX_PORT" "MultiPort Mode" "benchmark" else config_builder "fluxport" "$FLUX_PORT" "MultiPort Mode" "benchmark" fi - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then + if [[ -f $FLUX_BENCH_PATH/fluxbench.conf ]]; then #API PORT sudo ufw allow $FLUX_PORT > /dev/null 2>&1 #HOME UI PORT @@ -2611,8 +2645,13 @@ function upnp_enable() { fi if [[ "$1" != "install" ]]; then echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark.....${NC}" - sudo systemctl restart zelcash > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 + if [[ -z $FLUXOS_VERSION ]]; then + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + else + sudo systemctl restart fluxd > /dev/null 2>&1 + sudo systemctl restart fluxos > /dev/null 2>&1 + fi sleep 150 echo -e "${ARROW}${CYAN} Checking FluxOS logs... ${NC}" error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") @@ -2682,9 +2721,9 @@ function selfhosting_creator(){ case $CHOICE in "1)") echo -e "${ARROW} ${YELLOW}Creating cron service for ip rotate...${NC}" - if [[ -f /home/$USER/device_conf.json ]]; then - sudo rm -rf /home/$USER/device_conf.json - echo -e "${ARROW} ${CYAN}Removing config file, path: ${GREEN}/home/$USER/device_conf.json${NC}" + if [[ -f $DATA_PATH/device_conf.json ]]; then + sudo rm -rf $DATA_PATH/device_conf.json + echo -e "${ARROW} ${CYAN}Removing config file, path: ${GREEN}$DATA_PATH/device_conf.json${NC}" fi selfhosting ;; @@ -2702,13 +2741,13 @@ function selfhosting_creator(){ fi done; device_setup=$( - whiptail --title " SELECT YOUR DEVICE INTERFACE " \ - --radiolist " \n Use the UP/DOWN arrows to highlight the device name you want. Press Spacebar on the device name you want to select, THEN press ENTER." 25 55 10 \ - "${choices[@]}" \ - 3>&2 2>&1 1>&3 + whiptail --title " SELECT YOUR DEVICE INTERFACE " \ + --radiolist " \n Use the UP/DOWN arrows to highlight the device name you want. Press Spacebar on the device name you want to select, THEN press ENTER." 25 55 10 \ + "${choices[@]}" \ + 3>&2 2>&1 1>&3 ); if [[ "$device_setup" != "" ]]; then - if [[ ! -f /home/$USER/device_conf.json ]]; then + if [[ ! -f $DATA_PATH/device_conf.json ]]; then echo "{}" > device_conf.json fi echo "$(jq -r --arg value "$device_setup" '.device_name=$value' device_conf.json)" > device_conf.json @@ -2725,8 +2764,8 @@ function selfhosting_creator(){ echo -e "${ARROW} ${CYAN}Removing cron jobs...${NC}" crontab -u $USER -l | grep -v 'ip_check' | crontab -u $USER - echo -e "${ARROW} ${CYAN}Removing of files related to IP rotation...${NC}" - rm -rf /home/$USER/device_conf.json > /dev/null 2>&1 - rm -rf /home/$USER/ip_check.sh > /dev/null 2>&1 + rm -rf $DATA_PATH/device_conf.json > /dev/null 2>&1 + rm -rf $DATA_PATH/ip_check.sh > /dev/null 2>&1 echo -e "" esac } @@ -2747,7 +2786,7 @@ function selfhosting() { echo -e "${ARROW} ${CYAN}Device auto detection, name: ${GREEN}$device_name ${NC}" fi else - device_name="$device_setup" + device_name="$device_setup" fi if [[ "$device_name" != "" && "$WANIP" != "" ]]; then @@ -2759,11 +2798,18 @@ function selfhosting() { return 1 fi echo -e "${ARROW} ${CYAN}Creating IP check script...${NC}" && sleep 1 - sudo rm /home/$USER/ip_check.sh > /dev/null 2>&1 - sudo touch /home/$USER/ip_check.sh - sudo chown $USER:$USER /home/$USER/ip_check.sh - cat <<-'EOF' > /home/$USER/ip_check.sh + sudo rm $DATA_PATH/ip_check.sh > /dev/null 2>&1 + sudo touch $DATA_PATH/ip_check.sh + sudo chown $USER:$USER $DATA_PATH/ip_check.sh + cat <<-'EOF' > $DATA_PATH/ip_check.sh #!/bin/bash + if [[ "$FLUXOS_VERSION" == "" ]]; then + DATA_PATH="/home/$USER" + FLUXOS_PATH="/home/$USER/zelflux" + else + DATA_PATH="/dat" + FLUXOS_PATH="/dat/usr/lib/fluxos" + fi function get_ip(){ WANIP=$(curl --silent -m 10 https://api4.my-ip.io/ip | tr -dc '[:alnum:].') @@ -2776,8 +2822,8 @@ function selfhosting() { } function get_device_name(){ - if [[ -f /home/$USER/device_conf.json ]]; then - device_name=$(jq -r .device_name /home/$USER/device_conf.json) + if [[ -f $DATA_PATH/device_conf.json ]]; then + device_name=$(jq -r .device_name $DATA_PATH/device_conf.json) else device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') fi @@ -2790,14 +2836,14 @@ function selfhosting() { get_device_name if [[ "$device_name" != "" && "$WANIP" != "" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected during $1, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log + echo -e "New IP detected during $1, IP: $WANIP was added to $device_name at $date_timestamp" >> $DATA_PATH/ip_history.log sudo ip addr add $WANIP dev $device_name && sleep 2 fi fi if [[ $1 == "ip_check" ]]; then get_ip get_device_name - api_port=$(grep -w apiport /home/$USER/zelflux/config/userconfig.js | grep -o '[[:digit:]]*') + api_port=$(grep -w apiport $FLUXOS_PATH/config/userconfig.js | grep -o '[[:digit:]]*') if [[ "$api_port" == "" ]]; then api_port="16127" fi @@ -2805,23 +2851,26 @@ function selfhosting() { if [[ "$WANIP" != "" && "$confirmed_ip" != "" && "$confirmed_ip" != "null" ]]; then if [[ "$WANIP" != "$confirmed_ip" ]]; then date_timestamp=$(date '+%Y-%m-%d %H:%M:%S') - echo -e "New IP detected during $1, IP: $WANIP was added to $device_name at $date_timestamp" >> /home/$USER/ip_history.log + echo -e "New IP detected during $1, IP: $WANIP was added to $device_name at $date_timestamp" >> $DATA_PATH/ip_history.log sudo ip addr add $WANIP dev $device_name && sleep 2 fi fi fi EOF - sudo chmod +x /home/$USER/ip_check.sh + sudo chmod +x $DATA_PATH/ip_check.sh sudo [ -f /var/spool/cron/crontabs/$USER ] && crontab_check=$(sudo cat /var/spool/cron/crontabs/$USER | grep -o ip_check | wc -l) || crontab_check=0 - if [[ "$crontab_check" != "0" ]]; then echo -e "${ARROW} ${CYAN}Removing old cron jobs...${NC}" crontab -u $USER -l | grep -v 'ip_check' | crontab -u $USER - fi - echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 - (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=\$LOGNAME \$HOME/ip_check.sh restart") | crontab - - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=\$LOGNAME \$HOME/ip_check.sh ip_check") | crontab - + if [[ "$FLUXOS_VERSION" == "" ]]; then + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=\$LOGNAME \$HOME/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=\$LOGNAME \$HOME/ip_check.sh ip_check") | crontab - + else + (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=\$LOGNAME /dat/ip_check.sh restart") | crontab - + (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=\$LOGNAME /dat/ip_check.sh ip_check") | crontab - + fi echo -e "${ARROW} ${CYAN}Script installed! ${NC}" echo -e "" } @@ -2845,7 +2894,7 @@ function multinode(){ echo -e "${BOOK} ${RED}If FluxOs fails to communicate with router or upnp fails it will shutdown FluxOS... ${NC}" echo -e "" echo -e "${YELLOW}================================================================${NC}" - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then + if [[ ! -f $FLUXOS_PATH/config/userconfig.js ]]; then echo -e "" echo -e "${WORNING} ${CYAN}First install FluxNode...${NC}" echo -e "${WORNING} ${CYAN}Operation stopped...${NC}" @@ -2855,43 +2904,7 @@ function multinode(){ sleep 8 bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) } -function install_watchtower(){ - echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - echo -e "" - echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" - apps_check=$(docker ps | grep "flux_watchtower") - if [[ "$apps_check" != "" ]]; then - echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" - docker stop flux_watchtower > /dev/null 2>&1 - sleep 2 - echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" - docker rm flux_watchtower > /dev/null 2>&1 - fi - echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" - docker pull containrrr/watchtower:latest > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" - random=$(shuf -i 7500-35000 -n 1) - echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" - apps_id=$(docker run -d \ - --restart unless-stopped \ - --name flux_watchtower \ - -v /var/run/docker.sock:/var/run/docker.sock \ - containrrr/watchtower \ - --cleanup --interval $random 2> /dev/null) - if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then - echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" - else - echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" - fi -} + function analyzer_and_fixer(){ echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" echo -e "${YELLOW}================================================================${NC}" From 857a9802585bdc153c67b055dbf9a594013c84e5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:53:02 +0100 Subject: [PATCH 1041/1176] conditional correction --- flux_common.sh | 127 ++++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 65 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 68f5bf9d..8541e3c2 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -54,7 +54,7 @@ PORT=16125 export NEWT_COLORS=' title=black, ' -if [[ "$FLUXOS_VERSION" == "" ]]; then +if [[ -z $FLUXOS_VERSION ]]; then FLUXOS_PATH="/home/$USER/zelflux" FLUX_WATCHDOG_PATH="/home/$USER/watchdog" FLUX_DAEMON_PATH="/home/$USER/.flux" @@ -233,18 +233,18 @@ function buildBlockedPortsList() { key="$1" value="$2" if [[ $(cat "$FLUXOS_PATH/config/userconfig.js" | grep "$key") == "" ]]; then - insert "$FLUXOS_PATH/config/userconfig.js" "testnet" " $key: $value," - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3${NC}" "${CHECK_MARK}" - return + insert "$FLUXOS_PATH/config/userconfig.js" "testnet" " $key: $value," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3${NC}" "${CHECK_MARK}" + return fi } function CreateBlockedPortsList() { ADD=$(whiptail --inputbox "Enter the ports to the blocked list, separated by commas" 8 85 3>&1 1>&2 2>&3) if [[ $? == 1 ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" - echo -e "" - exit + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}The operation was canceled${NC}" "${X_MARK}" + echo -e "" + exit fi NumberCheck=$(sed 's/,/1/g' <<< $ADD) ADD=$(sed 's/,/ /g' <<< $ADD) @@ -368,19 +368,19 @@ function AddBlockedRepository() { function buildBlockedRepositoryList() { if [[ ! -f "$FLUXOS_PATH/config/userconfig.js" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" - exit + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + exit fi if [[ "$1" == "" || "$2" == "" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" - exit + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + exit fi key="$1" value="$2" if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "$key") == "" ]]; then - insert "$FLUXOS_PATH/config/userconfig.js" "testnet" " $key: $value," - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3${NC}" "${CHECK_MARK}" - return + insert "$FLUXOS_PATH/config/userconfig.js" "testnet" " $key: $value," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3${NC}" "${CHECK_MARK}" + return fi } @@ -472,21 +472,21 @@ function config_builder() { fi fi if [[ ! -f $FLUXOS_PATH/config/userconfig.js ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" - return + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + return fi if [[ "$1" == "" || "$2" == "" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" - return + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + return fi if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "$key") == "" ]]; then - insert "$FLUXOS_PATH/config/userconfig.js" "testnet" " $key: $value," - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" - return + insert "$FLUXOS_PATH/config/userconfig.js" "testnet" " $key: $value," + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" + return fi if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "$key" | grep "$value_check") != "" ]]; then - padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 skipped${NC}" "${X_MARK}" - return + padding "${ARROW}${GREEN} [FluxOS] ${CYAN}$3 skipped${NC}" "${X_MARK}" + return fi if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "$key") != "" ]]; then RemoveLine "$key" @@ -497,28 +497,28 @@ function config_builder() { ##################################################### if [[ "$4" == "daemon" ]]; then if [[ ! -f $FLUX_DAEMON_PATH/$CONFIG_FILE ]]; then - padding "${ARROW}${GREEN} [Daemon] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" - return + padding "${ARROW}${GREEN} [Daemon] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + return fi if [[ "$1" == "" || "$2" == "" ]]; then - padding "${ARROW}${GREEN} [Daemon] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" - return + padding "${ARROW}${GREEN} [Daemon] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + return fi if [[ ! $(grep -w $1 $FLUX_DAEMON_PATH/$CONFIG_FILE) && -f $FLUX_DAEMON_PATH/$CONFIG_FILE ]]; then echo "$1=$2" >> $FLUX_DAEMON_PATH/$CONFIG_FILE if [[ "$1=$2" == $(grep -w $1 $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then - padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" - return + padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" + return fi fi if [[ "$1=$2" == $(grep -w $1 $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then - padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 skipped${NC}" "${X_MARK}" - return + padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 skipped${NC}" "${X_MARK}" + return else - sed -i "s/$(grep -e $1 $FLUX_DAEMON_PATH/$CONFIG_FILE)/$1=$2/" $FLUX_DAEMON_PATH/$CONFIG_FILE - if [[ "$1=$2" == $(grep -w $1 $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then - padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" - fi + sed -i "s/$(grep -e $1 $FLUX_DAEMON_PATH/$CONFIG_FILE)/$1=$2/" $FLUX_DAEMON_PATH/$CONFIG_FILE + if [[ "$1=$2" == $(grep -w $1 $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then + padding "${ARROW}${GREEN} [Daemon] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" + fi fi fi ################################################### @@ -531,39 +531,39 @@ function config_builder() { mkdir -p $FLUX_BENCH_PATH > /dev/null 2>&1 echo "$1=$2" >> $FLUX_BENCH_PATH/fluxbench.conf if [[ "$1=$2" == $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" - return + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" + return fi fi if [[ ! $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then echo "$1=$2" >> $FLUX_BENCH_PATH/fluxbench.conf if [[ "$1=$2" == $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" - return + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 added successfully${NC}" "${CHECK_MARK}" + return fi fi if [[ "$1=$2" == $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 skipped${NC}" "${X_MARK}" + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 skipped${NC}" "${X_MARK}" else - sed -i "s/$(grep -e $1 $FLUX_BENCH_PATH/fluxbench.conf)/$1=$2/" $FLUX_BENCH_PATH/fluxbench.conf - if [[ "$1=$2" == $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then - padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" - fi + sed -i "s/$(grep -e $1 $FLUX_BENCH_PATH/fluxbench.conf)/$1=$2/" $FLUX_BENCH_PATH/fluxbench.conf + if [[ "$1=$2" == $(grep -w $1 $FLUX_BENCH_PATH/fluxbench.conf) ]]; then + padding "${ARROW}${GREEN} [BenchD] ${CYAN}$3 replaced successfully${NC}" "${CHECK_MARK}" + fi fi fi ################################################### if [[ "$4" == "watchdog" ]]; then if [[ ! -f "$FLUX_WATCHDOG_PATH/config.js" ]]; then - padding "${ARROW}${GREEN} [WatchD] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" - return + padding "${ARROW}${GREEN} [WatchD] ${CYAN}Config file does not exist...${NC}" "${X_MARK}" + return fi if [[ "$1" == "" || "$2" == "" ]]; then - padding "${ARROW}${GREEN} [WatchD] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" - return + padding "${ARROW}${GREEN} [WatchD] ${CYAN}Empty key/value skipped${NC}" "${X_MARK}" + return fi if [[ $(cat $FLUX_WATCHDOG_PATH/config.js | grep "$1: '$2'") != "" ]]; then - padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 skipped${NC}" "${X_MARK}" - return + padding "${ARROW}${GREEN} [WatchD] ${CYAN}$3 skipped${NC}" "${X_MARK}" + return fi if [[ $(cat $FLUX_WATCHDOG_PATH/config.js | grep "$1") != "" ]]; then sed -i "s/$(grep -e $1 $FLUX_WATCHDOG_PATH/config.js)/ $1: '$2',/" $FLUX_WATCHDOG_PATH/config.js @@ -602,7 +602,6 @@ END install_settings=($(jq -r 'keys | @sh' $DATA_PATH/install_conf.json)) for i in "${install_settings[@]}" do - install_key=$(echo $i | tr -d "'") key=$(jq -r .$install_key[].key 2> /dev/null <<< "$config_list") if [[ "$key" == "" ]]; then @@ -1107,7 +1106,7 @@ function fluxos_clean(){ fi echo -e "${ARROW} ${CYAN}Removing syncthing...${NC}" - if [[ "$FLUXOS_VERSION" == "" ]]; then + if [[ -z $FLUXOS_VERSION ]]; then sudo pkill -9 syncthing > /dev/null 2>&1 sudo apt-get remove --purge syncthing -y > /dev/null 2>&1 sudo apt-get autoremove -y > /dev/null 2>&1 @@ -1578,7 +1577,7 @@ function daemon_reconfiguration(){ fi fi fi - if [[ -z $FLUXOS_VERSION]]; then + if [[ -z $FLUXOS_VERSION ]]; then pm2 restart flux > /dev/null 2>&1 sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 else @@ -1592,7 +1591,6 @@ function daemon_reconfiguration(){ echo -e "" && echo -e "" } function replace_kadena { - if [[ -z "$KDA_A" ]]; then while true do @@ -1627,8 +1625,6 @@ function replace_zelid() { sleep 2 fi done - - if [[ $(grep -w $new_zelid $FLUXOS_PATH/config/userconfig.js) != "" ]]; then echo -e "${ARROW} ${CYAN}Replace ZEL ID skipped............................[${CHECK_MARK}${CYAN}]${NC}" else @@ -1640,7 +1636,6 @@ function replace_zelid() { } function thunder_mode(){ - if [[ -d $FLUX_BENCH_PATH ]]; then sudo chown -R $USER:$USER $FLUX_BENCH_PATH > /dev/null 2>&1 else @@ -1659,10 +1654,11 @@ function thunder_mode(){ fi if [[ "$1" == "" ]]; then echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Restarting service... ${NC}" - if [[ -z $FLUXOS_VERSION]]; then + if [[ -z $FLUXOS_VERSION ]]; then sudo systemctl restart zelcash > /dev/null 2>&1 else sudo systemctl restart fluxd > /dev/null 2>&1 + sudo systemctl restart fluxbenchd > /dev/null 2>&1 fi fi @@ -1674,7 +1670,7 @@ function development_mode(){ config_builder "development" "true" "Development Mode" "fluxos" cd $FLUXOS_PATH git checkout development && git pull > /dev/null 2>&1 - if [[ -z $FLUXOS_VERSION]]; then + if [[ -z $FLUXOS_VERSION ]]; then pm2 restart flux > /dev/null 2>&1 else sudo systemctl restart fluxos > /dev/null 2>&1 @@ -1684,7 +1680,7 @@ function development_mode(){ config_builder "development" "false" "Development Mode" "fluxos" cd $FLUXOS_PATH git checkout master && git pull > /dev/null 2>&1 - if [[ -z $FLUXOS_VERSION]]; then + if [[ -z $FLUXOS_VERSION ]]; then pm2 restart flux > /dev/null 2>&1 else sudo systemctl restart fluxos > /dev/null 2>&1 @@ -1993,6 +1989,7 @@ function stop_service() { else sudo systemctl stop flux-watchdog > /dev/null 2>&1 && sleep 2 sudo systemctl stop fluxd > /dev/null 2>&1 && sleep 2 + sudo systemctl stop fluxbenchd > /dev/null 2>&1 sudo fuser -k 16125/tcp > /dev/null 2>&1 && sleep 1 fi flux_chain_date_wipe @@ -2002,6 +1999,7 @@ function start_service() { sudo systemctl start zelcash > /dev/null 2>&1 && sleep 2 else sudo systemctl start fluxd > /dev/null 2>&1 && sleep 2 + sudo systemctl start fluxbenchd > /dev/null 2>&1 fi NUM='35' MSG1='Starting Flux daemon service...' @@ -2012,8 +2010,8 @@ function start_service() { pm2 restart flux > /dev/null 2>&1 && sleep 2 pm2 start watchdog --watch > /dev/null 2>&1 && sleep 2 else - sudo systemctl restart fluxos > /dev/null 2>&1 && sleep 2 - sudo systemctl start flux-watchdog > /dev/null 2>&1 && sleep 2 + sudo systemctl restart fluxos > /dev/null 2>&1 && sleep 2 + sudo systemctl start flux-watchdog > /dev/null 2>&1 && sleep 2 fi } ######### INSTALLATION SECTION ############################ @@ -2803,7 +2801,7 @@ function selfhosting() { sudo chown $USER:$USER $DATA_PATH/ip_check.sh cat <<-'EOF' > $DATA_PATH/ip_check.sh #!/bin/bash - if [[ "$FLUXOS_VERSION" == "" ]]; then + if [[ -z $FLUXOS_VERSION ]]; then DATA_PATH="/home/$USER" FLUXOS_PATH="/home/$USER/zelflux" else @@ -2864,7 +2862,7 @@ function selfhosting() { crontab -u $USER -l | grep -v 'ip_check' | crontab -u $USER - fi echo -e "${ARROW} ${CYAN}Adding cron jobs...${NC}" && sleep 1 - if [[ "$FLUXOS_VERSION" == "" ]]; then + if [[ -z $FLUXOS_VERSION ]]; then (crontab -l -u "$USER" 2>/dev/null; echo "@reboot env USER=\$LOGNAME \$HOME/ip_check.sh restart") | crontab - (crontab -l -u "$USER" 2>/dev/null; echo "*/15 * * * * env USER=\$LOGNAME \$HOME/ip_check.sh ip_check") | crontab - else @@ -2904,7 +2902,6 @@ function multinode(){ sleep 8 bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) } - function analyzer_and_fixer(){ echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" echo -e "${YELLOW}================================================================${NC}" From 61004217a3a816ec3c3358e2821fc06ae5b89b31 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:19:18 +0100 Subject: [PATCH 1042/1176] Improve repair of MongoDB --- flux_common.sh | 1 - multitoolbox.sh | 171 +++++++++++++++++++++++++++--------------------- 2 files changed, 97 insertions(+), 75 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 8541e3c2..bc107789 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1104,7 +1104,6 @@ function fluxos_clean(){ sudo docker rm $line > /dev/null 2>&1 && sleep 2 done fi - echo -e "${ARROW} ${CYAN}Removing syncthing...${NC}" if [[ -z $FLUXOS_VERSION ]]; then sudo pkill -9 syncthing > /dev/null 2>&1 diff --git a/multitoolbox.sh b/multitoolbox.sh index 92b75337..3560f1b1 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -705,20 +705,26 @@ function install_watchtower(){ function mongod_db_fix() { echo -e "${GREEN}Module: MongoDB FiX action${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${NC}" exit fi - - - CHOICE=$( - whiptail --title "MongoDB FiX action" --menu "Make your choice" 15 65 8 \ - "1)" "Soft repair - MongoDB database repair" \ - "2)" "Hard repair - MongoDB re-install" 3>&2 2>&1 1>&3 - ) + if [[ -z $FLUXOS_VERSION ]]; then + CHOICE=$( + whiptail --title "MongoDB FiX action" --menu "Make your choice" 15 65 8 \ + "1)" "Soft repair - MongoDB database repair" \ + "2)" "Hard repair - MongoDB re-install" 3>&2 2>&1 1>&3 + ) + else + CHOICE=$( + whiptail --title "MongoDB FiX action" --menu "Make your choice" 15 65 8 \ + "1)" "Soft repair - MongoDB database repair" \ + "2)" "Hard repair - MongoDB wipe" 3>&2 2>&1 1>&3 + ) + fi case $CHOICE in "1)") echo -e "" @@ -726,9 +732,11 @@ function mongod_db_fix() { echo -e "${ARROW} ${CYAN}Stopping mongod service ${NC}" sudo systemctl stop mongod echo -e "${ARROW} ${CYAN}Fix for corrupted DB ${NC}" - sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair > /dev/null 2>&1 + sudo rm $MONGODB_DATA_PATH/journal/* > /dev/null 2>&1 + sudo rm $MONGODB_DATA_PATH/mongod.lock > /dev/null 2>&1 + sudo -u mongodb mongod --dbpath $MONGODB_DATA_PATH --repair > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Fix for bad privilege ${NC}" - sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 + sudo chown -R mongodb:mongodb $MONGODB_DATA_PATH > /dev/null 2>&1 sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting mongod service ${NC}" sudo systemctl start mongod @@ -737,8 +745,14 @@ function mongod_db_fix() { echo -e "${ARROW} ${CYAN}Service status:${SEA} $(sudo systemctl status mongod | grep -w 'Active' | sed -e 's/^[ \t]*//')${NC}" fi echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark...${NC}" - sudo systemctl restart zelcash > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 + if [[ -z $FLUXOS_VERSION ]]; then + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + else + sudo systemctl restart fluxd > /dev/null 2>&1 + sudo systemctl restart fluxbenchd > /dev/null 2>&1 + sudo systemctl restart fluxos > /dev/null 2>&1 + fi sleep 5 echo -e "" ;; @@ -747,73 +761,82 @@ function mongod_db_fix() { echo -e "${ARROW} ${YELLOW}Hard repair starting... ${NC}" echo -e "${ARROW} ${CYAN}Stopping mongod service...${NC}" sudo systemctl stop mongod - #sudo rm -rf /home/$USER/mongoDB_backup.gz > /dev/null 2>&1 - #echo -e "${ARROW} ${CYAN}Backuping Database... ${NC}" - #mongodump --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Removing MongoDB... ${NC}" - sudo apt-get remove -f mongodb-org* -y > /dev/null 2>&1 - sudo apt-get purge --allow-change-held-packages mongodb-org* -y > /dev/null 2>&1 - sudo apt autoremove -y > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Removing Database... ${NC}" - sudo rm -r /var/log/mongodb > /dev/null 2>&1 - sudo rm -r /var/lib/mongodb > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Installing MongoDB... ${NC}" - avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) - os_version=$(lsb_release -rs | tr -d '.') - architecture=$(dpkg --print-architecture) - - if [[ $(lsb_release -d) = *Debian* ]]; then - os_name="Debian" - fi - if [[ $(lsb_release -d) = *Ubuntu* ]]; then - os_name="Ubuntu" - fi - #Ubuntu MongoDB 4.4 - if [[ "$avx_check" == "" && "$os_name" == "Ubuntu" && "$architecture" == "amd64" && "$os_version" -le "2010" ]] || [[ "$os_name" == "Ubuntu" && "$architecture" == "arm64" && "$os_version" -le "2010" ]]; then - install_mongod="4.4" - fi - #Debian MongoDB 4.4 - if [[ "$avx_check" == "" && "$os_name" == "Debian" && "$architecture" == "amd64" && "$os_version" -le "9" ]] || [[ "$os_name" == "Debian" && "$architecture" == "arm64" && "$os_version" -le "9" ]]; then + if [[ -z $FLUXOS_VERSION ]]; then + echo -e "${ARROW} ${CYAN}Removing MongoDB... ${NC}" + sudo apt-get remove -f mongodb-org* -y > /dev/null 2>&1 + sudo apt-get purge --allow-change-held-packages mongodb-org* -y > /dev/null 2>&1 + sudo apt autoremove -y > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Removing Database... ${NC}" + sudo rm -r /var/log/mongodb > /dev/null 2>&1 + sudo rm -r /var/lib/mongodb > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Installing MongoDB... ${NC}" + avx_check=$(cat /proc/cpuinfo | grep -o avx | head -n1) + os_version=$(lsb_release -rs | tr -d '.') + architecture=$(dpkg --print-architecture) + if [[ $(lsb_release -d) = *Debian* ]]; then + os_name="Debian" + fi + if [[ $(lsb_release -d) = *Ubuntu* ]]; then + os_name="Ubuntu" + fi + #Ubuntu MongoDB 4.4 + if [[ "$avx_check" == "" && "$os_name" == "Ubuntu" && "$architecture" == "amd64" && "$os_version" -le "2010" ]] || [[ "$os_name" == "Ubuntu" && "$architecture" == "arm64" && "$os_version" -le "2010" ]]; then install_mongod="4.4" - fi - if [[ "$install_mongod" == "4.4" ]]; then - sudo apt update -y > /dev/null 2>&1 - sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 - echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 && sleep 2 - echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 - echo "mongodb-org-shell hold" | sudo dpkg --set-selections > /dev/null 2>&1 - echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 - echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 + fi + #Debian MongoDB 4.4 + if [[ "$avx_check" == "" && "$os_name" == "Debian" && "$architecture" == "amd64" && "$os_version" -le "9" ]] || [[ "$os_name" == "Debian" && "$architecture" == "arm64" && "$os_version" -le "9" ]]; then + install_mongod="4.4" + fi + if [[ "$install_mongod" == "4.4" ]]; then + sudo apt update -y > /dev/null 2>&1 + sudo apt install -y mongodb-org=4.4.18 mongodb-org-server=4.4.18 mongodb-org-shell=4.4.18 mongodb-org-mongos=4.4.18 mongodb-org-tools=4.4.18 > /dev/null 2>&1 && sleep 2 + echo "mongodb-org hold" | sudo dpkg --set-selections > /dev/null 2>&1 && sleep 2 + echo "mongodb-org-server hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-shell hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-mongos hold" | sudo dpkg --set-selections > /dev/null 2>&1 + echo "mongodb-org-tools hold" | sudo dpkg --set-selections > /dev/null 2>&1 + else + sudo apt update -y > /dev/null 2>&1 + DEBIAN_FRONTEND=noninteractive sudo apt-get --yes install mongodb-org > /dev/null 2>&1 + fi + sudo mkdir -p /var/log/mongodb > /dev/null 2>&1 + sudo mkdir -p /var/lib/mongodb > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Settings privilege... ${NC}" + sudo chown -R mongodb:mongodb /var/log/mongodb > /dev/null 2>&1 + sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 + sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 + fluxos_clean + #echo -e "${ARROW} ${CYAN}Restoring Database... ${NC}" + #mongorestore --drop --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" + sudo systemctl enable mongod + sudo systemctl start mongod + if mongod --version > /dev/null 2>&1; then + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo -e "${ARROW} ${CYAN}Service status:${SEA} $(sudo systemctl status mongod | grep -w 'Active' | sed -e 's/^[ \t]*//')${NC}" + else + string_limit_x_mark "MongoDB was not installed................................." + fi + echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark...${NC}" + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + sleep 5 + echo -e "" else - sudo apt update -y > /dev/null 2>&1 - DEBIAN_FRONTEND=noninteractive sudo apt-get --yes install mongodb-org > /dev/null 2>&1 + sudo systemctl stop flux-watchdog > /dev/null 2>&1 + sudo systemctl stop fluxd > /dev/null 2>&1 + sudo systemctl stop fluxbenchd > /dev/null 2>&1 + sudo systemctl stop fluxos > /dev/null 2>&1 + sudo rm -rf /var/lib/mongodb/* + sudo systemctl start mongod + fluxos_clean + sudo systemctl start fluxd > /dev/null 2>&1 + sudo systemctl start fluxbenchd > /dev/null 2>&1 + sudo systemctl start fluxos > /dev/null 2>&1 + sudo systemctl start flux-watchdog > /dev/null 2>&1 fi - sudo mkdir -p /var/log/mongodb > /dev/null 2>&1 - sudo mkdir -p /var/lib/mongodb > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Settings privilege... ${NC}" - sudo chown -R mongodb:mongodb /var/log/mongodb > /dev/null 2>&1 - sudo chown -R mongodb:mongodb /var/lib/mongodb > /dev/null 2>&1 - sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 - fluxos_clean - #echo -e "${ARROW} ${CYAN}Restoring Database... ${NC}" - #mongorestore --drop --archive=/home/$USER/mongoDB_backup.gz > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" - sudo systemctl enable mongod - sudo systemctl start mongod - if mongod --version > /dev/null 2>&1; then - string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." - echo -e "${ARROW} ${CYAN}Service status:${SEA} $(sudo systemctl status mongod | grep -w 'Active' | sed -e 's/^[ \t]*//')${NC}" - else - string_limit_x_mark "MongoDB was not installed................................." - fi - echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark...${NC}" - sudo systemctl restart zelcash > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 - sleep 5 - echo -e "" ;; esac - } function node_reconfiguration() { reset="" From 0a79421f6ea6f4c0c5c1e0c34e61065ae47c7a8e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 15 Nov 2024 11:57:32 +0100 Subject: [PATCH 1043/1176] arcane support --- multinode.sh | 89 ++--- multitoolbox.sh | 961 ++++++++++++++++++++++++------------------------ 2 files changed, 536 insertions(+), 514 deletions(-) diff --git a/multinode.sh b/multinode.sh index 5d641423..d0521f57 100644 --- a/multinode.sh +++ b/multinode.sh @@ -2,51 +2,54 @@ source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" function upnp_disable() { - if [[ ! -f /home/$USER/zelflux/config/userconfig.js ]]; then - echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" - echo -e "" - exit - fi - - if [[ -f /home/$USER/.fluxbenchmark/fluxbench.conf ]]; then - if [[ $(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf) != "" ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Removing FluxOS UPnP configuration.....${NC}" - sed -i "/$(grep -e "fluxport" /home/$USER/.fluxbenchmark/fluxbench.conf)/d" /home/$USER/.fluxbenchmark/fluxbench.conf > /dev/null 2>&1 - else - echo -e "${ARROW} ${CYAN}UPnP Mode is already disabled...${NC}" - echo -e "" - exit - fi - else - echo -e "${ARROW} ${CYAN}UPnP Mode is already disabled...${NC}" - echo -e "" - exit - fi - - if [[ $(cat /home/$USER/zelflux/config/userconfig.js | grep 'apiport' | wc -l) == "1" ]]; then - RemoveLine "routerIP" - RemoveLine "apiport" - fi - echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark.....${NC}" - echo -e "" - sudo systemctl restart zelcash > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 - sleep 10 + if [[ ! -f $FLUXOS_PATH/config/userconfig.js ]]; then + echo -e "${WORNING} ${CYAN}Missing FluxOS configuration file - install/re-install Flux Node...${NC}" + echo -e "" + exit + fi + + if [[ -f $FLUX_BENCH_PATH/fluxbench.conf ]]; then + if [[ $(grep -e "fluxport" $FLUX_BENCH_PATH/fluxbench.conf) != "" ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Removing FluxOS UPnP configuration.....${NC}" + sed -i "/$(grep -e "fluxport" $FLUX_BENCH_PATH/fluxbench.conf)/d" $FLUX_BENCH_PATH/fluxbench.conf > /dev/null 2>&1 + else + echo -e "${ARROW} ${CYAN}UPnP Mode is already disabled...${NC}" + echo -e "" + exit + fi + else + echo -e "${ARROW} ${CYAN}UPnP Mode is already disabled...${NC}" + echo -e "" + exit + fi + if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep 'apiport' | wc -l) == "1" ]]; then + RemoveLine "routerIP" + RemoveLine "apiport" + fi + echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark.....${NC}" + echo -e "" + if [[ -z $FLUXOS_VERSION ]]; then + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + else + sudo systemctl restart fluxbenchd > /dev/null 2>&1 + sudo systemctl restart fluxos > /dev/null 2>&1 + fi + sleep 10 } - CHOICE=$( - whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ - "1)" "Enable UPnP Mode" \ - "2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 - ) - +CHOICE=$( +whiptail --title "UPnP Configuration" --menu "Make your choice" 16 30 9 \ +"1)" "Enable UPnP Mode" \ +"2)" "Disable UPnP Mode" 3>&2 2>&1 1>&3 +) case $CHOICE in - "1)") - upnp_enable - ;; - "2)") - upnp_disable - ;; + "1)") + upnp_enable + ;; + "2)") + upnp_disable + ;; esac diff --git a/multitoolbox.sh b/multitoolbox.sh index 3560f1b1..4d027d32 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -16,7 +16,6 @@ else export ROOT_BRANCH='master' fi - source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' @@ -35,222 +34,185 @@ zelflux_setting_import="0" OS_FLAGE="$2" function config_veryfity(){ - if [[ -f /home/$USER/.flux/flux.conf ]]; then - echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" - insightexplorer=$(cat /home/$USER/.flux/flux.conf | grep 'insightexplorer=1' | wc -l) - if [[ "$insightexplorer" == "1" ]]; then - echo -e "${ARROW} ${CYAN}Insightexplorer enabled..............[${CHECK_MARK}${CYAN}]${NC}" - echo "" - else - echo -e "${WORNING} ${CYAN}Insightexplorer disabled.............[${X_MARK}${CYAN}]${NC}" - echo -e "${WORNING} ${CYAN}Use option 2 for node re-install${NC}" - echo -e "" - exit - fi - fi + if [[ -f $FLUX_DAEMON_PATH/flux.conf ]]; then + echo -e "${ARROW} ${YELLOW}Checking config file...${NC}" + insightexplorer=$(cat $FLUX_DAEMON_PATH/flux.conf | grep 'insightexplorer=1' | wc -l) + if [[ "$insightexplorer" == "1" ]]; then + echo -e "${ARROW} ${CYAN}Insightexplorer enabled..............[${CHECK_MARK}${CYAN}]${NC}" + echo "" + else + echo -e "${WORNING} ${CYAN}Insightexplorer disabled.............[${X_MARK}${CYAN}]${NC}" + echo -e "${WORNING} ${CYAN}Use option 2 for node re-install${NC}" + echo -e "" + exit + fi + fi } function config_file() { - if [[ -f /home/$USER/install_conf.json ]]; then - - import_settings=$(cat /home/$USER/install_conf.json | jq -r '.import_settings') - bootstrap_url=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_url') - bootstrap_zip_del=$(cat /home/$USER/install_conf.json | jq -r '.bootstrap_zip_del') - use_old_chain=$(cat /home/$USER/install_conf.json | jq -r '.use_old_chain') - prvkey=$(cat /home/$USER/install_conf.json | jq -r '.prvkey') - outpoint=$(cat /home/$USER/install_conf.json | jq -r '.outpoint') - index=$(cat /home/$USER/install_conf.json | jq -r '.index') - zel_id=$(cat /home/$USER/install_conf.json | jq -r '.zelid') - kda_address=$(cat /home/$USER/install_conf.json | jq -r '.kda_address') - upnp_port=$(cat /home/$USER/install_conf.json | jq -r '.upnp_port') - gateway_ip=$(cat /home/$USER/install_conf.json | jq -r '.gateway_ip') - upnp_enabled=$(cat /home/$USER/install_conf.json | jq -r '.upnp_enabled') - thunder=$(cat /home/$USER/install_conf.json | jq -r '.thunder') - - echo -e "${ARROW} ${YELLOW}Install config summary:" - if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then - echo -e "${PIN}${CYAN}Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" - else - if [[ "$import_settings" == "1" ]]; then - echo -e "${PIN}${CYAN}Import settings from exist config files..........................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - - if [[ "$use_old_chain" == "1" ]]; then - echo -e "${PIN}${CYAN}During re-installation old chain will be used....................[${CHECK_MARK}${CYAN}]${NC}" - else - if [[ "$bootstrap_url" == "" || "$bootstrap_url" == "0" ]]; then - echo -e "${PIN}${CYAN}Use Flux Bootstrap from source build in scripts..................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${PIN}${CYAN}Use Flux Bootstrap from own source...............................[${CHECK_MARK}${CYAN}]${NC}" - fi - if [[ "$bootstrap_zip_del" == "1" ]]; then - echo -e "${PIN}${CYAN}Remove Flux Bootstrap archive file...............................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${PIN}${CYAN}Leave Flux Bootstrap archive file................................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi - - if [[ ( "$discord" != "" && "$discord" != "0" ) || "$telegram_alert" == '1' ]]; then - echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" - else - echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" - fi + if [[ -f $DATA_PATH/install_conf.json ]]; then + import_settings=$(cat $DATA_PATH/install_conf.json | jq -r '.import_settings') + bootstrap_url=$(cat $DATA_PATH/install_conf.json | jq -r '.bootstrap_url') + bootstrap_zip_del=$(cat $DATA_PATH/install_conf.json | jq -r '.bootstrap_zip_del') + use_old_chain=$(cat $DATA_PATH/install_conf.json | jq -r '.use_old_chain') + prvkey=$(cat $DATA_PATH/install_conf.json | jq -r '.prvkey') + outpoint=$(cat $DATA_PATH/install_conf.json | jq -r '.outpoint') + index=$(cat $DATA_PATH/install_conf.json | jq -r '.index') + zel_id=$(cat $DATA_PATH/install_conf.json | jq -r '.zelid') + kda_address=$(cat $DATA_PATH/install_conf.json | jq -r '.kda_address') + upnp_port=$(cat $DATA_PATH/install_conf.json | jq -r '.upnp_port') + gateway_ip=$(cat $DATA_PATH/install_conf.json | jq -r '.gateway_ip') + upnp_enabled=$(cat $DATA_PATH/install_conf.json | jq -r '.upnp_enabled') + thunder=$(cat $DATA_PATH/install_conf.json | jq -r '.thunder') + echo -e "${ARROW} ${YELLOW}Install config summary:" + if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]];then + echo -e "${PIN}${CYAN}Import settings from install_conf.json...........................[${CHECK_MARK}${CYAN}]${NC}" + else + if [[ "$import_settings" == "1" ]]; then + echo -e "${PIN}${CYAN}Import settings from exist config files..........................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + if [[ "$use_old_chain" == "1" ]]; then + echo -e "${PIN}${CYAN}During re-installation old chain will be used....................[${CHECK_MARK}${CYAN}]${NC}" + else + if [[ "$bootstrap_url" == "" || "$bootstrap_url" == "0" ]]; then + echo -e "${PIN}${CYAN}Use Flux Bootstrap from source build in scripts..................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${PIN}${CYAN}Use Flux Bootstrap from own source...............................[${CHECK_MARK}${CYAN}]${NC}" + fi + if [[ "$bootstrap_zip_del" == "1" ]]; then + echo -e "${PIN}${CYAN}Remove Flux Bootstrap archive file...............................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${PIN}${CYAN}Leave Flux Bootstrap archive file................................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi + if [[ ( "$discord" != "" && "$discord" != "0" ) || "$telegram_alert" == '1' ]]; then + echo -e "${PIN}${CYAN}Enable watchdog notification.....................................[${CHECK_MARK}${CYAN}]${NC}" + else + echo -e "${PIN}${CYAN}Disable watchdog notification....................................[${CHECK_MARK}${CYAN}]${NC}" + fi - if [[ ! -z $gateway_ip && ! -z $upnp_port ]] && [[ "$upnp_enabled" == "true" ]] ; then - echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" - fi - fi + if [[ ! -z $gateway_ip && ! -z $upnp_port ]] && [[ "$upnp_enabled" == "true" ]] ; then + echo -e "${PIN}${CYAN}Enable UPnP configuration........................................[${CHECK_MARK}${CYAN}]${NC}" + fi + fi } function install_flux() { - - echo -e "${GREEN}Module: Re-install FluxOS${NC}" - echo -e "${YELLOW}================================================================${NC}" - - if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - if pm2 -v > /dev/null 2>&1; then - pm2 del zelflux > /dev/null 2>&1 - pm2 del flux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - fi - - echo -e "${ARROW} ${CYAN}Removing syncthing...${NC}" - sudo pkill -9 syncthing > /dev/null 2>&1 - sudo apt-get remove --purge syncthing -y > /dev/null 2>&1 - sudo apt-get autoremove -y > /dev/null 2>&1 - - docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) - resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) - mongod_check=$(mongoexport -d localzelapps -c zelappsinformation --jsonArray --pretty --quiet | jq -r .[].name | head -n1) - if [[ "$mongod_check" != "" && "$mongod_check" != "null" ]]; then - echo -e "${ARROW} ${CYAN}Detected Flux MongoDB local apps collection ...${NC}" - echo -e "${ARROW} ${CYAN}Cleaning MongoDB Flux local apps collection...${NC}" - echo "db.zelappsinformation.drop()" | mongo localzelapps > /dev/null 2>&1 - fi - - if [[ $docker_check != 0 ]]; then - echo -e "${ARROW} ${CYAN}Detected running docker container...${NC}" - echo -e "${ARROW} ${CYAN}Removing containers...${NC}" - sudo aa-remove-unknown > /dev/null 2>&1 && sudo service docker restart > /dev/null 2>&1 - docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | - while read line; do - sudo docker stop $line > /dev/null 2>&1 && sleep 1 - sudo docker rm $line > /dev/null 2>&1 && sleep 1 - done - fi - - if [[ $resource_check != 0 ]]; then - echo -e "${ARROW} ${CYAN}Detected locked resource...${NC}" - echo -e "${ARROW} ${CYAN}Unmounting locked Flux resource${NC}" - df | egrep 'flux' | awk '{ print $1}' | - while read line; do - sudo umount -l $line - done - fi - - if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then - echo -e "${ARROW} ${CYAN}Import settings...${NC}" - ZELID=$(grep -w zelid /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') - WANIP=$(grep -w ipaddress /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*ipaddress: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$ZELID${NC}" - KDA_A=$(grep -w kadena /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" - fi - echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" - - upnp_port=$(grep -w apiport /home/$USER/$FLUX_DIR/config/userconfig.js | egrep -o '[0-9]+') - if [[ "$upnp_port" != "" ]]; then + echo -e "${GREEN}Module: Re-install FluxOS${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + if [[ -z $FLUXOS_VERSION ]]; then + if pm2 -v > /dev/null 2>&1; then + pm2 del zelflux > /dev/null 2>&1 + pm2 del flux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + fi + else + echo -e "${ARROW} ${CYAN}Stopping FluxOS....${NC}" + sudo systemctl stop flux-watchdog + sudo systemctl stop fluxos + fi + fluxos_clean + if [[ -f $FLUXOS_PATH/config/userconfig.js ]]; then + echo -e "${ARROW} ${CYAN}Import settings...${NC}" + ZELID=$(grep -w zelid $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') + WANIP=$(grep -w ipaddress $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*ipaddress: .//' | sed -e 's/.\{2\}$//') + echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$ZELID${NC}" + KDA_A=$(grep -w kadena $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + if [[ "$KDA_A" != "" ]]; then + echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" + fi + echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" + upnp_port=$(grep -w apiport $FLUXOS_PATH/config/userconfig.js | egrep -o '[0-9]+') + if [[ "$upnp_port" != "" ]]; then echo -e "${PIN}${CYAN}API port = ${GREEN}$upnp_port${NC}" fi - - router_ip=$(grep -w routerIP /home/$USER/$FLUX_DIR/config/userconfig.js | sed -e 's/.*routerIP: .//' | sed -e 's/.\{2\}$//') - if [[ "$router_ip" != "" ]]; then + router_ip=$(grep -w routerIP $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*routerIP: .//' | sed -e 's/.\{2\}$//') + if [[ "$router_ip" != "" ]]; then echo -e "${PIN}${CYAN}Router IP = ${GREEN}$router_ip${NC}" fi - ImportBlockedPorts if [[ "$blockedPortsList" != "" ]]; then echo -e "${PIN}${CYAN}BlockedPorts: [$display]${NC}" fi - ImportBlockedRepository if [[ "$blockedRepositoryList" != "" ]]; then echo -e "${PIN}${CYAN}BlockedRepositories: [$display]${NC}" fi - - echo -e "" - echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" - sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 - if [[ "$ZELID" != "" && "$WANIP" != "" && "$KDA_A" != "" ]]; then - zelflux_setting_import="1" - fi - fi - - if [ -d /home/$USER/$FLUX_DIR ]; then - echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" - sudo rm -rf $FLUX_DIR > /dev/null 2>&1 && sleep 1 - fi - - echo -e "${ARROW} ${CYAN}FluxOS downloading...${NC}" - git clone https://github.com/RunOnFlux/flux.git zelflux > /dev/null 2>&1 && sleep 1 - if [[ -d /home/$USER/$FLUX_DIR ]]; then - if [[ -f /home/$USER/$FLUX_DIR/package.json ]]; then - current_ver=$(jq -r '.version' /home/$USER/$FLUX_DIR/package.json) - else - string_limit_x_mark "FluxOS was not downloaded, run script again..........................................." - echo - exit - fi - string_limit_check_mark "FluxOS v$current_ver downloaded..........................................." "FluxOS ${GREEN}v$current_ver${CYAN} downloaded..........................................." - else - string_limit_x_mark "FluxOS was not downloaded, run script again..........................................." - echo - exit - fi - - if [[ "$zelflux_setting_import" == "0" ]]; then - get_ip "install" - while true - do - ZELID="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" - if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ] || [ $(grep -Eo "^0x[a-fA-F0-9]{40}$" <<< "$ZELID") ]; then - string_limit_check_mark "Zel ID is valid..........................................." - break - else - string_limit_x_mark "Zel ID is not valid try again..........................................." - sleep 2 - fi - done - - while true - do - KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=0" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - fi + echo -e "" + echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" + sudo rm -rf $FLUXOS_PATH > /dev/null 2>&1 && sleep 1 + if [[ "$ZELID" != "" && "$WANIP" != "" && "$KDA_A" != "" ]]; then + zelflux_setting_import="1" + fi + fi + if [ -d $FLUXOS_PATH ]; then + echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" + sudo rm -rf $FLUXOS_PATH > /dev/null 2>&1 && sleep 1 + fi + if [[ ! -z $FLUXOS_VERSION ]]; then + cd $DATA_PATH/usr/lib + FLUXOS_HOME_DIR="fluxos" + fi + if [[ -z $FLUXOS_VERSION ]]; then + FLUXOS_HOME_DIR="zelflux" + fi + echo -e "${ARROW} ${CYAN}FluxOS downloading...${NC}" + git clone https://github.com/RunOnFlux/flux.git $FLUXOS_HOME_DIR > /dev/null 2>&1 && sleep 1 + if [[ -d $FLUXOS_PATH ]]; then + if [[ -f $FLUXOS_PATH/package.json ]]; then + current_ver=$(jq -r '.version' $FLUXOS_PATH/package.json) + else + string_limit_x_mark "FluxOS was not downloaded, run script again..........................................." + echo + exit + fi + string_limit_check_mark "FluxOS v$current_ver downloaded..........................................." "FluxOS ${GREEN}v$current_ver${CYAN} downloaded..........................................." + else + string_limit_x_mark "FluxOS was not downloaded, run script again..........................................." + echo + exit + fi + if [[ "$zelflux_setting_import" == "0" ]]; then + get_ip "install" + while true + do + ZELID="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ] || [ $(grep -Eo "^0x[a-fA-F0-9]{40}$" <<< "$ZELID") ]; then + string_limit_check_mark "Zel ID is valid..........................................." + break + else + string_limit_x_mark "Zel ID is not valid try again..........................................." + sleep 2 + fi + done + while true + do + KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=0" + sleep 2 + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + fi fluxos_conf_create - if [[ -f /home/$USER/$FLUX_DIR/config/userconfig.js ]]; then - if [[ "$upnp_port" != "" ]]; then + if [[ -f $FLUXOS_PATH/config/userconfig.js ]]; then + if [[ "$upnp_port" != "" ]]; then config_builder "apiport" "$upnp_port" "API Port" "fluxos" - fi + fi if [[ "$router_ip" != "" ]]; then config_builder "routerIP" "$router_ip" "Router IP" "fluxos" - fi + fi if [[ "$blockedPortsList" != "" ]]; then RemoveLine "blockedPorts" buildBlockedPortsList " blockedPorts" "$blockedPortsList" "Blocked ports list created successfully!" "fluxos" @@ -259,79 +221,79 @@ function install_flux() { RemoveLine "blockedRepositories" buildBlockedRepositoryList " blockedRepositories" "$blockedRepositoryList" "Blocked repositories list created successfully!" "fluxos" fi - string_limit_check_mark "FluxOS configuration successfull..........................................." - else - string_limit_x_mark "FluxOS installation failed, missing config file..........................................." - echo - exit - fi - - if pm2 -v > /dev/null 2>&1; then - rm restart_zelflux.sh > /dev/null 2>&1 - pm2 del flux > /dev/null 2>&1 - pm2 del zelflux > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" - echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" - echo -e "" - pm2 start /home/$USER/$FLUX_DIR/start.sh --max-memory-restart 1500M --restart-delay 30000 --max-restarts 40 --name flux --time > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - pm2 list - else - pm2_install - if [[ "$PM2_INSTALL" == "1" ]]; then - echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" - echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" - echo - pm2 list - fi - fi + string_limit_check_mark "FluxOS configuration successfull..........................................." + else + string_limit_x_mark "FluxOS installation failed, missing config file..........................................." + echo + exit + fi + if [[ -z $FLUXOS_VERSION ]]; then + if pm2 -v > /dev/null 2>&1; then + rm restart_zelflux.sh > /dev/null 2>&1 + pm2 del flux > /dev/null 2>&1 + pm2 del zelflux > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" + echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" + echo -e "" + pm2 start /home/$USER/$FLUX_DIR/start.sh --max-memory-restart 1500M --restart-delay 30000 --max-restarts 40 --name flux --time > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + pm2 list + else + pm2_install + if [[ "$PM2_INSTALL" == "1" ]]; then + echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" + echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" + echo + pm2 list + fi + fi + else + echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" + echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" + sudo systemctl start flux-watchdog > /dev/null 2>&1 + sudo systemctl restart fluxbenchd > /dev/null 2>&1 + sudo systemctl start fluxos > /dev/null 2>&1 + fi } - - function create_config() { - echo -e "${GREEN}Module: Create FluxNode installation config file...${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - - if jq --version > /dev/null 2>&1; then - sleep 0.2 - else - echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" - sudo apt install jq -y > /dev/null 2>&1 - if jq --version > /dev/null 2>&1; then - #echo -e "${ARROW} ${CYAN}Nodejs version: ${GREEN}$(node -v)${CYAN} installed${NC}" - string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." - echo - else - #echo -e "${ARROW} ${CYAN}Nodejs was not installed${NC}" - string_limit_x_mark "JQ was not installed................................." - echo - exit - fi - fi + echo -e "${GREEN}Module: Create FluxNode installation config file...${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + if jq --version > /dev/null 2>&1; then + sleep 0.2 + else + echo -e "${ARROW} ${YELLOW}Installing JQ....${NC}" + sudo apt install jq -y > /dev/null 2>&1 + if jq --version > /dev/null 2>&1; then + string_limit_check_mark "JQ $(jq --version) installed................................." "JQ ${GREEN}$(jq --version)${CYAN} installed................................." + echo + else + string_limit_x_mark "JQ was not installed................................." + echo + exit + fi + fi CHOICE=$(whiptail --title "Create FluxNode installation config" --menu "Make your choice" 15 65 8 \ "1)" "Manualy - fill questions list" \ "2)" "Auto - import exists settings" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") - manual_build + manual_build ;; "2)") - config_smart_create + config_smart_create ;; - esac + esac } - - function install_watchdog() { if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" @@ -342,25 +304,40 @@ function install_watchdog() { fi echo -e "${GREEN}Module: Install watchdog for FluxNode${NC}" echo -e "${YELLOW}================================================================${NC}" - if ! pm2 -v > /dev/null 2>&1; then - pm2_install - if [[ "$PM2_INSTALL" == "0" ]]; then - exit - fi - echo -e "" - fi echo -e "${ARROW} ${CYAN}Cleaning...${NC}" - pm2 del watchdog > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Downloading...${NC}" - cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" - wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 - mv post-merge /home/$USER/watchdog/.git/hooks/post-merge - sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge - echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" - cd watchdog && npm install > /dev/null 2>&1 + if [[ -z $FLUXOS_VERSION ]]; then + if ! pm2 -v > /dev/null 2>&1; then + pm2_install + if [[ "$PM2_INSTALL" == "0" ]]; then + exit + fi + echo -e "" + fi + pm2 del watchdog > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + sudo rm -rf /home/$USER/watchdog > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Downloading...${NC}" + cd && git clone https://github.com/RunOnFlux/fluxnode-watchdog.git watchdog > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" + wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 + mv post-merge /home/$USER/watchdog/.git/hooks/post-merge + sudo chmod +x /home/$USER/watchdog/.git/hooks/post-merge + echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" + cd watchdog && npm install > /dev/null 2>&1 + else + sudo systemctl stop flux-watchdog + cd $FLUX_WATCHDOG_PATH + cd .. + sudo rm -rf $FLUX_WATCHDOG_PATH > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Downloading...${NC}" + git clone https://github.com/RunOnFlux/fluxnode-watchdog.git flux-watchdog > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Installing git hooks....${NC}" + wget https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/post-merge > /dev/null 2>&1 + mv post-merge $FLUX_WATCHDOG_PATH/.git/hooks/post-merge + sudo chmod +x $FLUX_WATCHDOG_PATH/.git/hooks/post-merge + echo -e "${ARROW} ${CYAN}Installing watchdog module....${NC}" + cd flux-watchdog && npm install > /dev/null 2>&1 + fi echo -e "${ARROW} ${CYAN}Creating config file....${NC}" if whiptail --yesno "Would you like enable FluxOS auto update?" 8 60; then flux_update='1' @@ -383,13 +360,7 @@ function install_watchdog() { bench_update='0' sleep 1 fi - #if whiptail --yesno "Would you like enable fix action (restart daemon, benchmark, mongodb)?" 8 75; then fix_action='1' - #sleep 1 - #else - #fix_action='0' - ##sleep 1 - #fi telegram_alert=0; discord=0; if whiptail --yesno "Would you like enable alert notification?" 8 60; then @@ -445,7 +416,6 @@ function install_watchdog() { sleep 1 fi done - sleep 1 while true do @@ -458,13 +428,11 @@ function install_watchdog() { sleep 1 fi done - sleep 1 ;; esac done fi - while true do node_label=$(whiptail --inputbox "Enter name of your node (alias)" 8 65 3>&1 1>&2 2>&3) @@ -493,9 +461,9 @@ function install_watchdog() { telegram_bot_token=0; telegram_chat_id=0; fi - if [[ -f /home/$USER/$CONFIG_DIR/$CONFIG_FILE ]]; then - index_from_file=$(grep -w zelnodeindex /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeindex=//') - tx_from_file=$(grep -w zelnodeoutpoint /home/$USER/$CONFIG_DIR/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') + if [[ -f $FLUX_BENCH_PATH/$CONFIG_FILE ]]; then + index_from_file=$(grep -w zelnodeindex $FLUX_BENCH_PATH/$CONFIG_FILE | sed -e 's/zelnodeindex=//') + tx_from_file=$(grep -w zelnodeoutpoint $FLUX_BENCH_PATH/$CONFIG_FILE | sed -e 's/zelnodeoutpoint=//') stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') if [[ "$stak_info" == "" ]]; then stak_info=$(curl -s -m 5 https://explorer.runonflux.io/api/tx/$tx_from_file | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2> /dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') @@ -512,10 +480,14 @@ function install_watchdog() { fi watchdog_conf_create echo -e "${ARROW} ${CYAN}Starting watchdog...${NC}" - pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 - pm2 save > /dev/null 2>&1 - if [[ -f /home/$USER/watchdog/watchdog.js ]]; then - current_ver=$(jq -r '.version' /home/$USER/watchdog/package.json) + if [[ -z $FLUXOS_VERSION ]]; then + pm2 start /home/$USER/watchdog/watchdog.js --name watchdog --watch /home/$USER/watchdog --ignore-watch '"./**/*.git" "./**/*node_modules" "./**/*watchdog_error.log" "./**/*config.js"' --watch-delay 20 > /dev/null 2>&1 + pm2 save > /dev/null 2>&1 + else + sudo systemctl start flux-watchdog > /dev/null 2>&1 + fi + if [[ -f $FLUX_WATCHDOG_PATH/watchdog.js ]]; then + current_ver=$(jq -r '.version' $FLUX_WATCHDOG_PATH/package.json) string_limit_check_mark "Watchdog v$current_ver installed..........................................." "Watchdog ${GREEN}v$current_ver${CYAN} installed..........................................." else string_limit_x_mark "Watchdog was not installed..........................................." @@ -556,9 +528,9 @@ function install_node(){ exit fi - if [[ "$OS_FLAGE" == "" ]]; then - os_check - fi + if [[ "$OS_FLAGE" == "" ]]; then + os_check + fi if sudo docker run hello-world > /dev/null 2>&1; then echo -e "" @@ -664,44 +636,6 @@ function install_docker(){ su - $usernew fi } -function install_watchtower(){ - echo -e "${GREEN}Module: Install flux_watchtower for docker images autoupdate${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - echo -e "" - echo -e "${ARROW} ${CYAN}Checking if flux_watchtower is installed....${NC}" - apps_check=$(docker ps | grep "flux_watchtower") - if [[ "$apps_check" != "" ]]; then - echo -e "${ARROW} ${CYAN}Stopping flux_watchtower...${NC}" - docker stop flux_watchtower > /dev/null 2>&1 - sleep 2 - echo -e "${ARROW} ${CYAN}Removing flux_watchtower...${NC}" - docker rm flux_watchtower > /dev/null 2>&1 - fi - echo -e "${ARROW} ${CYAN}Downloading containrrr/watchtower image...${NC}" - docker pull containrrr/watchtower:latest > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting containrrr/watchtower...${NC}" - random=$(shuf -i 7500-35000 -n 1) - echo -e "${ARROW} ${CYAN}Interval: ${GREEN} $random sec.${NC}" - apps_id=$(docker run -d \ - --restart unless-stopped \ - --name flux_watchtower \ - -v /var/run/docker.sock:/var/run/docker.sock \ - containrrr/watchtower \ - --cleanup --interval $random 2> /dev/null) - if [[ $apps_id =~ ^[[:alnum:]]+$ ]]; then - echo -e "${ARROW} ${CYAN}flux_watchtower installed successful, id: ${GREEN}$apps_id${NC}" - else - echo -e "${ARROW} ${CYAN}flux_watchtower installion failed...${NC}" - fi - -} function mongod_db_fix() { echo -e "${GREEN}Module: MongoDB FiX action${NC}" echo -e "${YELLOW}================================================================${NC}" @@ -722,38 +656,38 @@ function mongod_db_fix() { CHOICE=$( whiptail --title "MongoDB FiX action" --menu "Make your choice" 15 65 8 \ "1)" "Soft repair - MongoDB database repair" \ - "2)" "Hard repair - MongoDB wipe" 3>&2 2>&1 1>&3 + "2)" "Hard repair - MongoDB database wipe" 3>&2 2>&1 1>&3 ) fi - case $CHOICE in + case $CHOICE in "1)") - echo -e "" - echo -e "${ARROW} ${YELLOW}Soft repair starting... ${NC}" - echo -e "${ARROW} ${CYAN}Stopping mongod service ${NC}" - sudo systemctl stop mongod - echo -e "${ARROW} ${CYAN}Fix for corrupted DB ${NC}" - sudo rm $MONGODB_DATA_PATH/journal/* > /dev/null 2>&1 - sudo rm $MONGODB_DATA_PATH/mongod.lock > /dev/null 2>&1 - sudo -u mongodb mongod --dbpath $MONGODB_DATA_PATH --repair > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Fix for bad privilege ${NC}" - sudo chown -R mongodb:mongodb $MONGODB_DATA_PATH > /dev/null 2>&1 - sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting mongod service ${NC}" - sudo systemctl start mongod - if mongod --version > /dev/null 2>&1; then - string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." - echo -e "${ARROW} ${CYAN}Service status:${SEA} $(sudo systemctl status mongod | grep -w 'Active' | sed -e 's/^[ \t]*//')${NC}" - fi + echo -e "" + echo -e "${ARROW} ${YELLOW}Soft repair starting... ${NC}" + echo -e "${ARROW} ${CYAN}Stopping mongod service ${NC}" + sudo systemctl stop mongod + echo -e "${ARROW} ${CYAN}Fix for corrupted DB ${NC}" + sudo rm $MONGODB_DATA_PATH/journal/* > /dev/null 2>&1 + sudo rm $MONGODB_DATA_PATH/mongod.lock > /dev/null 2>&1 + sudo -u mongodb mongod --dbpath $MONGODB_DATA_PATH --repair > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Fix for bad privilege ${NC}" + sudo chown -R mongodb:mongodb $MONGODB_DATA_PATH > /dev/null 2>&1 + sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting mongod service ${NC}" + sudo systemctl start mongod + if mongod --version > /dev/null 2>&1; then + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo -e "${ARROW} ${CYAN}Service status:${SEA} $(sudo systemctl status mongod | grep -w 'Active' | sed -e 's/^[ \t]*//')${NC}" + fi echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark...${NC}" - if [[ -z $FLUXOS_VERSION ]]; then - sudo systemctl restart zelcash > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 - else - sudo systemctl restart fluxd > /dev/null 2>&1 - sudo systemctl restart fluxbenchd > /dev/null 2>&1 - sudo systemctl restart fluxos > /dev/null 2>&1 - fi - sleep 5 + if [[ -z $FLUXOS_VERSION ]]; then + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + else + sudo systemctl restart fluxd > /dev/null 2>&1 + sudo systemctl restart fluxbenchd > /dev/null 2>&1 + sudo systemctl restart fluxos > /dev/null 2>&1 + fi + sleep 5 echo -e "" ;; "2)") @@ -825,14 +759,14 @@ function mongod_db_fix() { else sudo systemctl stop flux-watchdog > /dev/null 2>&1 sudo systemctl stop fluxd > /dev/null 2>&1 - sudo systemctl stop fluxbenchd > /dev/null 2>&1 - sudo systemctl stop fluxos > /dev/null 2>&1 + sudo systemctl stop fluxbenchd > /dev/null 2>&1 + sudo systemctl stop fluxos > /dev/null 2>&1 sudo rm -rf /var/lib/mongodb/* sudo systemctl start mongod fluxos_clean - sudo systemctl start fluxd > /dev/null 2>&1 - sudo systemctl start fluxbenchd > /dev/null 2>&1 - sudo systemctl start fluxos > /dev/null 2>&1 + sudo systemctl start fluxd > /dev/null 2>&1 + sudo systemctl start fluxbenchd > /dev/null 2>&1 + sudo systemctl start fluxos > /dev/null 2>&1 sudo systemctl start flux-watchdog > /dev/null 2>&1 fi ;; @@ -840,45 +774,52 @@ function mongod_db_fix() { } function node_reconfiguration() { reset="" - if [[ -f /home/$USER/install_conf.json ]]; then + if [[ -f $DATA_PATH/install_conf.json ]]; then import_config_file "silent" get_ip - if [[ -d /home/$USER/zelflux ]]; then + if [[ -d $FLUXOS_PATH ]]; then if [[ "$KDA_A" != "" && "$ZELID" != "" ]]; then echo -e "${ARROW} ${CYAN}Creating FluxOS config file...${NC}" - sudo rm -rf /home/$USER/zelflux/config/userconfig.js > /dev/null 2>&1 + sudo rm -rf $FLUXOS_PATH/config/userconfig.js > /dev/null 2>&1 fluxos_conf_create reset=0 fi fi - if [[ -d /home/$USER/.flux ]]; then + if [[ -d $FLUX_DAEMON_PATH ]]; then if [[ "$prvkey" != "" && "$outpoint" != "" && "$index" != "" ]]; then zelnodeprivkey="$prvkey" zelnodeoutpoint="$outpoint" zelnodeindex="$index" echo -e "${ARROW} ${CYAN}Creating Daemon config file...${NC}" - sudo rm -rf /home/$USER/.flux/flux.conf > /dev/null 2>&1 + sudo rm -rf $FLUX_DAEMON_PATH/flux.conf > /dev/null 2>&1 flux_daemon_conf_create reset=0 fi fi - if [[ -d /home/$USER/watchdog ]]; then + if [[ -d $FLUX_WATCHDOG_PATH ]]; then echo -e "${ARROW} ${CYAN}Creating Watchdog config file...${NC}" - sudo rm -rf /home/$USER/watchdog/config.js > /dev/null 2>&1 + sudo rm -rf $FLUX_WATCHDOG_PATH/config.js > /dev/null 2>&1 fix_action='1' watchdog_conf_create reset=0 fi - if [[ -d /home/$USER/.flux ]]; then + if [[ -d $FLUX_DAEMON_PATH ]]; then if [[ ! -z "$upnp_port" && ! -z "$gateway_ip" ]]; then reset=1 upnp_enable fi fi if [[ "$reset" == "0" ]]; then - echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark...${NC}" - sudo systemctl restart zelcash > /dev/null 2>&1 - pm2 restart flux > /dev/null 2>&1 + if [[ -z $FLUXOS_VERSION ]]; then + echo -e "${ARROW} ${CYAN}Restarting FluxOS and Benchmark...${NC}" + sudo systemctl restart zelcash > /dev/null 2>&1 + pm2 restart flux > /dev/null 2>&1 + else + sudo systemctl restart fluxd > /dev/null 2>&1 + sudo systemctl restart fluxbenchd > /dev/null 2>&1 + sudo systemctl restart fluxos > /dev/null 2>&1 + sudo systemctl restart flux-watchdog > /dev/null 2>&1 + fi sleep 10 fi else @@ -908,7 +849,7 @@ if ! whiptail -v > /dev/null 2>&1; then sudo apt-get install -y whiptail > /dev/null 2>&1 fi -if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" ]]; then +if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" && $FLUXOS_VERSION == "" ]]; then echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)' @@ -926,143 +867,221 @@ figlet -f slant "Multitoolbox" echo -e "${YELLOW}================================================================${NC}" echo -e "${GREEN}Version: $dversion${NC}" echo -e "${GREEN}Branch: $ROOT_BRANCH${NC}" -echo -e "${GREEN}OS: Ubuntu 20/22/23, Debian 10/11/12 (if hardware requirements are met)${NC}" -echo -e "${GREEN}Created by: X4MiLX from Flux's team${NC}" -echo -e "${GREEN}Special thanks to dk808, CryptoWrench, jriggs28 && TechDufus${NC}" -echo -e "${YELLOW}================================================================${NC}" -echo -e "${CYAN}1 - Install Docker${NC}" -echo -e "${CYAN}2 - Install FluxNode${NC}" -echo -e "${CYAN}3 - FluxNode analyzer and fixer${NC}" -echo -e "${CYAN}4 - Install watchdog for FluxNode${NC}" -echo -e "${CYAN}5 - Restore Flux blockchain from bootstrap${NC}" -echo -e "${CYAN}6 - Create FluxNode installation config file${NC}" -echo -e "${CYAN}7 - Re-install FluxOS${NC}" -echo -e "${CYAN}8 - Flux Daemon Reconfiguration${NC}" -echo -e "${CYAN}9 - Create Flux daemon service${NC}" -echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" -echo -e "${CYAN}11 - FluxOS config management ${NC}" -echo -e "${CYAN}12 - Install fluxwatchtower for docker images autoupdate${NC}" -echo -e "${CYAN}13 - MongoDB FiX action${NC}" -echo -e "${CYAN}14 - Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" -echo -e "${CYAN}15 - Node reconfiguration from install config${NC}" -echo -e "${CYAN}16 - Hardware benchmark${NC}" +if [[ ! -z $FLUXOS_VERSION ]]; then + echo -e "${GREEN}FluxOS version: $FLUXOS_VERSION${NC}" +else + echo -e "${GREEN}OS: Ubuntu 20/22/23, Debian 10/11/12 (if hardware requirements are met)${NC}" +fi echo -e "${YELLOW}================================================================${NC}" - +if [[ -z $FLUXOS_VERSION ]]; then + echo -e "${CYAN}1 - Install Docker${NC}" + echo -e "${CYAN}2 - Install FluxNode${NC}" + echo -e "${CYAN}3 - FluxNode analyzer and fixer${NC}" + echo -e "${CYAN}4 - Install watchdog for FluxNode${NC}" + echo -e "${CYAN}5 - Restore Flux blockchain from bootstrap${NC}" + echo -e "${CYAN}6 - Create FluxNode installation config file${NC}" + echo -e "${CYAN}7 - Re-install FluxOS${NC}" + echo -e "${CYAN}8 - Flux Daemon Reconfiguration${NC}" + echo -e "${CYAN}9 - Create Flux daemon service${NC}" + echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" + echo -e "${CYAN}11 - FluxOS config management ${NC}" + echo -e "${CYAN}12 - MongoDB Repair Action${NC}" + echo -e "${CYAN}13 - Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" + echo -e "${CYAN}14 - Node reconfiguration from install config${NC}" + echo -e "${CYAN}15 - Hardware benchmark${NC}" + echo -e "${YELLOW}================================================================${NC}" +else + echo -e "${CYAN}1 - Re-install FluxOS${NC}" + echo -e "${CYAN}2 - Flux Daemon Reconfiguration${NC}" + echo -e "${CYAN}3 - FluxOS Config Management${NC}" + echo -e "${CYAN}4 - Restore Flux blockchain from bootstrap${NC}" + echo -e "${CYAN}5 - MongoDB Repair Action${NC}" + echo -e "${CYAN}6 - Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" + echo -e "${CYAN}7 - Node reconfiguration from install config${NC}" + echo -e "${CYAN}8 - Hardware benchmark${NC}" + echo -e "${YELLOW}================================================================${NC}" +fi read -rp "Pick an option and hit ENTER: " case "$REPLY" in 1) clear sleep 1 - install_docker + if [[ -z $FLUXOS_VERSION ]]; then + install_docker + else + install_flux + fi ;; 2) clear sleep 1 - install_node + if [[ -z $FLUXOS_VERSION ]]; then + install_node + else + daemon_reconfiguration + fi ;; 3) clear sleep 1 - analyzer_and_fixer + if [[ -z $FLUXOS_VERSION ]]; then + analyzer_and_fixer + else + fluxos_reconfiguration + fi ;; 4) clear sleep 1 - install_watchdog + if [[ -z $FLUXOS_VERSION ]]; then + install_watchdog + else + flux_daemon_bootstrap + fi ;; 5) clear sleep 1 - flux_daemon_bootstrap + if [[ -z $FLUXOS_VERSION ]]; then + flux_daemon_bootstrap + else + mongod_db_fix + fi ;; 6) clear sleep 1 - create_config + if [[ -z $FLUXOS_VERSION ]]; then + create_config + else + multinode + fi ;; 7) - clear - sleep 1 - install_flux + clear + sleep 1 + if [[ -z $FLUXOS_VERSION ]]; then + install_flux + else + echo -e "${GREEN}Module: Node reconfiguration from install config${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + node_reconfiguration + echo -e "" + fi ;; 8) - clear - sleep 1 - daemon_reconfiguration + clear + sleep 1 + if [[ -z $FLUXOS_VERSION ]]; then + daemon_reconfiguration + else + echo -e "${GREEN}Module: Hardware benchmark${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/hardwarebench.sh) + fi ;; 9) - clear - sleep 1 - echo -e "${GREEN}Module: Flux Daemon service creator${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" + if [[ ! -z $FLUXOS_VERSION ]]; then + exit + fi + clear + sleep 1 + echo -e "${GREEN}Module: Flux Daemon service creator${NC}" echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - create_service_scripts - create_service "install" - echo -e "" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + create_service_scripts + create_service "install" + echo -e "" ;; 10) - clear - sleep 1 - selfhosting_creator + if [[ ! -z $FLUXOS_VERSION ]]; then + exit + fi + clear + sleep 1 + selfhosting_creator ;; 11) - clear - sleep 1 - fluxos_reconfiguration - echo -e "" + if [[ ! -z $FLUXOS_VERSION ]]; then + exit + fi + clear + sleep 1 + fluxos_reconfiguration + echo -e "" ;; 12) - clear - sleep 1 - install_watchtower - echo -e "" - ;; - 13) - clear - sleep 1 - mongod_db_fix - echo -e "" + if [[ ! -z $FLUXOS_VERSION ]]; then + exit + fi + clear + sleep 1 + mongod_db_fix + echo -e "" ;; - 14) - clear - sleep 1 - multinode - echo -e "" + 13) + if [[ ! -z $FLUXOS_VERSION ]]; then + exit + fi + clear + sleep 1 + multinode + echo -e "" ;; - 15) - clear - sleep 1 - echo -e "${GREEN}Module: Node reconfiguration from install config${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - node_reconfiguration - echo -e "" + 14) + if [[ ! -z $FLUXOS_VERSION ]]; then + exit + fi + clear + sleep 1 + echo -e "${GREEN}Module: Node reconfiguration from install config${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + node_reconfiguration + echo -e "" ;; - 16) - clear - sleep 1 - echo -e "${GREEN}Module: Hardware benchmark${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/hardwarebench.sh) + 15) + if [[ ! -z $FLUXOS_VERSION ]]; then + exit + fi + clear + sleep 1 + echo -e "${GREEN}Module: Hardware benchmark${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/hardwarebench.sh) ;; esac # USED FOR CLEANUP AT END OF SCRIPT From c0d11fd9c32e0448b4367b78fff9f421668b365a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 15 Nov 2024 12:09:29 +0100 Subject: [PATCH 1044/1176] Conditional correction --- flux_common.sh | 16 +++++++++++++--- multitoolbox.sh | 18 +++++++++--------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index bc107789..3b77ad9e 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1542,8 +1542,16 @@ function daemon_reconfiguration(){ exit fi echo -e "${ARROW} ${CYAN}Stopping Flux daemon service...${NC}" - sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 - sudo fuser -k 16125/tcp > /dev/null 2>&1 + + if [[ -z $FLUXOS_VERSION ]]; then + sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 + sudo fuser -k 16125/tcp > /dev/null 2>&1 + else + sudo systemctl stop flux-watchdog > /dev/null 2>&1 && sleep 2 + sudo systemctl stop fluxd > /dev/null 2>&1 && sleep 2 + sudo systemctl stop fluxos > /dev/null 2>&1 && sleep 2 + fi + if [[ "$zelnodeprivkey" != "" ]]; then if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}Replace FluxNode Identity Key skipped....................[${CHECK_MARK}${CYAN}]${NC}" @@ -1581,7 +1589,9 @@ function daemon_reconfiguration(){ sudo systemctl start $COIN_NAME > /dev/null 2>&1 && sleep 2 else sudo systemctl start fluxos > /dev/null 2>&1 && sleep 2 - sudo systemctl start fluxd > /dev/null 2>&1 && sleep 2 + sudo systemctl start fluxd > /dev/null 2>&1 && sleep 2 + sudo systemctl restart fluxbenchd > /dev/null 2>&1 && sleep 2 + sudo systemctl start flux-watchdog > /dev/null 2>&1 && sleep 2 fi NUM='35' MSG1='Restarting daemon service...' diff --git a/multitoolbox.sh b/multitoolbox.sh index 4d027d32..b05f79a8 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -48,6 +48,7 @@ function config_veryfity(){ fi fi } + function config_file() { if [[ -f $DATA_PATH/install_conf.json ]]; then import_settings=$(cat $DATA_PATH/install_conf.json | jq -r '.import_settings') @@ -284,15 +285,14 @@ function create_config() { CHOICE=$(whiptail --title "Create FluxNode installation config" --menu "Make your choice" 15 65 8 \ "1)" "Manualy - fill questions list" \ "2)" "Auto - import exists settings" 3>&2 2>&1 1>&3 ) - case $CHOICE in - "1)") - manual_build - ;; - "2)") - config_smart_create - ;; - esac - + case $CHOICE in + "1)") + manual_build + ;; + "2)") + config_smart_create + ;; + esac } function install_watchdog() { if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then From 15bea256aa96b1525d228e6712f90cb953c374c8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:37:47 +0100 Subject: [PATCH 1045/1176] set FLUXOS_VERSION --- flux_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 3b77ad9e..6d594edb 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -54,6 +54,8 @@ PORT=16125 export NEWT_COLORS=' title=black, ' +FLUXOS_VERSION="1" + if [[ -z $FLUXOS_VERSION ]]; then FLUXOS_PATH="/home/$USER/zelflux" FLUX_WATCHDOG_PATH="/home/$USER/watchdog" From fa49cf62e68b99224e5e6f0edaecfd1e35be20f5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:24:16 +0100 Subject: [PATCH 1046/1176] add sudo --- flux_common.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 6d594edb..f64c131e 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1761,15 +1761,15 @@ function tar_file_unpack() { # tar is application/x-tar [[ "$MIME_TYPE" == "application/gzip" ]] && GZIP="-z" echo -e "${ARROW} ${CYAN}Unpacking daemon bootstrap please be patient...${NC}" - pv $TARFILE | tar $GZIP -x -C $DEST_DIR + pv $TARFILE | sudo tar $GZIP -x -C $DEST_DIR } function check_tar() { echo -e "${ARROW} ${CYAN}Checking file integrity...${NC}" - if tar -tf "$1" &>/dev/null; then + if sudo tar -tf "$1" &>/dev/null; then echo -e "${ARROW} ${CYAN}Bootstrap file is valid.................[${CHECK_MARK}${CYAN}]${NC}" else echo -e "${ARROW} ${CYAN}Bootstrap file is corrupted.............[${X_MARK}${CYAN}]${NC}" - rm -rf $1 + sudo rm -rf $1 fi } function tar_file_pack() { @@ -1895,7 +1895,7 @@ function bootstrap_new() { stop_service fi echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + sudo wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" else if [[ "$Mode" != "install" ]]; then @@ -1903,7 +1903,7 @@ function bootstrap_new() { fi DOWNLOAD_URL="$bootstrap_url" echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + sudo wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" fi @@ -1912,10 +1912,10 @@ function bootstrap_new() { fi if [[ -z "$bootstrap_zip_del" ]]; then - rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 + sudo rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 else if [[ "$bootstrap_zip_del" == "1" ]]; then - rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 + sudo rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 fi fi } @@ -1943,7 +1943,7 @@ function bootstrap_manual() { echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" fi echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + sudo wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress if [[ "$Mode" != "install" ]]; then stop_service fi @@ -1954,13 +1954,13 @@ function bootstrap_manual() { DOWNLOAD_URL="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" BOOTSTRAP_FILE="${DOWNLOAD_URL##*/}" - wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + sudo wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress if [[ "$Mode" != "install" ]]; then stop_service fi if [[ "$BOOTSTRAP_FILE" == *".zip"* ]]; then echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" - unzip -o $DATA_PATH/$BOOTSTRAP_FILE -d $FLUX_DAEMON_PATH > /dev/null 2>&1 + sudo unzip -o $DATA_PATH/$BOOTSTRAP_FILE -d $FLUX_DAEMON_PATH > /dev/null 2>&1 else tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" sleep 1 @@ -1988,7 +1988,7 @@ function bootstrap_local() { function flux_chain_date_wipe() { if [[ -e $FLUX_DAEMON_PATH/blocks ]] && [[ -e $FLUX_DAEMON_PATH/chainstate ]]; then echo -e "${ARROW} ${CYAN}Removing blocks, chainstate, determ_zelnodes directories...${NC}" - rm -rf $FLUX_DAEMON_PATH/blocks $FLUX_DAEMON_PATH/chainstate $FLUX_DAEMON_PATH/determ_zelnodes > /dev/null 2>&1 + sudo rm -rf $FLUX_DAEMON_PATH/blocks $FLUX_DAEMON_PATH/chainstate $FLUX_DAEMON_PATH/determ_zelnodes > /dev/null 2>&1 fi } function stop_service() { From 6c197a6db16f022f2b64da88db3edd5f30e05a5b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:52:30 +0100 Subject: [PATCH 1047/1176] Update flux_common.sh --- flux_common.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f64c131e..2826c9bc 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -54,7 +54,6 @@ PORT=16125 export NEWT_COLORS=' title=black, ' -FLUXOS_VERSION="1" if [[ -z $FLUXOS_VERSION ]]; then FLUXOS_PATH="/home/$USER/zelflux" From b07119b280810ec241b4d061b99c5125d8767313 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 12 Dec 2024 19:27:24 +0100 Subject: [PATCH 1048/1176] Update flux_common.sh --- flux_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/flux_common.sh b/flux_common.sh index 2826c9bc..f64c131e 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -54,6 +54,7 @@ PORT=16125 export NEWT_COLORS=' title=black, ' +FLUXOS_VERSION="1" if [[ -z $FLUXOS_VERSION ]]; then FLUXOS_PATH="/home/$USER/zelflux" From 1b52d901afe91d1056f25ff967c50da0a67ef5a7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:41:49 +0100 Subject: [PATCH 1049/1176] Fix permission after bootstrap unpack --- flux_common.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f64c131e..e617e09d 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -54,7 +54,6 @@ PORT=16125 export NEWT_COLORS=' title=black, ' -FLUXOS_VERSION="1" if [[ -z $FLUXOS_VERSION ]]; then FLUXOS_PATH="/home/$USER/zelflux" @@ -1762,6 +1761,9 @@ function tar_file_unpack() { [[ "$MIME_TYPE" == "application/gzip" ]] && GZIP="-z" echo -e "${ARROW} ${CYAN}Unpacking daemon bootstrap please be patient...${NC}" pv $TARFILE | sudo tar $GZIP -x -C $DEST_DIR + if [[ -n $FLUXOS_VERSION ]]; then + sudo chown -R fluxd:fluxd $FLUX_DAEMON_PATH > /dev/null 2>&1 + fi } function check_tar() { echo -e "${ARROW} ${CYAN}Checking file integrity...${NC}" From ef22c8c499626d4688590ec8401c74e3924acd89 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:22:56 +0100 Subject: [PATCH 1050/1176] fix docker access --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index e617e09d..56d2b9c5 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1099,7 +1099,7 @@ function fluxos_clean(){ if [[ $docker_check != 0 ]]; then echo -e "${ARROW} ${CYAN}Removing containers...${NC}" sudo service docker restart > /dev/null 2>&1 && sleep 2 - docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | + sudo docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | while read line; do sudo docker stop $line > /dev/null 2>&1 && sleep 2 sudo docker rm $line > /dev/null 2>&1 && sleep 2 From e7a7eafb045cad3fd2495e74e86cd917dca0be32 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:27:14 +0100 Subject: [PATCH 1051/1176] recreate syncthing config from template --- flux_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/flux_common.sh b/flux_common.sh index 56d2b9c5..90ec5853 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1113,6 +1113,7 @@ function fluxos_clean(){ else sudo systemctl stop syncthing > /dev/null 2>&1 sudo rm /dat/usr/lib/syncthing/config.xml > /dev/null 2>&1 + sudo cp /dat/usr/lib/syncthing/original.xml /dat/usr/lib/syncthing/config.xml > /dev/null 2>&1 fi if [[ $resource_check != 0 ]]; then echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 From 365129fcb9bdbd53372dfb2fef61449d52a41e70 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:39:17 +0100 Subject: [PATCH 1052/1176] [ADD] SUDO_CMD in daemon_reconfiguration --- flux_common.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 90ec5853..7e2081f6 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1549,6 +1549,7 @@ function daemon_reconfiguration(){ sudo systemctl stop $COIN_NAME > /dev/null 2>&1 && sleep 2 sudo fuser -k 16125/tcp > /dev/null 2>&1 else + SUDO_CMD="sudo" sudo systemctl stop flux-watchdog > /dev/null 2>&1 && sleep 2 sudo systemctl stop fluxd > /dev/null 2>&1 && sleep 2 sudo systemctl stop fluxos > /dev/null 2>&1 && sleep 2 @@ -1558,7 +1559,7 @@ function daemon_reconfiguration(){ if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}Replace FluxNode Identity Key skipped....................[${CHECK_MARK}${CYAN}]${NC}" else - sed -i "s/$(grep -e zelnodeprivkey $FLUX_DAEMON_PATH/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" $FLUX_DAEMON_PATH/$CONFIG_FILE + $SUDO_CMD sed -i "s/$(grep -e zelnodeprivkey $FLUX_DAEMON_PATH/$CONFIG_FILE)/zelnodeprivkey=$zelnodeprivkey/" $FLUX_DAEMON_PATH/$CONFIG_FILE if [[ "zelnodeprivkey=$zelnodeprivkey" == $(grep -w zelnodeprivkey $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}FluxNode Identity Key replaced successful................[${CHECK_MARK}${CYAN}]${NC}" fi @@ -1569,7 +1570,7 @@ function daemon_reconfiguration(){ if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}Replace FluxNode Collateral TX ID outpoint skipped ..................[${CHECK_MARK}${CYAN}]${NC}" else - sed -i "s/$(grep -e zelnodeoutpoint $FLUX_DAEMON_PATH/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" $FLUX_DAEMON_PATH/$CONFIG_FILE + $SUDO_CMD sed -i "s/$(grep -e zelnodeoutpoint $FLUX_DAEMON_PATH/$CONFIG_FILE)/zelnodeoutpoint=$zelnodeoutpoint/" $FLUX_DAEMON_PATH/$CONFIG_FILE if [[ "zelnodeoutpoint=$zelnodeoutpoint" == $(grep -w zelnodeoutpoint $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}FluxNode Collateral TX ID replaced successful...............[${CHECK_MARK}${CYAN}]${NC}" fi @@ -1580,7 +1581,7 @@ function daemon_reconfiguration(){ if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}Replace FluxNode Output Index skipped......................[${CHECK_MARK}${CYAN}]${NC}" else - sed -i "s/$(grep -w zelnodeindex $FLUX_DAEMON_PATH/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" $FLUX_DAEMON_PATH/$CONFIG_FILE + $SUDO_CMD sed -i "s/$(grep -w zelnodeindex $FLUX_DAEMON_PATH/$CONFIG_FILE)/zelnodeindex=$zelnodeindex/" $FLUX_DAEMON_PATH/$CONFIG_FILE if [[ "zelnodeindex=$zelnodeindex" == $(grep -w zelnodeindex $FLUX_DAEMON_PATH/$CONFIG_FILE) ]]; then echo -e "${ARROW} ${CYAN}FluxNode Output Index replaced successful..................[${CHECK_MARK}${CYAN}]${NC}" fi From badb97ddfef1488b7670ac25909f5383a4ad719f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 12:16:11 +0100 Subject: [PATCH 1053/1176] [ADD] FLUX_APPS_FOLDER --- flux_common.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 7e2081f6..6efcf6f4 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -64,6 +64,7 @@ if [[ -z $FLUXOS_VERSION ]]; then MONGODB_DATA_PATH="/var/lib/mongodb" MONGODB_LOG_PATH="/var/log/mongodb" FLUX_DAEMON_SERVICE="zelflux" + FLUX_APPS_FOLDER="$FLUXOS_PATH/ZelApps" else FLUXOS_PATH="/dat/usr/lib/fluxos" FLUX_WATCHDOG_PATH="/dat/usr/lib/fluxwatchdog" @@ -73,6 +74,7 @@ else MONGODB_DATA_PATH="/dat/var/lib/mongodb" MONGODB_LOG_PATH="/dat/var/log/mongodb" FLUX_DAEMON_SERVICE="fluxd" + FLUX_APPS_FOLDER="/dat/var/lib/fluxos/flux-apps" fi ##### CONFIGS SECTION ###################################### @@ -1094,7 +1096,7 @@ function os_check(){ } function fluxos_clean(){ - docker_check=$(docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) + docker_check=$(sudo docker container ls -a | egrep 'zelcash|flux' | grep -Eo "^[0-9a-z]{8,}\b" | wc -l) resource_check=$(df | egrep 'flux' | awk '{ print $1}' | wc -l) if [[ $docker_check != 0 ]]; then echo -e "${ARROW} ${CYAN}Removing containers...${NC}" @@ -1122,14 +1124,14 @@ function fluxos_clean(){ sudo umount -l $line && sleep 1 done fi - if [[ -d $FLUXOS_PATH/ZelApps && $(find $FLUXOS_PATH/ZelApps -maxdepth 1 -mindepth 1 -type d | wc -l) -gt 1 ]]; then + if [[ -d $FLUX_APPS_FOLDER && $(find $FLUX_APPS_FOLDER -maxdepth 1 -mindepth 1 -type d | wc -l) -gt 1 ]]; then echo -e "${ARROW} ${CYAN}Cleaning FluxOS Apps directory...${NC}" && sleep 1 - APPS_LIST=($(find $FLUXOS_PATH/ZelApps -maxdepth 1 -mindepth 1 -type d -printf '%P\n')) + APPS_LIST=($(find $FLUX_APPS_FOLDER -maxdepth 1 -mindepth 1 -type d -printf '%P\n')) LENGTH=${#APPS_LIST[@]} for (( j=0; j<${LENGTH}; j++ )); do if [[ "${APPS_LIST[$j]}" != "ZelShare" && "${APPS_LIST[$j]}" != "" ]]; then - echo -e "${ARROW} ${CYAN}Apps directory removed, path: ${GREEN}$FLUXOS_PATH/ZelApps/${APPS_LIST[$j]}${NC}" + echo -e "${ARROW} ${CYAN}Apps directory removed, path: ${GREEN}$FLUX_APPS_FOLDER/${APPS_LIST[$j]}${NC}" sudo rm -rf $FLUXOS_PATH/ZelApps/${APPS_LIST[$j]} fi done From ce699f994a33df208404f8cafd867cf260489e7e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 12:25:42 +0100 Subject: [PATCH 1054/1176] bypass user check --- multitoolbox.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index b05f79a8..d76c254f 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -100,13 +100,15 @@ function config_file() { function install_flux() { echo -e "${GREEN}Module: Re-install FluxOS${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi + if [[ -z $FLUXOS_VERSION ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + fi if [[ -z $FLUXOS_VERSION ]]; then if pm2 -v > /dev/null 2>&1; then pm2 del zelflux > /dev/null 2>&1 From b6a2ca82de936967ef0f565fb43e917b8208ff8e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 12:53:38 +0100 Subject: [PATCH 1055/1176] add logs --- flux_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/flux_common.sh b/flux_common.sh index 6efcf6f4..ae07aaaf 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1121,6 +1121,7 @@ function fluxos_clean(){ echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 df | egrep 'flux' | awk '{ print $1}' | while read line; do + echo -e "${CYAN}Unmounting - $line ${NC}" sudo umount -l $line && sleep 1 done fi From c154bd26f49c1fd5fe7eb8e9b287b390aec752ec Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 13:01:35 +0100 Subject: [PATCH 1056/1176] exclude flux_crypt from umount --- flux_common.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index ae07aaaf..38853193 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1119,9 +1119,8 @@ function fluxos_clean(){ fi if [[ $resource_check != 0 ]]; then echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 - df | egrep 'flux' | awk '{ print $1}' | + df | grep 'flux' | grep -v 'flux_crypt' | awk '{ print $1 }' | while read line; do - echo -e "${CYAN}Unmounting - $line ${NC}" sudo umount -l $line && sleep 1 done fi From 83f1bc64d91daa3c7f29a7fe425450d8abe4fd99 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 13:37:42 +0100 Subject: [PATCH 1057/1176] add logs --- flux_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/flux_common.sh b/flux_common.sh index 38853193..b8bf4490 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1121,6 +1121,7 @@ function fluxos_clean(){ echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 df | grep 'flux' | grep -v 'flux_crypt' | awk '{ print $1 }' | while read line; do + echo -e "${CYAN}Unmounting - $line ...${NC}" && sleep 1 sudo umount -l $line && sleep 1 done fi From f3fdff8ed0fbd22edbea6abb99ae71b31a8e9c28 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 14:53:58 +0100 Subject: [PATCH 1058/1176] bypass user check --- multitoolbox.sh | 80 +++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d76c254f..494d7d91 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -262,13 +262,15 @@ function install_flux() { function create_config() { echo -e "${GREEN}Module: Create FluxNode installation config file...${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi + if [[ -z $FLUXOS_VERSION ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + fi if jq --version > /dev/null 2>&1; then sleep 0.2 else @@ -297,13 +299,15 @@ function create_config() { esac } function install_watchdog() { - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi + if [[ -z $FLUXOS_VERSION ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + fi echo -e "${GREEN}Module: Install watchdog for FluxNode${NC}" echo -e "${YELLOW}================================================================${NC}" echo -e "${ARROW} ${CYAN}Cleaning...${NC}" @@ -497,16 +501,18 @@ function install_watchdog() { echo -e "" } function flux_daemon_bootstrap() { - echo -e "${GREEN}Module: Restore Flux blockchain from bootstrap${NC}" + echo -e "${GREEN}Module: Restore Flux blockchain from bootstrap${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit + if [[ -z $FLUXOS_VERSION ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi fi - cd + cd echo -e "${NC}" config_veryfity bootstrap_new @@ -641,13 +647,15 @@ function install_docker(){ function mongod_db_fix() { echo -e "${GREEN}Module: MongoDB FiX action${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi + if [[ -z $FLUXOS_VERSION ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + fi if [[ -z $FLUXOS_VERSION ]]; then CHOICE=$( whiptail --title "MongoDB FiX action" --menu "Make your choice" 15 65 8 \ @@ -967,13 +975,6 @@ case "$REPLY" in else echo -e "${GREEN}Module: Node reconfiguration from install config${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi node_reconfiguration echo -e "" fi @@ -986,13 +987,6 @@ case "$REPLY" in else echo -e "${GREEN}Module: Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/hardwarebench.sh) fi ;; From e06e06b8951b7d53d77f97fbfcfa999caca5b7ec Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 16:47:01 +0100 Subject: [PATCH 1059/1176] Update multitoolbox.sh --- multitoolbox.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 494d7d91..3f589a31 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -772,12 +772,15 @@ function mongod_db_fix() { sudo systemctl stop fluxbenchd > /dev/null 2>&1 sudo systemctl stop fluxos > /dev/null 2>&1 sudo rm -rf /var/lib/mongodb/* - sudo systemctl start mongod fluxos_clean + echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" + sudo systemctl start mongod sudo systemctl start fluxd > /dev/null 2>&1 sudo systemctl start fluxbenchd > /dev/null 2>&1 sudo systemctl start fluxos > /dev/null 2>&1 sudo systemctl start flux-watchdog > /dev/null 2>&1 + sudo systemctl start syncthing > /dev/null 2>&1 + echo -e "" fi ;; esac From 25e3777b54398445d78bf9d26fbaa0c907877d9a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 16:51:30 +0100 Subject: [PATCH 1060/1176] Update multitoolbox.sh --- multitoolbox.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3f589a31..d3372d91 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -117,8 +117,9 @@ function install_flux() { fi else echo -e "${ARROW} ${CYAN}Stopping FluxOS....${NC}" - sudo systemctl stop flux-watchdog - sudo systemctl stop fluxos + sudo systemctl stop flux-watchdog > /dev/null 2>&1 + sudo systemctl stop fluxos > /dev/null 2>&1 + sudo systemctl stop syncthing > /dev/null 2>&1 fi fluxos_clean if [[ -f $FLUXOS_PATH/config/userconfig.js ]]; then @@ -254,6 +255,7 @@ function install_flux() { else echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" + sudo systemctl start syncthing > /dev/null 2>&1 sudo systemctl start flux-watchdog > /dev/null 2>&1 sudo systemctl restart fluxbenchd > /dev/null 2>&1 sudo systemctl start fluxos > /dev/null 2>&1 From a67fbb0d7473685a16c9059a7c988f0a7bcebfe2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 17:01:32 +0100 Subject: [PATCH 1061/1176] Add more log steps --- multitoolbox.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d3372d91..9871bfed 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -769,19 +769,34 @@ function mongod_db_fix() { sleep 5 echo -e "" else + echo -e "${ARROW} ${CYAN}Stopping Flux Watchdog service... ${NC}" sudo systemctl stop flux-watchdog > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Stopping Fluxd service... ${NC}" sudo systemctl stop fluxd > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Stopping Fluxbench service... ${NC}" sudo systemctl stop fluxbenchd > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Stopping FluxOS service... ${NC}" sudo systemctl stop fluxos > /dev/null 2>&1 sudo rm -rf /var/lib/mongodb/* fluxos_clean - echo -e "${ARROW} ${CYAN}Starting mongod service... ${NC}" - sudo systemctl start mongod + echo -e "${ARROW} ${CYAN}Starting MongoDB service... ${NC}" + sudo systemctl start mongod > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting Fluxd service... ${NC}" sudo systemctl start fluxd > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting Fluxbench service... ${NC}" sudo systemctl start fluxbenchd > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting FluxOS service... ${NC}" sudo systemctl start fluxos > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting Flux Watchdog service... ${NC}" sudo systemctl start flux-watchdog > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting Syncthing service... ${NC}" sudo systemctl start syncthing > /dev/null 2>&1 + if mongod --version > /dev/null 2>&1; then + string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." + echo -e "${ARROW} ${CYAN}Service status:${SEA} $(sudo systemctl status mongod | grep -w 'Active' | sed -e 's/^[ \t]*//')${NC}" + else + string_limit_x_mark "MongoDB was not installed................................." + fi echo -e "" fi ;; From 76e67f07c0502c9e037b5dc20021942be09e5dc8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 17:02:17 +0100 Subject: [PATCH 1062/1176] Update flux_common.sh --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index b8bf4490..84af011d 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1118,7 +1118,7 @@ function fluxos_clean(){ sudo cp /dat/usr/lib/syncthing/original.xml /dat/usr/lib/syncthing/config.xml > /dev/null 2>&1 fi if [[ $resource_check != 0 ]]; then - echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource${NC}" && sleep 1 + echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource...${NC}" && sleep 1 df | grep 'flux' | grep -v 'flux_crypt' | awk '{ print $1 }' | while read line; do echo -e "${CYAN}Unmounting - $line ...${NC}" && sleep 1 From b36e516fed991784072c5d2e05a616e125d28286 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 14 Dec 2024 17:17:24 +0100 Subject: [PATCH 1063/1176] Minor edits --- multitoolbox.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9871bfed..beea4fc6 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -647,7 +647,7 @@ function install_docker(){ fi } function mongod_db_fix() { - echo -e "${GREEN}Module: MongoDB FiX action${NC}" + echo -e "${GREEN}Module: MongoDB Repair Assistant${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ -z $FLUXOS_VERSION ]]; then if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then @@ -660,7 +660,7 @@ function mongod_db_fix() { fi if [[ -z $FLUXOS_VERSION ]]; then CHOICE=$( - whiptail --title "MongoDB FiX action" --menu "Make your choice" 15 65 8 \ + whiptail --title "MongoDB Repair Assistant" --menu "Make your choice" 15 65 8 \ "1)" "Soft repair - MongoDB database repair" \ "2)" "Hard repair - MongoDB re-install" 3>&2 2>&1 1>&3 ) @@ -675,16 +675,16 @@ function mongod_db_fix() { "1)") echo -e "" echo -e "${ARROW} ${YELLOW}Soft repair starting... ${NC}" - echo -e "${ARROW} ${CYAN}Stopping mongod service ${NC}" + echo -e "${ARROW} ${CYAN}Stopping MongoDB service ${NC}" sudo systemctl stop mongod - echo -e "${ARROW} ${CYAN}Fix for corrupted DB ${NC}" + echo -e "${ARROW} ${CYAN}Fixing corrupted DB ${NC}" sudo rm $MONGODB_DATA_PATH/journal/* > /dev/null 2>&1 sudo rm $MONGODB_DATA_PATH/mongod.lock > /dev/null 2>&1 sudo -u mongodb mongod --dbpath $MONGODB_DATA_PATH --repair > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Fix for bad privilege ${NC}" + echo -e "${ARROW} ${CYAN}Setting privilege ${NC}" sudo chown -R mongodb:mongodb $MONGODB_DATA_PATH > /dev/null 2>&1 sudo chown mongodb:mongodb /tmp/mongodb-27017.sock > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting mongod service ${NC}" + echo -e "${ARROW} ${CYAN}Starting MongoDB service ${NC}" sudo systemctl start mongod if mongod --version > /dev/null 2>&1; then string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." @@ -705,7 +705,7 @@ function mongod_db_fix() { "2)") echo -e "" echo -e "${ARROW} ${YELLOW}Hard repair starting... ${NC}" - echo -e "${ARROW} ${CYAN}Stopping mongod service...${NC}" + echo -e "${ARROW} ${CYAN}Stopping MongoDB service...${NC}" sudo systemctl stop mongod if [[ -z $FLUXOS_VERSION ]]; then echo -e "${ARROW} ${CYAN}Removing MongoDB... ${NC}" @@ -781,16 +781,16 @@ function mongod_db_fix() { fluxos_clean echo -e "${ARROW} ${CYAN}Starting MongoDB service... ${NC}" sudo systemctl start mongod > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting Syncthing service... ${NC}" + sudo systemctl start syncthing > /dev/null 2>&1 + echo -e "${ARROW} ${CYAN}Starting FluxOS service... ${NC}" + sudo systemctl start fluxos > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting Fluxd service... ${NC}" sudo systemctl start fluxd > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting Fluxbench service... ${NC}" sudo systemctl start fluxbenchd > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting FluxOS service... ${NC}" - sudo systemctl start fluxos > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting Flux Watchdog service... ${NC}" sudo systemctl start flux-watchdog > /dev/null 2>&1 - echo -e "${ARROW} ${CYAN}Starting Syncthing service... ${NC}" - sudo systemctl start syncthing > /dev/null 2>&1 if mongod --version > /dev/null 2>&1; then string_limit_check_mark "MongoDB $(mongod --version | grep 'db version' | sed 's/db version.//') installed................................." "MongoDB ${GREEN}$(mongod --version | grep 'db version' | sed 's/db version.//')${CYAN} installed................................." echo -e "${ARROW} ${CYAN}Service status:${SEA} $(sudo systemctl status mongod | grep -w 'Active' | sed -e 's/^[ \t]*//')${NC}" @@ -915,7 +915,7 @@ if [[ -z $FLUXOS_VERSION ]]; then echo -e "${CYAN}9 - Create Flux daemon service${NC}" echo -e "${CYAN}10 - Create Self-hosting cron ip service ${NC}" echo -e "${CYAN}11 - FluxOS config management ${NC}" - echo -e "${CYAN}12 - MongoDB Repair Action${NC}" + echo -e "${CYAN}12 - MongoDB Repair Assistant${NC}" echo -e "${CYAN}13 - Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" echo -e "${CYAN}14 - Node reconfiguration from install config${NC}" echo -e "${CYAN}15 - Hardware benchmark${NC}" @@ -925,7 +925,7 @@ else echo -e "${CYAN}2 - Flux Daemon Reconfiguration${NC}" echo -e "${CYAN}3 - FluxOS Config Management${NC}" echo -e "${CYAN}4 - Restore Flux blockchain from bootstrap${NC}" - echo -e "${CYAN}5 - MongoDB Repair Action${NC}" + echo -e "${CYAN}5 - MongoDB Repair Assistant${NC}" echo -e "${CYAN}6 - Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" echo -e "${CYAN}7 - Node reconfiguration from install config${NC}" echo -e "${CYAN}8 - Hardware benchmark${NC}" From 5eb9001b7a36126dfe230a87337ca82932a8ce79 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 10:51:02 +0100 Subject: [PATCH 1064/1176] [ADD] SUDO_CMD --- multitoolbox.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index beea4fc6..77d50fa0 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -167,7 +167,10 @@ function install_flux() { FLUXOS_HOME_DIR="zelflux" fi echo -e "${ARROW} ${CYAN}FluxOS downloading...${NC}" - git clone https://github.com/RunOnFlux/flux.git $FLUXOS_HOME_DIR > /dev/null 2>&1 && sleep 1 + if [[ -n $FLUXOS_VERSION ]]; then + SUDO_CMD="sudo" + fi + $SUDO_CMD git clone https://github.com/RunOnFlux/flux.git $FLUXOS_HOME_DIR > /dev/null 2>&1 && sleep 1 if [[ -d $FLUXOS_PATH ]]; then if [[ -f $FLUXOS_PATH/package.json ]]; then current_ver=$(jq -r '.version' $FLUXOS_PATH/package.json) From 9cb342bde2f0fc1b1298fdabc91823469f33e35f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 11:07:20 +0100 Subject: [PATCH 1065/1176] Use tmp directory for config creation --- flux_common.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 84af011d..6393a7b8 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -104,8 +104,15 @@ function fluxos_conf_create(){ else testnet=false fi - touch $FLUXOS_PATH/config/userconfig.js - cat <<- EOF >| $FLUXOS_PATH/config/userconfig.js + + if [[ -n $FLUXOS_VERSION ]]; then + FLUXOS_CONFIG="/tmp" + else + FLUXOS_CONFIG="$FLUXOS_PATH/config" + fi + + touch $FLUXOS_CONFIG/userconfig.js + cat <<- EOF >| $FLUXOS_CONFIG/userconfig.js module.exports = { initial: { ipaddress: '${WANIP}', @@ -117,6 +124,10 @@ module.exports = { } } EOF +if [[ -n $FLUXOS_VERSION ]]; then + sudo mv $FLUXOS_CONFIG/userconfig.js $FLUXOS_PATH/config/userconfig.js +fi + } function flux_daemon_conf_create() { From c9d05b29c3b861d62bd958f72f32212c8bb50683 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 14:46:06 +0100 Subject: [PATCH 1066/1176] Update multitoolbox.sh --- multitoolbox.sh | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 77d50fa0..dd4ae302 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -198,19 +198,21 @@ function install_flux() { sleep 2 fi done - while true - do - KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=0" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done + if [[ -z $FLUXOS_VERSION ]]; then + while true + do + KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) + if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + KDA_A="kadena:$KDA_A?chainid=0" + sleep 2 + break + else + echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + sleep 2 + fi + done + fi fi fluxos_conf_create if [[ -f $FLUXOS_PATH/config/userconfig.js ]]; then From 14c1f5ad249fcf3da966823ba1118b4b3e550198 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 17:48:20 +0100 Subject: [PATCH 1067/1176] [ADD] SUDO_CMD --- multinode.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index d0521f57..c4294373 100644 --- a/multinode.sh +++ b/multinode.sh @@ -12,7 +12,10 @@ function upnp_disable() { if [[ $(grep -e "fluxport" $FLUX_BENCH_PATH/fluxbench.conf) != "" ]]; then echo -e "" echo -e "${ARROW} ${YELLOW}Removing FluxOS UPnP configuration.....${NC}" - sed -i "/$(grep -e "fluxport" $FLUX_BENCH_PATH/fluxbench.conf)/d" $FLUX_BENCH_PATH/fluxbench.conf > /dev/null 2>&1 + if [[ -n $FLUXOS_VERSION ]]; then + SUDO_CMD="sudo" + fi + $SUDO_CMD sed -i "/$(grep -e "fluxport" $FLUX_BENCH_PATH/fluxbench.conf)/d" $FLUX_BENCH_PATH/fluxbench.conf > /dev/null 2>&1 else echo -e "${ARROW} ${CYAN}UPnP Mode is already disabled...${NC}" echo -e "" From 33eb4ebc7143f73ce1abef5ef93910acaa886cd4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 19:10:23 +0100 Subject: [PATCH 1068/1176] [ADD] SUDO_CMD in RemoveLine --- flux_common.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 6393a7b8..fe659322 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -227,7 +227,10 @@ function insert() { } function RemoveLine(){ - sed -i "/$1/d" $FLUXOS_PATH/config/userconfig.js + if [[ -n $FLUXOS_VERSION ]]; then + SUDO_CMD="sudo" + fi + $SUDO_CMD sed -i "/$1/d" $FLUXOS_PATH/config/userconfig.js } function ClearList() { From e7db1ad62582cbb023c7ccdfeda46f0e4c867198 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 19:17:48 +0100 Subject: [PATCH 1069/1176] [ADD] npm install in FluxOS re-install --- multitoolbox.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index dd4ae302..aad08cef 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -258,6 +258,9 @@ function install_flux() { fi fi else + echo -e "${ARROW} ${CYAN}Installing FluxOS dependencies....${NC}" + cd $FLUXOS_PATH + sudo npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" sudo systemctl start syncthing > /dev/null 2>&1 From e820343e1758c925c32c4d1db5f862402f64d1c4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 21:57:34 +0100 Subject: [PATCH 1070/1176] [ADD] Benchmark for crypt device --- hardwarebench.sh | 502 +++++++++++++++++++++++++---------------------- 1 file changed, 262 insertions(+), 240 deletions(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index c5c8770d..e5ed5f99 100644 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -106,8 +106,6 @@ fi echo -e "| CPU vcores: ${CYAN}${vcore}${NC}" -echo -e "| CPU cores: ${CYAN}${core}${NC}" - if [[ "$ram" -ge "$cumulus_ram" ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]]; then status="CUMULUS" @@ -122,259 +120,283 @@ if [[ "$status" == "" ]]; then status="FAILED" fi - -outputdiskbench="Disks Bench:"; -#checking loop for lxc only if mount == '/' -loop_mount=$(cd $HOME && LC_ALL=C lsblk -l -b -n | grep 'loop' | awk '{ if ($7 == "/") printf("%.2f\n", $4/(1024*1024*1024))}') -if [[ "$loop_mount" != "" ]]; then - - #echo -e "Device type: loop" - #echo -e "" - mount_path="/" - io1=$( dd_benchmark "$mount_path" ) - #printf '1st run: %s\n' "$(printf '%d\n' "$io1" | Bps_to_MiBps)" - io2=$( dd_benchmark "$mount_path" ) - #printf '2nd run: %s\n' "$(printf '%d\n' "$io2" | Bps_to_MiBps)" - io3=$( dd_benchmark "$mount_path" ) - #printf '3rd run: %s\n' "$(printf '%d\n' "$io3" | Bps_to_MiBps)" - # Calculating avg I/O (better approach with awk for non int values) - - if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) - elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) - else - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) - fi - - #echo -e "-----------------------------" - outputdiskbench+=" loop $loop_mount $ioavg" - if [[ "${ioavg%%.*}" -ge "180" ]]; then - SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$loop_mount"')}') - else - HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$loop_mount"')}') - fi - echo -e "$outputdiskbench" - echo -e "" - exit -###In this case we exit no other partition will be tested - -fi -################################# -lvm_mount="" -raid_list=() -#create disk array ( check only disk > 2GB && name not mmcblk0/mmcblk0p1 to not run disk speed on microsd cards ) -disc__array=($(cd $HOME && LC_ALL=C lsblk -o NAME,SIZE,TYPE -b -n | grep ' disk' | awk '{ if ($2 > 2147483648 && $1 != "mmcblk0" && $1 != "mmcblk0p1") print $1}')) -#echo -e "" -#echo -e "Disk count: ${#disc__array[@]}" -#echo -e "-----------------------------" -for((i=0;i<${#disc__array[@]};i++)); -do - #checking if disk structure is accessable - cd $HOME && lsblk -l -b -n /dev/${disc__array[i]} > /dev/null 2>&1 - if [ $? != 0 ]; then - #echo -e "Disk name: ${disc__array[i]}" - #echo -e "Error: Can't grab device stucture... device skipped!" - #echo -e "-----------------------------" - continue +if [[ -n $FLUXOS_VERSION ]]; then + outputdiskbench="Disk Bench:"; + mount_size=$(LC_ALL=C lsblk -l -b -n | grep 'crypt' | awk '{ if ($7 == "/dat") printf("%.2f\n", $4/(1024*1024*1024))}') + device_name=$(LC_ALL=C lsblk -l -b -n | grep 'crypt' | grep '/dat' | awk {'printf("%s\n", $1)'}) + if [[ "$mount_size" != "" ]]; then + mount_path="/dat" + io1=$( dd_benchmark "$mount_path" ) + io2=$( dd_benchmark "$mount_path" ) + io3=$( dd_benchmark "$mount_path" ) + if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) + elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) + else + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi - #checking direct mount - disk_mount_check=$(cd $HOME && LC_ALL=C lsblk -l -b -n /dev/${disc__array[i]} | egrep ' disk' | awk '{ if ( $7 == "") print "no"; else print "yes"}') - if [[ "$disk_mount_check" == "no" ]]; then - #checking lvm mount - lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) - lvm_name=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $1 }' ) - - if [[ "$lvm_name" != "" ]]; then - count=$(echo ${mount_list[@]} | tr ' ' '\n' | awk '$1 == "'"$lvm_mount"'"{print $0}' | wc -l) - if [[ "$count" == "0" ]]; then - mount_list+=("$lvm_mount") + outputdiskbench+=" $device_name $mount_size $ioavg" + if [[ "${ioavg%%.*}" -ge "180" ]]; then + SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$mount_size"')}') + else + HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$mount_size"')}') + fi + fi +else + outputdiskbench="Disks Bench:"; + #checking loop for lxc only if mount == '/' + loop_mount=$(cd $HOME && LC_ALL=C lsblk -l -b -n | grep 'loop' | awk '{ if ($7 == "/") printf("%.2f\n", $4/(1024*1024*1024))}') + if [[ "$loop_mount" != "" ]]; then + + #echo -e "Device type: loop" + #echo -e "" + mount_path="/" + io1=$( dd_benchmark "$mount_path" ) + #printf '1st run: %s\n' "$(printf '%d\n' "$io1" | Bps_to_MiBps)" + io2=$( dd_benchmark "$mount_path" ) + #printf '2nd run: %s\n' "$(printf '%d\n' "$io2" | Bps_to_MiBps)" + io3=$( dd_benchmark "$mount_path" ) + #printf '3rd run: %s\n' "$(printf '%d\n' "$io3" | Bps_to_MiBps)" + # Calculating avg I/O (better approach with awk for non int values) + + if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) + elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) + else + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) + fi + + #echo -e "-----------------------------" + outputdiskbench+=" loop $loop_mount $ioavg" + if [[ "${ioavg%%.*}" -ge "180" ]]; then + SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$loop_mount"')}') + else + HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$loop_mount"')}') + fi + echo -e "$outputdiskbench" + echo -e "" + exit + ###In this case we exit no other partition will be tested + + fi + ################################# + lvm_mount="" + raid_list=() + #create disk array ( check only disk > 2GB && name not mmcblk0/mmcblk0p1 to not run disk speed on microsd cards ) + disc__array=($(cd $HOME && LC_ALL=C lsblk -o NAME,SIZE,TYPE -b -n | grep ' disk' | awk '{ if ($2 > 2147483648 && $1 != "mmcblk0" && $1 != "mmcblk0p1") print $1}')) + #echo -e "" + #echo -e "Disk count: ${#disc__array[@]}" + #echo -e "-----------------------------" + for((i=0;i<${#disc__array[@]};i++)); + do + #checking if disk structure is accessable + cd $HOME && lsblk -l -b -n /dev/${disc__array[i]} > /dev/null 2>&1 + if [ $? != 0 ]; then + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Error: Can't grab device stucture... device skipped!" + #echo -e "-----------------------------" + continue + fi + #checking direct mount + disk_mount_check=$(cd $HOME && LC_ALL=C lsblk -l -b -n /dev/${disc__array[i]} | egrep ' disk' | awk '{ if ( $7 == "") print "no"; else print "yes"}') + if [[ "$disk_mount_check" == "no" ]]; then + #checking lvm mount + lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) + lvm_name=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $1 }' ) + + if [[ "$lvm_name" != "" ]]; then + count=$(echo ${mount_list[@]} | tr ' ' '\n' | awk '$1 == "'"$lvm_mount"'"{print $0}' | wc -l) + if [[ "$count" == "0" ]]; then + mount_list+=("$lvm_mount") + else + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Error: Mount point already checked... device skipped!" + #echo -e "-----------------------------" + continue + fi + fi + + if [[ "$lvm_name" != "" && "$lvm_mount" == "" ]]; then + + if [[ ! -d /.benchmark_test ]]; then + sudo mkdir /.benchmark_test + fi + sudo mount /dev/mapper/$lvm_name /.benchmark_test + fi + + lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) + + if [[ "$lvm_mount" != "" ]]; then + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') else - #echo -e "Disk name: ${disc__array[i]}" - #echo -e "Error: Mount point already checked... device skipped!" - #echo -e "-----------------------------" - continue + + #checking if disk partition type is LVM2_member + part_type_check=$(cd $HOME && LC_ALL=C lsblk -o NAME,TYPE,FSTYPE,SIZE -b -n /dev/${disc__array[i]} --sort SIZE | egrep ' part' | egrep 'LVM2_member' | tail -n1 | wc -l) + if [[ "$part_type_check" != "0" ]]; then + #skipp disk + partition_name=$(awk '{print $1}' <<< $part_type_check) + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Error: LVM2_member partition detected... device skipped!" + #echo -e "-----------------------------" + continue + fi + + #checking raid + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' raid' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') + + if [[ "$partition_output" == "" ]]; then + #checking part ( when not lvm and raid ) + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' part' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') + else + + partition_name=$(awk '{print $1}' <<< $partition_output) + #add raid name to skip list + if [[ ! " ${raid_list[@]} " =~ " ${partition_name} " ]]; then + raid_list+=("$partition_name") + else + #skipped raid already tested + #echo -e "Disk name: ${disc__array[i]}" + #echo -e "Info: Disk skipped - raid already tested!" + #echo -e "-----------------------------" + continue + fi + fi fi - fi - - if [[ "$lvm_name" != "" && "$lvm_mount" == "" ]]; then - - if [[ ! -d /.benchmark_test ]]; then + + else + partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') + fi + + partition_name=$(awk '{print $1}' <<< $partition_output) + partition_size=$(awk '{printf("%.2f",$2)}' <<< $partition_output) + + if [[ "$lvm_mount" == "" && "$raid_list" == "" ]]; then + disk_size=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --noheadings | head -n1 | awk '{printf("%.2f",$4/(1024*1024*1024))}') + else + disk_size=$partition_size + fi + if [[ "$lvm_mount" == "" ]]; then + if [[ ! -d /.benchmark_test ]]; then sudo mkdir /.benchmark_test - fi - sudo mount /dev/mapper/$lvm_name /.benchmark_test + fi + sudo mount /dev/$partition_name /.benchmark_test + available_space=$(LC_ALL=C df /dev/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else print "null"}') + else + available_space=$(LC_ALL=C df /dev/mapper/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else print "null"}') + fi + #echo -e "Disk Name: ${disc__array[i]}" + #echo -e "Partition: /dev/$partition_name" + #echo -e "Size: $disk_size" + #echo -e "Available space: $available_space" + if [[ "$available_space" != "null" && "$available_space" != "" ]]; then + + if [[ "$lvm_mount" == "" ]]; then + mount_path="/.benchmark_test" + else + mount_path="$lvm_mount" fi - - lvm_mount=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{ print $7 }' ) - - if [[ "$lvm_mount" != "" ]]; then - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' lvm| dm' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') - else - - #checking if disk partition type is LVM2_member - part_type_check=$(cd $HOME && LC_ALL=C lsblk -o NAME,TYPE,FSTYPE,SIZE -b -n /dev/${disc__array[i]} --sort SIZE | egrep ' part' | egrep 'LVM2_member' | tail -n1 | wc -l) - if [[ "$part_type_check" != "0" ]]; then - #skipp disk - partition_name=$(awk '{print $1}' <<< $part_type_check) - #echo -e "Disk name: ${disc__array[i]}" - #echo -e "Error: LVM2_member partition detected... device skipped!" - #echo -e "-----------------------------" - continue - fi - - #checking raid - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' raid' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') - - if [[ "$partition_output" == "" ]]; then - #checking part ( when not lvm and raid ) - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | egrep ' part' | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') + #echo -e "Mount point: $mount_path" + io1=$( dd_benchmark "$mount_path" ) + #printf ' 1st run: %s\n' "$(printf '%d\n' "$io1" | Bps_to_MiBps)" + io2=$( dd_benchmark "$mount_path" ) + #printf ' 2nd run: %s\n' "$(printf '%d\n' "$io2" | Bps_to_MiBps)" + io3=$( dd_benchmark "$mount_path" ) + #printf ' 3rd run: %s\n' "$(printf '%d\n' "$io3" | Bps_to_MiBps)" + # Calculating avg I/O (better approach with awk for non int values) + if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) + elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) + else + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) + fi + + outputdiskbench+=" ${disc__array[i]} $disk_size $ioavg" + if [[ "${ioavg%%.*}" -ge "180" ]]; then + SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$disk_size"')}') + else + HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$disk_size"')}') + fi + #echo -e "-----------------------------" + if [[ "$lvm_mount" == "" ]]; then + sudo umount /.benchmark_test + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + echo -e "" + else + sudo rm -rf /.benchmark_test + fi + + fi + #check if test point mounted if exist unmount it LVM case + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + sudo umount /.benchmark_test + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + echo -e "" + else + sudo rm -rf /.benchmark_test + fi + fi + + else + + #echo -e "Error: space not enough... write test skipped!" + #echo -e "-----------------------------" + if [[ "$lvm_mount" == "" ]]; then + + sudo umount /.benchmark_test + if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then + echo -e "" else - - partition_name=$(awk '{print $1}' <<< $partition_output) - #add raid name to skip list - if [[ ! " ${raid_list[@]} " =~ " ${partition_name} " ]]; then - raid_list+=("$partition_name") - else - #skipped raid already tested - #echo -e "Disk name: ${disc__array[i]}" - #echo -e "Info: Disk skipped - raid already tested!" - #echo -e "-----------------------------" - continue - fi + sudo rm -rf /.benchmark_test fi - fi - - else - partition_output=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --sort SIZE | tail -n1 | awk '{print $1 " " $4/(1024*1024*1024) }') - fi - - partition_name=$(awk '{print $1}' <<< $partition_output) - partition_size=$(awk '{printf("%.2f",$2)}' <<< $partition_output) - - if [[ "$lvm_mount" == "" && "$raid_list" == "" ]]; then - disk_size=$(cd $HOME && LC_ALL=C lsblk -l -b /dev/${disc__array[i]} --noheadings | head -n1 | awk '{printf("%.2f",$4/(1024*1024*1024))}') - else - disk_size=$partition_size - fi - if [[ "$lvm_mount" == "" ]]; then - if [[ ! -d /.benchmark_test ]]; then - sudo mkdir /.benchmark_test fi - sudo mount /dev/$partition_name /.benchmark_test - available_space=$(LC_ALL=C df /dev/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else print "null"}') - else - available_space=$(LC_ALL=C df /dev/mapper/$partition_name | grep $partition_name | tail -n1 | awk '{ if ($4 > 2097152) printf("%.2f",$4/(1024*1024)); else print "null"}') - fi - #echo -e "Disk Name: ${disc__array[i]}" - #echo -e "Partition: /dev/$partition_name" - #echo -e "Size: $disk_size" - #echo -e "Available space: $available_space" - if [[ "$available_space" != "null" && "$available_space" != "" ]]; then - - if [[ "$lvm_mount" == "" ]]; then - mount_path="/.benchmark_test" - else - mount_path="$lvm_mount" - fi - #echo -e "Mount point: $mount_path" - io1=$( dd_benchmark "$mount_path" ) - #printf ' 1st run: %s\n' "$(printf '%d\n' "$io1" | Bps_to_MiBps)" - io2=$( dd_benchmark "$mount_path" ) - #printf ' 2nd run: %s\n' "$(printf '%d\n' "$io2" | Bps_to_MiBps)" - io3=$( dd_benchmark "$mount_path" ) - #printf ' 3rd run: %s\n' "$(printf '%d\n' "$io3" | Bps_to_MiBps)" - # Calculating avg I/O (better approach with awk for non int values) - if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) - elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) - else - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi - - outputdiskbench+=" ${disc__array[i]} $disk_size $ioavg" - if [[ "${ioavg%%.*}" -ge "180" ]]; then - SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$disk_size"')}') - else - HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$disk_size"')}') - fi - #echo -e "-----------------------------" - if [[ "$lvm_mount" == "" ]]; then - sudo umount /.benchmark_test - if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then - echo -e "" + + done + + if [[ "$outputdiskbench" == "Disks Bench:" ]]; then + # lsblk failed checking direct mount from df + df_direct_mount=$(LC_ALL=C df --output=source,fstype,size,avail,target | grep 'dev' | awk '{ if ($5 == "/") printf("%s %.2f %.2f\n", $1,$3/(1024*1024),$4/(1024*1024))}') + + if [[ df_direct_mount != "" ]]; then + + device_name=$(awk '{print $1}' <<< $df_direct_mount) + partition_size=$(awk '{print $2}' <<< $df_direct_mount) + + #echo -e "Device name: $device_name" + #echo -e "Device size: $partition_size" + mount_path="/" + #echo -e "Mount point: $mount_path" + io1=$( dd_benchmark "$mount_path" ) + #printf ' 1st run: %s\n' "$(printf '%d\n' "$io1" | Bps_to_MiBps)" + io2=$( dd_benchmark "$mount_path" ) + #printf ' 2nd run: %s\n' "$(printf '%d\n' "$io2" | Bps_to_MiBps)" + io3=$( dd_benchmark "$mount_path" ) + #printf ' 3rd run: %s\n' "$(printf '%d\n' "$io3" | Bps_to_MiBps)" + # Calculating avg I/O (better approach with awk for non int values) + + if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) + elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) else - sudo rm -rf /.benchmark_test + ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) fi - - fi - #check if test point mounted if exist unmount it LVM case - if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then - sudo umount /.benchmark_test - if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then - echo -e "" + + #echo -e "-----------------------------" + outputdiskbench+=" $device_name $partition_size $ioavg" + if [[ "${ioavg%%.*}" -ge "180" ]]; then + SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$partition_size"')}') else - sudo rm -rf /.benchmark_test + HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$partition_size"')}') fi + #echo -e "$outputdiskbench" + #echo -e "" fi - - else - - #echo -e "Error: space not enough... write test skipped!" - #echo -e "-----------------------------" - if [[ "$lvm_mount" == "" ]]; then - - sudo umount /.benchmark_test - if [[ $(cd $HOME && lsblk -l | grep "benchmark_test") ]]; then - echo -e "" - else - sudo rm -rf /.benchmark_test - fi - fi - fi - -done - -if [[ "$outputdiskbench" == "Disks Bench:" ]]; then - # lsblk failed checking direct mount from df - df_direct_mount=$(LC_ALL=C df --output=source,fstype,size,avail,target | grep 'dev' | awk '{ if ($5 == "/") printf("%s %.2f %.2f\n", $1,$3/(1024*1024),$4/(1024*1024))}') - - if [[ df_direct_mount != "" ]]; then - - device_name=$(awk '{print $1}' <<< $df_direct_mount) - partition_size=$(awk '{print $2}' <<< $df_direct_mount) - - #echo -e "Device name: $device_name" - #echo -e "Device size: $partition_size" - mount_path="/" - #echo -e "Mount point: $mount_path" - io1=$( dd_benchmark "$mount_path" ) - #printf ' 1st run: %s\n' "$(printf '%d\n' "$io1" | Bps_to_MiBps)" - io2=$( dd_benchmark "$mount_path" ) - #printf ' 2nd run: %s\n' "$(printf '%d\n' "$io2" | Bps_to_MiBps)" - io3=$( dd_benchmark "$mount_path" ) - #printf ' 3rd run: %s\n' "$(printf '%d\n' "$io3" | Bps_to_MiBps)" - # Calculating avg I/O (better approach with awk for non int values) - - if [[ "$io1" -le "$io2" ]] && [[ "$io1" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io2"' + '"$io3"')/2)}' | Bps_to_MiBps ) - elif [[ "$io2" -le "$io1" ]] && [[ "$io2" -le "$io3" ]]; then - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io3"')/2)}' | Bps_to_MiBps ) - else - ioavg=$( awk 'BEGIN{printf("%.0f", ('"$io1"' + '"$io2"')/2)}' | Bps_to_MiBps ) - fi - - #echo -e "-----------------------------" - outputdiskbench+=" $device_name $partition_size $ioavg" - if [[ "${ioavg%%.*}" -ge "180" ]]; then - SSD=$(awk 'BEGIN{printf("%d",'"$SSD"'+'"$partition_size"')}') - else - HDD=$(awk 'BEGIN{printf("%d",'"$HDD"'+'"$partition_size"')}') - fi - #echo -e "$outputdiskbench" - #echo -e "" fi -fi +fi if [[ $status == "CUMULUS" ]]; then SCORE=1 fi From 96954a1dacf4e8973d20b0b208f6f79069e33684 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 22:10:00 +0100 Subject: [PATCH 1071/1176] Use local script for benchmark --- multitoolbox.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index aad08cef..f48a7696 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1015,7 +1015,11 @@ case "$REPLY" in else echo -e "${GREEN}Module: Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/hardwarebench.sh) + if [[ -n $FLUXOS_VERSION ]]; then + bash -i "/usr/lib/multitoolbox/hardwarebench.sh" + else + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/hardwarebench.sh) + fi fi ;; 9) From 0ec9b750f29d230b1414f9c0ddfaece938663b0e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 22:17:21 +0100 Subject: [PATCH 1072/1176] Use local scripts --- multitoolbox.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f48a7696..5c030f50 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -6,7 +6,11 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh) $ROOT_BRANCH $2 + if [[ -n "/usr/lib/multitoolbox/multitoolbox.sh" ]]; then + bash -i "/usr/lib/multitoolbox/multitoolbox.sh" + else + bash -i <(curl -s "https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh") $ROOT_BRANCH $2 + fi unset ROOT_BRANCH unset BRANCH_ALREADY_REFERENCED set -o history @@ -16,7 +20,12 @@ else export ROOT_BRANCH='master' fi -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh)" +if [[ -f "/usr/lib/multitoolbox/flux_common.sh" ]]; then + source "/usr/lib/multitoolbox/flux_common.sh" +else + source /dev/stdin <<< "$(curl -s "https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh")" +fi + if [[ -d /home/$USER/.zelcash ]]; then CONFIG_DIR='.zelcash' CONFIG_FILE='zelcash.conf' From d00185d67f7b2a51e6f2ef89105e130b1d93ef76 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 22:18:18 +0100 Subject: [PATCH 1073/1176] Use local file --- multinode.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/multinode.sh b/multinode.sh index c4294373..6870e47b 100644 --- a/multinode.sh +++ b/multinode.sh @@ -1,5 +1,9 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" +if [[ -f "/usr/lib/multitoolbox/flux_common.sh" ]]; then + source "/usr/lib/multitoolbox/flux_common.sh" +else + source /dev/stdin <<< "$(curl -s "https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh")" +fi function upnp_disable() { if [[ ! -f $FLUXOS_PATH/config/userconfig.js ]]; then From 23d3567c4793550b67467361ecf3317d68dae866 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 22:23:17 +0100 Subject: [PATCH 1074/1176] Use local file --- flux_common.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index fe659322..1e57699b 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2932,7 +2932,11 @@ function multinode(){ exit fi sleep 8 - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) + if [[ -f "/usr/lib/multitoolbox/multinode.sh" ]]; then + bash -i "/usr/lib/multitoolbox/multinode.sh" + else + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/multinode.sh) + fi } function analyzer_and_fixer(){ echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" @@ -2944,5 +2948,9 @@ function analyzer_and_fixer(){ echo -e "${NC}" exit fi - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) + if [[ -f "/usr/lib/multitoolbox/nodeanalizerandfixer.sh" ]]; then + bash -i "/usr/lib/multitoolbox/nodeanalizerandfixer.sh" + else + bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/nodeanalizerandfixer.sh) + fi } From cd8e657774564a325a9f39c6468753b6862a0860 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 22:38:16 +0100 Subject: [PATCH 1075/1176] Minor edit --- multitoolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 5c030f50..19459420 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -272,6 +272,7 @@ function install_flux() { sudo npm install > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" + echo sudo systemctl start syncthing > /dev/null 2>&1 sudo systemctl start flux-watchdog > /dev/null 2>&1 sudo systemctl restart fluxbenchd > /dev/null 2>&1 From a91585b6bbcb78aa931d1d8b7edb8867231d016c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 15 Dec 2024 23:03:33 +0100 Subject: [PATCH 1076/1176] Minor edit --- flux_common.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 1e57699b..fead67bf 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1665,17 +1665,21 @@ function replace_zelid() { } function thunder_mode(){ - if [[ -d $FLUX_BENCH_PATH ]]; then - sudo chown -R $USER:$USER $FLUX_BENCH_PATH > /dev/null 2>&1 - else - mkdir -p $FLUX_BENCH_PATH > /dev/null 2>&1 + if [[ -z $FLUXOS_VERSION ]]; then + if [[ -d $FLUX_BENCH_PATH ]]; then + sudo chown -R $USER:$USER $FLUX_BENCH_PATH > /dev/null 2>&1 + else + mkdir -p $FLUX_BENCH_PATH > /dev/null 2>&1 + fi fi - if [[ -f $FLUX_BENCH_PATH/fluxbench.conf ]]; then if [[ $(grep -e "thunder" $FLUX_BENCH_PATH/fluxbench.conf) == "" ]]; then config_builder "thunder" "1" "Thunder Mode" "benchmark" else - sed -i "/$(grep -e "thunder" $FLUX_BENCH_PATH/fluxbench.conf)/d" $FLUX_BENCH_PATH/fluxbench.conf > /dev/null 2>&1 + if [[ -n $FLUXOS_VERSION ]]; then + SUDO_CMD="sudo" + fi + $SUDO_CMD sed -i "/$(grep -e "thunder" $FLUX_BENCH_PATH/fluxbench.conf)/d" $FLUX_BENCH_PATH/fluxbench.conf > /dev/null 2>&1 echo -e "${ARROW}${GREEN} [BenchD] ${CYAN}Thunder Mode disabled successful${NC}" "${CHECK_MARK}" fi else @@ -1698,7 +1702,10 @@ function development_mode(){ echo -e "${ARROW}${GREEN} [FluxOS] ${CYAN}Enabling development mode... ${NC}" config_builder "development" "true" "Development Mode" "fluxos" cd $FLUXOS_PATH - git checkout development && git pull > /dev/null 2>&1 + if [[ -n $FLUXOS_VERSION ]]; then + SUDO_CMD="sudo" + fi + $SUDO_CMD git checkout development && git pull > /dev/null 2>&1 if [[ -z $FLUXOS_VERSION ]]; then pm2 restart flux > /dev/null 2>&1 else @@ -1708,7 +1715,10 @@ function development_mode(){ echo -e "${ARROW}${GREEN} [FluxOS] ${CYAN}Disabling development mode... ${NC}" config_builder "development" "false" "Development Mode" "fluxos" cd $FLUXOS_PATH - git checkout master && git pull > /dev/null 2>&1 + if [[ -n $FLUXOS_VERSION ]]; then + SUDO_CMD="sudo" + fi + $SUDO_CMD git checkout master && git pull > /dev/null 2>&1 if [[ -z $FLUXOS_VERSION ]]; then pm2 restart flux > /dev/null 2>&1 else From 56d1d3970e198bee25508f76a317edb2d5331ada Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 16 Dec 2024 09:04:19 +0100 Subject: [PATCH 1077/1176] [ADD] Flags in npm install --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 19459420..a2fe6a01 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -269,7 +269,7 @@ function install_flux() { else echo -e "${ARROW} ${CYAN}Installing FluxOS dependencies....${NC}" cd $FLUXOS_PATH - sudo npm install > /dev/null 2>&1 + sudo npm install --omit=dev --cache /dat/usr/lib/npm > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" echo -e "${ARROW} ${CYAN}FluxOS loading will take 2-3min....${NC}" echo From c66e8055fd49dadc04b617c1c4973fc610d23daa Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:49:11 +0100 Subject: [PATCH 1078/1176] [ADD] Arcane diagnostic --- nodeanalizerandfixer.sh | 659 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 658 insertions(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 9fdc620f..56e47e89 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -1,6 +1,663 @@ #!/bin/bash -source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/${ROOT_BRANCH}/flux_common.sh)" +if [[ -f "/usr/lib/multitoolbox/flux_common.sh" ]]; then + source "/usr/lib/multitoolbox/flux_common.sh" +else + source /dev/stdin <<< "$(curl -s "https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/flux_common.sh")" +fi + +if [[ -n $FLUXOS_VERSION ]]; then + #const + REPLACE="0" + FLUXCONF="0" + FLUXRESTART="0" + ZELCONF="0" + BTEST="0" + LC_CHECK="0" + ZELFLUX_PORT1="0" + ZELFLUX_PORT2="0" + FLUX_UPDATE="0" + OWNER="0" + IP_FIX="0" + SCVESION=v4.0 + FLUX_DIR='zelflux' + COIN_NAME='zelcash' + COIN_DAEMON='zelcashd' + BENCH_DIR_LOG='.zelbenchmark' + BENCH_DAEMON='zelbenchd' + BENCH_NAME='zelbench' + COIN_CLI='flux-cli -conf=/dat/var/lib/fluxd/flux.conf' + BENCH_CLI='fluxbench-cli' + CONFIG_FILE='flux.conf' + FLUXOS_PATH="/dat/usr/lib/fluxos" + FLUX_WATCHDOG_PATH="/dat/usr/lib/fluxwatchdog" + FLUX_DAEMON_PATH="/dat/var/lib/fluxd" + FLUX_BENCH_PATH="/dat/usr/lib/fluxbenchd" + DATA_PATH="/dat" + MONGODB_DATA_PATH="/dat/var/lib/mongodb" + MONGODB_LOG_PATH="/dat/var/log/mongodb" + FLUX_DAEMON_SERVICE="fluxd" + FLUX_APPS_FOLDER="/dat/var/lib/fluxos/flux-apps" + + + get_ip + #function + function show_time() { + num=$1 + min=0 + hour=0 + day=0 + if((num>59));then + ((sec=num%60)) + ((num=num/60)) + if((num>59));then + ((min=num%60)) + ((num=num/60)) + if((num>23));then + ((hour=num%24)) + ((day=num/24)) + else + ((hour=num)) + fi + else + ((min=num)) + fi + else + ((sec=num)) + fi + echo -e "${PIN} ${CYAN}Last error was \c" + echo -e "${RED}$day"d "$hour"h "$min"m "$sec"s"${CYAN} ago.${NC}" + } + function check_listen_ports(){ + if ! lsof -v > /dev/null 2>&1; then + sudo apt-get install lsof -y > /dev/null 2>&1 && sleep 1 + fi + + if [[ -f $FLUX_BENCH_PATH/fluxbench.conf ]]; then + FluxAPI=$(grep -Po "(?<=fluxport=)\d+" $FLUX_BENCH_PATH/fluxbench.conf) + FLUXOS_CONFIG=$(grep -Po "$FluxAPI" $FLUX_BENCH_PATH/fluxbench.conf) + if [[ "$FLUXOS_CONFIG" != "" ]]; then + FluxUI=$(($FluxAPI-1)) + UPNP=1 + else + FluxAPI=16127 + FluxUI=16126 + UPNP=0 + fi + else + FluxAPI=16127 + FluxUI=16126 + UPNP=0 + fi + if sudo lsof -i -n | grep LISTEN | grep 27017 | grep mongod > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Mongod listen on port 27017${NC}" + else + echo -e "${X_MARK} ${CYAN} Mongod not listen${NC}" + fi + if sudo lsof -i -n | grep LISTEN | grep 16125 | grep fluxd > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Flux daemon listen on port 16125${NC}" + else + if sudo lsof -i -n | grep LISTEN | grep 16125 | grep zelcashd > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Flux daemon listen on port 16125${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux daemon not listen${NC}" + fi + fi + if sudo lsof -i -n | grep LISTEN | grep 16224 | grep bench > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Flux benchmark listen on port 16224${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux benchmark not listen${NC}" + fi + if sudo lsof -i -n | grep LISTEN | grep $FluxUI | grep node > /dev/null 2>&1; then + ZELFLUX_PORT1="1" + fi + if sudo lsof -i -n | grep LISTEN | grep $FluxAPI | grep node > /dev/null 2>&1 ; then + ZELFLUX_PORT2="1" + fi + if [[ "$ZELFLUX_PORT1" == "1" && "$ZELFLUX_PORT2" == "1" ]]; then + echo -e "${CHECK_MARK} ${CYAN} Flux listen on ports $FluxUI/$FluxAPI ${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux not listen${NC}" + fi + echo -e "" + echo -e "${BOOK} ${YELLOW}FluxOS networking: ${NC}" + + output=$(upnpc -l 2>&1) + if echo "$output" | egrep -q "No IGD UPnP Device found|No UPnP-enabled devices|No valid UPNP Internet Gateway Device found"; then + echo -e "${PIN} ${CYAN}UPnP STATUS: ${RED}DISABLED${NC}" + else + echo -e "${PIN} ${CYAN}UPnP STATUS: ${GREEN}ENABLED${NC}" + fi + echo -e "${PIN} ${CYAN}FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" + echo -e "${PIN} ${CYAN}FluxUI PORT: ${ORANGE}$FluxUI ${NC}" + if [[ -f /home/$USER/.pm2/logs/flux-out.log ]]; then + error_check=$(sudo journalctl -u fluxos.service -b -n 20 | grep "UPnP failed") + if [[ "$error_check" != "" ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Checking FluxOS logs... ${NC}" + echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." + echo -e "" + fi + fi + } + function get_last_benchmark(){ + if [[ "$2" == "check" ]]; then + info_check=$(sudo grep 'Found' $FLUX_BENCH_PATH/debug.log | egrep 'Found|Historical' | grep $1 | tail -n1 | egrep -o '[0-9]+(\.[0-9]+)|([0-9]+)' | tail -n1 | awk '{printf "%.2f\n", $1}') + if [[ "$info_check" == "" ]]; then + skipp_debug=1 + return 1 + fi + fi + if [[ "$1" == "cores" ]]; then + cores=$(sudo grep 'Found' $FLUX_BENCH_PATH/debug.log | egrep 'Found|Historical' | grep 'cores' | tail -n1 | egrep -Eo '[^ ]+$') + echo -e "${PIN}${CYAN} CORES: ${GREEN}$cores${NC}" + fi + + if [[ "$1" == "HDD" || "$1" == "DD_WRITE" || "$1" == "ram" || "$1" == "eps" ]] && [[ "$2" != "check" ]]; then + + info=$(sudo grep 'Found' $FLUX_BENCH_PATH/debug.log | egrep 'Found|Historical' | grep $1 | tail -n1 | egrep -o '[0-9]+(\.[0-9]+)|([0-9]+)' | tail -n1 | awk '{printf "%.2f\n", $1}') + + if [[ "$1" == "ram" ]]; then + echo -e "${PIN}${CYAN} RAM: ${GREEN}$info${NC}" + fi + + if [[ "$1" == "eps" ]]; then + echo -e "${PIN}${CYAN} EPS: ${GREEN}$info${NC}" + fi + + if [[ "$1" == "DD_WRITE" ]]; then + echo -e "${PIN}${CYAN} DD_WRITE: ${GREEN}$info${NC}" + fi + + if [[ "$1" == "HDD" ]]; then + echo -e "${PIN}${CYAN} HDD: ${GREEN}$info${NC}" + fi + fi + } + function integration(){ + PATH_TO_FOLDER=( /usr/local/bin/ ) + if [[ -f /usr/local/bin/fluxd ]]; then + FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' ) + else + FILE_ARRAY=( 'zelbench-cli' 'zelbenchd' 'zelcash-cli' 'zelcashd' 'zelcash-fetch-params.sh' 'zelcash-tx' ) + fi + ELEMENTS=${#FILE_ARRAY[@]} + NOT_FOUND="0" + for (( i=0;i<$ELEMENTS;i++)); do + if [ -f $PATH_TO_FOLDER${FILE_ARRAY[${i}]} ]; then + echo -e "${CHECK_MARK} ${CYAN} ${FILE_ARRAY[${i}]}" + else + echo -e "${X_MARK} ${CYAN} ${FILE_ARRAY[${i}]}" + NOT_FOUND="1" + fi + done + } + + sleep 1 + if ! bc -v > /dev/null 2>&1 ; then + sudo apt install -y bc > /dev/null 2>&1 && sleep 1 + fi + echo -e "${NC}" + if [ -f $FLUX_BENCH_PATH/debug.log ]; then + echo -e "${BOOK} ${YELLOW}Checking Flux benchmark $FLUX_BENCH_PATH/debug.log${NC}" + if [[ $(sudo egrep -ac -wi --color 'Failed' $FLUX_BENCH_PATH/debug.log) != "0" ]]; then + echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(sudo egrep -ac --color 'Failed' $FLUX_BENCH_PATH/debug.log)${CYAN} error events${NC}" + #egrep -wi --color 'warning|error|critical|failed' ~/.zelbenchmark/debug.log + error_line=$(sudo egrep -a --color 'Failed' $FLUX_BENCH_PATH/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + event_date=$(sudo egrep -a --color 'Failed' $FLUX_BENCH_PATH/debug.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}') + echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" + event_time_uxtime=$(date -ud "$event_date" +"%s") + event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" + event_time="$event_time_uxtime" + now_date=$(date +%s) + tdiff=$((now_date-event_time)) + show_time "$tdiff" + echo -e "${PIN} ${CYAN}Creating Flux benchmark_debug_error.log${NC}" + sudo egrep -a --color 'Failed' $FLUX_BENCH_PATH/debug.log > /tmp/benchmark_debug_error.log + echo -e "" + else + echo -e "${GREEN}\xF0\x9F\x94\x8A ${CYAN}Found: ${GREEN}0 errors${NC}" + echo -e "" + fi + skipp_debug=0 + get_last_benchmark "HDD" "check" + if [[ "$skipp_debug" == "0" ]]; then + echo -e "${BOOK} ${YELLOW}Last benchmark from $FLUX_BENCH_PATH/debug.log${NC}" + get_last_benchmark "HDD" + get_last_benchmark "DD_WRITE" + get_last_benchmark "ram" + get_last_benchmark "cores" + echo -e "" + fi + fi + if [ -f $FLUX_DAEMON_PATH/debug.log ]; then + echo -e "${BOOK} ${YELLOW}Checking Flux daemon $FLUX_DAEMON_PATH/debug.log${NC}" + if [[ $(sudo egrep -ac -wi --color 'error|failed' $FLUX_DAEMON_PATH/debug.log) != "0" ]]; then + echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(sudo egrep -ac -wi --color 'error|failed' $FLUX_DAEMON_PATH/debug.log)${CYAN} error events, ${RED}$(sudo egrep -ac -wi --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log) ${CYAN}related to benchmark${NC}" + if [[ $(sudo egrep -ac -wi --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log) != "0" ]]; then + echo -e "${BOOK} ${CYAN}FluxBench errors info:${NC}" + error_line=$(sudo egrep -a --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + event_date=$(sudo egrep -a --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}') + echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" + event_time_uxtime=$(date -ud "$event_date" +"%s") + event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" + event_time="$event_time_uxtime" + now_date=$(date +%s) + tdiff=$((now_date-event_time)) + show_time "$tdiff" + fi + echo -e "${PIN} ${CYAN}Creating flux_daemon_debug_error.log${NC}" + sudo egrep -a --color 'error|failed' $FLUX_DAEMON_PATH/debug.log > /tmp/flux_daemon_debug_error.log + echo -e "" + else + echo -e "${GREEN}\xF0\x9F\x94\x8A ${CYAN}Found: ${GREEN}0 errors${NC}" + echo -e "" + fi + fi + + if [[ "$($BENCH_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + echo -e "${BOOK} ${YELLOW}Flux benchmark status:${NC}" + bench_getatus=$($BENCH_CLI getstatus) + bench_status=$(jq -r '.status' <<< "$bench_getatus") + bench_benchmark=$(jq -r '.benchmarking' <<< "$bench_getatus") + bench_back=$(jq -r '.zelback' <<< "$bench_getatus") + if [[ "$bench_back" == "null" ]]; then + bench_back=$(jq -r '.flux' <<< "$bench_getatus") + fi + + bench_getinfo=$($BENCH_CLI getinfo) + bench_version=$(jq -r '.version' <<< "$bench_getinfo") + + if [[ "$bench_benchmark" == "failed" || "$bench_benchmark" == "toaster" ]]; then + bench_benchmark_color="${RED}$bench_benchmark" + else + bench_benchmark_color="${SEA}$bench_benchmark" + fi + + if [[ "$bench_status" == "online" ]]; then + bench_status_color="${SEA}$bench_status" + else + bench_status_color="${RED}$bench_status" + fi + + if [[ "$bench_back" == "connected" ]]; then + bench_back_color="${SEA}$bench_back" + else + bench_back_color="${RED}$bench_back" + fi + + echo -e "${PIN} ${CYAN}Flux benchmark version: ${SEA}$bench_version${NC}" + echo -e "${PIN} ${CYAN}Flux benchmark status: $bench_status_color${NC}" + echo -e "${PIN} ${CYAN}Benchmark: $bench_benchmark_color${NC}" + echo -e "${PIN} ${CYAN}Flux: $bench_back_color${NC}" + echo -e "${NC}" + + if [[ "$bench_benchmark" == "running" ]]; then + echo -e "${ARROW} ${CYAN} Benchmarking hasn't completed, please wait until benchmarking has completed.${NC}" + fi + + if [[ "$bench_benchmark" == "CUMULUS" || "$bench_benchmark" == "NIMBUS" || "$bench_benchmark" == "STRATUS" ]]; then + echo -e "${CHECK_MARK} ${CYAN} Flux benchmark working correct, all requirements met.${NC}" + fi + + if [[ "$bench_benchmark" == "failed" ]]; then + echo -e "${X_MARK} ${CYAN} Flux benchmark problem detected, check benchmark debug.log${NC}" + fi + + core=$($BENCH_CLI getbenchmarks | jq '.cores') + if [[ "$bench_benchmark" == "failed" && "$core" > "0" ]]; then + BTEST="1" + echo -e "${X_MARK} ${CYAN} Flux benchmark working correct but minimum system requirements not met.${NC}" + check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" + check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" + fi + + if [[ "$bench_back" == "disconnected" ]]; then + echo -e "${X_MARK} ${CYAN} FluxBack does not work properly${NC}" + if [[ "$WANIP" != "" ]]; then + back_error_check=$(curl -s -m 5 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .status ) + if [[ "$back_error_check" != "success" && "$back_error_check" != "" ]]; then + back_error=$(curl -s -m 8 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .data.message.message 2>/dev/null ) + if [[ "$back_error" != "" ]]; then + echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" + else + back_error=$(curl -s -m 8 http://$WANIP:$FluxAPI/zelid/loginphrase | jq -r .data.message 2>/dev/null ) + if [[ "$back_error" != "" ]]; then + echo -e "${X_MARK} ${CYAN} FluxBack error: ${RED}$back_error${NC}" + fi + fi + fi + fi + device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + local_device_ip=$(ip a list $device_name | grep -o $WANIP ) + if [[ "$WANIP" != "" ]]; then + if [[ "$local_device_ip" == "$WANIP" ]]; then + echo -e "${CHECK_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) matches local device(${GREEN}$device_name${CYAN}) IP(${GREEN}$local_device_ip${CYAN})${NC}" + else + echo -e "${X_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) not matches local device(${GREEN}$device_name${CYAN}) IP${NC}" + echo -e "${ARROW} ${CYAN} If you under NAT use option 10 from multitoolbox (self-hosting)${NC}" + ## dev_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2"0"}') + ## sudo ip addr add "$WANPI" dev "$dev_name" + # IP_FIX="1" + fi + else + echo -e "${ARROW} ${CYAN} Local device(${GREEN}$device_name${CYAN}) IP veryfication failed...${NC}" + fi + fi + echo -e "${NC}" + fi + if [[ "$($COIN_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then + echo -e "${BOOK} ${YELLOW}Flux deamon information:${NC}" + daemon_getinfo=$($COIN_CLI getinfo) + version=$(jq -r '.version' <<< "$daemon_getinfo") + blocks_hight=$(jq -r '.blocks' <<< "$daemon_getinfo") + protocolversion=$(jq -r '.protocolversion' <<< "$daemon_getinfo") + connections=$(jq -r '.connections' <<< "$daemon_getinfo") + error=$(jq -r '.error' <<< "$daemon_getinfo") + if [[ "$error" != "" && "$error" != null ]]; then + echo + echo -e "${X_MARK} ${CYAN} Flux daemon error detected: ${RED}$error${CYAN}) IP${NC}" + fi + echo -e "${PIN} ${CYAN}Version: ${SEA}$version${NC}" + echo -e "${PIN} ${CYAN}Protocolversion: ${SEA}$protocolversion${NC}" + echo -e "${PIN} ${CYAN}Connections: ${SEA}$connections${NC}" + echo -e "${PIN} ${CYAN}Blocks: ${SEA}$blocks_hight${NC}" + network_height_01=$(curl -sk -m 5 https://$network_url_1/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) + network_height_02=$(curl -sk -m 5 https://$network_url_2/api/status?q=getInfo getinfo 2>/dev/null | jq '.info.blocks' 2> /dev/null) + explorer_network_hight=$(max "$network_height_01" "$network_height_02") + block_diff=$((explorer_network_hight-blocks_hight)) + if [[ "$explorer_network_hight" != "0" ]]; then + if [[ "$block_diff" < 10 ]]; then + echo -e "${PIN} ${CYAN}Status: ${GREEN}synced${NC}" + else + echo -e "${PIN} ${CYAN}Status: ${RED}not synced${NC}" + fi + else + echo -e "${PIN} ${CYAN}Info: ${RED}sync check skipped...${NC}" + fi + echo -e "" + echo -e "${BOOK} ${YELLOW}Checking node status:${NC}" + getzelnodestatus=$($COIN_CLI getzelnodestatus) + node_status=$(jq -r '.status' <<< "$getzelnodestatus") + collateral=$(jq -r '.collateral' <<< "$getzelnodestatus") + if [[ "$node_status" == "CONFIRMED" ]]; then + node_status_color="${SEA}$node_status" + elif [[ "$node_status" == "STARTED" ]];then + node_status_color="${YELLOW}$node_status" + else + node_status_color="${RED}$node_status" + fi + echo -e "${PIN} ${CYAN}Node status: $node_status_color${NC}" + if [[ "$node_status" == "DOS" ]]; then + blocks_till=$($COIN_CLI getdoslist | jq .[] | grep "$collateral" -A5 -B1 | jq .eligible_in) + dos_till=$((blocks_hight+blocks_till)) + echo -e "${PIN} ${RED}DOS ${CYAN}Till: ${ORANGE}$dos_till ${CYAN}EXPIRE_COUNT: ${ORANGE}$blocks_till${CYAN} Time left: ${RED}~$((2*blocks_till)) min. ${NC}" + fi + echo -e "${PIN} ${CYAN}Collateral: ${SEA}$collateral${NC}" + echo -e "" + flux_communication=$(curl -SsL -m 10 http://"$WANIP":"$FluxAPI"/flux/checkcommunication 2>/dev/null | jq -r .data.message 2>/dev/null) + if [[ "$flux_communication" != "null" && "$flux_communication" != "" ]]; then + echo -e "${BOOK} ${YELLOW}Checking FluxOS communication: ${NC}" + echo -e "${ARROW} ${CYAN}$flux_communication${NC}" + echo -e "" + fi + if [[ "$explorer_network_hight" != "0" ]]; then + echo -e "${BOOK} ${YELLOW}Checking collateral:${NC}" + txhash=$(grep -o "\w*" <<< "$collateral") + txhash=$(sed -n "2p" <<< "$txhash") + txhash=$(egrep "\w{10,50}" <<< "$txhash") + if [[ "$txhash" != "" ]]; then + stak_info="" + + if [[ -f $FLUX_DAEMON_PATH/flux.conf ]]; then + index_from_file=$(grep -w zelnodeindex $FLUX_DAEMON_PATH/flux.conf | sed -e 's/zelnodeindex=//') + stak_info=$(curl -s -m 10 https://$network_url_1/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + if [[ "$stak_info" == "" ]]; then + stak_info=$(curl -s -m 10 https://$network_url_2/api/tx/$txhash 2>/dev/null | jq -r ".vout[$index_from_file] | .value,.n,.scriptPubKey.addresses[0],.spentTxId" 2>/dev/null | paste - - - - | awk '{printf "%0.f %d %s %s\n",$1,$2,$3,$4}' | grep 'null' | egrep -o '1000|12500|40000') + fi + fi + + if [[ "$stak_info" != "" ]]; then + type=$(awk '{print $1}' <<< "$stak_info") + conf=$($COIN_CLI gettxout $txhash $index_from_file | jq .confirmations) + if [[ $conf == ?(-)+([0-9]) ]]; then + if [ "$conf" -ge "100" ]; then + echo -e "${CHECK_MARK} ${CYAN} Confirmations numbers >= 100($conf)${NC}" + else + echo -e "${X_MARK} ${CYAN} Confirmations numbers < 100($conf)${NC}" + fi + else + echo -e "${X_MARK} ${CYAN} FluxNode outpoint is not valid${NC}" + fi + if [[ $type == ?(-)+([0-9]) ]]; then + case $type in + "1000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}CUMULUS${NC}" ;; + "12500") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}NIMBUS${NC}";; + "40000") echo -e "${ARROW} ${CYAN}Tier: ${GREEN}STRATUS${NC}";; + esac + case $bench_benchmark in + "CUMULUS") bench_benchmark_value=1000 ;; + "NIMBUS") bench_benchmark_value=12500 ;; + "STRATUS") bench_benchmark_value=40000 ;; + esac + if [[ -z bench_benchmark_value ]]; then + echo -e "" + else + if [[ "$bench_benchmark_value" -ge "$type" ]]; then + case $type in + "1000") bench_benchmark_value_name="CUMULUS" ;; + "12500") bench_benchmark_value_name="NIMBUS" ;; + "40000") bench_benchmark_value_name="STRATUS" ;; + esac + else + case $type in + "1000") bench_benchmark_value_name="CUMULUS" ;; + "12500") bench_benchmark_value_name="NIMBUS" ;; + "40000") bench_benchmark_value_name="STRATUS" ;; + esac + if [[ "$bench_benchmark" == "running" ]]; then + echo -en "" + else + echo -en "" + fi + fi + fi + fi + else + echo -e "${X_MARK} ${CYAN} Flux collateral check skipped...${NC}" + fi + #url_to_check="https://explorer.zel.cash/api/tx/$txhash" + #type=$(wget -nv -qO - $url_to_check | jq '.vout' | grep '"value"' | egrep -o '10000|25000|100000') + #type=$(zelcash-cli gettxout $txhash 0 | jq .value) + fi + fi + fi + + echo -e "${NC}" + echo -e "${BOOK} ${YELLOW}Checking listen ports:${NC}" + check_listen_ports + echo -e "${NC}" + echo -e "${BOOK} ${YELLOW}Files integrity checking:${NC}" + integration + echo -e "" + echo -e "${BOOK} ${YELLOW}Checking service:${NC}" + docker_working=0 + docker_running=$(sudo systemctl status docker 2> /dev/null | grep 'running' | grep -o 'since.*') + docker_inactive=$(sudo systemctl status docker 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') + mongod_running=$(sudo systemctl status mongod 2> /dev/null | grep 'running' | grep -o 'since.*') + mongod_inactive=$(sudo systemctl status mongod 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') + daemon_running=$(sudo systemctl status fluxd 2> /dev/null | grep 'running' | grep -o 'since.*') + daemon_inactive=$(sudo systemctl status fluxd 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') + fluxos_running=$(sudo systemctl status fluxos 2> /dev/null | grep 'running' | grep -o 'since.*') + fluxos_inactive=$(sudo systemctl status fluxos 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') + fluxwatchdog_running=$(sudo systemctl status flux-watchdog 2> /dev/null | grep 'running' | grep -o 'since.*') + fluxwatchdog_inactive=$(sudo systemctl status flux-watchdog 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') + + if sudo systemctl list-units | grep docker.service | egrep -wi 'running' > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN}Docker service running ${SEA}$docker_running${NC}" + #docker_working=1 + else + if [[ "$docker_inactive" != "" ]]; then + echo -e "${X_MARK} ${CYAN}Docker service not running ${RED}$docker_inactive${NC}" + else + echo -e "${X_MARK} ${CYAN}Docker is not installed${NC}" + fi + fi + verifity_mongod=0 + if sudo systemctl list-units | grep mongod | egrep -wi 'running' > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} MongoDB service running ${SEA}$mongod_running${NC}" + else + if [[ "$mongod_inactive" != "" ]]; then + echo -e "${X_MARK} ${CYAN} MongoDB service not running ${RED}$mongod_inactive${NC}" + verifity_mongod=1 + else + echo -e "${X_MARK} ${CYAN} MongoDB service is not installed${NC}" + fi + fi + + if sudo systemctl list-units | grep fluxd | egrep -wi 'running' > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Flux daemon service running ${SEA}$daemon_running${NC}" + else + if [[ "$daemon_inactive" != "" ]]; then + echo -e "${X_MARK} ${CYAN} Flux daemon service not running ${RED}$daemon_inactive${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux daemon service is not installed${NC}" + fi + fi + + if sudo systemctl list-units | grep fluxos | egrep -wi 'running' > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} FluxOS service running ${SEA}$fluxos_running${NC}" + else + if [[ "$daemon_inactive" != "" ]]; then + echo -e "${X_MARK} ${CYAN} FluxOS service not running ${RED}$fluxos_inactive${NC}" + else + echo -e "${X_MARK} ${CYAN} FluxOS service is not installed${NC}" + fi + fi + + if sudo systemctl list-units | grep 'flux-watchdog' | egrep -wi 'running' > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Flux-watchdog service running ${SEA}$fluxwatchdog_running${NC}" + else + if [[ "$daemon_inactive" != "" ]]; then + echo -e "${X_MARK} ${CYAN} Flux-watchdog service not running ${RED}$fluxwatchdog_inactive${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux-watchdog service is not installed${NC}" + fi + fi + + echo -e "" + + if [[ $(curl -s -m 5 --head "$WANIP:$FluxUI" | head -n 1 | grep "200 OK") ]]; then + echo -e "${CHECK_MARK} ${CYAN} FluxOS front is working${NC}" + else + echo -e "${X_MARK} ${CYAN} FluxOS front is not working${NC}" + fi + if [[ -d $FLUXOS_PATH ]]; then + FILE=$FLUXOS_PATH/config/userconfig.js + if [[ -f "$FILE" ]]; then + current_ver=$(jq -r '.version' $FLUXOS_PATH/package.json) + required_ver=$(curl -sS --max-time 10 https://raw.githubusercontent.com/RunOnFlux/flux/master/package.json | jq -r '.version') + if [[ "$required_ver" != "" ]]; then + if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then + echo -e "${CHECK_MARK} ${CYAN} You have the current version of FluxOS ${GREEN}(v$required_ver)${NC}" + else + echo -e "${HOT} ${CYAN}New version of FluxOS available ${SEA}$required_ver${NC}" + FLUX_UPDATE="1" + fi + fi + echo -e "${CHECK_MARK} ${CYAN} FluxOS config $FLUXOS_PATH/config/userconfig.js exists${NC}" + ZELIDLG=`echo -n $(grep -w zelid $FLUXOS_PATH/config/userconfig.js | sed -e "s/'//g" | sed -e "s/,//g" | sed -e "s/.*zelid://g") | wc -m` + if [[ "$ZELIDLG" -eq "35" || "$ZELIDLG" -eq "34" || "$ZELIDLG" -eq "33" ]]; then + echo -e "${CHECK_MARK} ${CYAN} Flux ID is valid${NC}" + elif [[ "$ZELIDLG" == "0" || "$ZELIDLG" == "2" ]]; then + echo -e "${X_MARK} ${CYAN} Flux ID is missing...${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux ID is not valid${NC}" + fi + + if [[ -f $FLUXOS_PATH/error.log ]]; then + echo -e "" + echo -e "${BOOK} ${YELLOW}FluxOS error.log file detected, check ~/error.log" + echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(wc -l < $FLUXOS_PATH/error.log)${CYAN} error events${NC}" + error_line=$(cat $FLUXOS_PATH/error.log | grep 'Error' | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{3\}Z//' | xargs) + echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" + event_date=$(cat $FLUXOS_PATH/error.log | grep 'Error' | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{3\}Z') + event_time_uxtime=$(date -d "$event_date" +"%s") + event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" + now_date=$(date +%s) + tdiff=$((now_date-event_time_uxtime)) + show_time "$tdiff" + fi + else + FLUXCONF="1" + echo -e "${X_MARK} ${CYAN}Flux config $FLUXOS_PATH/config/userconfig.js does not exists${NC}" + fi + else + echo -e "${X_MARK} ${CYAN}Directory $FLUXOS_PATH does not exists${CYAN}" + fi + if [[ "$ZELCONF" == "1" ]]; then + echo -e "" + echo -e "${BOOK} ${YELLOW}Checking $FLUX_DAEMON_PATH/flux.conf${NC}" + if [[ $zelnodeprivkey == $(grep -w zelnodeprivkey $FLUX_DAEMON_PATH/flux.conf | sed -e 's/zelnodeprivkey=//') ]]; then + echo -e "${CHECK_MARK} ${CYAN} FluxNode Identity Key matches${NC}" + else + REPLACE="1" + echo -e "${X_MARK} ${CYAN} FluxNode Identity Key does not match${NC}" + fi + + if [[ $zelnodeoutpoint == $(grep -w zelnodeoutpoint $FLUX_DAEMON_PATH/flux.conf | sed -e 's/zelnodeoutpoint=//') ]]; then + echo -e "${CHECK_MARK} ${CYAN} FluxNode Collateral TX ID matches${NC}" + else + REPLACE="1" + echo -e "${X_MARK} ${CYAN} FluxNode Collateral TX ID does not match${NC}" + fi + + if [[ $zelnodeindex == $(grep -w zelnodeindex $FLUX_DAEMON_PATH/flux.conf | sed -e 's/zelnodeindex=//') ]]; then + echo -e "${CHECK_MARK} ${CYAN} FluxNode Output Index matches${NC}" + else + REPLACE="1" + echo -e "${X_MARK} ${CYAN} FluxNode Output Index does not match${NC}" + fi + + fi + if [[ -f $FLUX_WATCHDOG_PATH/package.json ]]; then + echo -e "" + echo -e "${BOOK} ${YELLOW}Checking Watchdog:${NC}" + current_ver=$(jq -r '.version' $FLUX_WATCHDOG_PATH/package.json) + required_ver=$(curl -sS https://raw.githubusercontent.com/RunOnFlux/fluxnode-watchdog/master/package.json | jq -r '.version') + if [[ "$required_ver" != "" ]]; then + if [ "$(printf '%s\n' "$required_ver" "$current_ver" | sort -V | head -n1)" = "$required_ver" ]; then + echo -e "${CHECK_MARK} ${CYAN} You have the current version of Watchdog ${GREEN}(v$required_ver)${NC}" + else + echo -e "${HOT} ${CYAN}New version of Watchdog available ${SEA}$required_ver${NC}" + fi + fi + fi + if [[ -f $FLUX_WATCHDOG_PATH/watchdog_error.log ]]; then + echo -e "" + echo -e "${BOOK} ${YELLOW}Watchdog watchdog_error.log file detected, check ~/watchdog/watchdog_error.log" + echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(wc -l < $FLUX_WATCHDOG_PATH/watchdog_error.log)${CYAN} error events${NC}" + error_line=$(cat $FLUX_WATCHDOG_PATH/watchdog_error.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" + event_date=$(cat $FLUX_WATCHDOG_PATH/watchdog_error.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}' | head -n1) + event_time_uxtime=$(date -ud "$event_date" +"%s") + event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" + now_date=$(date +%s) + tdiff=$((now_date-event_time_uxtime)) + show_time "$tdiff" + fi + echo -e "${YELLOW}===================================================${NC}" + echo -e "" + exit +fi #const REPLACE="0" From dd7dbf43a07902d8a5cb98f17c1904c4b697b354 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:03:36 +0100 Subject: [PATCH 1079/1176] Minor edits --- flux_common.sh | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index fead67bf..681940b4 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2917,13 +2917,15 @@ function selfhosting() { function multinode(){ echo -e "${GREEN}Module: Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi + if [[ -z $FLUXOS_VERSION ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + fi echo -e "" echo -e "${ARROW} ${CYAN}OPTION ALLOWS YOU: ${NC}" echo -e "${HOT} ${CYAN}Run node as selfhosting with upnp communication ${NC}" @@ -2949,15 +2951,17 @@ function multinode(){ fi } function analyzer_and_fixer(){ - echo -e "${GREEN}Module: FluxNode analyzer and fixer${NC}" + echo -e "${GREEN}Module: FluxNode Diagnostics${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi + if [[ -z $FLUXOS_VERSION ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + fi if [[ -f "/usr/lib/multitoolbox/nodeanalizerandfixer.sh" ]]; then bash -i "/usr/lib/multitoolbox/nodeanalizerandfixer.sh" else From 6557eab307987363222ebd2851f3b67115a969bf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:07:20 +0100 Subject: [PATCH 1080/1176] Minor edit --- multitoolbox.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index a2fe6a01..82b28b68 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -945,7 +945,7 @@ else echo -e "${CYAN}4 - Restore Flux blockchain from bootstrap${NC}" echo -e "${CYAN}5 - MongoDB Repair Assistant${NC}" echo -e "${CYAN}6 - Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" - echo -e "${CYAN}7 - Node reconfiguration from install config${NC}" + echo -e "${CYAN}7 - FluxNode Diagnostics${NC}" echo -e "${CYAN}8 - Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" fi @@ -1011,9 +1011,7 @@ case "$REPLY" in if [[ -z $FLUXOS_VERSION ]]; then install_flux else - echo -e "${GREEN}Module: Node reconfiguration from install config${NC}" - echo -e "${YELLOW}================================================================${NC}" - node_reconfiguration + analyzer_and_fixer echo -e "" fi ;; From 7192936fc0bca73ce95f99038b342c9225ffec1e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:29:47 +0100 Subject: [PATCH 1081/1176] [ADD] System secure status --- nodeanalizerandfixer.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 56e47e89..70b92e20 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -265,6 +265,8 @@ if [[ -n $FLUXOS_VERSION ]]; then bench_status=$(jq -r '.status' <<< "$bench_getatus") bench_benchmark=$(jq -r '.benchmarking' <<< "$bench_getatus") bench_back=$(jq -r '.zelback' <<< "$bench_getatus") + bench_systemsecure=$(jq -r '.systemsecure' <<< "$bench_getatus") + if [[ "$bench_back" == "null" ]]; then bench_back=$(jq -r '.flux' <<< "$bench_getatus") fi @@ -289,7 +291,14 @@ if [[ -n $FLUXOS_VERSION ]]; then else bench_back_color="${RED}$bench_back" fi - + + if [[ "$bench_systemsecure" == "true" ]]; then + bench_systemsecure_color="${SEA}$bench_systemsecure" + else + bench_systemsecure_color="${RED}$bench_systemsecure" + fi + + echo -e "${PIN} ${CYAN}Flux system secure: ${SEA}$bench_systemsecure_color${NC}" echo -e "${PIN} ${CYAN}Flux benchmark version: ${SEA}$bench_version${NC}" echo -e "${PIN} ${CYAN}Flux benchmark status: $bench_status_color${NC}" echo -e "${PIN} ${CYAN}Benchmark: $bench_benchmark_color${NC}" From de6800f9d8971f122379e5bbb72d00e5a308d7a3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:21:23 +0100 Subject: [PATCH 1082/1176] [FIX] flux-watchdog service status --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 70b92e20..df5fc63a 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -551,7 +551,7 @@ if [[ -n $FLUXOS_VERSION ]]; then if sudo systemctl list-units | grep 'flux-watchdog' | egrep -wi 'running' > /dev/null 2>&1; then echo -e "${CHECK_MARK} ${CYAN} Flux-watchdog service running ${SEA}$fluxwatchdog_running${NC}" else - if [[ "$daemon_inactive" != "" ]]; then + if [[ "$fluxwatchdog_inactive" != "" ]]; then echo -e "${X_MARK} ${CYAN} Flux-watchdog service not running ${RED}$fluxwatchdog_inactive${NC}" else echo -e "${X_MARK} ${CYAN} Flux-watchdog service is not installed${NC}" From 2c760d48f49cbef630a0f5bf0e66625ed141a4dd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:07:12 +0100 Subject: [PATCH 1083/1176] [ADD] SUDO_CMD --- flux_common.sh | 52 +++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 681940b4..e171487f 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -444,7 +444,10 @@ function blocked_repositories(){ function fluxosConfigBackup(){ ConfigFile="$FLUXOS_PATH/config/userconfig.js" if [[ -f $ConfigFile ]]; then - cp -nf $ConfigFile $DATA_PATH/userconfig.js.backup + if [[ -n $FLUXOS_VERSION ]]; then + SUDO_CMD="sudo" + fi + $SUDO_CMD cp -nf $ConfigFile $DATA_PATH/userconfig.js.backup if [[ -f $DATA_PATH/userconfig.js.backup ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js backup successfully${NC}" "${CHECK_MARK}" else @@ -459,7 +462,10 @@ function fluxosConfigRestore(){ ConfigFile="$FLUXOS_PATH/config/userconfig.js" if [[ -d $FLUXOS_PATH ]]; then if [[ -f $DATA_PATH/userconfig.js.backup ]]; then - cp -nf $DATA_PATH/userconfig.js.backup $ConfigFile + if [[ -n $FLUXOS_VERSION ]]; then + SUDO_CMD="sudo" + fi + $SUDO_CMD cp -nf $DATA_PATH/userconfig.js.backup $ConfigFile if [[ -f $ConfigFile ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js restored successfully${NC}" "${CHECK_MARK}" else @@ -1730,13 +1736,15 @@ function development_mode(){ function fluxos_reconfiguration { echo -e "${GREEN}Module: FluxOS reconfiguration${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi + if [[ -z $FLUXOS_VERSION ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + fi if ! [[ -f $FLUXOS_PATH/config/userconfig.js ]]; then echo -e "${WORNING} ${CYAN}FluxOS userconfig.js not exist, operation aborted${NC}" echo -e "" @@ -1745,37 +1753,33 @@ function fluxos_reconfiguration { CHOICE=$( whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ "1)" "Replace ZELID" \ - "2)" "Add/Replace kadena address" \ - "3)" "Enable/Disable thunder mode" \ - "4)" "Enable/Disable development mode" \ - "5)" "Blocked Ports Management" \ - "6)" "Blocked Repositories Management" \ - "7)" "FluxOS config backup" \ - "8)" "FluxOS config restore" 3>&2 2>&1 1>&3 + "2)" "Enable/Disable thunder mode" \ + "3)" "Enable/Disable development mode" \ + "4)" "Blocked Ports Management" \ + "5)" "Blocked Repositories Management" \ + "6)" "FluxOS config backup" \ + "7)" "FluxOS config restore" 3>&2 2>&1 1>&3 ) case $CHOICE in "1)") replace_zelid ;; "2)") - replace_kadena - ;; - "3)") thunder_mode ;; - "4)") + "3)") development_mode ;; - "5)") + "4)") blocked_ports ;; - "6)") + "5)") blocked_repositories ;; - "7)") + "6)") fluxosConfigBackup ;; - "8)") + "7)") fluxosConfigRestore ;; esac From 7b9239f372a58c527eaf9128c44543b8d0729629 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:48:40 +0100 Subject: [PATCH 1084/1176] [FIX] UPNP log check --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index e171487f..6e9e15e8 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2698,7 +2698,7 @@ function upnp_enable() { fi sleep 150 echo -e "${ARROW}${CYAN} Checking FluxOS logs... ${NC}" - error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") + error_check=$(sudo journalctl -u fluxos.service -b -n 25 | grep "UPnP failed") if [[ "$error_check" == "" ]]; then echo -e "" LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') From 56a71e75b483dfa78db3772b63dae340281d4493 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:59:54 +0100 Subject: [PATCH 1085/1176] [ADD] Multitoolbox git info --- multitoolbox.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 82b28b68..fe9bc4b2 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -905,6 +905,11 @@ if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" && $FLUXOS_V source /etc/bash.bashrc fi +cd /usr/lib/multitoolbox +commit_hash=$(git rev-parse --short HEAD) +commit_date=$(git log -1 --date=format:'%Y-%m-%d %H:%M:%S' --format=%cd) +cd + if ! wget --version > /dev/null 2>&1 ; then sudo apt install -y wget > /dev/null 2>&1 && sleep 2 fi @@ -913,7 +918,8 @@ sleep 1 echo -e "${BLUE}" figlet -f slant "Multitoolbox" echo -e "${YELLOW}================================================================${NC}" -echo -e "${GREEN}Version: $dversion${NC}" +echo -e "${GREEN}Commit: $commit_hash${NC}" +echo -e "${GREEN}Data: $commit_date${NC}" echo -e "${GREEN}Branch: $ROOT_BRANCH${NC}" if [[ ! -z $FLUXOS_VERSION ]]; then echo -e "${GREEN}FluxOS version: $FLUXOS_VERSION${NC}" From dce108810429a532001502d0927ff8825d8810a7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:03:26 +0100 Subject: [PATCH 1086/1176] Minor edits --- multitoolbox.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index fe9bc4b2..42e67c07 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -37,7 +37,7 @@ fi FLUX_DIR='zelflux' FLUX_APPS_DIR='ZelApps' COIN_NAME='zelcash' -dversion="v7.8" +dversion="v8.0" PM2_INSTALL="0" zelflux_setting_import="0" OS_FLAGE="$2" @@ -905,10 +905,12 @@ if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" && $FLUXOS_V source /etc/bash.bashrc fi -cd /usr/lib/multitoolbox -commit_hash=$(git rev-parse --short HEAD) -commit_date=$(git log -1 --date=format:'%Y-%m-%d %H:%M:%S' --format=%cd) -cd +if [[ -d /usr/lib/multitoolbox ]]; then + cd /usr/lib/multitoolbox + commit_hash=$(git rev-parse --short HEAD) + commit_date=$(git log -1 --date=format:'%Y-%m-%d %H:%M:%S' --format=%cd) + cd +fi if ! wget --version > /dev/null 2>&1 ; then sudo apt install -y wget > /dev/null 2>&1 && sleep 2 @@ -918,8 +920,11 @@ sleep 1 echo -e "${BLUE}" figlet -f slant "Multitoolbox" echo -e "${YELLOW}================================================================${NC}" -echo -e "${GREEN}Commit: $commit_hash${NC}" -echo -e "${GREEN}Data: $commit_date${NC}" +if [[ -n $FLUXOS_VERSION ]]; then + echo -e "${GREEN}Version: $dversion${NC}" + echo -e "${GREEN}Commit: $commit_hash${NC}" + echo -e "${GREEN}Data: $commit_date${NC}" +fi echo -e "${GREEN}Branch: $ROOT_BRANCH${NC}" if [[ ! -z $FLUXOS_VERSION ]]; then echo -e "${GREEN}FluxOS version: $FLUXOS_VERSION${NC}" From 7ea573c126c607321ef5f5c174cc385a1c468c0c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:09:44 +0100 Subject: [PATCH 1087/1176] Remove bootstrap archive after unpack --- flux_common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 6e9e15e8..2e3af4b5 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1901,9 +1901,9 @@ function bootstrap_new() { if [[ -f "$FILE_PATH" ]]; then if [[ "$Mode" != "install" ]]; then start_service - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + # if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then sudo rm -rf $FILE_PATH > /dev/null 2>&1 && sleep 2 - fi + # fi fi return else @@ -1911,9 +1911,9 @@ function bootstrap_new() { bootstrap_manual if [[ "$Mode" != "install" && "$server_offline" == "0" ]]; then start_service - if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + # if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then sudo rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 && sleep 2 - fi + # fi fi return fi From e4e868f8219bd3f477339682a0e7aa0fc1ce2e9d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:12:33 +0100 Subject: [PATCH 1088/1176] Add missing sudo --- multitoolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 42e67c07..824f4068 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -907,8 +907,8 @@ fi if [[ -d /usr/lib/multitoolbox ]]; then cd /usr/lib/multitoolbox - commit_hash=$(git rev-parse --short HEAD) - commit_date=$(git log -1 --date=format:'%Y-%m-%d %H:%M:%S' --format=%cd) + commit_hash=$(sudo git rev-parse --short HEAD) + commit_date=$(sudo git log -1 --date=format:'%Y-%m-%d %H:%M:%S' --format=%cd) cd fi From 998af5bcee9603dbbaebb8fcfeb4f87aa12f7184 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:24:30 +0100 Subject: [PATCH 1089/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 824f4068..05e40f9a 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -135,7 +135,7 @@ function install_flux() { echo -e "${ARROW} ${CYAN}Import settings...${NC}" ZELID=$(grep -w zelid $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') WANIP=$(grep -w ipaddress $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*ipaddress: .//' | sed -e 's/.\{2\}$//') - echo -e "${PIN}${CYAN}Zel ID = ${GREEN}$ZELID${NC}" + echo -e "${PIN}${CYAN}Flux/SSP ID = ${GREEN}$ZELID${NC}" KDA_A=$(grep -w kadena $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') if [[ "$KDA_A" != "" ]]; then echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" From b2d83a2d07b869b847b0b552f31fe5d87db5abab Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:26:25 +0100 Subject: [PATCH 1090/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 2e3af4b5..4a2e7846 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1752,7 +1752,7 @@ function fluxos_reconfiguration { fi CHOICE=$( whiptail --title "FluxOS Configuration" --menu "Make your choice" 15 40 6 \ - "1)" "Replace ZELID" \ + "1)" "Replace Flux/SSP ID" \ "2)" "Enable/Disable thunder mode" \ "3)" "Enable/Disable development mode" \ "4)" "Blocked Ports Management" \ From b63fde34b74700a0436dca5344b7c21868f368e7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:47:33 +0100 Subject: [PATCH 1091/1176] [FIX] FluxOS error check --- flux_common.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 4a2e7846..69f6a10c 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2698,7 +2698,11 @@ function upnp_enable() { fi sleep 150 echo -e "${ARROW}${CYAN} Checking FluxOS logs... ${NC}" - error_check=$(sudo journalctl -u fluxos.service -b -n 25 | grep "UPnP failed") + if [[ -n $FLUXOS_VESRION ]]; then + error_check=$(sudo journalctl -u fluxos.service -b -n 25 | grep "UPnP failed") + else + error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") + fi if [[ "$error_check" == "" ]]; then echo -e "" LOCAL_IP=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') From f08f5b460387d88cbd61544056986a4a0e18b45d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:52:09 +0100 Subject: [PATCH 1092/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 05e40f9a..e66acfaf 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -267,7 +267,7 @@ function install_flux() { fi fi else - echo -e "${ARROW} ${CYAN}Installing FluxOS dependencies....${NC}" + echo -e "${ARROW} ${CYAN}Installing FluxOS dependencies will take 5min....${NC}" cd $FLUXOS_PATH sudo npm install --omit=dev --cache /dat/usr/lib/npm > /dev/null 2>&1 echo -e "${ARROW} ${CYAN}Starting FluxOS....${NC}" From 155638df57f3dcfa74d7a39f0a366610f8784702 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:00:34 +0100 Subject: [PATCH 1093/1176] Minor edit --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 69f6a10c..e2eba8aa 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -447,7 +447,7 @@ function fluxosConfigBackup(){ if [[ -n $FLUXOS_VERSION ]]; then SUDO_CMD="sudo" fi - $SUDO_CMD cp -nf $ConfigFile $DATA_PATH/userconfig.js.backup + $SUDO_CMD cp -nf $ConfigFile $DATA_PATH/userconfig.js.backup > /dev/null 2>&1 if [[ -f $DATA_PATH/userconfig.js.backup ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js backup successfully${NC}" "${CHECK_MARK}" else @@ -465,7 +465,7 @@ function fluxosConfigRestore(){ if [[ -n $FLUXOS_VERSION ]]; then SUDO_CMD="sudo" fi - $SUDO_CMD cp -nf $DATA_PATH/userconfig.js.backup $ConfigFile + $SUDO_CMD cp -nf $DATA_PATH/userconfig.js.backup $ConfigFile > /dev/null 2>&1 if [[ -f $ConfigFile ]]; then padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js restored successfully${NC}" "${CHECK_MARK}" else From 64b48735c8c0e2d8b31be95cc04f57b8d3c5234e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:02:44 +0100 Subject: [PATCH 1094/1176] Minor edits --- flux_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index e2eba8aa..8614f559 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -439,6 +439,7 @@ function blocked_repositories(){ buildBlockedRepositoryList " blockedRepositories" "$string" "Blocked repositories list cleared successful!" "fluxos" ;; esac + echo -e "" } function fluxosConfigBackup(){ @@ -456,6 +457,7 @@ function fluxosConfigBackup(){ else padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs userconfig.js file not exists${NC}" "${X_MARK}" fi + echo -e "" } function fluxosConfigRestore(){ @@ -477,6 +479,7 @@ function fluxosConfigRestore(){ else padding "${ARROW}${GREEN} [FluxOS] ${CYAN}FluxOs not installed${NC}" "${X_MARK}" fi + echo -e "" } function config_builder() { From bac82625a5ab9ea469a39add99f2ba3f15cf9a4a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:07:05 +0100 Subject: [PATCH 1095/1176] [ADD] Local branch info --- multitoolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index e66acfaf..aa03b646 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -909,6 +909,7 @@ if [[ -d /usr/lib/multitoolbox ]]; then cd /usr/lib/multitoolbox commit_hash=$(sudo git rev-parse --short HEAD) commit_date=$(sudo git log -1 --date=format:'%Y-%m-%d %H:%M:%S' --format=%cd) + ROOT_BRANCH=$(sudo git rev-parse --abbrev-ref HEAD) cd fi From 4cba489f7a288bb04ebb399e3729e7a28f9ec8e1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:11:51 +0100 Subject: [PATCH 1096/1176] [ADD] Syncthing service status --- nodeanalizerandfixer.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index df5fc63a..8b9492ad 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -505,6 +505,8 @@ if [[ -n $FLUXOS_VERSION ]]; then fluxos_inactive=$(sudo systemctl status fluxos 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') fluxwatchdog_running=$(sudo systemctl status flux-watchdog 2> /dev/null | grep 'running' | grep -o 'since.*') fluxwatchdog_inactive=$(sudo systemctl status flux-watchdog 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') + syncthing_running=$(sudo systemctl status syncthing 2> /dev/null | grep 'running' | grep -o 'since.*') + syncthing_inactive=$(sudo systemctl status syncthingg 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') if sudo systemctl list-units | grep docker.service | egrep -wi 'running' > /dev/null 2>&1; then echo -e "${CHECK_MARK} ${CYAN}Docker service running ${SEA}$docker_running${NC}" @@ -547,6 +549,16 @@ if [[ -n $FLUXOS_VERSION ]]; then echo -e "${X_MARK} ${CYAN} FluxOS service is not installed${NC}" fi fi + + if sudo systemctl list-units | grep syncthing | egrep -wi 'running' > /dev/null 2>&1; then + echo -e "${CHECK_MARK} ${CYAN} Syncthing service running ${SEA}$syncthing_running${NC}" + else + if [[ "$syncthing_inactive" != "" ]]; then + echo -e "${X_MARK} ${CYAN} Syncthing service not running ${RED}$syncthing_inactive${NC}" + else + echo -e "${X_MARK} ${CYAN} Syncthing service is not installed${NC}" + fi + fi if sudo systemctl list-units | grep 'flux-watchdog' | egrep -wi 'running' > /dev/null 2>&1; then echo -e "${CHECK_MARK} ${CYAN} Flux-watchdog service running ${SEA}$fluxwatchdog_running${NC}" From da7db9a4d466abf79f6ef854e3ab925482cf771a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:01:09 +0100 Subject: [PATCH 1097/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index aa03b646..d9db4f0c 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -198,7 +198,7 @@ function install_flux() { get_ip "install" while true do - ZELID="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your ZEL ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + ZELID="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your Flux/SSP ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ] || [ $(grep -Eo "^0x[a-fA-F0-9]{40}$" <<< "$ZELID") ]; then string_limit_check_mark "Zel ID is valid..........................................." break From 7a6b7d7f2be0ada4a88f3a6a83affa1b5ebbe45e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:01:54 +0100 Subject: [PATCH 1098/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 8614f559..f57f2737 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -721,7 +721,7 @@ function config_smart_create() { echo -e "${ARROW} ${YELLOW}Imported fluxOS settings:${NC}" ZELID=$(grep -w zelid $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') if [[ "$ZELID" != "" ]]; then - echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" + echo -e "${PIN}${CYAN} Flux/SSP ID = ${GREEN}$ZELID${NC}" smart_install_conf "zelid" "$ZELID" "$1" fi KDA_A=$(grep -w kadena $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') From a7b1bcfdf479b7d49209108aa42fd08a5cf39ed3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:19:20 +0100 Subject: [PATCH 1099/1176] [FIX] Import settings --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d9db4f0c..9240e4d5 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -160,7 +160,7 @@ function install_flux() { echo -e "" echo -e "${ARROW} ${CYAN}Removing any instances of FluxOS....${NC}" sudo rm -rf $FLUXOS_PATH > /dev/null 2>&1 && sleep 1 - if [[ "$ZELID" != "" && "$WANIP" != "" && "$KDA_A" != "" ]]; then + if [[ "$ZELID" != "" && "$WANIP" != "" ]]; then zelflux_setting_import="1" fi fi From 275f3da84afea2dea5d31f9ff443ea4880597324 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:24:55 +0100 Subject: [PATCH 1100/1176] Disabled part of code --- multitoolbox.sh | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 9240e4d5..8477edb4 100644 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -136,10 +136,10 @@ function install_flux() { ZELID=$(grep -w zelid $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*zelid: .//' | sed -e 's/.\{2\}$//') WANIP=$(grep -w ipaddress $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*ipaddress: .//' | sed -e 's/.\{2\}$//') echo -e "${PIN}${CYAN}Flux/SSP ID = ${GREEN}$ZELID${NC}" - KDA_A=$(grep -w kadena $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" - fi + #KDA_A=$(grep -w kadena $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') + #if [[ "$KDA_A" != "" ]]; then + #echo -e "${PIN}${CYAN}Kadena address = ${GREEN}$KDA_A${NC}" + #fi echo -e "${PIN}${CYAN}IP = ${GREEN}$WANIP${NC}" upnp_port=$(grep -w apiport $FLUXOS_PATH/config/userconfig.js | egrep -o '[0-9]+') if [[ "$upnp_port" != "" ]]; then @@ -198,30 +198,30 @@ function install_flux() { get_ip "install" while true do - ZELID="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your Flux/SSP ID from ZelCore (Apps -> Zel ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" + ZELID="$(whiptail --title "MULTITOOLBOX" --inputbox "Enter your Flux/SSP ID from ZelCore (Apps -> Flux ID (CLICK QR CODE)) " 8 72 3>&1 1>&2 2>&3)" if [ $(printf "%s" "$ZELID" | wc -c) -eq "34" ] || [ $(printf "%s" "$ZELID" | wc -c) -eq "33" ] || [ $(grep -Eo "^0x[a-fA-F0-9]{40}$" <<< "$ZELID") ]; then - string_limit_check_mark "Zel ID is valid..........................................." + string_limit_check_mark "Flux/SSP ID is valid..........................................." break else - string_limit_x_mark "Zel ID is not valid try again..........................................." + string_limit_x_mark "Flux/SSP ID is not valid try again..........................................." sleep 2 fi done - if [[ -z $FLUXOS_VERSION ]]; then - while true - do - KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=0" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - fi + #if [[ -z $FLUXOS_VERSION ]]; then + #while true + #do + #KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) + #if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then + #echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" + #KDA_A="kadena:$KDA_A?chainid=0" + #sleep 2 + #break + #else + #echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" + #sleep 2 + #fi + #done + #fi fi fluxos_conf_create if [[ -f $FLUXOS_PATH/config/userconfig.js ]]; then From aa4b83ea732a26cd9e410b76d99d5d33b568e761 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:27:00 +0100 Subject: [PATCH 1101/1176] Remove umount logs --- flux_common.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f57f2737..1d7cdfc3 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -1144,7 +1144,6 @@ function fluxos_clean(){ echo -e "${ARROW} ${CYAN}Unmounting locked FluxOS resource...${NC}" && sleep 1 df | grep 'flux' | grep -v 'flux_crypt' | awk '{ print $1 }' | while read line; do - echo -e "${CYAN}Unmounting - $line ...${NC}" && sleep 1 sudo umount -l $line && sleep 1 done fi From 2f9144af6c8b8229ac4684fe53bf05dca18b71cf Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:45:20 +0100 Subject: [PATCH 1102/1176] fix typo --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 1d7cdfc3..1e565f1a 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2700,7 +2700,7 @@ function upnp_enable() { fi sleep 150 echo -e "${ARROW}${CYAN} Checking FluxOS logs... ${NC}" - if [[ -n $FLUXOS_VESRION ]]; then + if [[ -n $FLUXOS_VERSION ]]; then error_check=$(sudo journalctl -u fluxos.service -b -n 25 | grep "UPnP failed") else error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") From 20a7eb86766ccd596813d69a0d80c11cb6823269 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:34:31 +0100 Subject: [PATCH 1103/1176] Removed pm2 log file check --- nodeanalizerandfixer.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 8b9492ad..e90df263 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -130,15 +130,15 @@ if [[ -n $FLUXOS_VERSION ]]; then fi echo -e "${PIN} ${CYAN}FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" echo -e "${PIN} ${CYAN}FluxUI PORT: ${ORANGE}$FluxUI ${NC}" - if [[ -f /home/$USER/.pm2/logs/flux-out.log ]]; then - error_check=$(sudo journalctl -u fluxos.service -b -n 20 | grep "UPnP failed") - if [[ "$error_check" != "" ]]; then - echo -e "" - echo -e "${ARROW} ${YELLOW}Checking FluxOS logs... ${NC}" - echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." - echo -e "" - fi + + error_check=$(sudo journalctl -u fluxos.service -b -n 25 | grep "UPnP failed") + if [[ "$error_check" != "" ]]; then + echo -e "" + echo -e "${ARROW} ${YELLOW}Checking FluxOS logs... ${NC}" + echo -e "${WORNING} ${RED}Problem with UPnP detected, FluxOS Shutting down..." + echo -e "" fi + } function get_last_benchmark(){ if [[ "$2" == "check" ]]; then From 53de66a4905db9effbdc648b71106de4b61a31a5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:39:51 +0100 Subject: [PATCH 1104/1176] Changed check marker --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index e90df263..f440e969 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -131,7 +131,7 @@ if [[ -n $FLUXOS_VERSION ]]; then echo -e "${PIN} ${CYAN}FluxAPI PORT: ${ORANGE}$FluxAPI ${NC}" echo -e "${PIN} ${CYAN}FluxUI PORT: ${ORANGE}$FluxUI ${NC}" - error_check=$(sudo journalctl -u fluxos.service -b -n 25 | grep "UPnP failed") + error_check=$(sudo journalctl -u fluxos.service -b -n 25 | grep "Deactivated successfully") if [[ "$error_check" != "" ]]; then echo -e "" echo -e "${ARROW} ${YELLOW}Checking FluxOS logs... ${NC}" From cc3630abd07965978799cda81711083501ed9f63 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:41:32 +0100 Subject: [PATCH 1105/1176] Changed check marker --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 1e565f1a..756da32d 100644 --- a/flux_common.sh +++ b/flux_common.sh @@ -2701,7 +2701,7 @@ function upnp_enable() { sleep 150 echo -e "${ARROW}${CYAN} Checking FluxOS logs... ${NC}" if [[ -n $FLUXOS_VERSION ]]; then - error_check=$(sudo journalctl -u fluxos.service -b -n 25 | grep "UPnP failed") + error_check=$(sudo journalctl -u fluxos.service -b -n 25 | grep "Deactivated successfully") else error_check=$(tail -n10 /home/$USER/.pm2/logs/flux-out.log | grep "UPnP failed") fi From 52167a50dc25ff5811a419c0b99bba3cac461277 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:44:29 +0100 Subject: [PATCH 1106/1176] [FIX] Service status --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index f440e969..4dd71759 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -543,7 +543,7 @@ if [[ -n $FLUXOS_VERSION ]]; then if sudo systemctl list-units | grep fluxos | egrep -wi 'running' > /dev/null 2>&1; then echo -e "${CHECK_MARK} ${CYAN} FluxOS service running ${SEA}$fluxos_running${NC}" else - if [[ "$daemon_inactive" != "" ]]; then + if [[ "$fluxos_inactive" != "" ]]; then echo -e "${X_MARK} ${CYAN} FluxOS service not running ${RED}$fluxos_inactive${NC}" else echo -e "${X_MARK} ${CYAN} FluxOS service is not installed${NC}" From 49645e8c66dc7f62b47184680f1d3b3c7fccf781 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:00:16 +0100 Subject: [PATCH 1107/1176] Update nodeanalizerandfixer.sh --- nodeanalizerandfixer.sh | 125 +++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 60 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 4dd71759..5264313c 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -198,66 +198,7 @@ if [[ -n $FLUXOS_VERSION ]]; then sudo apt install -y bc > /dev/null 2>&1 && sleep 1 fi echo -e "${NC}" - if [ -f $FLUX_BENCH_PATH/debug.log ]; then - echo -e "${BOOK} ${YELLOW}Checking Flux benchmark $FLUX_BENCH_PATH/debug.log${NC}" - if [[ $(sudo egrep -ac -wi --color 'Failed' $FLUX_BENCH_PATH/debug.log) != "0" ]]; then - echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(sudo egrep -ac --color 'Failed' $FLUX_BENCH_PATH/debug.log)${CYAN} error events${NC}" - #egrep -wi --color 'warning|error|critical|failed' ~/.zelbenchmark/debug.log - error_line=$(sudo egrep -a --color 'Failed' $FLUX_BENCH_PATH/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') - event_date=$(sudo egrep -a --color 'Failed' $FLUX_BENCH_PATH/debug.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}') - echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" - event_time_uxtime=$(date -ud "$event_date" +"%s") - event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') - event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') - echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" - event_time="$event_time_uxtime" - now_date=$(date +%s) - tdiff=$((now_date-event_time)) - show_time "$tdiff" - echo -e "${PIN} ${CYAN}Creating Flux benchmark_debug_error.log${NC}" - sudo egrep -a --color 'Failed' $FLUX_BENCH_PATH/debug.log > /tmp/benchmark_debug_error.log - echo -e "" - else - echo -e "${GREEN}\xF0\x9F\x94\x8A ${CYAN}Found: ${GREEN}0 errors${NC}" - echo -e "" - fi - skipp_debug=0 - get_last_benchmark "HDD" "check" - if [[ "$skipp_debug" == "0" ]]; then - echo -e "${BOOK} ${YELLOW}Last benchmark from $FLUX_BENCH_PATH/debug.log${NC}" - get_last_benchmark "HDD" - get_last_benchmark "DD_WRITE" - get_last_benchmark "ram" - get_last_benchmark "cores" - echo -e "" - fi - fi - if [ -f $FLUX_DAEMON_PATH/debug.log ]; then - echo -e "${BOOK} ${YELLOW}Checking Flux daemon $FLUX_DAEMON_PATH/debug.log${NC}" - if [[ $(sudo egrep -ac -wi --color 'error|failed' $FLUX_DAEMON_PATH/debug.log) != "0" ]]; then - echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(sudo egrep -ac -wi --color 'error|failed' $FLUX_DAEMON_PATH/debug.log)${CYAN} error events, ${RED}$(sudo egrep -ac -wi --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log) ${CYAN}related to benchmark${NC}" - if [[ $(sudo egrep -ac -wi --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log) != "0" ]]; then - echo -e "${BOOK} ${CYAN}FluxBench errors info:${NC}" - error_line=$(sudo egrep -a --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') - event_date=$(sudo egrep -a --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}') - echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" - event_time_uxtime=$(date -ud "$event_date" +"%s") - event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') - event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') - echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" - event_time="$event_time_uxtime" - now_date=$(date +%s) - tdiff=$((now_date-event_time)) - show_time "$tdiff" - fi - echo -e "${PIN} ${CYAN}Creating flux_daemon_debug_error.log${NC}" - sudo egrep -a --color 'error|failed' $FLUX_DAEMON_PATH/debug.log > /tmp/flux_daemon_debug_error.log - echo -e "" - else - echo -e "${GREEN}\xF0\x9F\x94\x8A ${CYAN}Found: ${GREEN}0 errors${NC}" - echo -e "" - fi - fi + if [[ "$($BENCH_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then echo -e "${BOOK} ${YELLOW}Flux benchmark status:${NC}" @@ -577,6 +518,70 @@ if [[ -n $FLUXOS_VERSION ]]; then else echo -e "${X_MARK} ${CYAN} FluxOS front is not working${NC}" fi + + + if [ -f $FLUX_BENCH_PATH/debug.log ]; then + echo -e "${BOOK} ${YELLOW}Checking Flux benchmark $FLUX_BENCH_PATH/debug.log${NC}" + if [[ $(sudo egrep -ac -wi --color 'Failed' $FLUX_BENCH_PATH/debug.log) != "0" ]]; then + echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(sudo egrep -ac --color 'Failed' $FLUX_BENCH_PATH/debug.log)${CYAN} error events${NC}" + #egrep -wi --color 'warning|error|critical|failed' ~/.zelbenchmark/debug.log + error_line=$(sudo egrep -a --color 'Failed' $FLUX_BENCH_PATH/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + event_date=$(sudo egrep -a --color 'Failed' $FLUX_BENCH_PATH/debug.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}') + echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" + event_time_uxtime=$(date -ud "$event_date" +"%s") + event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" + event_time="$event_time_uxtime" + now_date=$(date +%s) + tdiff=$((now_date-event_time)) + show_time "$tdiff" + echo -e "${PIN} ${CYAN}Creating Flux benchmark_debug_error.log${NC}" + sudo egrep -a --color 'Failed' $FLUX_BENCH_PATH/debug.log > /tmp/benchmark_debug_error.log + echo -e "" + else + echo -e "${GREEN}\xF0\x9F\x94\x8A ${CYAN}Found: ${GREEN}0 errors${NC}" + echo -e "" + fi + skipp_debug=0 + get_last_benchmark "HDD" "check" + if [[ "$skipp_debug" == "0" ]]; then + echo -e "${BOOK} ${YELLOW}Last benchmark from $FLUX_BENCH_PATH/debug.log${NC}" + get_last_benchmark "HDD" + get_last_benchmark "DD_WRITE" + get_last_benchmark "ram" + get_last_benchmark "cores" + echo -e "" + fi + fi + if [ -f $FLUX_DAEMON_PATH/debug.log ]; then + echo -e "" + echo -e "${BOOK} ${YELLOW}Checking Flux daemon $FLUX_DAEMON_PATH/debug.log${NC}" + if [[ $(sudo egrep -ac -wi --color 'error|failed' $FLUX_DAEMON_PATH/debug.log) != "0" ]]; then + echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(sudo egrep -ac -wi --color 'error|failed' $FLUX_DAEMON_PATH/debug.log)${CYAN} error events, ${RED}$(sudo egrep -ac -wi --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log) ${CYAN}related to benchmark${NC}" + if [[ $(sudo egrep -ac -wi --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log) != "0" ]]; then + echo -e "${BOOK} ${CYAN}FluxBench errors info:${NC}" + error_line=$(sudo egrep -a --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') + event_date=$(sudo egrep -a --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log | tail -1 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}') + echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" + event_time_uxtime=$(date -ud "$event_date" +"%s") + event_human_time_local=$(date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + event_human_time_utc=$(TZ=GMT date -d @"$event_time_uxtime" +'%Y-%m-%d %H:%M:%S [%z]') + echo -e "${PIN} ${CYAN}Last error time: ${SEA}$event_human_time_local${NC} / ${GREEN}$event_human_time_utc${NC}" + event_time="$event_time_uxtime" + now_date=$(date +%s) + tdiff=$((now_date-event_time)) + show_time "$tdiff" + fi + echo -e "${PIN} ${CYAN}Creating flux_daemon_debug_error.log${NC}" + sudo egrep -a --color 'error|failed' $FLUX_DAEMON_PATH/debug.log > /tmp/flux_daemon_debug_error.log + echo -e "" + else + echo -e "${GREEN}\xF0\x9F\x94\x8A ${CYAN}Found: ${GREEN}0 errors${NC}" + echo -e "" + fi + fi + if [[ -d $FLUXOS_PATH ]]; then FILE=$FLUXOS_PATH/config/userconfig.js if [[ -f "$FILE" ]]; then From ac68cfcda5a4f56c8c0414f70762cfaa58764a69 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:02:24 +0100 Subject: [PATCH 1108/1176] Update nodeanalizerandfixer.sh --- nodeanalizerandfixer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 5264313c..1aff5794 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -521,6 +521,7 @@ if [[ -n $FLUXOS_VERSION ]]; then if [ -f $FLUX_BENCH_PATH/debug.log ]; then + echo -e "" echo -e "${BOOK} ${YELLOW}Checking Flux benchmark $FLUX_BENCH_PATH/debug.log${NC}" if [[ $(sudo egrep -ac -wi --color 'Failed' $FLUX_BENCH_PATH/debug.log) != "0" ]]; then echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(sudo egrep -ac --color 'Failed' $FLUX_BENCH_PATH/debug.log)${CYAN} error events${NC}" From 6a8eee688b24e7d89704fd528a5414ceaef68a2b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:03:56 +0100 Subject: [PATCH 1109/1176] Minor edit --- nodeanalizerandfixer.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 1aff5794..44cfe943 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -556,7 +556,6 @@ if [[ -n $FLUXOS_VERSION ]]; then fi fi if [ -f $FLUX_DAEMON_PATH/debug.log ]; then - echo -e "" echo -e "${BOOK} ${YELLOW}Checking Flux daemon $FLUX_DAEMON_PATH/debug.log${NC}" if [[ $(sudo egrep -ac -wi --color 'error|failed' $FLUX_DAEMON_PATH/debug.log) != "0" ]]; then echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(sudo egrep -ac -wi --color 'error|failed' $FLUX_DAEMON_PATH/debug.log)${CYAN} error events, ${RED}$(sudo egrep -ac -wi --color 'benchmarking' $FLUX_DAEMON_PATH/debug.log) ${CYAN}related to benchmark${NC}" From 03cd0845bfddaed3bfbcfc8f694f31c5e0c21277 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:06:05 +0100 Subject: [PATCH 1110/1176] Disabled bench checks --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 44cfe943..3349f0e2 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -262,8 +262,8 @@ if [[ -n $FLUXOS_VERSION ]]; then if [[ "$bench_benchmark" == "failed" && "$core" > "0" ]]; then BTEST="1" echo -e "${X_MARK} ${CYAN} Flux benchmark working correct but minimum system requirements not met.${NC}" - check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" - check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" + #check_benchmarks "eps" "89.99" " CPU speed" "< 90.00 events per second" + #check_benchmarks "ddwrite" "159.99" " Disk write speed" "< 160.00 events per second" fi if [[ "$bench_back" == "disconnected" ]]; then From a7d69db5764047c937c7c53b225c794e8739fda9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:12:04 +0100 Subject: [PATCH 1111/1176] Minor edits --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 3349f0e2..bfa03d56 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -607,7 +607,7 @@ if [[ -n $FLUXOS_VERSION ]]; then if [[ -f $FLUXOS_PATH/error.log ]]; then echo -e "" - echo -e "${BOOK} ${YELLOW}FluxOS error.log file detected, check ~/error.log" + echo -e "${BOOK} ${YELLOW}FluxOS error.log file detected, check $FLUXOS_PATH/error.log" echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(wc -l < $FLUXOS_PATH/error.log)${CYAN} error events${NC}" error_line=$(cat $FLUXOS_PATH/error.log | grep 'Error' | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{3\}Z//' | xargs) echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" @@ -667,7 +667,7 @@ if [[ -n $FLUXOS_VERSION ]]; then fi if [[ -f $FLUX_WATCHDOG_PATH/watchdog_error.log ]]; then echo -e "" - echo -e "${BOOK} ${YELLOW}Watchdog watchdog_error.log file detected, check ~/watchdog/watchdog_error.log" + echo -e "${BOOK} ${YELLOW}Watchdog watchdog_error.log file detected, check $FLUX_WATCHDOG_PATH/watchdog_error.log" echo -e "${YELLOW}${WORNING} ${CYAN}Found: ${RED}$(wc -l < $FLUX_WATCHDOG_PATH/watchdog_error.log)${CYAN} error events${NC}" error_line=$(cat $FLUX_WATCHDOG_PATH/watchdog_error.log | tail -1 | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.[0-9]\{2\}.//') echo -e "${PIN} ${CYAN}Last error line: $error_line${NC}" From 9af268590843a48c498d2ea8e29609f65434a7d1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:14:50 +0100 Subject: [PATCH 1112/1176] Disabled network ip check --- nodeanalizerandfixer.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index bfa03d56..1ca803d8 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -282,21 +282,21 @@ if [[ -n $FLUXOS_VERSION ]]; then fi fi fi - device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') - local_device_ip=$(ip a list $device_name | grep -o $WANIP ) - if [[ "$WANIP" != "" ]]; then - if [[ "$local_device_ip" == "$WANIP" ]]; then - echo -e "${CHECK_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) matches local device(${GREEN}$device_name${CYAN}) IP(${GREEN}$local_device_ip${CYAN})${NC}" - else - echo -e "${X_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) not matches local device(${GREEN}$device_name${CYAN}) IP${NC}" - echo -e "${ARROW} ${CYAN} If you under NAT use option 10 from multitoolbox (self-hosting)${NC}" + #device_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2}' | sed 's/://' | sed 's/@/ /' | awk '{print $1}') + #local_device_ip=$(ip a list $device_name | grep -o $WANIP ) + #if [[ "$WANIP" != "" ]]; then + #if [[ "$local_device_ip" == "$WANIP" ]]; then + #echo -e "${CHECK_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) matches local device(${GREEN}$device_name${CYAN}) IP(${GREEN}$local_device_ip${CYAN})${NC}" + #else + #echo -e "${X_MARK} ${CYAN} Public IP(${GREEN}$WANIP${CYAN}) not matches local device(${GREEN}$device_name${CYAN}) IP${NC}" + #echo -e "${ARROW} ${CYAN} If you under NAT use option 10 from multitoolbox (self-hosting)${NC}" ## dev_name=$(ip addr | grep 'BROADCAST,MULTICAST,UP,LOWER_UP' | head -n1 | awk '{print $2"0"}') ## sudo ip addr add "$WANPI" dev "$dev_name" # IP_FIX="1" - fi - else - echo -e "${ARROW} ${CYAN} Local device(${GREEN}$device_name${CYAN}) IP veryfication failed...${NC}" - fi + #fi + #else + #echo -e "${ARROW} ${CYAN} Local device(${GREEN}$device_name${CYAN}) IP veryfication failed...${NC}" + #fi fi echo -e "${NC}" fi From cd20392597d042b403982b0e1623932f74bb5eb3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 22:38:47 +0100 Subject: [PATCH 1113/1176] Update nodeanalizerandfixer.sh --- nodeanalizerandfixer.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 1ca803d8..8f5c9f60 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -199,6 +199,11 @@ if [[ -n $FLUXOS_VERSION ]]; then fi echo -e "${NC}" + if [[ -f /var/log/sas-error.log ]]; then + Flux System Attestation Service (SAS) + exit + fi + if [[ "$($BENCH_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then echo -e "${BOOK} ${YELLOW}Flux benchmark status:${NC}" @@ -445,7 +450,8 @@ if [[ -n $FLUXOS_VERSION ]]; then fluxos_running=$(sudo systemctl status fluxos 2> /dev/null | grep 'running' | grep -o 'since.*') fluxos_inactive=$(sudo systemctl status fluxos 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') fluxwatchdog_running=$(sudo systemctl status flux-watchdog 2> /dev/null | grep 'running' | grep -o 'since.*') - fluxwatchdog_inactive=$(sudo systemctl status flux-watchdog 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') + fluxwatchdog_inactive=$(sudo systemctl status flux-watchdog 2> /dev/null | egrep 'inactive|failed') + fluxwatchdog_awaiting=$(sudo systemctl status flux-watchdog 2> /dev/null | egrep 'inactive') syncthing_running=$(sudo systemctl status syncthing 2> /dev/null | grep 'running' | grep -o 'since.*') syncthing_inactive=$(sudo systemctl status syncthingg 2> /dev/null | egrep 'inactive|failed' | grep -o 'since.*') @@ -504,8 +510,12 @@ if [[ -n $FLUXOS_VERSION ]]; then if sudo systemctl list-units | grep 'flux-watchdog' | egrep -wi 'running' > /dev/null 2>&1; then echo -e "${CHECK_MARK} ${CYAN} Flux-watchdog service running ${SEA}$fluxwatchdog_running${NC}" else - if [[ "$fluxwatchdog_inactive" != "" ]]; then - echo -e "${X_MARK} ${CYAN} Flux-watchdog service not running ${RED}$fluxwatchdog_inactive${NC}" + if [[ "$fluxwatchdog_inactive" != "" || "$fluxwatchdog_awaiting" != "" ]]; then + if [[ -n $fluxwatchdog_inactive ]]; then + echo -e "${X_MARK} ${CYAN} Flux-watchdog service not running ${RED}$fluxwatchdog_inactive${NC}" + else + echo -e "${X_MARK} ${CYAN} Flux-watchdog service awaiting...${NC}" + fi else echo -e "${X_MARK} ${CYAN} Flux-watchdog service is not installed${NC}" fi From efc89f0524d678acb553801922c0f346b93bdb0e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 23:07:26 +0100 Subject: [PATCH 1114/1176] [ADD] SAS log check --- nodeanalizerandfixer.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 8f5c9f60..c05a809c 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -200,11 +200,13 @@ if [[ -n $FLUXOS_VERSION ]]; then echo -e "${NC}" if [[ -f /var/log/sas-error.log ]]; then - Flux System Attestation Service (SAS) + error_last_line=$(sudo cat /var/log/sas-error.log | tail -n1) + echo -e "${X_MARK} ${CYAN}Flux System Attestation Service (SAS) /var/log/sas-error.log detected!${NC}" + echo -e "${PIN} ${CYAN}Last error line: $error_last_line${NC}" + echo -e "" exit fi - if [[ "$($BENCH_CLI getinfo 2>/dev/null | jq -r '.version' 2>/dev/null)" != "" ]]; then echo -e "${BOOK} ${YELLOW}Flux benchmark status:${NC}" bench_getatus=$($BENCH_CLI getstatus) From 8fb098dde6b9279621a26ffc1944a84e595bdaf9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 19 Dec 2024 23:18:39 +0100 Subject: [PATCH 1115/1176] Minor edit --- nodeanalizerandfixer.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index c05a809c..c4d876ad 100644 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -201,7 +201,8 @@ if [[ -n $FLUXOS_VERSION ]]; then if [[ -f /var/log/sas-error.log ]]; then error_last_line=$(sudo cat /var/log/sas-error.log | tail -n1) - echo -e "${X_MARK} ${CYAN}Flux System Attestation Service (SAS) /var/log/sas-error.log detected!${NC}" + echo -e "${WORNING} ${CYAN}Flux System Attestation Service (SAS) error detected!${NC}" + echo -e "${PIN} ${CYAN}Log file: /var/log/sas-error.log${NC}" echo -e "${PIN} ${CYAN}Last error line: $error_last_line${NC}" echo -e "" exit From 040451e7818d406a291c0a2ff9ccac400ef543ec Mon Sep 17 00:00:00 2001 From: David White <david@runonflux.io> Date: Fri, 20 Dec 2024 07:06:55 +0000 Subject: [PATCH 1116/1176] Make script executable --- apps_info.sh | 0 cdn-speedtest.sh | 0 flux_common.sh | 0 hardwarebench.sh | 0 install_pro.sh | 0 install_pro_testnet.sh | 0 multinode.sh | 0 multitoolbox.sh | 0 multitoolbox_testnet.sh | 0 nodeanalizerandfixer.sh | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 apps_info.sh mode change 100644 => 100755 cdn-speedtest.sh mode change 100644 => 100755 flux_common.sh mode change 100644 => 100755 hardwarebench.sh mode change 100644 => 100755 install_pro.sh mode change 100644 => 100755 install_pro_testnet.sh mode change 100644 => 100755 multinode.sh mode change 100644 => 100755 multitoolbox.sh mode change 100644 => 100755 multitoolbox_testnet.sh mode change 100644 => 100755 nodeanalizerandfixer.sh diff --git a/apps_info.sh b/apps_info.sh old mode 100644 new mode 100755 diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh old mode 100644 new mode 100755 diff --git a/flux_common.sh b/flux_common.sh old mode 100644 new mode 100755 diff --git a/hardwarebench.sh b/hardwarebench.sh old mode 100644 new mode 100755 diff --git a/install_pro.sh b/install_pro.sh old mode 100644 new mode 100755 diff --git a/install_pro_testnet.sh b/install_pro_testnet.sh old mode 100644 new mode 100755 diff --git a/multinode.sh b/multinode.sh old mode 100644 new mode 100755 diff --git a/multitoolbox.sh b/multitoolbox.sh old mode 100644 new mode 100755 diff --git a/multitoolbox_testnet.sh b/multitoolbox_testnet.sh old mode 100644 new mode 100755 diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh old mode 100644 new mode 100755 From b7e2be11af1d53cde5f0ee59ef812e7a3e34bf3f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 21 Dec 2024 11:06:12 +0100 Subject: [PATCH 1117/1176] Skip user check --- flux_common.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 756da32d..0763e02c 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1533,13 +1533,15 @@ function create_swap() { function daemon_reconfiguration(){ echo -e "${GREEN}Module: Flux Daemon Reconfiguration${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi + if [[ -z $FLUXOS_VERSION ]]; then + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + fi config_veryfity echo -e "" echo -e "${ARROW} ${YELLOW}Fill in all the fields that you want to replace${NC}" From 9512dea974f0e9fcd0032e4d0beed0270395f530 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Dec 2024 13:53:27 +0100 Subject: [PATCH 1118/1176] [ADD] Log Viewer --- XK4MiLX | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 XK4MiLX diff --git a/XK4MiLX b/XK4MiLX new file mode 100644 index 00000000..3637949d --- /dev/null +++ b/XK4MiLX @@ -0,0 +1,63 @@ +#!/bin/bash + +set +o history +# +# Script to launch tmux in tiled mode with the most common log files being tailed +# + +TMUX=$(type -p tmux) || { echo "This script requires tmux"; exit 1; } + +SESSION="FLUX-$$" + +NOKILL=0 +LAYOUT=tiled + +declare -A FILES +if [ -d "/dat" ]; then + FILES+=( + [4 Watchdog]="sudo tail -F /dat/usr/lib/fluxwatchdog/watchdog_error.log" + [2 FluxD]="sudo tail -F /dat/var/lib/fluxd/debug.log" + [3 BenchMark]="sudo tail -F /dat/usr/lib/fluxbenchd/debug.log" + [1 FluxOS]="sudo tail -F dat/usr/lib/fluxos/debug.log" + ) +fi + +function at_exit() { + $TMUX kill-session -t "$SESSION" >/dev/null 2>&1 +} +[[ "$NOKILL" == "1" ]] || trap at_exit EXIT + +$TMUX -q new-session -d -s "$SESSION" -n Main "printf '\033]2;Main\033\\' ; bash" + +$TMUX set-option -t "$SESSION" -q mouse on + +# Create panes for each file +for key in "${!FILES[@]}"; do + # Extract file path from the command + FILE_PATH=$(echo "${FILES[${key}]}" | awk '{print $NF}') + + if [ -e "$FILE_PATH" ]; then + echo "Creating tmux pane for ${key}: ${FILES[${key}]}" # Debugging output + $TMUX -q split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${key}' ; eval ${FILES[${key}]}" + $TMUX -q select-layout -t "$SESSION" "$LAYOUT" + else + echo "Skipping ${key}: File not found (${FILE_PATH})" + fi +done + +# Ensure the first pane is removed +$TMUX -q kill-pane -t "${SESSION}.0" + +# Final layout adjustments +$TMUX -q select-layout -t "$SESSION" "$LAYOUT" + +# Set tmux options for appearance +$TMUX set-option -t "$SESSION" -g status-style bg=colour235,fg=yellow,dim +$TMUX set-window-option -t "$SESSION" -g window-status-style fg=brightblue,bg=colour236,dim +$TMUX set-window-option -t "$SESSION" -g window-status-current-style fg=brightred,bg=colour236,bright + +$TMUX -q set-window-option -t "$SESSION" synchronize-panes on +$TMUX set-option -t "$SESSION" -w pane-border-status bottom + +# Attach to the tmux session +$TMUX -q attach -t "$SESSION" >/dev/null 2>&1 From 8eba065da3904aaca26f37d35ff53d91980ee736 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Dec 2024 13:56:35 +0100 Subject: [PATCH 1119/1176] Rename XK4MiLX to log_viewer.sh --- XK4MiLX => log_viewer.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename XK4MiLX => log_viewer.sh (100%) diff --git a/XK4MiLX b/log_viewer.sh similarity index 100% rename from XK4MiLX rename to log_viewer.sh From 05708e6967b3c70273f71554a81c78e4fbccf042 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Dec 2024 14:06:03 +0100 Subject: [PATCH 1120/1176] [ADD] Log Viewer --- multitoolbox.sh | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 8477edb4..dc26d5ea 100755 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -958,7 +958,8 @@ else echo -e "${CYAN}5 - MongoDB Repair Assistant${NC}" echo -e "${CYAN}6 - Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" echo -e "${CYAN}7 - FluxNode Diagnostics${NC}" - echo -e "${CYAN}8 - Hardware benchmark${NC}" + echo -e "${CYAN}8 - Log Viewer${NC}" + echo -e "${CYAN}9 - Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" fi read -rp "Pick an option and hit ENTER: " @@ -1033,6 +1034,11 @@ case "$REPLY" in if [[ -z $FLUXOS_VERSION ]]; then daemon_reconfiguration else + bash -i "/usr/lib/multitoolbox/log_viewer.sh" + fi + ;; + 9) + if [[ -n $FLUXOS_VERSION ]]; then echo -e "${GREEN}Module: Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ -n $FLUXOS_VERSION ]]; then @@ -1040,26 +1046,22 @@ case "$REPLY" in else bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/hardwarebench.sh) fi - fi - ;; - 9) - if [[ ! -z $FLUXOS_VERSION ]]; then - exit - fi - clear - sleep 1 - echo -e "${GREEN}Module: Flux Daemon service creator${NC}" - echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" + else + clear + sleep 1 + echo -e "${GREEN}Module: Flux Daemon service creator${NC}" echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - create_service_scripts - create_service "install" - echo -e "" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" + echo -e "${YELLOW}================================================================${NC}" + echo -e "${NC}" + exit + fi + create_service_scripts + create_service "install" + echo -e "" + fi ;; 10) if [[ ! -z $FLUXOS_VERSION ]]; then From 66d309463fb6f92193756049feb5dc8597401e77 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Dec 2024 14:22:16 +0100 Subject: [PATCH 1121/1176] [ADD] Additional SAS logs --- nodeanalizerandfixer.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index c4d876ad..97ed84ea 100755 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -201,10 +201,18 @@ if [[ -n $FLUXOS_VERSION ]]; then if [[ -f /var/log/sas-error.log ]]; then error_last_line=$(sudo cat /var/log/sas-error.log | tail -n1) + error_content=$(sudo cat /var/log/sas-error.log) + debug_content=$(sudo cat /var/log/sysd.log | tail -n50) echo -e "${WORNING} ${CYAN}Flux System Attestation Service (SAS) error detected!${NC}" echo -e "${PIN} ${CYAN}Log file: /var/log/sas-error.log${NC}" echo -e "${PIN} ${CYAN}Last error line: $error_last_line${NC}" echo -e "" + echo -e "${PIN} ${BOOK}Content of sas-error.log${NC}" + echo -e "-------------------------------------------------------------" + echo -e "$error_content" + echo -e "${PIN} ${BOOK}Content of sysd.log${NC}" + echo -e "-------------------------------------------------------------" + echo -e "$debug_content" exit fi From 7db892b824b823876d11fe0ffa64139befb0f8d3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Dec 2024 19:29:54 +0100 Subject: [PATCH 1122/1176] [FIX] FluxOS log path --- log_viewer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log_viewer.sh b/log_viewer.sh index 3637949d..ef00e2d0 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -18,7 +18,7 @@ if [ -d "/dat" ]; then [4 Watchdog]="sudo tail -F /dat/usr/lib/fluxwatchdog/watchdog_error.log" [2 FluxD]="sudo tail -F /dat/var/lib/fluxd/debug.log" [3 BenchMark]="sudo tail -F /dat/usr/lib/fluxbenchd/debug.log" - [1 FluxOS]="sudo tail -F dat/usr/lib/fluxos/debug.log" + [1 FluxOS]="sudo tail -F /dat/usr/lib/fluxos/debug.log" ) fi From 9d45513461667791fb5613961bb1d0cb1522ba14 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Dec 2024 20:20:07 +0100 Subject: [PATCH 1123/1176] remove log output --- log_viewer.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/log_viewer.sh b/log_viewer.sh index ef00e2d0..f78f58c9 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -37,7 +37,6 @@ for key in "${!FILES[@]}"; do FILE_PATH=$(echo "${FILES[${key}]}" | awk '{print $NF}') if [ -e "$FILE_PATH" ]; then - echo "Creating tmux pane for ${key}: ${FILES[${key}]}" # Debugging output $TMUX -q split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${key}' ; eval ${FILES[${key}]}" $TMUX -q select-layout -t "$SESSION" "$LAYOUT" else From dc19680f76bfbfaa8e2716ab01edba2e4dc9a8cd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Dec 2024 21:56:24 +0100 Subject: [PATCH 1124/1176] [FIX] SAS logs --- nodeanalizerandfixer.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 97ed84ea..6f605f16 100755 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -202,15 +202,16 @@ if [[ -n $FLUXOS_VERSION ]]; then if [[ -f /var/log/sas-error.log ]]; then error_last_line=$(sudo cat /var/log/sas-error.log | tail -n1) error_content=$(sudo cat /var/log/sas-error.log) - debug_content=$(sudo cat /var/log/sysd.log | tail -n50) + debug_content=$(sudo cat /var/log/sas.log | tail -n50) echo -e "${WORNING} ${CYAN}Flux System Attestation Service (SAS) error detected!${NC}" echo -e "${PIN} ${CYAN}Log file: /var/log/sas-error.log${NC}" echo -e "${PIN} ${CYAN}Last error line: $error_last_line${NC}" echo -e "" - echo -e "${PIN} ${BOOK}Content of sas-error.log${NC}" + echo -e "${BOOK}Content of sas-error.log${NC}" echo -e "-------------------------------------------------------------" echo -e "$error_content" - echo -e "${PIN} ${BOOK}Content of sysd.log${NC}" + echo -e "-------------------------------------------------------------" + echo -e "${BOOK}Content of sas.log${NC}" echo -e "-------------------------------------------------------------" echo -e "$debug_content" exit From ed07b0e106cd52d65d85b1b2090a4022539de952 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 30 Dec 2024 22:45:59 +0100 Subject: [PATCH 1125/1176] [FIX] scrolling for xterm --- log_viewer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/log_viewer.sh b/log_viewer.sh index f78f58c9..14c4d536 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -30,6 +30,7 @@ function at_exit() { $TMUX -q new-session -d -s "$SESSION" -n Main "printf '\033]2;Main\033\\' ; bash" $TMUX set-option -t "$SESSION" -q mouse on +$TMUX set-option -t "$SESSION" -ga terminal-overrides ',xterm*:smcup@:rmcup@' # Create panes for each file for key in "${!FILES[@]}"; do From 86b89a861a58f930063777e99f51f7d43a9cbc5e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 31 Dec 2024 12:01:58 +0100 Subject: [PATCH 1126/1176] improvements - log file validation - clean up - optimization --- log_viewer.sh | 91 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 37 deletions(-) diff --git a/log_viewer.sh b/log_viewer.sh index 14c4d536..fc02bb1c 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -1,63 +1,80 @@ #!/bin/bash - set +o history -# -# Script to launch tmux in tiled mode with the most common log files being tailed -# - -TMUX=$(type -p tmux) || { echo "This script requires tmux"; exit 1; } - +TMUX=$(command -v tmux) || { echo "This script requires tmux. Please install it."; exit 1; } SESSION="FLUX-$$" +LAYOUT="tiled" -NOKILL=0 -LAYOUT=tiled - +# Log files and their titles declare -A FILES -if [ -d "/dat" ]; then - FILES+=( - [4 Watchdog]="sudo tail -F /dat/usr/lib/fluxwatchdog/watchdog_error.log" - [2 FluxD]="sudo tail -F /dat/var/lib/fluxd/debug.log" - [3 BenchMark]="sudo tail -F /dat/usr/lib/fluxbenchd/debug.log" - [1 FluxOS]="sudo tail -F /dat/usr/lib/fluxos/debug.log" - ) -fi +FILES+=( + [Watchdog]="/dat/usr/lib/fluxwatchdog/watchdog_error.log" + [FluxD]="/dat/var/lib/fluxd/debug.log" + [BenchMark]="/dat/usr/lib/fluxbenchd/debug.log" + [FluxOS]="/dat/usr/lib/fluxos/debug.log" +) + +# Cleanup function function at_exit() { $TMUX kill-session -t "$SESSION" >/dev/null 2>&1 } -[[ "$NOKILL" == "1" ]] || trap at_exit EXIT -$TMUX -q new-session -d -s "$SESSION" -n Main "printf '\033]2;Main\033\\' ; bash" +# Trap SIGINT (Ctrl+C) and SIGTERM to cleanup +trap at_exit SIGINT SIGTERM EXIT + +VALID_FILES=() +for title in "${!FILES[@]}"; do + LOG_FILE="${FILES[$title]}" + if [ -f "$LOG_FILE" ]; then + VALID_FILES+=("$title") + fi +done + +# Exit if no valid log files are found +if [ "${#VALID_FILES[@]}" -eq 0 ]; then + echo "No valid log files found. Exiting." + echo -e "" + exit 1 +fi + +# Start tmux session if it doesn't already exist +if ! $TMUX has-session -t "$SESSION" 2>/dev/null; then + $TMUX new-session -d -s "$SESSION" -n Main "printf '\033]2;Main\033\\' ; bash" +else + echo "Session $SESSION already exists. Attaching to it." + $TMUX attach -t "$SESSION" + exit 0 +fi +# Enable mouse and adjust terminal overrides $TMUX set-option -t "$SESSION" -q mouse on $TMUX set-option -t "$SESSION" -ga terminal-overrides ',xterm*:smcup@:rmcup@' -# Create panes for each file -for key in "${!FILES[@]}"; do - # Extract file path from the command - FILE_PATH=$(echo "${FILES[${key}]}" | awk '{print $NF}') - - if [ -e "$FILE_PATH" ]; then - $TMUX -q split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${key}' ; eval ${FILES[${key}]}" - $TMUX -q select-layout -t "$SESSION" "$LAYOUT" +# Create panes for each log file +for title in "${!FILES[@]}"; do + LOG_FILE="${FILES[$title]}" + if [ -f "$LOG_FILE" ]; then + $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}'" + $TMUX select-layout -t "$SESSION" "$LAYOUT" else - echo "Skipping ${key}: File not found (${FILE_PATH})" + echo "Skipping ${title}: File not found (${LOG_FILE})" fi done -# Ensure the first pane is removed -$TMUX -q kill-pane -t "${SESSION}.0" +# Remove the initial empty pane +$TMUX kill-pane -t "${SESSION}.0" -# Final layout adjustments -$TMUX -q select-layout -t "$SESSION" "$LAYOUT" +# Final tmux layout adjustments +$TMUX select-layout -t "$SESSION" "$LAYOUT" -# Set tmux options for appearance +# Customize tmux appearance $TMUX set-option -t "$SESSION" -g status-style bg=colour235,fg=yellow,dim $TMUX set-window-option -t "$SESSION" -g window-status-style fg=brightblue,bg=colour236,dim $TMUX set-window-option -t "$SESSION" -g window-status-current-style fg=brightred,bg=colour236,bright -$TMUX -q set-window-option -t "$SESSION" synchronize-panes on -$TMUX set-option -t "$SESSION" -w pane-border-status bottom +# Synchronize panes for uniform control +$TMUX set-window-option -t "$SESSION" synchronize-panes on +$TMUX set-option -t "$SESSION" pane-border-status bottom # Attach to the tmux session -$TMUX -q attach -t "$SESSION" >/dev/null 2>&1 +$TMUX attach -t "$SESSION" >/dev/null 2>&1 From 5cfd7d30e4e89740aa243757c24fcde3e6cbfb38 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 31 Dec 2024 14:17:22 +0100 Subject: [PATCH 1127/1176] [ADD] Log selection menu --- log_viewer.sh | 52 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/log_viewer.sh b/log_viewer.sh index fc02bb1c..32cc84ac 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -1,17 +1,24 @@ #!/bin/bash set +o history + +export NEWT_COLORS=' +title=black, +' + TMUX=$(command -v tmux) || { echo "This script requires tmux. Please install it."; exit 1; } SESSION="FLUX-$$" LAYOUT="tiled" # Log files and their titles declare -A FILES - FILES+=( - [Watchdog]="/dat/usr/lib/fluxwatchdog/watchdog_error.log" - [FluxD]="/dat/var/lib/fluxd/debug.log" - [BenchMark]="/dat/usr/lib/fluxbenchd/debug.log" + [Flux-Watchdog]="/dat/usr/lib/watchdog/watchdog_error.log" + [Flux-Daemon]="/dat/var/lib/fluxd/debug.log" + [Flux-Benchmark]="/dat/usr/lib/fluxbenchd/debug.log" [FluxOS]="/dat/usr/lib/fluxos/debug.log" + [SAS-DEBUG]="/var/log/sas.log" + [SAS-ERROR]="/var/log/sas-error.log" + [MongoDB]="/dat/var/log/mongodb/mongod.log" ) # Cleanup function @@ -22,21 +29,37 @@ function at_exit() { # Trap SIGINT (Ctrl+C) and SIGTERM to cleanup trap at_exit SIGINT SIGTERM EXIT -VALID_FILES=() +# Verify if all files exist and prepare the whiptail menu options +MENU_OPTIONS=() for title in "${!FILES[@]}"; do LOG_FILE="${FILES[$title]}" if [ -f "$LOG_FILE" ]; then - VALID_FILES+=("$title") + MENU_OPTIONS+=("$title" " " ON) + else + echo "Skipping ${title}: File not found (${LOG_FILE})" fi done # Exit if no valid log files are found -if [ "${#VALID_FILES[@]}" -eq 0 ]; then - echo "No valid log files found. Exiting." +if [ "${#MENU_OPTIONS[@]}" -eq 0 ]; then + echo -e "No valid log files found. Exiting." echo -e "" exit 1 fi +# Display whiptail menu +SELECTED_FILES=$(whiptail --title "Select Log Files" --checklist \ + "\nChoose which log files to monitor. Navigate using arrow keys, toggle selection with Spacebar, and confirm with Enter. To close the log monitor, press Ctrl+C.\n" 25 50 10 \ + "${MENU_OPTIONS[@]}" 3>&1 1>&2 2>&3) + +# Handle user cancel or no selection +if [ $? -ne 0 ] || [ -z "$SELECTED_FILES" ]; then + exit 1 +fi + +# Parse selected files into an array +SELECTED_FILES=($(echo "$SELECTED_FILES" | tr -d '"')) + # Start tmux session if it doesn't already exist if ! $TMUX has-session -t "$SESSION" 2>/dev/null; then $TMUX new-session -d -s "$SESSION" -n Main "printf '\033]2;Main\033\\' ; bash" @@ -50,15 +73,12 @@ fi $TMUX set-option -t "$SESSION" -q mouse on $TMUX set-option -t "$SESSION" -ga terminal-overrides ',xterm*:smcup@:rmcup@' -# Create panes for each log file -for title in "${!FILES[@]}"; do +# Create panes for each selected file +for title in "${SELECTED_FILES[@]}"; do LOG_FILE="${FILES[$title]}" - if [ -f "$LOG_FILE" ]; then - $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}'" - $TMUX select-layout -t "$SESSION" "$LAYOUT" - else - echo "Skipping ${title}: File not found (${LOG_FILE})" - fi + echo "Opening pane for: $title ($LOG_FILE)" + $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}'" + $TMUX select-layout -t "$SESSION" "$LAYOUT" done # Remove the initial empty pane From b8a4526371fe6520212bf419cfcc5937e69dd474 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 31 Dec 2024 22:01:29 +0100 Subject: [PATCH 1128/1176] Minor edit --- log_viewer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/log_viewer.sh b/log_viewer.sh index 32cc84ac..427cef0e 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -24,6 +24,7 @@ FILES+=( # Cleanup function function at_exit() { $TMUX kill-session -t "$SESSION" >/dev/null 2>&1 + set -o history } # Trap SIGINT (Ctrl+C) and SIGTERM to cleanup From 6880673da197c7956f3417606636609ab33427c1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 1 Jan 2025 19:08:39 +0100 Subject: [PATCH 1129/1176] [ADD] jq for read if valid json --- log_viewer.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/log_viewer.sh b/log_viewer.sh index 427cef0e..e5437fe2 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -78,7 +78,11 @@ $TMUX set-option -t "$SESSION" -ga terminal-overrides ',xterm*:smcup@:rmcup@' for title in "${SELECTED_FILES[@]}"; do LOG_FILE="${FILES[$title]}" echo "Opening pane for: $title ($LOG_FILE)" - $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}'" + if jq empty ${LOG_FILE} > /dev/null 2>&1; then + $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}' | jq ." + else + $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}'" + fi $TMUX select-layout -t "$SESSION" "$LAYOUT" done From cda2309de6f16574e9e1935804f5c3c273e7b82a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 1 Jan 2025 19:11:53 +0100 Subject: [PATCH 1130/1176] [ADD] sudo --- log_viewer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log_viewer.sh b/log_viewer.sh index e5437fe2..2d8938a3 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -78,7 +78,7 @@ $TMUX set-option -t "$SESSION" -ga terminal-overrides ',xterm*:smcup@:rmcup@' for title in "${SELECTED_FILES[@]}"; do LOG_FILE="${FILES[$title]}" echo "Opening pane for: $title ($LOG_FILE)" - if jq empty ${LOG_FILE} > /dev/null 2>&1; then + if sudo jq empty ${LOG_FILE} > /dev/null 2>&1; then $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}' | jq ." else $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}'" From 75b1983cb51af3e20f25668a9727b582105690c4 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 5 Jan 2025 22:24:39 +0100 Subject: [PATCH 1131/1176] [ADD] Stream chain data from local network --- flux_common.sh | 202 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 183 insertions(+), 19 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 0763e02c..d697492e 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1958,12 +1958,148 @@ function bootstrap_new() { fi fi } + +##### STREAM SECTION +# Clean data directories +clean() { + local silent_mode=$1 + cd $DEST_PATH 2>/dev/null + sudo rm -rf blocks chainstate determ_zelnodes 2>/dev/null + cd 2>/dev/null + [ "$silent_mode" != "true" ] && echo -e "🧹 Cleaned data directories." +} + +# Stop services +stop_xservices() { + local silent_mode=$1 + [ "$silent_mode" != "true" ] && echo -e "⏹️ Stopping services..." + sudo systemctl stop "$FLUXD_SERVICE" + if [ -n "$FLUXOS_VERSION" ]; then + sudo systemctl stop "$WATCHDOG_SERVICE" + else + pm2 stop watchdog + fi +} + +# Start services +start_xservices() { + local silent_mode=$1 + [ "$silent_mode" != "true" ] && echo -e "▶️ Starting services..." + sudo systemctl start "$FLUXD_SERVICE" + if [ -n "$FLUXOS_VERSION" ]; then + sudo systemctl start "$WATCHDOG_SERVICE" + else + pm2 start watchdog --watch + fi +} + +# Get local machine's IP address +get_local_ip() { + local silent_mode=$1 + [ "$silent_mode" != "true" ] && echo -e "🌐 Getting local LAN IP address..." + local_ip=$(upnpc -l 2>/dev/null | awk -F': ' '/Local LAN ip address/ {print $2}') + + if [ -z "$local_ip" ]; then + [ "$silent_mode" != "true" ] && echo -e "❌ Local LAN IP not found." >&2 + exit 1 + else + [ "$silent_mode" != "true" ] && echo -e "✅ Local LAN IP: $local_ip" + fi + + echo "$local_ip" +} + +# Discover UPnP nodes and group them by tier +discover_upnp_nodes() { + local silent_mode=$1 + [ "$silent_mode" != "true" ] && echo -e "🔍 Discovering UPnP nodes..." + + local_ip=$(get_local_ip "$silent_mode") + if [ -n "$local_ip" ]; then + local raw_nodes=($(upnpc -l 2>/dev/null | \ + awk '/Flux_Backend_API/ && !/Flux_Backend_API_SSL/ {print $3}' | \ + awk -F'->' '{print $2}' | \ + grep -v "$local_ip" | \ + sort -u)) + + unset node_map + declare -A node_map # Associative array to store nodes by tier + tiers=("stratus_new" "nimbus_new" "cumulus_new") # Priority tiers + + for node in "${raw_nodes[@]}"; do + [ "$silent_mode" != "true" ] && echo -e "🛠️ Checking tier information for node: $node" + response=$(curl -s --max-time 5 -X GET "http://${node}/flux/nodetier") + tier=$(echo "$response" | jq -r '.data' 2>/dev/null) + status=$(echo "$response" | jq -r '.status' 2>/dev/null) + + if [ "$status" == "success" ] && [ -n "$tier" ]; then + if [[ " ${tiers[@]} " =~ " $tier " ]]; then + [ "$silent_mode" != "true" ] && echo -e "✨ Node $node belongs to tier: $tier" + node_map["$tier"]+="$node " + fi + else + [ "$silent_mode" != "true" ] && echo -e "❌ Node $node failed tier verification." >&2 + fi + done + + # Print grouped nodes by tier in order of priority + if [ ${#node_map[@]} -gt 0 ]; then + [ "$silent_mode" != "true" ] && echo -e "📊 Nodes grouped by tier:" + for tier in "${tiers[@]}"; do + if [ -n "${node_map[$tier]}" ]; then + [ "$silent_mode" != "true" ] && echo " - $tier: ${node_map[$tier]}" + fi + done + return 0 + else + [ "$silent_mode" != "true" ] && echo -e "🚫 No valid nodes found for any tier." >&2 + return 1 + fi + else + return 1 + fi +} + +# Stream chain locally from prioritized nodes +stream_chain_locally() { + local silent_mode=$1 + [ "$silent_mode" != "true" ] && echo -e "📂 Starting local chain streaming..." + for tier in "stratus_new" "nimbus_new" "cumulus_new"; do + nodes=(${node_map[$tier]}) + for node in "${nodes[@]}"; do + [ "$silent_mode" != "true" ] && echo -e "📡 Attempting to stream chain from node: $node" + curl -s --max-time 5 -X POST "http://${node}/streamchain" | tar -xv -C "$DEST_PATH" + if [ $? -eq 0 ]; then + [ "$silent_mode" != "true" ] && echo -e "✅ Successfully streamed chain from $node" + if [ -n "$FLUXOS_VERSION" ]; then + sudo chown -R fluxd:fluxd "$DEST_PATH" + fi + return 0 + else + [ "$silent_mode" != "true" ] && echo -e "❌ Failed to stream chain from $node" >&2 + clean "$silent_mode" + fi + done + done + + [ "$silent_mode" != "true" ] && echo -e "🚫 Failed to stream chain locally from all nodes" >&2 + clean "$silent_mode" + return 1 +} +###################################################################################################### function bootstrap_manual() { - CHOICE=$( - whiptail --title "FluxNode Installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ - "1)" "Download from source build in script" \ - "2)" "Download from own source" 3>&2 2>&1 1>&3 - ) + + discover_upnp_nodes "true" + if [ $? -eq 0 ]; then + CHOICE=$( + whiptail --title "FluxNode Installation" --menu "Choose a method how to get bootstrap file" 10 47 2 \ + "1)" "Download from CDN servers" \ + "2)" "Stream from local network" 3>&2 2>&1 1>&3 + ) + else + CHOICE="1)" + fi + case $CHOICE in "1)") #server_list=("http://cdn-11.runonflux.io/apps/fluxshare/getfile/" "http://cdn-12.runonflux.io/apps/fluxshare/getfile/" "http://cdn-13.runonflux.io/apps/fluxshare/getfile/" "http://cdn-10.runonflux.io/apps/fluxshare/getfile/") @@ -1990,20 +2126,48 @@ function bootstrap_manual() { sleep 1 ;; "2)") - DOWNLOAD_URL="$(whiptail --title "Flux daemon bootstrap setup" --inputbox "Enter your URL (zip, tar.gz)" 8 72 3>&1 1>&2 2>&3)" - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - BOOTSTRAP_FILE="${DOWNLOAD_URL##*/}" - sudo wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - if [[ "$Mode" != "install" ]]; then - stop_service - fi - if [[ "$BOOTSTRAP_FILE" == *".zip"* ]]; then - echo -e "${ARROW} ${CYAN}Unpacking wallet bootstrap please be patient...${NC}" - sudo unzip -o $DATA_PATH/$BOOTSTRAP_FILE -d $FLUX_DAEMON_PATH > /dev/null 2>&1 - else - tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" - sleep 1 - fi + if [ -n "$FLUXOS_VERSION" ]; then + DEST_PATH="/dat/var/lib/fluxd" + FLUXD_SERVICE="fluxd" + WATCHDOG_SERVICE="flux-watchdog" + else + DEST_PATH="$HOME/.flux" + FLUXD_SERVICE="zelcash" + fi + + SECONDS=0 # Start timer + silent_mode="false" + + discover_upnp_nodes "$silent_mode" + if [ $? -eq 0 ]; then + [ "$silent_mode" != "true" ] && echo -e "✅ Successfully discovered and grouped nodes by tier." + # Stop services before streaming + stop_xservices "$silent_mode" + # Clean old data + clean "$silent_mode" + # Stream the chain locally + stream_chain_locally "$silent_mode" + if [ $? -ne 0 ]; then + [ "$silent_mode" != "true" ] && echo -e "❌ Chain streaming failed." + # Start services even if chain streaming fails + start_xservices "$silent_mode" + exit 1 + fi + # Start services after successful streaming + start_xservices "$silent_mode" + # Calculate elapsed time + elapsed=$SECONDS + hours=$((elapsed / 3600)) + minutes=$(((elapsed % 3600) / 60)) + seconds=$((elapsed % 60)) + [ "$silent_mode" != "true" ] && echo -e "🎉 Chain streaming process completed successfully." + [ "$silent_mode" != "true" ] && echo -e "⏱️ Total execution time: ${hours}h ${minutes}m ${seconds}s." + echo -e "" + else + [ "$silent_mode" != "true" ] && echo -e "❌ Failed to discover and verify nodes." + echo -e "" + exit 1 + fi ;; esac } From 68400ac9ae26cdb0c57fa7ff83244626b473e37d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 5 Jan 2025 22:47:03 +0100 Subject: [PATCH 1132/1176] removed time limit from streamchain --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index d697492e..84f2af79 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2068,7 +2068,7 @@ stream_chain_locally() { nodes=(${node_map[$tier]}) for node in "${nodes[@]}"; do [ "$silent_mode" != "true" ] && echo -e "📡 Attempting to stream chain from node: $node" - curl -s --max-time 5 -X POST "http://${node}/streamchain" | tar -xv -C "$DEST_PATH" + curl -s -X POST "http://${node}/streamchain" | tar -xv -C "$DEST_PATH" if [ $? -eq 0 ]; then [ "$silent_mode" != "true" ] && echo -e "✅ Successfully streamed chain from $node" if [ -n "$FLUXOS_VERSION" ]; then From 14012ca1199966f9d66d785142eee99680fb17db Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 6 Jan 2025 10:47:15 +0100 Subject: [PATCH 1133/1176] Disable config_veryfity --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index dc26d5ea..77aa91fc 100755 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -534,7 +534,7 @@ function flux_daemon_bootstrap() { fi cd echo -e "${NC}" - config_veryfity + #config_veryfity bootstrap_new } function install_node(){ From 5fa0ad81558341a67d454a8dcd866bc8a1a1a9d2 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:46:05 +0100 Subject: [PATCH 1134/1176] [FIX] node_map as global variable --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 84f2af79..40794f20 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2023,7 +2023,7 @@ discover_upnp_nodes() { sort -u)) unset node_map - declare -A node_map # Associative array to store nodes by tier + declare -g -A node_map tiers=("stratus_new" "nimbus_new" "cumulus_new") # Priority tiers for node in "${raw_nodes[@]}"; do From fe0b7509f6a4f1dad838c6bc3b68883df258dc90 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:52:44 +0100 Subject: [PATCH 1135/1176] Minor edit --- flux_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/flux_common.sh b/flux_common.sh index 40794f20..94673c48 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2151,6 +2151,7 @@ function bootstrap_manual() { [ "$silent_mode" != "true" ] && echo -e "❌ Chain streaming failed." # Start services even if chain streaming fails start_xservices "$silent_mode" + echo -e "" exit 1 fi # Start services after successful streaming From 90fb16cce42c9a565db09e6ede326d74a2465ff0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:00:08 +0100 Subject: [PATCH 1136/1176] [FIX] streamchain endpoint --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 94673c48..76b1c85d 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2068,7 +2068,7 @@ stream_chain_locally() { nodes=(${node_map[$tier]}) for node in "${nodes[@]}"; do [ "$silent_mode" != "true" ] && echo -e "📡 Attempting to stream chain from node: $node" - curl -s -X POST "http://${node}/streamchain" | tar -xv -C "$DEST_PATH" + curl -s -X POST "http://${node}/flux/streamchain" | tar -xv -C "$DEST_PATH" if [ $? -eq 0 ]; then [ "$silent_mode" != "true" ] && echo -e "✅ Successfully streamed chain from $node" if [ -n "$FLUXOS_VERSION" ]; then From eae769b305c6475fb37faf7dac9fca609c89597f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:26:29 +0100 Subject: [PATCH 1137/1176] [FIX] Prevent clean action if the file does not exist or the variable is empty. Skip on option 2. --- flux_common.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 76b1c85d..f9785184 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1905,19 +1905,19 @@ function bootstrap_new() { if [[ -f "$FILE_PATH" ]]; then if [[ "$Mode" != "install" ]]; then start_service - # if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then + if [[ -f $FILE_PATH && $FILE_PATH != "" ]]; then sudo rm -rf $FILE_PATH > /dev/null 2>&1 && sleep 2 - # fi + fi fi return else if [[ ! -f $DATA_PATH/install_conf.json ]]; then bootstrap_manual - if [[ "$Mode" != "install" && "$server_offline" == "0" ]]; then + if [[ "$Mode" != "install" && "$server_offline" == "0" && CHOICE == "1)" ]]; then start_service - # if whiptail --yesno "Would you like remove bootstrap archive file?" 8 60; then - sudo rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 && sleep 2 - # fi + if [[ -f $DATA_PATH/$BOOTSTRAP_FILE && $BOOTSTRAP_FILE != "" ]]; then + sudo rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 && sleep 2 + fi fi return fi From 7559f578f78a5d28cb0cc13d735201a9ed938075 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:30:17 +0100 Subject: [PATCH 1138/1176] [FIX] Missing variable symbol --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f9785184..64498ad2 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1913,7 +1913,7 @@ function bootstrap_new() { else if [[ ! -f $DATA_PATH/install_conf.json ]]; then bootstrap_manual - if [[ "$Mode" != "install" && "$server_offline" == "0" && CHOICE == "1)" ]]; then + if [[ "$Mode" != "install" && "$server_offline" == "0" && $CHOICE == "1)" ]]; then start_service if [[ -f $DATA_PATH/$BOOTSTRAP_FILE && $BOOTSTRAP_FILE != "" ]]; then sudo rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 && sleep 2 From a2fe92a33f50d77a079fd495e75a80381b2fb921 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:40:18 +0100 Subject: [PATCH 1139/1176] [ADD] pino-pretty for json --- log_viewer.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/log_viewer.sh b/log_viewer.sh index 2d8938a3..becd0b58 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -16,8 +16,7 @@ FILES+=( [Flux-Daemon]="/dat/var/lib/fluxd/debug.log" [Flux-Benchmark]="/dat/usr/lib/fluxbenchd/debug.log" [FluxOS]="/dat/usr/lib/fluxos/debug.log" - [SAS-DEBUG]="/var/log/sas.log" - [SAS-ERROR]="/var/log/sas-error.log" + [SAS]="/var/log/sas.log" [MongoDB]="/dat/var/log/mongodb/mongod.log" ) @@ -79,7 +78,7 @@ for title in "${SELECTED_FILES[@]}"; do LOG_FILE="${FILES[$title]}" echo "Opening pane for: $title ($LOG_FILE)" if sudo jq empty ${LOG_FILE} > /dev/null 2>&1; then - $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}' | jq ." + $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}' | pino-pretty --colorize --translateTime 'dd-mm-yyyy HH:MM:ss'" else $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}'" fi From e3b0329d7f24733fdc8880c8358fb1edca1deb9c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 6 Jan 2025 23:49:45 +0100 Subject: [PATCH 1140/1176] [ADD] Detection of error logs from the current boot --- nodeanalizerandfixer.sh | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 6f605f16..6e37a068 100755 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -198,22 +198,20 @@ if [[ -n $FLUXOS_VERSION ]]; then sudo apt install -y bc > /dev/null 2>&1 && sleep 1 fi echo -e "${NC}" - - if [[ -f /var/log/sas-error.log ]]; then - error_last_line=$(sudo cat /var/log/sas-error.log | tail -n1) - error_content=$(sudo cat /var/log/sas-error.log) - debug_content=$(sudo cat /var/log/sas.log | tail -n50) - echo -e "${WORNING} ${CYAN}Flux System Attestation Service (SAS) error detected!${NC}" - echo -e "${PIN} ${CYAN}Log file: /var/log/sas-error.log${NC}" - echo -e "${PIN} ${CYAN}Last error line: $error_last_line${NC}" + BOOT_ID=$(sudo cat /proc/sys/kernel/random/boot_id) + $LOG_FILE="/var/log/sas.log" + LAST_LOG_LINE=$(sudo grep -n "\"boot_id\":\"$BOOT_ID\"" "$LOG_FILE" | sudo grep -E '"level":[5-9][0-9]' | sudo tail -n 1 | cut -d: -f1) + if [[ -n "$LAST_LOG_LINE" ]]; then + START_LINE=$((LAST_LOG_LINE - 10)) + if [[ $START_LINE -lt 1 ]]; then + START_LINE=1 + fi + echo -e "${WORNING} ${CYAN}Flux System Attestation Service (SAS) error detected! ${NC}" + echo -e "${PIN} ${CYAN}Log file: /var/log/sas.log ${NC}" + echo -e "${BOOK}Last error and 10 prior entries for the current boot ${NC}" + echo -e "---------------------------------------------------------------------" + sudo sed -n "${START_LINE},${LAST_LOG_LINE}p" "$LOG_FILE" | pino-pretty --colorize --translateTime 'dd-mm-yyyy HH:MM:ss' echo -e "" - echo -e "${BOOK}Content of sas-error.log${NC}" - echo -e "-------------------------------------------------------------" - echo -e "$error_content" - echo -e "-------------------------------------------------------------" - echo -e "${BOOK}Content of sas.log${NC}" - echo -e "-------------------------------------------------------------" - echo -e "$debug_content" exit fi From 7018cfcd42b5d05f77d462042d11613a375984dd Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 6 Jan 2025 23:51:30 +0100 Subject: [PATCH 1141/1176] Minor edits --- nodeanalizerandfixer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 6e37a068..ebc8bbc8 100755 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -200,7 +200,7 @@ if [[ -n $FLUXOS_VERSION ]]; then echo -e "${NC}" BOOT_ID=$(sudo cat /proc/sys/kernel/random/boot_id) $LOG_FILE="/var/log/sas.log" - LAST_LOG_LINE=$(sudo grep -n "\"boot_id\":\"$BOOT_ID\"" "$LOG_FILE" | sudo grep -E '"level":[5-9][0-9]' | sudo tail -n 1 | cut -d: -f1) + LAST_LOG_LINE=$(grep -n "\"boot_id\":\"$BOOT_ID\"" "$LOG_FILE" | grep -E '"level":[5-9][0-9]' | tail -n 1 | cut -d: -f1) if [[ -n "$LAST_LOG_LINE" ]]; then START_LINE=$((LAST_LOG_LINE - 10)) if [[ $START_LINE -lt 1 ]]; then @@ -210,7 +210,7 @@ if [[ -n $FLUXOS_VERSION ]]; then echo -e "${PIN} ${CYAN}Log file: /var/log/sas.log ${NC}" echo -e "${BOOK}Last error and 10 prior entries for the current boot ${NC}" echo -e "---------------------------------------------------------------------" - sudo sed -n "${START_LINE},${LAST_LOG_LINE}p" "$LOG_FILE" | pino-pretty --colorize --translateTime 'dd-mm-yyyy HH:MM:ss' + sed -n "${START_LINE},${LAST_LOG_LINE}p" "$LOG_FILE" | pino-pretty --colorize --translateTime 'dd-mm-yyyy HH:MM:ss' echo -e "" exit fi From fdbe793d48e60f86a65a030f4a5d47cee60c900e Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:43:27 +0100 Subject: [PATCH 1142/1176] {FIX] LOG_FILE --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index ebc8bbc8..10dfe471 100755 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -199,7 +199,7 @@ if [[ -n $FLUXOS_VERSION ]]; then fi echo -e "${NC}" BOOT_ID=$(sudo cat /proc/sys/kernel/random/boot_id) - $LOG_FILE="/var/log/sas.log" + LOG_FILE="/var/log/sas.log" LAST_LOG_LINE=$(grep -n "\"boot_id\":\"$BOOT_ID\"" "$LOG_FILE" | grep -E '"level":[5-9][0-9]' | tail -n 1 | cut -d: -f1) if [[ -n "$LAST_LOG_LINE" ]]; then START_LINE=$((LAST_LOG_LINE - 10)) From cbcb76faba671fb1cf1fa7960ec4c9da43ef81d3 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:11:33 +0100 Subject: [PATCH 1143/1176] Improve bootstrapping from CDN --- flux_common.sh | 85 +++++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 39 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 64498ad2..f642586c 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1890,39 +1890,62 @@ function cdn_speedtest() { fi #echo -e "${CHECK_MARK} ${GREEN}Fastest Server: ${YELLOW}$DOWNLOAD_URL${NC}" } + +function download_and_unpack() { + FILE_SIZE=$(curl -sI "$DOWNLOAD_URL" | grep -i "content-length" | awk '{print $2}' | tr -d '\r') + if [ -z "$FILE_SIZE" ]; then + echo "⚠️ Unable to retrieve file size. Progress will be approximate." + FILE_SIZE=0 + fi + # Record the start time + START_TIME=$(date +%s) + # Download and extract with progress using pigz + echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" + echo -e "📥 Starting download and extraction..." + if curl -sSL "$DOWNLOAD_URL" | pv -s "$FILE_SIZE" | pigz -dc | tar -x -C "$FLUX_DAEMON_PATH"; then + echo -e "✅ Download and extraction completed successfully." + # Record the end time + END_TIME=$(date +%s) + ELAPSED_TIME=$((END_TIME - START_TIME)) + HOURS=$((ELAPSED_TIME / 3600)) + MINUTES=$(( (ELAPSED_TIME % 3600) / 60 )) + SECONDS=$((ELAPSED_TIME % 60)) + # Print completion message with formatted time + echo -e "⏱️ Download and extraction completed in ${HOURS}h ${MINUTES}m ${SECONDS}s." + else + echo -e "❌ Error: Download or extraction failed." + exit 1 + fi +} + function bootstrap_new() { echo -e "${ARROW} ${YELLOW}Restore daemon chain from bootstrap${NC}" if ! wget --version > /dev/null 2>&1 ; then sudo apt install -y wget > /dev/null 2>&1 && sleep 2 fi + if ! pigz --version > /dev/null 2>&1 ; then + sudo apt install -y pigz > /dev/null 2>&1 && sleep 2 + fi if ! wget --version > /dev/null 2>&1 ; then echo -e "${WORNING} ${CYAN}Wget not installed, operation aborted.. ${NC}" && sleep 1 echo -e "" return fi - Mode="$1" - bootstrap_local - if [[ -f "$FILE_PATH" ]]; then - if [[ "$Mode" != "install" ]]; then - start_service - if [[ -f $FILE_PATH && $FILE_PATH != "" ]]; then - sudo rm -rf $FILE_PATH > /dev/null 2>&1 && sleep 2 - fi - fi + if ! pigz --version > /dev/null 2>&1 ; then + echo -e "${WORNING} ${CYAN}Pigz not installed, operation aborted.. ${NC}" && sleep 1 + echo -e "" return - else - if [[ ! -f $DATA_PATH/install_conf.json ]]; then - bootstrap_manual - if [[ "$Mode" != "install" && "$server_offline" == "0" && $CHOICE == "1)" ]]; then - start_service - if [[ -f $DATA_PATH/$BOOTSTRAP_FILE && $BOOTSTRAP_FILE != "" ]]; then - sudo rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 && sleep 2 - fi - fi - return - fi fi + Mode="$1" + if [[ ! -f $DATA_PATH/install_conf.json ]]; then + bootstrap_manual + if [[ "$Mode" != "install" && "$server_offline" == "0" && $CHOICE == "1)" ]]; then + start_service + fi + return + fi + if [[ "$bootstrap_url" == "0" || "$bootstrap_url" == "" || "$bootstrap_url" == "null" ]]; then cdn_speedtest "0" "6" if [[ "$server_offline" == "1" ]]; then @@ -1933,30 +1956,18 @@ function bootstrap_new() { if [[ "$Mode" != "install" ]]; then stop_service fi - echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - sudo wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" + download_and_unpack else if [[ "$Mode" != "install" ]]; then stop_service fi DOWNLOAD_URL="$bootstrap_url" - echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - sudo wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress - tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" + download_and_unpack fi if [[ "$Mode" != "install" ]]; then start_service fi - - if [[ -z "$bootstrap_zip_del" ]]; then - sudo rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 - else - if [[ "$bootstrap_zip_del" == "1" ]]; then - sudo rm -rf $DATA_PATH/$BOOTSTRAP_FILE > /dev/null 2>&1 - fi - fi } ##### STREAM SECTION @@ -2088,7 +2099,6 @@ stream_chain_locally() { } ###################################################################################################### function bootstrap_manual() { - discover_upnp_nodes "true" if [ $? -eq 0 ]; then CHOICE=$( @@ -2117,13 +2127,10 @@ function bootstrap_manual() { if [[ "$DB_HIGHT" != "" ]]; then echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" fi - echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - sudo wget --tries 5 -O $DATA_PATH/$BOOTSTRAP_FILE $DOWNLOAD_URL -q --show-progress + download_and_unpack if [[ "$Mode" != "install" ]]; then stop_service fi - tar_file_unpack "$DATA_PATH/$BOOTSTRAP_FILE" "$FLUX_DAEMON_PATH" - sleep 1 ;; "2)") if [ -n "$FLUXOS_VERSION" ]; then From 7a130cfb69d7a1765a53a2d6fcedecbaa7102997 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:14:15 +0100 Subject: [PATCH 1144/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index f642586c..ddbbadd0 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2127,10 +2127,10 @@ function bootstrap_manual() { if [[ "$DB_HIGHT" != "" ]]; then echo -e "${ARROW} ${CYAN}Flux daemon bootstrap height: ${GREEN}$DB_HIGHT${NC}" fi - download_and_unpack if [[ "$Mode" != "install" ]]; then stop_service fi + download_and_unpack ;; "2)") if [ -n "$FLUXOS_VERSION" ]; then From a4ddd9438ce33bb823a42720e84fa2c149cc5ac0 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:25:19 +0100 Subject: [PATCH 1145/1176] Minor edit --- flux_common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index ddbbadd0..3e5e8267 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1900,10 +1900,8 @@ function download_and_unpack() { # Record the start time START_TIME=$(date +%s) # Download and extract with progress using pigz - echo -e "${ARROW} ${CAYN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" - echo -e "📥 Starting download and extraction..." + echo -e "${ARROW} ${CYAN}Downloading File: ${GREEN}$DOWNLOAD_URL ${NC}" if curl -sSL "$DOWNLOAD_URL" | pv -s "$FILE_SIZE" | pigz -dc | tar -x -C "$FLUX_DAEMON_PATH"; then - echo -e "✅ Download and extraction completed successfully." # Record the end time END_TIME=$(date +%s) ELAPSED_TIME=$((END_TIME - START_TIME)) @@ -1911,9 +1909,11 @@ function download_and_unpack() { MINUTES=$(( (ELAPSED_TIME % 3600) / 60 )) SECONDS=$((ELAPSED_TIME % 60)) # Print completion message with formatted time - echo -e "⏱️ Download and extraction completed in ${HOURS}h ${MINUTES}m ${SECONDS}s." + echo -e "${ARROW} Download and extraction completed in ${HOURS}h ${MINUTES}m ${SECONDS}s." else echo -e "❌ Error: Download or extraction failed." + clean + echo -e "" exit 1 fi } From e41a51a18aa032638dcb3d33e9ba85a139610a3f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 14:27:53 +0100 Subject: [PATCH 1146/1176] Minor edit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 3e5e8267..3e1cf10a 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1909,7 +1909,7 @@ function download_and_unpack() { MINUTES=$(( (ELAPSED_TIME % 3600) / 60 )) SECONDS=$((ELAPSED_TIME % 60)) # Print completion message with formatted time - echo -e "${ARROW} Download and extraction completed in ${HOURS}h ${MINUTES}m ${SECONDS}s." + echo -e "${ARROW} ${CYAN}Download and extraction completed in ${GREEN}${HOURS}h ${MINUTES}m ${SECONDS}s${NC}" else echo -e "❌ Error: Download or extraction failed." clean From 8cb0c5ee53128b362f25d65c1b53b82f17bc2b7c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:20:14 +0100 Subject: [PATCH 1147/1176] [FIX] Permissions on Arcane --- flux_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 3e1cf10a..e708bff0 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1910,6 +1910,9 @@ function download_and_unpack() { SECONDS=$((ELAPSED_TIME % 60)) # Print completion message with formatted time echo -e "${ARROW} ${CYAN}Download and extraction completed in ${GREEN}${HOURS}h ${MINUTES}m ${SECONDS}s${NC}" + if [[ -n $FLUXOS_VERSION ]]; then + sudo chown -R fluxd:fluxd $FLUX_DAEMON_PATH > /dev/null 2>&1 + fi else echo -e "❌ Error: Download or extraction failed." clean From d41287fcfc4428aef919cf880541f54efff7263f Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:12:56 +0100 Subject: [PATCH 1148/1176] [ADD] dat mount check --- nodeanalizerandfixer.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 10dfe471..5a1a320b 100755 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -198,17 +198,18 @@ if [[ -n $FLUXOS_VERSION ]]; then sudo apt install -y bc > /dev/null 2>&1 && sleep 1 fi echo -e "${NC}" + MOUNT_CHECK=$(df | grep "/dat") BOOT_ID=$(sudo cat /proc/sys/kernel/random/boot_id) LOG_FILE="/var/log/sas.log" LAST_LOG_LINE=$(grep -n "\"boot_id\":\"$BOOT_ID\"" "$LOG_FILE" | grep -E '"level":[5-9][0-9]' | tail -n 1 | cut -d: -f1) - if [[ -n "$LAST_LOG_LINE" ]]; then + if [[ -n "$LAST_LOG_LINE" && $MOUNT_CHECK != "" ]]; then START_LINE=$((LAST_LOG_LINE - 10)) if [[ $START_LINE -lt 1 ]]; then START_LINE=1 fi echo -e "${WORNING} ${CYAN}Flux System Attestation Service (SAS) error detected! ${NC}" echo -e "${PIN} ${CYAN}Log file: /var/log/sas.log ${NC}" - echo -e "${BOOK}Last error and 10 prior entries for the current boot ${NC}" + echo -e "${BOOK} ${CYAN}Last error and 10 prior entries for the current boot ${NC}" echo -e "---------------------------------------------------------------------" sed -n "${START_LINE},${LAST_LOG_LINE}p" "$LOG_FILE" | pino-pretty --colorize --translateTime 'dd-mm-yyyy HH:MM:ss' echo -e "" From 73608d6d4969fec4290c0826a0a733b96e95ef72 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:14:13 +0100 Subject: [PATCH 1149/1176] Minor edit --- nodeanalizerandfixer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeanalizerandfixer.sh b/nodeanalizerandfixer.sh index 5a1a320b..a29ab1b8 100755 --- a/nodeanalizerandfixer.sh +++ b/nodeanalizerandfixer.sh @@ -202,7 +202,7 @@ if [[ -n $FLUXOS_VERSION ]]; then BOOT_ID=$(sudo cat /proc/sys/kernel/random/boot_id) LOG_FILE="/var/log/sas.log" LAST_LOG_LINE=$(grep -n "\"boot_id\":\"$BOOT_ID\"" "$LOG_FILE" | grep -E '"level":[5-9][0-9]' | tail -n 1 | cut -d: -f1) - if [[ -n "$LAST_LOG_LINE" && $MOUNT_CHECK != "" ]]; then + if [[ -n "$LAST_LOG_LINE" && $MOUNT_CHECK == "" ]]; then START_LINE=$((LAST_LOG_LINE - 10)) if [[ $START_LINE -lt 1 ]]; then START_LINE=1 From 1f441b02f828df54a53755f94a50880639b407ad Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:19:22 +0100 Subject: [PATCH 1150/1176] Minor edit --- multitoolbox.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 77aa91fc..df6b409d 100755 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1039,6 +1039,8 @@ case "$REPLY" in ;; 9) if [[ -n $FLUXOS_VERSION ]]; then + clear + sleep 1 echo -e "${GREEN}Module: Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" if [[ -n $FLUXOS_VERSION ]]; then From de7a5a0393e0e2c48bae0267d5fcf106b2a02206 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:21:33 +0100 Subject: [PATCH 1151/1176] Cleanup --- multitoolbox.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index df6b409d..d85eb4f9 100755 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -1043,11 +1043,7 @@ case "$REPLY" in sleep 1 echo -e "${GREEN}Module: Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ -n $FLUXOS_VERSION ]]; then - bash -i "/usr/lib/multitoolbox/hardwarebench.sh" - else - bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/hardwarebench.sh) - fi + bash -i "/usr/lib/multitoolbox/hardwarebench.sh" else clear sleep 1 From 6f87f94a5f69a80174e861eff2fb081a5053828a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 7 Jan 2025 20:53:38 +0100 Subject: [PATCH 1152/1176] benchmark correction --- hardwarebench.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hardwarebench.sh b/hardwarebench.sh index e5ed5f99..be26c629 100755 --- a/hardwarebench.sh +++ b/hardwarebench.sh @@ -91,13 +91,13 @@ else cumulus_ram=7 fi -if [[ "$ram" -ge "$cumulus_ram" ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]]; then +if [[ "$ram" -ge "$cumulus_ram" ]] && [[ "$vcore" -ge 4 ]]; then status="CUMULUS" fi -if [[ "$ram" -ge 30 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]]; then +if [[ "$ram" -ge 30 ]] && [[ "$vcore" -ge 8 ]]; then status="NIMBUS" fi -if [[ "$ram" -ge 61 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]]; then +if [[ "$ram" -ge 61 ]] && [[ "$vcore" -ge 16 ]]; then status="STRATUS" fi if [[ "$status" == "" ]]; then @@ -107,13 +107,13 @@ fi echo -e "| CPU vcores: ${CYAN}${vcore}${NC}" -if [[ "$ram" -ge "$cumulus_ram" ]] && [[ "$core" -ge 2 ]] && [[ "$vcore" -ge 4 ]]; then +if [[ "$ram" -ge "$cumulus_ram" ]] && [[ "$vcore" -ge 4 ]]; then status="CUMULUS" fi -if [[ "$ram" -ge 30 ]] && [[ "$core" -ge 4 ]] && [[ "$vcore" -ge 8 ]]; then +if [[ "$ram" -ge 30 ]] && [[ "$vcore" -ge 8 ]]; then status="NIMBUS" fi -if [[ "$ram" -ge 61 ]] && [[ "$core" -ge 8 ]] && [[ "$vcore" -ge 16 ]]; then +if [[ "$ram" -ge 61 ]] && [[ "$vcore" -ge 16 ]]; then status="STRATUS" fi if [[ "$status" == "" ]]; then @@ -122,7 +122,7 @@ fi if [[ -n $FLUXOS_VERSION ]]; then outputdiskbench="Disk Bench:"; - mount_size=$(LC_ALL=C lsblk -l -b -n | grep 'crypt' | awk '{ if ($7 == "/dat") printf("%.2f\n", $4/(1024*1024*1024))}') + mount_size=$(sudo lvs --units g --nosuffix --noheadings -o lv_size,vg_name | awk '/vg_flux/ {sum += $1} END {print sum}') device_name=$(LC_ALL=C lsblk -l -b -n | grep 'crypt' | grep '/dat' | awk {'printf("%s\n", $1)'}) if [[ "$mount_size" != "" ]]; then mount_path="/dat" From 846bf657b7fb8b9ca96f5fa1f716c8366e289e1d Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:37:29 +0100 Subject: [PATCH 1153/1176] Panel name on top --- log_viewer.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/log_viewer.sh b/log_viewer.sh index becd0b58..641d868c 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -20,7 +20,7 @@ FILES+=( [MongoDB]="/dat/var/log/mongodb/mongod.log" ) -# Cleanup function +# Cleanup function to kill the tmux session and its panes function at_exit() { $TMUX kill-session -t "$SESSION" >/dev/null 2>&1 set -o history @@ -35,8 +35,6 @@ for title in "${!FILES[@]}"; do LOG_FILE="${FILES[$title]}" if [ -f "$LOG_FILE" ]; then MENU_OPTIONS+=("$title" " " ON) - else - echo "Skipping ${title}: File not found (${LOG_FILE})" fi done @@ -73,15 +71,17 @@ fi $TMUX set-option -t "$SESSION" -q mouse on $TMUX set-option -t "$SESSION" -ga terminal-overrides ',xterm*:smcup@:rmcup@' -# Create panes for each selected file +# Create panes for each selected file dynamically +PANE_COUNT=0 for title in "${SELECTED_FILES[@]}"; do LOG_FILE="${FILES[$title]}" echo "Opening pane for: $title ($LOG_FILE)" - if sudo jq empty ${LOG_FILE} > /dev/null 2>&1; then - $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}' | pino-pretty --colorize --translateTime 'dd-mm-yyyy HH:MM:ss'" + if sudo jq empty "$LOG_FILE" > /dev/null 2>&1; then + $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}' | pino-pretty --colorize --translateTime 'dd-mm-yyyy HH:MM:ss'" else - $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}'" + $TMUX split-window -t "$SESSION" "printf '\033]2;%s\033\\' '${title}' ; sudo tail -F '${LOG_FILE}'" fi + PANE_COUNT=$((PANE_COUNT + 1)) $TMUX select-layout -t "$SESSION" "$LAYOUT" done @@ -98,7 +98,7 @@ $TMUX set-window-option -t "$SESSION" -g window-status-current-style fg=brightre # Synchronize panes for uniform control $TMUX set-window-option -t "$SESSION" synchronize-panes on -$TMUX set-option -t "$SESSION" pane-border-status bottom +$TMUX set-option -t "$SESSION" pane-border-status top # Attach to the tmux session $TMUX attach -t "$SESSION" >/dev/null 2>&1 From d19a2778ac1fb7975697f733bacd3bc144e7fe45 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Jan 2025 11:38:47 +0100 Subject: [PATCH 1154/1176] [ADD] UPnP port detection and filtering --- flux_common.sh | 65 +++++++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index e708bff0..6b096f38 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2757,7 +2757,7 @@ function log_rotate() { } #### UPnP function upnp_enable() { - if [[ -d $FLUX_BENCH_PATH ]]; then + if [[ -d $FLUX_BENCH_PATH && $FLUXOS_VERSION == "" ]]; then sudo chown -R $USER:$USER $FLUX_BENCH_PATH > /dev/null 2>&1 fi try="0" @@ -2768,29 +2768,46 @@ function upnp_enable() { echo -e "" return fi - while true - do - echo -e "${ARROW}${CYAN} Checking port validation.....${NC}" - # Check if upnp_port is set - if [[ -z "$upnp_port" ]]; then - FLUX_PORT=$(whiptail --inputbox "Enter your FluxOS port (Ports allowed are: 16127, 16137, 16147, 16157, 16167, 16177, 16187, 16197)" 8 80 3>&1 1>&2 2>&3) - else - FLUX_PORT="$upnp_port" - fi - if [[ $FLUX_PORT == "16127" || $FLUX_PORT == "16137" || $FLUX_PORT == "16147" || $FLUX_PORT == "16157" || $FLUX_PORT == "16167" || $FLUX_PORT == "16177" || $FLUX_PORT == "16187" || $FLUX_PORT == "16197" ]]; then - string_limit_check_mark "Port is valid..........................................." - break - else - string_limit_x_mark "Port $FLUX_PORT is not allowed..............................." - sleep 1 - try=$(($try+1)) - if [[ "$try" -gt "3" ]]; then - echo -e "${WORNING} ${CYAN}You have reached the maximum number of attempts...${NC}" - echo -e "" - exit - fi - fi - done + if [[ -z "$upnp_port" ]]; then + candidate_ports=(16127 16137 16147 16157 16167 16177 16187 16197) + current_mappings=$(upnpc -l 2>/dev/null) + used_ports=() + while IFS= read -r line; do + if echo "$line" | grep -qE "TCP[[:space:]]([0-9]+)->.*'Flux_Backend_API'"; then + if ! echo "$line" | grep -q "Flux_Backend_API_SSL"; then + port=$(echo "$line" | grep -oE "TCP[[:space:]]([0-9]+)" | awk '{print $2}') + used_ports+=("$port") + fi + fi + done <<< "$current_mappings" + + available_ports=() + for port in "${candidate_ports[@]}"; do + if [[ ! " ${used_ports[*]} " =~ " $port " ]]; then + available_ports+=("$port") + fi + done + + if [ ${#available_ports[@]} -eq 0 ]; then + whiptail --title "Error" --msgbox "No free ports are available." 8 50 + exit + fi + radio_list=() + for port in "${available_ports[@]}"; do + radio_list+=("$port" "" OFF) + done + + FLUX_PORT=$(whiptail --title "Select Your FluxOS UPnP Port" --radiolist \ + "Use the UP/DOWN arrows to highlight the port. Press Spacebar to select, THEN press ENTER." 17 50 8 \ + "${radio_list[@]}" 3>&1 1>&2 2>&3) + + if [ $? -ne 0 ]; then + exit + fi + else + FLUX_PORT="$upnp_port" + fi + config_builder "apiport" "$FLUX_PORT" "MultiPort Mode" "fluxos" if [[ ! -d $FLUX_BENCH_PATH ]]; then sudo mkdir -p $FLUX_BENCH_PATH 2>/dev/null From 115b463a217b9dba2956ccf23929a9df81ab6a76 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:08:14 +0100 Subject: [PATCH 1155/1176] Minor edit --- multitoolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index d85eb4f9..3a8b75e8 100755 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -6,7 +6,7 @@ if ! [[ -z $1 ]]; then if [[ $BRANCH_ALREADY_REFERENCED != '1' ]]; then export ROOT_BRANCH="$1" export BRANCH_ALREADY_REFERENCED='1' - if [[ -n "/usr/lib/multitoolbox/multitoolbox.sh" ]]; then + if [[ -f "/usr/lib/multitoolbox/multitoolbox.sh" ]]; then bash -i "/usr/lib/multitoolbox/multitoolbox.sh" else bash -i <(curl -s "https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/$ROOT_BRANCH/multitoolbox.sh") $ROOT_BRANCH $2 From 47be14e7ed1395134b9115efc928863335493228 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:40:10 +0100 Subject: [PATCH 1156/1176] increase sleep --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 6b096f38..ed8d208a 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2892,7 +2892,7 @@ function upnp_enable() { sudo systemctl restart fluxd > /dev/null 2>&1 sudo systemctl restart fluxos > /dev/null 2>&1 fi - sleep 150 + sleep 180 echo -e "${ARROW}${CYAN} Checking FluxOS logs... ${NC}" if [[ -n $FLUXOS_VERSION ]]; then error_check=$(sudo journalctl -u fluxos.service -b -n 25 | grep "Deactivated successfully") From 86dec5a7ec2c7b91093a953a69dcb36cf0c00ee9 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Jan 2025 22:28:31 +0100 Subject: [PATCH 1157/1176] [ADD] miniupnpc install --- flux_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index ed8d208a..189a0745 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1929,6 +1929,9 @@ function bootstrap_new() { if ! pigz --version > /dev/null 2>&1 ; then sudo apt install -y pigz > /dev/null 2>&1 && sleep 2 fi + if ! upnpc -h > /dev/null 2>&1 ; then + sudo apt install -y miniupnpc > /dev/null 2>&1 && sleep 2 + fi if ! wget --version > /dev/null 2>&1 ; then echo -e "${WORNING} ${CYAN}Wget not installed, operation aborted.. ${NC}" && sleep 1 echo -e "" From 04350a703dd61e746c3573128b5a656f0a65bf65 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Jan 2025 22:32:26 +0100 Subject: [PATCH 1158/1176] [ADD] miniupnpc install --- multitoolbox.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3a8b75e8..f506e1cc 100755 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -897,6 +897,10 @@ if ! whiptail -v > /dev/null 2>&1; then sudo apt-get install -y whiptail > /dev/null 2>&1 fi +if ! upnpc -h > /dev/null 2>&1 ; then + sudo apt install -y miniupnpc > /dev/null 2>&1 && sleep 2 +fi + if [[ $(cat /etc/bash.bashrc | grep 'multitoolbox' | wc -l) == "0" && $FLUXOS_VERSION == "" ]]; then echo "alias multitoolbox='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox.sh)'" | sudo tee -a /etc/bash.bashrc echo "alias multitoolbox_testnet='bash -i <(curl -s https://raw.githubusercontent.com/RunOnFlux/fluxnode-multitool/master/multitoolbox_testnet.sh)'" | sudo tee -a /etc/bash.bashrc From 588fa205552495b97db6be9404480a0136312b58 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Jan 2025 22:33:21 +0100 Subject: [PATCH 1159/1176] Minor edit --- flux_common.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 189a0745..ed8d208a 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1929,9 +1929,6 @@ function bootstrap_new() { if ! pigz --version > /dev/null 2>&1 ; then sudo apt install -y pigz > /dev/null 2>&1 && sleep 2 fi - if ! upnpc -h > /dev/null 2>&1 ; then - sudo apt install -y miniupnpc > /dev/null 2>&1 && sleep 2 - fi if ! wget --version > /dev/null 2>&1 ; then echo -e "${WORNING} ${CYAN}Wget not installed, operation aborted.. ${NC}" && sleep 1 echo -e "" From 273dd01c06ca4604fe932038591bb939882a113a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sat, 11 Jan 2025 22:34:57 +0100 Subject: [PATCH 1160/1176] Minor edit --- multitoolbox.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index f506e1cc..3afb3e3e 100755 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -889,10 +889,6 @@ if ! gzip -V > /dev/null 2>&1; then sudo apt-get install -y gzip > /dev/null 2>&1 fi -if ! zip -v > /dev/null 2>&1; then - sudo apt-get install -y zip > /dev/null 2>&1 -fi - if ! whiptail -v > /dev/null 2>&1; then sudo apt-get install -y whiptail > /dev/null 2>&1 fi From 3ca854c1abe74c4fd7ae0bf39f19935ff3383321 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 12 Jan 2025 15:27:40 +0100 Subject: [PATCH 1161/1176] [UPDATE] Allow port selection regardless of usage status --- flux_common.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index ed8d208a..dcf35118 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2771,37 +2771,37 @@ function upnp_enable() { if [[ -z "$upnp_port" ]]; then candidate_ports=(16127 16137 16147 16157 16167 16177 16187 16197) current_mappings=$(upnpc -l 2>/dev/null) + local_ip=$(echo "$current_mappings" | grep -oP 'Local LAN ip address : \K[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+') used_ports=() + used_ports_by_host=() + while IFS= read -r line; do - if echo "$line" | grep -qE "TCP[[:space:]]([0-9]+)->.*'Flux_Backend_API'"; then - if ! echo "$line" | grep -q "Flux_Backend_API_SSL"; then - port=$(echo "$line" | grep -oE "TCP[[:space:]]([0-9]+)" | awk '{print $2}') - used_ports+=("$port") + if echo "$line" | grep -q "TCP "; then + port=$(echo "$line" | sed -n 's/.*TCP \([0-9]\+\)->.*/\1/p') + host=$(echo "$line" | sed -n 's/.*->\([0-9\.]\+\):.*/\1/p') + used_ports+=("$port") + if [[ "$host" == "$local_ip" ]]; then + used_ports_by_host+=("$port") fi fi done <<< "$current_mappings" - available_ports=() + radio_list=() for port in "${candidate_ports[@]}"; do - if [[ ! " ${used_ports[*]} " =~ " $port " ]]; then - available_ports+=("$port") + if [[ " ${used_ports_by_host[*]} " =~ " $port " ]]; then + radio_list+=("$port" "(In Use by Host) " ON) + elif [[ " ${used_ports[*]} " =~ " $port " ]]; then + radio_list+=("$port" "(In Use) " OFF) + else + radio_list+=("$port" "(Available) " OFF) fi done - if [ ${#available_ports[@]} -eq 0 ]; then - whiptail --title "Error" --msgbox "No free ports are available." 8 50 - exit - fi - radio_list=() - for port in "${available_ports[@]}"; do - radio_list+=("$port" "" OFF) - done - FLUX_PORT=$(whiptail --title "Select Your FluxOS UPnP Port" --radiolist \ "Use the UP/DOWN arrows to highlight the port. Press Spacebar to select, THEN press ENTER." 17 50 8 \ "${radio_list[@]}" 3>&1 1>&2 2>&3) - if [ $? -ne 0 ]; then + if [[ $? -ne 0 || -z $FLUX_PORT ]]; then exit fi else From 7e15c6dfe41da626a44e9aae25f18ed37b622556 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 12 Jan 2025 15:33:41 +0100 Subject: [PATCH 1162/1176] Minor edit --- flux_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index dcf35118..80203880 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2802,6 +2802,8 @@ function upnp_enable() { "${radio_list[@]}" 3>&1 1>&2 2>&3) if [[ $? -ne 0 || -z $FLUX_PORT ]]; then + echo -e "${WORNING} ${CYAN}No port selected. Operation aborted.${NC}" + echo -e "" exit fi else From 142a95eec653d1bcfaa8be39fa0c5610ad5a3948 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:51:33 +0100 Subject: [PATCH 1163/1176] [FIX] watchdog log path --- log_viewer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log_viewer.sh b/log_viewer.sh index 641d868c..65836fca 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -12,7 +12,7 @@ LAYOUT="tiled" # Log files and their titles declare -A FILES FILES+=( - [Flux-Watchdog]="/dat/usr/lib/watchdog/watchdog_error.log" + [Flux-Watchdog]="/dat/usr/lib/fluxwatchdog/watchdog_error.log" [Flux-Daemon]="/dat/var/lib/fluxd/debug.log" [Flux-Benchmark]="/dat/usr/lib/fluxbenchd/debug.log" [FluxOS]="/dat/usr/lib/fluxos/debug.log" From 9bac3320dc3cce6052d48b20907d5fe61f1a110a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:13:54 +0100 Subject: [PATCH 1164/1176] [ADD] streamchainpreparation in stream_chain_locally --- flux_common.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flux_common.sh b/flux_common.sh index 80203880..99fbe4c6 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2082,6 +2082,10 @@ stream_chain_locally() { nodes=(${node_map[$tier]}) for node in "${nodes[@]}"; do [ "$silent_mode" != "true" ] && echo -e "📡 Attempting to stream chain from node: $node" + preparation=$(curl -sSL http://${node}/flux/streamchainpreparation | jq -r '.status' 2>/dev/null) + if [ $preparation != "success" ]; then + continue + fi curl -s -X POST "http://${node}/flux/streamchain" | tar -xv -C "$DEST_PATH" if [ $? -eq 0 ]; then [ "$silent_mode" != "true" ] && echo -e "✅ Successfully streamed chain from $node" From 8c3e8bd89d5593f39c321f6164154416dfd7731c Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:31:49 +0100 Subject: [PATCH 1165/1176] [ADD] Syncthing log to log viewer --- log_viewer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/log_viewer.sh b/log_viewer.sh index 65836fca..8c3e75a1 100644 --- a/log_viewer.sh +++ b/log_viewer.sh @@ -18,6 +18,7 @@ FILES+=( [FluxOS]="/dat/usr/lib/fluxos/debug.log" [SAS]="/var/log/sas.log" [MongoDB]="/dat/var/log/mongodb/mongod.log" + [Syncthing]="/dat/var/log/syncthing.log" ) # Cleanup function to kill the tmux session and its panes From baa37af71e259334e15a6453e5476ac3142f594b Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 29 Jan 2025 23:14:19 +0100 Subject: [PATCH 1166/1176] [FIX] Watchdog path for config --- flux_common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 99fbe4c6..03c67ae2 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -79,9 +79,9 @@ fi ##### CONFIGS SECTION ###################################### function watchdog_conf_create(){ - sudo touch $WATCHDOG_PATH/config.js - sudo chown $USER:$USER $WATCHDOG_PATH/config.js - cat <<- EOF >| $WATCHDOG_PATH/config.js + sudo touch $FLUX_WATCHDOG_PATH/config.js + sudo chown $USER:$USER $FLUX_WATCHDOG_PATH/config.js + cat <<- EOF >| $FLUX_WATCHDOG_PATH/config.js module.exports = { label: '${node_label}', tier_eps_min: '${eps_limit}', From 8bc839c136a5a55fa950371140a82ddb1f6e67f7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 1 Jun 2025 12:36:47 +0200 Subject: [PATCH 1167/1176] remove UPNP settings from ArcaneOS --- multitoolbox.sh | 53 ++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 3afb3e3e..7fc5ef62 100755 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -956,10 +956,9 @@ else echo -e "${CYAN}3 - FluxOS Config Management${NC}" echo -e "${CYAN}4 - Restore Flux blockchain from bootstrap${NC}" echo -e "${CYAN}5 - MongoDB Repair Assistant${NC}" - echo -e "${CYAN}6 - Multinode configuration with UPNP communication (Needs Router with UPNP support)${NC}" - echo -e "${CYAN}7 - FluxNode Diagnostics${NC}" - echo -e "${CYAN}8 - Log Viewer${NC}" - echo -e "${CYAN}9 - Hardware benchmark${NC}" + echo -e "${CYAN}6 - FluxNode Diagnostics${NC}" + echo -e "${CYAN}7 - Log Viewer${NC}" + echo -e "${CYAN}8 - Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" fi read -rp "Pick an option and hit ENTER: " @@ -1015,7 +1014,7 @@ case "$REPLY" in if [[ -z $FLUXOS_VERSION ]]; then create_config else - multinode + analyzer_and_fixer fi ;; 7) @@ -1024,8 +1023,7 @@ case "$REPLY" in if [[ -z $FLUXOS_VERSION ]]; then install_flux else - analyzer_and_fixer - echo -e "" + bash -i "/usr/lib/multitoolbox/log_viewer.sh" fi ;; 8) @@ -1034,32 +1032,29 @@ case "$REPLY" in if [[ -z $FLUXOS_VERSION ]]; then daemon_reconfiguration else - bash -i "/usr/lib/multitoolbox/log_viewer.sh" - fi - ;; - 9) - if [[ -n $FLUXOS_VERSION ]]; then - clear - sleep 1 echo -e "${GREEN}Module: Hardware benchmark${NC}" echo -e "${YELLOW}================================================================${NC}" bash -i "/usr/lib/multitoolbox/hardwarebench.sh" - else - clear - sleep 1 - echo -e "${GREEN}Module: Flux Daemon service creator${NC}" + fi + ;; + 9) + if [[ ! -z $FLUXOS_VERSION ]]; then + exit + fi + clear + sleep 1 + echo -e "${GREEN}Module: Flux Daemon service creator${NC}" + echo -e "${YELLOW}================================================================${NC}" + if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then + echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" + echo -e "${CYAN}Please switch to the user account.${NC}" echo -e "${YELLOW}================================================================${NC}" - if [[ "$USER" == "root" || "$USER" == "ubuntu" || "$USER" == "admin" ]]; then - echo -e "${CYAN}You are currently logged in as ${GREEN}$USER${NC}" - echo -e "${CYAN}Please switch to the user account.${NC}" - echo -e "${YELLOW}================================================================${NC}" - echo -e "${NC}" - exit - fi - create_service_scripts - create_service "install" - echo -e "" - fi + echo -e "${NC}" + exit + fi + create_service_scripts + create_service "install" + echo -e "" ;; 10) if [[ ! -z $FLUXOS_VERSION ]]; then From a030c19c8455e08752d4dc2d4411e39994fe9bff Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Jul 2025 14:09:46 +0200 Subject: [PATCH 1168/1176] rename flux-fetch-params.sh --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 03c67ae2..c6141a94 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1236,7 +1236,7 @@ function string_limit_check_mark() { echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" } function integration_check() { - FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params.sh' 'flux-tx' ) + FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'fetch-params.sh' 'flux-tx' ) ELEMENTS=${#FILE_ARRAY[@]} for (( i=0;i<$ELEMENTS;i++)); do string="${FILE_ARRAY[${i}]}......................................" @@ -2584,7 +2584,7 @@ function finalizing() { } function zk_params() { echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" - bash flux-fetch-params.sh > /dev/null 2>&1 && sleep 2 + bash fetch-params.sh > /dev/null 2>&1 && sleep 2 sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 } function flux_package() { From adb448d378e27461d1c04b507d0d87b0e726d6ed Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Jul 2025 14:17:43 +0200 Subject: [PATCH 1169/1176] fix --- flux_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index c6141a94..026affbf 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1236,7 +1236,7 @@ function string_limit_check_mark() { echo -e "${ARROW} ${CYAN}$string[${CHECK_MARK}${CYAN}]${NC}" } function integration_check() { - FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'fetch-params.sh' 'flux-tx' ) + FILE_ARRAY=( 'fluxbench-cli' 'fluxbenchd' 'flux-cli' 'fluxd' 'flux-fetch-params' 'flux-tx' ) ELEMENTS=${#FILE_ARRAY[@]} for (( i=0;i<$ELEMENTS;i++)); do string="${FILE_ARRAY[${i}]}......................................" @@ -2584,7 +2584,7 @@ function finalizing() { } function zk_params() { echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" - bash fetch-params.sh > /dev/null 2>&1 && sleep 2 + bash fetch-params > /dev/null 2>&1 && sleep 2 sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 } function flux_package() { From 91673a04618d810314240da0a37da021a98a9ff8 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Sun, 13 Jul 2025 14:18:31 +0200 Subject: [PATCH 1170/1176] fix name --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 026affbf..bfdcb9ae 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -2584,7 +2584,7 @@ function finalizing() { } function zk_params() { echo -e "${ARROW} ${YELLOW}Installing zkSNARK params...${NC}" - bash fetch-params > /dev/null 2>&1 && sleep 2 + bash flux-fetch-params > /dev/null 2>&1 && sleep 2 sudo chown -R $USER:$USER /home/$USER > /dev/null 2>&1 } function flux_package() { From 6d7f5df2c8104213b6cb75b7ee91153f8934b8b5 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:46:16 +0200 Subject: [PATCH 1171/1176] remove kda address --- install_pro.sh | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/install_pro.sh b/install_pro.sh index bd9edd9a..ce51041e 100755 --- a/install_pro.sh +++ b/install_pro.sh @@ -406,20 +406,7 @@ function create_conf() { echo -e "${ARROW} ${CYAN}Zel ID is not valid try again...........[${X_MARK}${CYAN}]${NC}" sleep 4 fi - done - while true - do - KDA_A=$(whiptail --inputbox "Node tier eligible to receive KDA rewards, what's your KDA address? Nothing else will be required on FluxOS regarding KDA." 8 85 3>&1 1>&2 2>&3) - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - KDA_A="kadena:$KDA_A?chainid=0" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done + done fi } function install_daemon() { From 8dab227f7284d094160a1635f3dc0e244ced16ab Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:51:17 +0200 Subject: [PATCH 1172/1176] Update flux_common.sh --- flux_common.sh | 51 -------------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index bfdcb9ae..9884ebd1 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -117,7 +117,6 @@ module.exports = { initial: { ipaddress: '${WANIP}', zelid: '${ZELID}', - kadena: '${KDA_A}', development: false, blockedPorts: [], testnet: $testnet, @@ -190,7 +189,6 @@ function install_conf_create(){ "outpoint": "${outpoint}", "index": "${index}", "zelid": "${zel_id}", - "kda_address": "${kda_address}", "firewall_disable": "${firewall_disable}", "bootstrap_url": "${bootstrap_url}", "bootstrap_zip_del": "${bootstrap_zip_del}", @@ -611,7 +609,6 @@ function smart_reconfiguration(){ "outpoint": [{"key": "zelnodeoutpoint", "label": "Collateral TX ID"}], "index": [{"key": "zelnodeindex", "label": "Output Index"}], "node_label": [{"key": "label", "label": "Node Label"}], - "kda_address": [{"key": "kadena", "label": "Kadena Address"}], "ping": [{"key": "ping", "label": "Discord Nick Ping"}], "zelflux_update": [{"key": "zelflux_update", "label": "FluxOS Auto Update"}], "zelcash_update": [{"key": "zelcash_update", "label": "Daemon Auto Update"}], @@ -724,11 +721,6 @@ function config_smart_create() { echo -e "${PIN}${CYAN} Flux/SSP ID = ${GREEN}$ZELID${NC}" smart_install_conf "zelid" "$ZELID" "$1" fi - KDA_A=$(grep -w kadena $FLUXOS_PATH/config/userconfig.js | sed -e 's/.*kadena: .//' | sed -e 's/.\{2\}$//') - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" - smart_install_conf "kda_address" "$KDA_A" "$1" - fi upnp_port=$(grep -w apiport $FLUXOS_PATH/config/userconfig.js | grep -o '[[:digit:]]*') if [[ "$upnp_port" != "" ]]; then gateway_ip=$(ip rout | head -n1 | awk '{print $3}' 2>/dev/null) @@ -857,7 +849,6 @@ function manual_build(){ outpoint="" index="" zelid="" - kda_address="" node_label="0" fix_action="1" eps_limit="0" @@ -885,21 +876,6 @@ function manual_build(){ fi done sleep 1 - while true - do - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - KDA_A=$(grep -Eo "^k:[0-9a-z]{64}\b" <<< "$KDA_A") - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - kda_address="kadena:$KDA_A?chainid=0" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - sleep 1 if whiptail --yesno "Would you like enable autoupdate?" 8 65; then zelflux_update='1' zelcash_update='1' @@ -1337,7 +1313,6 @@ function import_config_file() { index=$(cat $DATA_PATH/install_conf.json | jq -r '.index') #FluxOS ZELID=$(cat $DATA_PATH/install_conf.json | jq -r '.zelid') - KDA_A=$(cat $DATA_PATH/install_conf.json | jq -r '.kda_address') #Benchmark thunder=$(cat $DATA_PATH/install_conf.json | jq -r '.thunder') #WatchDog @@ -1629,29 +1604,6 @@ function daemon_reconfiguration(){ spinning_timer echo -e "" && echo -e "" } -function replace_kadena { - if [[ -z "$KDA_A" ]]; then - while true - do - KDA_A=$(whiptail --inputbox "Please enter your Kadena address from Zelcore" 8 85 3>&1 1>&2 2>&3) - KDA_A=$(grep -Eo "^k:[0-9a-z]{64}\b" <<< "$KDA_A") - if [[ "$KDA_A" != "" && "$KDA_A" != *kadena* && "$KDA_A" = *k:* ]]; then - echo -e "${ARROW} ${CYAN}Kadena address is valid.................[${CHECK_MARK}${CYAN}]${NC}" - sleep 2 - break - else - echo -e "${ARROW} ${CYAN}Kadena address is not valid.............[${X_MARK}${CYAN}]${NC}" - sleep 2 - fi - done - fi - kda_address="kadena:$KDA_A?chainid=0" - if [[ $(cat $FLUXOS_PATH/config/userconfig.js | grep "kadena") != "" ]]; then - config_builder "kadena" "$kda_address" "Kadena address" "fluxos" - ##insertAfter "/home/$USER/zelflux/config/userconfig.js" "zelid" " kadena: '$kda_address'," - ##echo -e "${ARROW} ${CYAN}Kadena address set successfully........................[${CHECK_MARK}${CYAN}]${NC}" - fi -} function replace_zelid() { while true do @@ -2435,9 +2387,6 @@ function start_install() { if [[ "$ZELID" != "" ]]; then echo -e "${PIN}${CYAN} Zel ID = ${GREEN}$ZELID${NC}" && sleep 1 fi - if [[ "$KDA_A" != "" ]]; then - echo -e "${PIN}${CYAN} KDA address = ${GREEN}$KDA_A${NC}" && sleep 1 - fi echo -e "" echo -e "${ARROW} ${YELLOW}Watchdog conf settings:${NC}" if [[ "$node_label" != "" && "$node_label" != "0" ]]; then From 56cd7cf8c893008993d3284ac660f220890c2aba Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:54:11 +0200 Subject: [PATCH 1173/1176] Update multitoolbox.sh --- multitoolbox.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multitoolbox.sh b/multitoolbox.sh index 7fc5ef62..d09fe1fa 100755 --- a/multitoolbox.sh +++ b/multitoolbox.sh @@ -68,7 +68,6 @@ function config_file() { outpoint=$(cat $DATA_PATH/install_conf.json | jq -r '.outpoint') index=$(cat $DATA_PATH/install_conf.json | jq -r '.index') zel_id=$(cat $DATA_PATH/install_conf.json | jq -r '.zelid') - kda_address=$(cat $DATA_PATH/install_conf.json | jq -r '.kda_address') upnp_port=$(cat $DATA_PATH/install_conf.json | jq -r '.upnp_port') gateway_ip=$(cat $DATA_PATH/install_conf.json | jq -r '.gateway_ip') upnp_enabled=$(cat $DATA_PATH/install_conf.json | jq -r '.upnp_enabled') @@ -826,7 +825,7 @@ function node_reconfiguration() { import_config_file "silent" get_ip if [[ -d $FLUXOS_PATH ]]; then - if [[ "$KDA_A" != "" && "$ZELID" != "" ]]; then + if [[ "$ZELID" != "" ]]; then echo -e "${ARROW} ${CYAN}Creating FluxOS config file...${NC}" sudo rm -rf $FLUXOS_PATH/config/userconfig.js > /dev/null 2>&1 fluxos_conf_create From 809734b487a92ea4c8c1af596138ee890aea9c7b Mon Sep 17 00:00:00 2001 From: David White <david@runonflux.io> Date: Mon, 8 Dec 2025 11:59:02 +0000 Subject: [PATCH 1174/1176] Follow redirects for speedtest URLs --- cdn-speedtest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cdn-speedtest.sh b/cdn-speedtest.sh index dbdbab06..9ae19630 100755 --- a/cdn-speedtest.sh +++ b/cdn-speedtest.sh @@ -57,9 +57,9 @@ start_test=`date +%s` while [ $i -lt $len ]; do if [[ "$custom_url" == "1" ]]; then - testing=$(curl -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + testing=$(curl -L -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) else - testing=$(curl -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + testing=$(curl -L -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) fi testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') mb=$(bc <<<"scale=2; $testing_size / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') From cc714221b182342f869469b2bdb6d7f8982537f3 Mon Sep 17 00:00:00 2001 From: David White <david@runonflux.io> Date: Mon, 8 Dec 2025 12:10:20 +0000 Subject: [PATCH 1175/1176] Update remaining callsites to follow redirects --- flux_common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flux_common.sh b/flux_common.sh index 9884ebd1..575dee01 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1795,9 +1795,9 @@ function cdn_speedtest() { while [ $i -lt $len ]; do if [[ "$custom_url" == "1" ]]; then - testing=$(curl -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + testing=$(curl -L -m ${dTime} ${rand_by_domain[$i]}${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) else - testing=$(curl -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) + testing=$(curl -L -m ${dTime} http://cdn-${rand_by_domain[$i]}.runonflux.io/apps/fluxshare/getfile/${BOOTSTRAP_FILE} --output testspeed -fail --silent --show-error 2>&1) fi testing_size=$(grep -Po "\d+" <<< "$testing" | paste - - - - | awk '{printf "%d\n",$3}') mb=$(bc <<<"scale=2; $testing_size / 1048576 / $dTime" | awk '{printf "%2.2f\n", $1}') @@ -1844,7 +1844,7 @@ function cdn_speedtest() { } function download_and_unpack() { - FILE_SIZE=$(curl -sI "$DOWNLOAD_URL" | grep -i "content-length" | awk '{print $2}' | tr -d '\r') + FILE_SIZE=$(curl -sSLI "$DOWNLOAD_URL" | grep -i "content-length" | awk '{print $2}' | tr -d '\r') if [ -z "$FILE_SIZE" ]; then echo "⚠️ Unable to retrieve file size. Progress will be approximate." FILE_SIZE=0 From 362e5c381b7589dabe713924b1ea79bbbac88b4f Mon Sep 17 00:00:00 2001 From: TheTrunk <tadeas@runonflux.io> Date: Fri, 12 Dec 2025 06:33:55 +0100 Subject: [PATCH 1176/1176] =?UTF-8?q?fix=20bootstrap=20download=20Note:=20?= =?UTF-8?q?The=20HTTP=20request=20gets=20a=20301=20redirect=20(HTTP=20?= =?UTF-8?q?=E2=86=92=20HTTPS),=20so=20there=20were=20two=20Content-Length?= =?UTF-8?q?=20headers=20in=20the=20response:=201st=20redirect=20response,?= =?UTF-8?q?=202nd=20actual=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flux_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux_common.sh b/flux_common.sh index 575dee01..dade9332 100755 --- a/flux_common.sh +++ b/flux_common.sh @@ -1844,7 +1844,7 @@ function cdn_speedtest() { } function download_and_unpack() { - FILE_SIZE=$(curl -sSLI "$DOWNLOAD_URL" | grep -i "content-length" | awk '{print $2}' | tr -d '\r') + FILE_SIZE=$(curl -sSLI "$DOWNLOAD_URL" | grep -i "content-length" | tail -1 | awk '{print $2}' | tr -d '\r') if [ -z "$FILE_SIZE" ]; then echo "⚠️ Unable to retrieve file size. Progress will be approximate." FILE_SIZE=0