Skip to content

Instantly share code, notes, and snippets.

@dayne
Created November 3, 2017 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dayne/273bffa4e60215d2945e651455761ed9 to your computer and use it in GitHub Desktop.
Save dayne/273bffa4e60215d2945e651455761ed9 to your computer and use it in GitHub Desktop.
a command line launcher for swathviewer
#!/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
@dayne
Copy link
Author

dayne commented Nov 3, 2017

Usage:

curl https://git.io/vFcXA
chmod +x swathviewer.sh
./swathviewer.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment