You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
selenium-deb-pkg/download.sh

50 lines
918 B

#!/bin/bash
if ! . ./CONFIG ; then
echo "Error sourcing configuration file CONFIG" >&2
exit 1
fi
# allow overriding via command line
if [ -n "$1" ] ; then
version="$1"
fi
echo "Using selenium version $version (override via file CONFIG)"
if [ -n "$version" ] ; then
jar="selenium-server-standalone-${version}.jar"
else
echo "Error: \$version is unset." >&2
exit 1
fi
create_symlink() {
ln -sf "$jar" selenium-server.jar
}
if [ -r "$jar" ] ; then
echo "File $jar exists already, nothing to do."
create_symlink
exit 0
fi
# release 2.40.0 is available in directory 2.40
minor_version=${version%.[0-9]}
echo "Downloading $jar (might take a while...)"
if wget --no-verbose -O "$jar" "http://selenium-release.storage.googleapis.com/${minor_version}/${jar}" ; then
echo OK
else
echo "ERROR" >&2
exit 1
fi
if ! test -s "$jar" ; then
echo "Empty $jar file." >&2
exit 1
fi
create_symlink