1
0
Fork 0

Updated script to v2.1.0

Changes:
Added Spinners
This commit is contained in:
Rishon Jonathan R 2023-03-08 11:33:41 +05:30
parent f312a6eb27
commit 3d8de27422
1 changed files with 29 additions and 1 deletions

View File

@ -1,5 +1,20 @@
#!/bin/bash #!/bin/bash
RELEASE=$(lsb_release -sr) RELEASE=$(lsb_release -sr)
spin()
{
spinner="/|\\-/|\\-"
while :
do
for i in `seq 0 7`
do
echo -n "${spinner:$i:1}"
echo -en "\010"
sleep 0.1
done
done
}
#Creates Logs #Creates Logs
mkdir ./logs mkdir ./logs
touch ./logs/repoLog.txt touch ./logs/repoLog.txt
@ -7,8 +22,17 @@ touch ./logs/repoLog2.txt
touch ./logs/installLog.txt touch ./logs/installLog.txt
touch ./logs/configLog.txt touch ./logs/configLog.txt
echo "Enabling 32-bit support..." echo "Enabling 32-bit support..."
spin &
SPIN_PID=$!
trap "kill -9 $SPIN_PID" `seq 0 15`
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
kill -9 $SPIN_PID
echo "Adding the repositories..." echo "Adding the repositories..."
spin &
SPIN_PID=$!
trap "kill -9 $SPIN_PID" `seq 0 15`
sudo add-apt-repository universe -y &>> ./logs/repoLog2.txt sudo add-apt-repository universe -y &>> ./logs/repoLog2.txt
{ {
if [ "$RELEASE" = "20.04" ]; then if [ "$RELEASE" = "20.04" ]; then
@ -31,14 +55,18 @@ fi
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo apt update sudo apt update
} &> ./logs/repoLog.txt } &> ./logs/repoLog.txt
kill -9 $SPIN_PID
read -p "Install wine? [Y/n]:" -n 1 -r read -p "Install wine? [Y/n]:" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]] if [[ $REPLY =~ ^[Yy]$ ]]
then then
spin &
SPIN_PID=$!
trap "kill -9 $SPIN_PID" `seq 0 15`
sudo apt install winehq-stable winetricks &> ./logs/installLog.txt sudo apt install winehq-stable winetricks &> ./logs/installLog.txt
winecfg &> ./logs/configLog.txt winecfg &> ./logs/configLog.txt
else else
echo echo
echo "Abort." echo "Abort."
fi fi
echo "The logs can be found at" $(pwd)"/" echo "The logs can be found at" $(pwd)"/"