Skip to content

Commit

Permalink
Update ipchanger.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
LxaNce-Hacker authored Jul 9, 2023
1 parent 377e736 commit 2fac1c4
Showing 1 changed file with 18 additions and 104 deletions.
122 changes: 18 additions & 104 deletions ipchanger.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
## LxaNce

## Directories
BASE_DIR=$(realpath "$(dirname "$BASH_SOURCE")")


RED="$(printf '\033[31m')" GREEN="$(printf '\033[32m')" ORANGE="$(printf '\033[33m')" BLUE="$(printf '\033[34m')"
MAGENTA="$(printf '\033[35m')" CYAN="$(printf '\033[36m')" WHITE="$(printf '\033[37m')" BLACK="$(printf '\033[30m')"
REDBG="$(printf '\033[41m')" GREENBG="$(printf '\033[42m')" ORANGEBG="$(printf '\033[43m')" BLUEBG="$(printf '\033[44m')"
MAGENTABG="$(printf '\033[45m')" CYANBG="$(printf '\033[46m')" WHITEBG="$(printf '\033[47m')" BLACKBG="$(printf '\033[40m')"
RESETBG="$(printf '\e[0m\n')"

__vrsn__=2

banner(){
clear
cat<<- EOF
Expand All @@ -28,20 +35,19 @@ check_update(){
relase_url='https://api.github.com/repos/LxaNce-Hacker/IP-Changer/releases/latest'
new_version=$(curl -s "${relase_url}" | grep '"tag_name":' | awk -F\" '{print $4}')
tarball_url="https://github.com/LxaNce-Hacker/IP-Changer/archive/refs/tags/${new_version}.tar.gz"

if [[ $new_version != $__vrsn__ ]]; then
echo -ne "${ORANGE}update found\n"${WHITE}
echo -ne "${ORANGE}update found\n"${WHITE} | pv -qL 20
sleep 2
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${ORANGE} Downloading Update..."
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${ORANGE} Downloading Update..." | pv -qL 20
pushd "$HOME" > /dev/null 2>&1
wget "${tarball_url}" -O ".IP-Changer.tar.gz"

if [[ -e ".IP-Changer.tar.gz" ]]; then
tar -xf .IP-Changer.tar.gz -C "$BASE_DIR" --strip-components 1 > /dev/null 2>&1
[ $? -ne 0 ] && { echo -e "\n\n${RED}[${WHITE}!${RED}]${RED} Error occured while extracting."; reset_color; exit 1; }
rm -f .IP-Changer.tar.gz
popd > /dev/null 2>&1
{ sleep 3; clear; banner_small; }
{ sleep 3; clear; banner; }
echo -ne "\n${GREEN}[${WHITE}+${GREEN}] Successfully updated! Run ipchanger again\n\n" | pv -qL 20
{ reset_color ; exit 1; }
else
Expand All @@ -54,6 +60,13 @@ check_update(){
clear
}

## Reset terminal colors
reset_color() {
tput sgr0 # reset attributes
tput op # reset color
return
}

## Check Internet Status
check_status() {
banner;
Expand Down Expand Up @@ -185,105 +198,6 @@ ifconfig $store | grep netmask | pv -qL 20
























## Tool Created By Prince Katiyar

## LxaNce














































































Expand Down

0 comments on commit 2fac1c4

Please sign in to comment.