a2server/scripts/show_changes
T. Joseph Carter 16e1306dbb Cleanups for consistency with a2cloud mostly
- 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.
2018-09-06 13:35:01 -07:00

34 lines
1.2 KiB
Bash
Executable File

#! /bin/bash
# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh:
# show_changes - show a2server version differences
#
# To the extent possible under law, T. Joseph Carter and Ivan Drucker have
# waived all copyright and related or neighboring rights to the a2server
# scripts themselves. Software used or installed by these scripts is subject
# to other licenses. This work is published from the United States.
# Find the path of our source directory
top_src="$( dirname "${BASH_SOURCE[0]}" )/.."
pushd $top_src >/dev/null
top_src="$PWD"
popd >/dev/null
if [[ ! -f "$top_src/.a2server_source" ]]; then
printf "\na2server: cannot find a2server source directory in $top_src.\n\n"
exit 1
fi
newVersion=$(grep '^a2ServerVersion' "$top_src/install.sh" | cut -d '"' -f 2)
if [[ -f /usr/local/etc/A2SERVER-version ]]; then
read installedVersion </usr/local/etc/A2SERVER-version
if [[ $installedVersion != *.*.* ]]; then
# Deal with old three-digit version
installedVersion="${installedVersion:0:1}.${installedVersion:1:1}.${installedVersion:2}"
fi
fi
echo "a2server version available: $newVersion"
echo "a2server version installed: ${installedVersion:-None}"
# FIXME: Do something useful with a changelog perhaps?