diff options
-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 |