-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimization of the installer script
- Loading branch information
Showing
1 changed file
with
41 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,63 @@ | ||
#!/bin/bash | ||
|
||
banner="What are you using: | ||
1) Linux | ||
2) Termux | ||
" | ||
echo "$banner" | ||
read -p "--> " usr_ch | ||
|
||
if [[ $usr_ch = 1 ]]; then | ||
username=$USER | ||
sudo apt update -y | ||
sudo apt upgrade -y | ||
sudo apt autoremove -y | ||
# Install OpenJDK and git | ||
sudo apt install openjdk -y | ||
sudo apt install git | ||
sudo apt install openjdk git -y | ||
java -version | ||
cd /home/$username/desktop | ||
cd /home/$username/desktop && cat > installer.sh <<EOF | ||
while : | ||
do | ||
echo -e "Select option\n1) Install\n2) Update\n3) Remove\n4) Close" | ||
read -p "--> " user_choice | ||
if [ "\$user_choice" = 1 ]; then | ||
git clone https://github.com/Fedi6431/LHE-Local_Host_Executer.git | ||
echo -e "\\nLHE installed successfully!\\n" | ||
elif [ "\$user_choice" = 2 ]; then | ||
rm -rfv LHE-Local_Host_Executer | ||
echo -e "\\nRemoved old LHE-Local_Host_Executer\\n" | ||
git clone https://github.com/Fedi6431/LHE-Local_Host_Executer.git | ||
echo -e "\\nUpdated git LHE-Local_Host_Executer!\\n" | ||
elif [ "\$user_choice" = 3 ]; then | ||
rm -rfv LHE-Local_Host_Executer | ||
echo -e "\\nRemoved LHE-Local_Host_Executer successfully!\\n" | ||
elif [ "\$user_choice" = 4 ]; then | ||
echo -e "\\nThanks for using Fedi6431's LHE installer\\n" | ||
break | ||
else | ||
echo -e "\\nWrong option\\n" | ||
fi | ||
read -p "Press Enter to continue" | ||
clear | ||
done | ||
EOF | ||
clear | ||
chmod +x installer.sh | ||
./installer.sh | ||
cd /home/$username/desktop || exit | ||
elif [[ $usr_ch = 2 ]]; then | ||
pkg update -y | ||
apt upgrade -y | ||
apt autoremove -y | ||
pkg install openjdk | ||
pkg install git | ||
pkg install openjdk git | ||
java -version | ||
cd ~ | ||
cat > installer.sh <<EOF | ||
while : | ||
do | ||
echo -e "Select option\n1) Install\n2) Update\n3) Remove\n4) Close" | ||
read -p "--> " user_choice | ||
if [ "\$user_choice" = 1 ]; then | ||
cd ~ || exit | ||
else | ||
echo "Invalid choice. Exiting." | ||
exit 1 | ||
fi | ||
|
||
cat > installer.sh <<EOF | ||
while true; do | ||
echo -e "Select option\n1) Install\n2) Update\n3) Remove\n4) Close" | ||
read -p "--> " user_choice | ||
case \$user_choice in | ||
1) | ||
git clone https://github.com/Fedi6431/LHE-Local_Host_Executer.git | ||
echo -e "\\nLHE installed successfully!\\n" | ||
elif [ "\$user_choice" = 2 ]; then | ||
rm -rfv LHE-Local_Host_Executer | ||
echo -e "\\nRemoved old LHE-Local_Host_Executer\\n" | ||
git clone https://github.com/Fedi6431/LHE-Local_Host_Executer.git | ||
echo -e "\\nUpdated git LHE-Local_Host_Executer!\\n" | ||
elif [ "\$user_choice" = 3 ]; then | ||
rm -rfv LHE-Local_Host_Executer | ||
echo -e "\\nRemoved LHE-Local_Host_Executer successfully!\\n" | ||
elif [ "\$user_choice" = 4 ]; then | ||
echo -e "\\nThanks for using Fedi6431's LHE installer\\n" | ||
break | ||
else | ||
;; | ||
2) | ||
rm -rfv LHE-Local_Host_Executer | ||
echo -e "\\nRemoved old LHE-Local_Host_Executer\\n" | ||
git clone https://github.com/Fedi6431/LHE-Local_Host_Executer.git | ||
echo -e "\\nUpdated git LHE-Local_Host_Executer!\\n" | ||
;; | ||
3) | ||
rm -rfv LHE-Local_Host_Executer | ||
echo -e "\\nRemoved LHE-Local_Host_Executer successfully!\\n" | ||
;; | ||
4) | ||
echo -e "\\nThanks for using Fedi6431's LHE installer\\n" | ||
break | ||
;; | ||
*) | ||
echo -e "\\nWrong option\\n" | ||
fi | ||
read -p "Press Enter to continue" | ||
clear | ||
done | ||
EOF | ||
;; | ||
esac | ||
read -p "Press Enter to continue" | ||
clear | ||
chmod +x installer.sh | ||
./installer.sh | ||
fi | ||
done | ||
EOF | ||
|
||
chmod +x installer.sh | ||
./installer.sh |