aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-01-11 11:41:24 -0200
committerSilvio Rhatto <rhatto@riseup.net>2016-01-11 11:41:24 -0200
commitf5553ec0a0a55ad5c147bcf1213942d4b561ecea (patch)
tree77642e63bab4cfafc814b153dffa90c319244102
parent580dba9df805cf3941b18381e8a5c70f9446663f (diff)
downloaddownloaders-f5553ec0a0a55ad5c147bcf1213942d4b561ecea.tar.gz
downloaders-f5553ec0a0a55ad5c147bcf1213942d4b561ecea.tar.bz2
Version checks at mediawiki-dl
-rwxr-xr-xmediawiki-dl11
1 files changed, 11 insertions, 0 deletions
diff --git a/mediawiki-dl b/mediawiki-dl
index de595c0..9b75d18 100755
--- a/mediawiki-dl
+++ b/mediawiki-dl
@@ -18,9 +18,13 @@ function mediawiki_deploy {
MAJOR_VERSION="`echo $VERSION | cut -d . --fields=1,2`"
TARBALL="mediawiki-$VERSION.tar.gz"
+ # Version check
if [ -z "$VERSION" ]; then
echo "usage: $BASENAME deploy <version>"
exit 1
+ elif [ -d "mediawiki-$VERSION" ]; then
+ echo "error: mediawiki-$VERSION already installed."
+ exit
fi
$sudo wget $RELEASES/$MAJOR_VERSION/$TARBALL || exit 1
@@ -37,9 +41,16 @@ function mediawiki_upgrade {
OLD_VERSION="$1"
VERSION="$2"
+ # Version check
if [ -z "$VERSION" ]; then
echo "usage: $BASENAME upgrade <old-version> <new-version>"
exit 1
+ elif [ -d "mediawiki-$VERSION" ]; then
+ echo "error: mediawiki-$VERSION already installed."
+ exit
+ elif [ ! -d "mediawiki-$OLD_VERSION" ]; then
+ echo "error: mediawiki-$OLD_VERSION is not installed, aborting."
+ exit 1
fi
# Deploy