Skip to content

Commit

Permalink
Introduce of version_script_check
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao-at-decenomy authored May 4, 2023
1 parent c84315c commit 07a01d7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion decenomy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ NC='\033[0m'
ASCII_L="--│█│█"
ASCII_R="│█│█--"
ASCII_LINE="--------------------------------------------------------------"
SCRIPVERSION=v1.0.2
SCRIPVERSION=v1.0.3
SCRIPT_GITHUB=https://api.github.com/repos/decenomy/mnscript/releases/latest
SCRIPT_FILE=`curl -s $SCRIPT_GITHUB | grep "browser_download_url.*decenomy.sh" | cut -d : -f 2,3 | tr -d \" | xargs`
NODEIP=$(curl --fail --retry 3 -s4 icanhazip.com)
Expand All @@ -31,6 +31,8 @@ fi

# Header for menu screen.
header() {
version_script_check
echo
echo -e "${BLUE}${BOLD}
\t\t ██████╗ ███╗ ███╗██╗ ██╗
\t\t ██╔══██╗████╗ ████║╚██╗ ██╔╝
Expand Down Expand Up @@ -2122,6 +2124,14 @@ function wallet_install_check() {
clear
}

# Process for Prompting Information About a New Version of the Script.
function version_script_check() {
LATEST_VERSION=$(curl -s $SCRIPT_GITHUB | grep -oP '(?<="tag_name": ")[^"]+')
if [ "$SCRIPTVERSION" != "$LATEST_VERSION" ]; then
echo -e "${RED}New script version available:${NC} $LATEST_VERSION"
fi
}

# Process to upgrade script version.
function upgrade_script() {
cp decenomy decenomy_old
Expand Down

0 comments on commit 07a01d7

Please sign in to comment.