Skip to content

Commit

Permalink
Update installer.sh
Browse files Browse the repository at this point in the history
Optimization of the installer script
  • Loading branch information
Fedi6431 authored Jul 5, 2024
1 parent c05f00e commit e576bc2
Showing 1 changed file with 41 additions and 62 deletions.
103 changes: 41 additions & 62 deletions Installer/Linux/installer.sh
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

0 comments on commit e576bc2

Please sign in to comment.