mirror of
https://github.com/RasppleII/a2server.git
synced 2025-01-04 23:30:06 +00:00
16e1306dbb
- Added bash check to install.sh - Switched to using top_src instead of a2sSource (not yet in ivan.sh subscripts) - Added processing of -y and -c flags to install.sh ala a2cloud - Put the intro blurb and continue question in install.sh (didn't remove the one from ivan.sh yet as it serves as a useful way to test things about to be in progress and stop after them…) - Added the fixup script, currently empty for a2server, but ohh will that be changing! - Added the show_changes script. It doesn't do a whole lot for a2server just like it doesn't for a2cloud yet. To be addressed. Higher priorities right now. - Fixed a bug where fresh installs would say that upgrading from your version of a2server wasn't supported anymore.
94 lines
3.2 KiB
Bash
Executable File
94 lines
3.2 KiB
Bash
Executable File
#! /bin/bash
|
|
# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh:
|
|
|
|
# setup/index.txt - upgrade path from Ivan's a2server tree
|
|
#
|
|
# Ivan's a2server installed with a single copy-paste of a command line that
|
|
# downloaded a script and ran it sight-unseen. People are going to continue
|
|
# to run that command (they shouldn't, but they will), and we can support
|
|
# them doing it for now.
|
|
|
|
a2sBranch="master"
|
|
a2sScriptURL="https://raw.githubusercontent.com/RasppleII/a2server/${a2sBranch}"
|
|
a2sTarball="https://github.com/RasppleII/a2server/archive/${a2sBranch}.tar.gz"
|
|
|
|
# Set top_src to the location of the source tree if we're running in one
|
|
top_src="$( dirname "${BASH_SOURCE[0]}" )/.."
|
|
if [[ -f "$top_src/.a2server_source" ]]; then
|
|
pushd $top_src >/dev/null
|
|
top_src="$PWD"
|
|
popd >/dev/null
|
|
|
|
cat <<-EOT
|
|
This script exists solely for backward-compatibility with IvanX's a2server
|
|
website and aliases installed by older versions. You appear to have an
|
|
a2server source directory here:
|
|
$top_src
|
|
|
|
Please run ./install.sh in that directory. Thanks!
|
|
|
|
EOT
|
|
exit 1
|
|
fi
|
|
|
|
# Find the version in the install script
|
|
newVersion=$(wget -qO- "${a2sScriptURL}/install.sh" | grep '^a2serverVersion' | cut -d '"' -f 2)
|
|
|
|
# It almost never is, but this script could be run with command line arguments,
|
|
# of which -y we can use, so we should check for it. We'll pass them all to
|
|
# the install script later
|
|
autoAnswerYes=
|
|
for arg in $@; do
|
|
if [[ $arg == "-y" ]]; then
|
|
autoAnswerYes=1
|
|
break
|
|
fi
|
|
done
|
|
|
|
cat <<EOT
|
|
|
|
Hello, you've reached the single wget command version of the a2server install
|
|
script. This script is being phased out for a number of reasons. The most
|
|
important is that it is not repeatable. This script will download things
|
|
behind the scenes, run them without much verification, and then delete what it
|
|
ran, no matter if the installation finished successfully or not. The next
|
|
time you run the same command, you may get a different (hopefully better)
|
|
version.
|
|
|
|
Right now, a2server ${newVersion} is available.
|
|
|
|
If you are seeing this text, iKarith (Joseph Carter) hasn't bothered to write
|
|
publicly-facing end-user documentation for downloading and installing a2server
|
|
a more preferred way. He's filed an issue about this, please do follow the
|
|
instructions there:
|
|
https://github.com/RasppleII/a2server/issues/60
|
|
|
|
For now, this script does what the old installer used to.
|
|
|
|
EOT
|
|
|
|
if [[ ! $autoAnswerYes ]]; then
|
|
printf "Do you want to install a2server with this script? "
|
|
read
|
|
if [[ ${REPLY:0:1} != "y" && ${REPLY:0:1} != "Y" ]]; then
|
|
printf "\nOkay, not installing anything now!\n\n"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
top_src=$(mktemp -d /tmp/a2server.XXXXXXXXXXXX)
|
|
|
|
# Normally tarballs unpack in a subdirectory, but we want it to unpack into
|
|
# $top_src directly (even though the directory has the tarball in it.)
|
|
printf "\na2server: Downloading installer to $top_src.\n"
|
|
wget -O "$top_src/a2server-$a2sBranch.tar.gz" "$a2sTarball"
|
|
tar -C $top_src --strip-components=1 -zxf "$top_src/a2server-${a2sBranch}.tar.gz"
|
|
|
|
# Now we actually run the installer as if we were installing it by hand
|
|
printf "\na2server: Running the installer now.\n"
|
|
"${top_src}/install.sh" "$@"
|
|
|
|
# Clean up and delete the installer we downloaded
|
|
printf "\na2server: Finished with installer, now deleting ${top_src}.\n"
|
|
rm -rf "$top_src"
|