diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-01-11 11:41:24 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-01-11 11:41:24 -0200 |
commit | f5553ec0a0a55ad5c147bcf1213942d4b561ecea (patch) | |
tree | 77642e63bab4cfafc814b153dffa90c319244102 /mediawiki-dl | |
parent | 580dba9df805cf3941b18381e8a5c70f9446663f (diff) | |
download | downloaders-f5553ec0a0a55ad5c147bcf1213942d4b561ecea.tar.gz downloaders-f5553ec0a0a55ad5c147bcf1213942d4b561ecea.tar.bz2 |
Version checks at mediawiki-dl
Diffstat (limited to 'mediawiki-dl')
-rwxr-xr-x | mediawiki-dl | 11 |
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 |