From e24f7072046d7202060e62ffb077759ccb6f240c Mon Sep 17 00:00:00 2001 From: Rishon Jonathan R Date: Thu, 9 Mar 2023 21:40:34 +0530 Subject: [PATCH] Changes to be committed: modified: README.md modified: wine-installer-ubuntu.sh new file: wine-script-updater.sh --- README.md | 3 +-- wine-installer-ubuntu.sh | 19 ++++++++++++++++--- wine-script-updater.sh | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 5 deletions(-) mode change 100755 => 100644 wine-installer-ubuntu.sh create mode 100644 wine-script-updater.sh diff --git a/README.md b/README.md index c625af9..daa1533 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,4 @@ sudo apt install wget wget https://raw.githubusercontent.com/RishonDev/get-wine-latest.sh/main/wine-installer-ubuntu.sh chmod +x wine-installer-ubuntu.sh ./wine-installer-ubuntu.sh -``` - +``` \ No newline at end of file diff --git a/wine-installer-ubuntu.sh b/wine-installer-ubuntu.sh old mode 100755 new mode 100644 index 530e8c8..164f08b --- a/wine-installer-ubuntu.sh +++ b/wine-installer-ubuntu.sh @@ -1,4 +1,16 @@ #!/bin/bash +while getopts ":v:" opt; do + case $opt in + v) + echo "2.1.0" + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + echo "-v Displays the version" + exit 1 + ;; + esac +done RELEASE=$(lsb_release -sr) spin() @@ -21,7 +33,7 @@ touch ./logs/repoLog.txt touch ./logs/repoLog2.txt touch ./logs/installLog.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` @@ -29,7 +41,7 @@ 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` @@ -57,9 +69,10 @@ fi } &> ./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]$ ]] then + echo spin & SPIN_PID=$! trap "kill -9 $SPIN_PID" `seq 0 15` diff --git a/wine-script-updater.sh b/wine-script-updater.sh new file mode 100644 index 0000000..cb455f3 --- /dev/null +++ b/wine-script-updater.sh @@ -0,0 +1,22 @@ +#!/bin/bash +spin() +{ + spinner="/|\\-/|\\-" + while : + do + for i in `seq 0 7` + do + echo -n "${spinner:$i:1}" + echo -en "\010" + sleep 0.1 + done + done +} + +echo "Updating script..." +spin & +SPIN_PID=$! +trap "kill -9 $SPIN_PID" `seq 0 15` +wget https://raw.githubusercontent.com/RishonDev/get-wine-latest.sh/v2.1.0/wine-installer-ubuntu.sh -O ./wine-installer-ubuntu.sh +kill -9 $SPIN_PID +echo "Done." \ No newline at end of file