-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
97 lines (87 loc) · 2.86 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin
#Copyright 2021 KITHACK
#Written by: Adrian Guillermo
#Facebook: https://facebook.com/adrian.guillermo.22
#Github: https://github.com/AdrMXR
#Update KitHack
# colors
red='\e[1;31m'
default='\e[0m'
yellow='\e[0;33m'
orange='\e[38;5;166m'
green='\033[92m'
# location
path=$(pwd)
# Check root
if [ "$(id -u)" != "0" ] > /dev/null 2>&1; then
echo -e '\n$red[x] Este script necesita permisos root.' 1>&2
exit
fi
# Banner
clear
sleep 2
echo -e "$yellow ____ ___ .___ "
echo -e "$yellow | | \______ __| _/____ _/ |_ ____ "
echo -e "$yellow | | /\____ \ / __ |\__ \\ __\/ __ \ "
echo -e "$yellow | | / | |_> > /_/ | / __ \| | \ ___/ "
echo -e "$yellow |______/ | __/\____ |(____ /__| \___ > /\ /\ /\ "
echo -e "$yellow |__| \/ \/ \/ \/ \/ \/ "
echo -e " "
echo -e "$orange Update KitHack v1.3.2 "
echo -e " "
echo -e "$orange By:AdrMXR "
# Check if there is an internet connection
ping -c 1 google.com > /dev/null 2>&1
if [[ "$?" == 0 ]]; then
echo ""
echo -e "$green[✔][Internet Connection]............[ OK ]"
sleep 1.5
else
echo ""
echo -e "$red[!][Internet Connection].........[ NOT FOUND ]"
echo ""
exit
fi
# Creating temporary directory...
if [ -d tools ] && [ -d output ]; then
echo -e "$yellow"
echo -n [*] Creando directorio temporal...= ;
sleep 3 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
echo ""
temp="$HOME/hacktemp"
mkdir "$temp"
mv "$path/output" "$temp/output"
mv "$path/tools" "$temp/tools"
echo ""
echo -e "$green[✔] Done."
sleep 1.5
fi
# Updating KitHack...
echo -e "$yellow"
echo -n [*] Actualizando KitHack desde Github...= ;
sleep 3 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
echo -e "$green"
echo ""
git config --global pull.rebase true
git reset HEAD --hard
git pull origin master
sleep 1.5
# Moving the files in the temporary directory again
if [ -d $HOME/hacktemp ]; then
echo -e "$yellow"
echo -n [*] Moviendo archivos del directorio temporal...= ;
sleep 3 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
echo ""
mv "$temp/output" "$path/output"
mv "$temp/tools" "$path/tools"
rm -rf "$temp"
echo ""
echo -e "$green[✔] Done."
sleep 1.5
fi
# Running installer
echo -e "$yellow"
echo -n [*] Ejecutando instalador...= ;
sleep 3 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
bash install.sh
exit