1
0
mirror of https://github.com/Z4nzu/hackingtool.git synced 2025-06-20 06:15:54 +02:00

feat: format out put and group commands

- set the trace (set -e)
- format output from tabs to sapces, since it's most verbose
- group installation in oneline preventing bash to run multiple command
This commit is contained in:
sanix-darker
2022-06-26 14:32:07 +02:00
parent f0e80c1339
commit c6796a9e2f

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
set -e
clear clear
BLACK='\e[30m' BLACK='\e[30m'
@ -26,11 +29,8 @@ echo " ███ █▀ ███ █▀ ████████
echo " ▀ ▀ "; echo " ▀ ▀ ";
echo -e "${BLUE} https://github.com/Z4nzu/hackingtool ${NC}" echo -e "${BLUE} https://github.com/Z4nzu/hackingtool ${NC}"
echo -e "${RED} [!] This Tool Must Run As ROOT [!]${NC}\n"
echo -e "${RED} [!] This Tool Must Run As ROOT [!]${NC}" echo -e ${CYAN} "Select Best Option : \n"
echo ""
echo -e ${CYAN} "Select Best Option : "
echo ""
echo -e "${WHITE} [1] Kali Linux / Parrot-Os (apt)" echo -e "${WHITE} [1] Kali Linux / Parrot-Os (apt)"
echo -e "${WHITE} [2] Arch Linux (pacman)" # added arch linux support because of feature request #231 echo -e "${WHITE} [2] Arch Linux (pacman)" # added arch linux support because of feature request #231
echo -e "${WHITE} [0] Exit " echo -e "${WHITE} [0] Exit "
@ -44,13 +44,13 @@ if [ $choice == 1 ] || [ $choice == 2 ]; then
if [[ $? == 0 ]]; then if [[ $? == 0 ]]; then
echo -e ${BLUE}"[✔] Loading ... " echo -e ${BLUE}"[✔] Loading ... "
if [ $choice == 1 ]; then if [ $choice == 1 ]; then
sudo apt-get update && apt-get upgrade sudo apt-get update -y && apt-get upgrade -y
sudo apt-get install python3-pip sudo apt-get install python3-pip -y
elif [ $choice == 2 ]; then # added arch linux support because of feature request #231 elif [ $choice == 2 ]; then # added arch linux support because of feature request #231
sudo pacman -Suy sudo pacman -Suy
sudo pacman -S python-pip sudo pacman -S python-pip yay
sudo pacman -S yay
fi fi
echo "[✔] Checking directories..." echo "[✔] Checking directories..."
if [ -d "$INSTALL_DIR" ]; then if [ -d "$INSTALL_DIR" ]; then
echo "[!] A Directory hackingtool Was Found.. Do You Want To Replace It ? [y/n]:" ; echo "[!] A Directory hackingtool Was Found.. Do You Want To Replace It ? [y/n]:" ;
@ -61,40 +61,31 @@ if [ $choice == 1 ] || [ $choice == 2 ]; then
exit exit
fi fi
fi fi
echo "[✔] Installing ...";
echo ""; echo "[✔] Installing ...\n";
sudo git clone https://github.com/Z4nzu/hackingtool.git "$INSTALL_DIR"; sudo git clone https://github.com/Z4nzu/hackingtool.git "$INSTALL_DIR";
echo "#!/bin/bash echo "#!/bin/bash
python3 $INSTALL_DIR/hackingtool.py" '${1+"$@"}' > hackingtool; python3 $INSTALL_DIR/hackingtool.py" '${1+"$@"}' > hackingtool;
sudo chmod +x hackingtool; sudo chmod +x hackingtool;
sudo cp hackingtool /usr/bin/; sudo cp hackingtool /usr/bin/ && rm hackingtool;
rm hackingtool;
echo ""; echo "\n[✔] Trying to installing Requirements ..."
echo "[✔] Trying to installing Requirements ..."
if [ $choice == 1 ]; then if [ $choice == 1 ]; then
sudo pip3 install lolcat sudo pip3 install lolcat boxes flask requests
sudo apt-get install -y figlet sudo apt-get install -y figlet
sudo pip3 install boxes
sudo apt-get install boxes
sudo pip3 install flask
sudo pip3 install requests
elif [ $choice == 2 ]; then # added arch linux support because of feature request #231 elif [ $choice == 2 ]; then # added arch linux support because of feature request #231
sudo pip3 install lolcat sudo pip3 install lolcat boxes flask requests
sudo pacman -S figlet
sudo pip3 install boxes
yay -S boxes --noconfirm yay -S boxes --noconfirm
sudo pip3 install flask sudo pacman -S figlet
sudo pip3 install requests
fi fi
else else
echo -e $RED "Please Check Your Internet Connection ..!!" echo -e $RED "Please Check Your Internet Connection ..!!"
fi fi
if [ -d "$INSTALL_DIR" ]; then if [ -d "$INSTALL_DIR" ]; then
echo ""; echo "";
echo "[✔] Successfuly Installed !!! "; echo "[✔] Successfuly Installed !!! \n\n";
echo "";
echo "";
echo -e $ORANGE " [+]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+]" echo -e $ORANGE " [+]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+]"
echo " [+] [+]" echo " [+] [+]"
echo -e $ORANGE " [+] ✔✔✔ Now Just Type In Terminal (hackingtool) ✔✔✔ [+]" echo -e $ORANGE " [+] ✔✔✔ Now Just Type In Terminal (hackingtool) ✔✔✔ [+]"