Created
November 3, 2017 22:04
-
-
Save dayne/273bffa4e60215d2945e651455761ed9 to your computer and use it in GitHub Desktop.
a command line launcher for swathviewer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Enable completions | |
# Usage: gina swathviewer | |
# Summary: Downloads and starts swathviewer | |
# Help: Options: | |
# --force-download # force redownload of the client | |
if [ "$1" = "--complete" ]; then | |
echo --force-download | |
exit | |
fi | |
SV=SwathViewer-Latest.jar | |
latest=http://sv.gina.alaska.edu/${SV} | |
cd /tmp | |
if [ -f $SV ]; then | |
echo "found existing SwathViewer download, use --force-download to redownload" | |
if [ "$1" = "--force-download" ]; then | |
rm $SV | |
fi | |
fi | |
if [ ! -f $SV ]; then | |
echo "downloading latest SwathViewer" | |
wget --quiet $latest | |
fi | |
if [ ! -f $SV ]; then | |
echo "download failed" | |
exit | |
fi | |
java=`command -v java` | |
if [ ! -f $java ]; then | |
echo "Unable to find java" | |
exit | |
fi | |
echo "launching" | |
${java} -Xmx512M -jar $SV > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: