You've already forked hackingtool
mirror of
https://github.com/Z4nzu/hackingtool.git
synced 2025-06-20 06:15:54 +02:00
[FIX]#Install & Update Script fixed, added gitignore
This commit is contained in:
82
update.sh
82
update.sh
@ -1,3 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
RED='\e[1;31m'
|
||||
GREEN='\e[1;32m'
|
||||
YELLOW='\e[1;33m'
|
||||
BLUE='\e[1;34m'
|
||||
|
||||
echo "███████╗██╗ ██╗███╗ ██╗███████╗██╗ ██╗ ";
|
||||
echo "╚══███╔╝██║ ██║████╗ ██║╚══███╔╝██║ ██║ ";
|
||||
echo " ███╔╝ ███████║██╔██╗ ██║ ███╔╝ ██║ ██║ ";
|
||||
@ -6,48 +13,39 @@ echo "███████╗ ██║██║ ╚████║██
|
||||
echo "╚══════╝ ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═════╝ ";
|
||||
echo " ";
|
||||
|
||||
clear
|
||||
# Check if the script is run as root
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo -e "${RED}[ERROR]\e[0m This script must be run as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo chmod +x /etc/
|
||||
install_dir="/usr/share/hackingtool"
|
||||
# Change to the directory containing the install.sh script
|
||||
cd $install_dir || { echo -e "${RED}[ERROR]\e[0m Could not change to directory containing install.sh."; exit 1; }
|
||||
echo -e "${YELLOW}[*] Checking Internet Connection ..${NC}"
|
||||
echo "";
|
||||
if curl -s -m 10 https://www.google.com > /dev/null || curl -s -m 10 https://www.github.com > /dev/null; then
|
||||
echo -e "${GREEN}[✔] Internet connection is OK [✔]${NC}"
|
||||
echo ""
|
||||
else
|
||||
echo -e "${RED}[✘] Please check your internet connection[✘]"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
echo -e "[*]Marking hackingtool directory as safe-directory"
|
||||
git config --global --add safe.directory $install_dir
|
||||
# Update the repository and the tool itself
|
||||
echo -e "${BLUE}[INFO]\e[0m Updating repository and tool..."
|
||||
if ! sudo git pull; then
|
||||
echo -e "${RED}[ERROR]\e[0m Failed to update repository or tool."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
clear
|
||||
# Re-run the installation script
|
||||
echo -e "${GREEN}[INFO]\e[0m Running installation script..."
|
||||
if ! sudo bash install.sh; then
|
||||
echo -e "${RED}[ERROR]\e[0m Failed to run installation script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo chmod +x /usr/share/doc
|
||||
|
||||
clear
|
||||
|
||||
sudo rm -rf /usr/share/doc/hackingtool/
|
||||
|
||||
clear
|
||||
|
||||
cd /etc/
|
||||
|
||||
clear
|
||||
|
||||
sudo rm -rf /etc/hackingtool
|
||||
|
||||
clear
|
||||
|
||||
mkdir hackingtool
|
||||
|
||||
clear
|
||||
|
||||
cd hackingtool
|
||||
|
||||
clear
|
||||
|
||||
git clone https://github.com/Z4nzu/hackingtool.git
|
||||
|
||||
clear
|
||||
|
||||
cd hackingtool
|
||||
|
||||
clear
|
||||
|
||||
sudo chmod +x install.sh
|
||||
|
||||
clear
|
||||
|
||||
./install.sh
|
||||
|
||||
clear
|
||||
echo -e "${GREEN}[SUCCESS]\e[0m Tool updated successfully."
|
||||
|
Reference in New Issue
Block a user