swh:1:snp:79c9132b4a8931e989e318225e00e088ef6f383d
Raw File
Tip revision: a8fa8f03b50a72034009439908f1339f4ce94518 authored by Ron Burkey on 06 June 2021, 12:28:21 UTC
Fixed more hyperlinks.
Tip revision: a8fa8f0
UpdateVirtualAGC
#!/bin/bash
# This script tries to update to the latest version of VirtualAGC.
echo ""
echo ""

NAME=`wget -O - https://www.ibiblio.org/apollo/Downloads 2>/dev/null | grep 'VirtualAGC[-]Ubuntu[-]14[.]04[-]32' | sed -e 's/.*href=\"//' -e 's/\".*//' | sort | tail -n 1`
if [[ "$NAME" =~ VirtualAGC.*xz ]]
then
	echo "Download and install to $NAME?   "
	echo "The $HOME/VirtualAGC folder will be completely replaced if so."
	if read -p "Enter YES if you want to do this:   " && [[ "$REPLY" == "YES" ]]
	then
		echo "Killing running instances of VirtualAGC ..."
		killall VirtualAGC
		cd ~
		echo "Removing old VirtualAGC installation ..."
		rm VirtualAGC -rf
		rm $NAME
		echo "Downloading update ..."
		if wget -O - "https://www.ibiblio.org/apollo/Downloads/$NAME" >$NAME
		then
			echo "Unpacking the update ..."
			tar -xJf $NAME
			echo "Sanity check of the new VirtualAGC folder ..."
			if [[ ! -d VirtualAGC/bin || ! -d VirtualAGC/Resources ]]
			then
				echo "The new VirtualAGC folder doesn't seem to have the correct contents."
				echo "There must have been an error of some kind."
			fi
		else
			echo "Unable to download https://www.ibiblio.org/apollo/Downloads/$NAME"
		fi
	else
		echo "Cancelled by user."
	fi
else
	echo "No downloadable update found."
fi
read -p "Hit ENTER to close this window."


back to top