Skip to content

Instantly share code, notes, and snippets.

@tokkenno
Last active January 1, 2020 09:16
Show Gist options
  • Select an option

  • Save tokkenno/f93ad3ead2d2a2cddd1a to your computer and use it in GitHub Desktop.

Select an option

Save tokkenno/f93ad3ead2d2a2cddd1a to your computer and use it in GitHub Desktop.
Easy installer for SeaDAS and OCCSW from seadas.gsfc.nasa.gov (For Ubuntu or Debian-like systems)
#!/bin/bash
# Select the modules to install with true/false
INSTALL_AQUARIUS=false
INSTALL_AVHHR=false
INSTALL_CZCS=false
INSTALL_GOCI=false
INSTALL_HICO=false
INSTALL_MERIS=false
INSTALL_MODIS_AQUA=false
INSTALL_MODIS_TERRA=false
INSTALL_MOS=false
INSTALL_OCM1=false
INSTALL_OCM2=false
INSTALL_OCTS=false
INSTALL_OLI=false
INSTALL_OSMI=false
INSTALL_SEAWIFS=false
INSTALL_VIIRSN=false
INSTALL_DIRECT_BROADCAST=false
INSTALL_EVALUATION_SENSOR=false
INSTALL_SOURCES=false
# Program sources
SEADAS_VERSION="7.2"
SEADAS_SRC="http://oceandata.sci.gsfc.nasa.gov/SeaDAS/installer/"$SEADAS_VERSION"/seadas_"$SEADAS_VERSION"_linux64_installer.sh"
OCCSW_SRC="http://oceandata.sci.gsfc.nasa.gov/ocssw/install_ocssw.py"
# Install code. Don't touch this.
CMD="/tmp/occsw.py --install-dir=/opt/seadas-"$SEADAS_VERSION"/ocssw --arch=linux_64 -c"
if [ $INSTALL_AQUARIUS == true ]; then
CMD=$CMD" --aquarius"
fi
if [ $INSTALL_AVHHR == true ]; then
CMD=$CMD" --avhrr"
fi
if [ $INSTALL_CZCS == true ]; then
CMD=$CMD" --cvcs"
fi
if [ $INSTALL_GOCI == true ]; then
CMD=$CMD" --goci"
fi
if [ $INSTALL_HICO == true ]; then
CMD=$CMD" --hico"
fi
if [ $INSTALL_MERIS == true ]; then
CMD=$CMD" --meris"
fi
if [ $INSTALL_MODIS_AQUA == true ]; then
CMD=$CMD" --aqua"
fi
if [ $INSTALL_MODIS_TERRA == true ]; then
CMD=$CMD" --terra"
fi
if [ $INSTALL_MOS == true ]; then
CMD=$CMD" --mos"
fi
if [ $INSTALL_OCM1 == true ]; then
CMD=$CMD" --ocm1"
fi
if [ $INSTALL_OCM2 == true ]; then
CMD=$CMD" --ocm2"
fi
if [ $INSTALL_OCTS == true ]; then
CMD=$CMD" --octs"
fi
if [ $INSTALL_OLI == true ]; then
CMD=$CMD" --oli"
fi
if [ $INSTALL_OSMI == true ]; then
CMD=$CMD" --osmi"
fi
if [ $INSTALL_SEAWIFS == true ]; then
CMD=$CMD" --seawifs"
fi
if [ $INSTALL_VIIRSN == true ]; then
CMD=$CMD" --viirsn"
fi
if [ $INSTALL_DIRECT_BROADCAST == true ]; then
CMD=$CMD" --direct-broadcast"
fi
if [ $INSTALL_EVALUATION_SENSOR == true ]; then
CMD=$CMD" --eval"
fi
if [ $INSTALL_SOURCES == true ]; then
CMD=$CMD" --src"
fi
echo "Actualizando el sistema..."
sudo apt-get update >> /dev/null
sudo apt-get upgrade -y >> /dev/null
echo "Instalando paquetes necesarios..."
sudo apt-get install curl git wget -y >> /dev/null
echo "Descargando SeaDAS..."
wget --output-document=/tmp/seadas.sh --tries=2 $SEADAS_SRC >> /dev/null
echo "Descargando instalador de OCCSW..."
wget --output-document=/tmp/occsw.py --tries=2 $OCCSW_SRC >> /dev/null
sudo chmod u+x /tmp/seadas.sh
sudo chmod u+x /tmp/occsw.py
echo "Instalando SeaDAS..."
sudo /tmp/seadas.sh >> seadas.log
echo "Descargando e instalando OCCSW..."
sudo $CMD >> occsw.log
echo "Instalando variables de entorno..."
sudo chmod -R 777 /opt/seadas-$SEADAS_VERSION
sudo echo -e "\nexport PATH=/opt/seadas-"$SEADAS_VERSION"/bin:$PATH" >> /etc/bash.bashrc
sudo echo -e "\nexport PATH=/opt/seadas-"$SEADAS_VERSION"/bin:$PATH" >> ~/.bashrc
sudo echo -e "\nexport OCSSWROOT=/opt/seadas-"$SEADAS_VERSION"/ocssw" >> /etc/bash.bashrc
sudo echo -e "\nexport OCSSWROOT=/opt/seadas-"$SEADAS_VERSION"/ocssw" >> ~/.bashrc
sudo echo -e "\nsource $OCSSWROOT/OCSSW_bash.env" >> /etc/bash.bashrc
sudo echo -e "\nsource $OCSSWROOT/OCSSW_bash.env" >> ~/.bashrc
echo "Instalación completada"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment