#!/bin/bash ############################################################################### # # Illumina BaseMount Installer # Copyright 2021 # Script Version 0.3.0 # ############################################################################### # # BaseMount setup script set -e INV="\033[7m" BRN="\033[33m" RED="\033[31m" END="\033[0m\033[27m" function prf() { printf "$1$END\n" } function on_error() { printf "$RED It looks like you had an issue trying to install BaseMount. Troubleshooting and basic usage information for BaseMount are available at: https://basemount.basespace.illumina.com $END" } trap on_error ERR if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" 1>&2 exit 1 fi if [ -z "$1" ] then #echo "Using production bintray repo" credential="" repoPrefix="" else echo "INFO: Using test bintray repo" credential="basespace-devs:$1@" repoPrefix="Test-" fi # OS/Distro Detection if [ -f /etc/debian_version ]; then OS=Debian elif [ -f /etc/redhat-release ]; then OS=RedHat elif [ -f /etc/system-release ]; then OS=`cut -d " " -f 1 /etc/system-release` elif [ -f /etc/lsb-release ]; then . /etc/lsb-release OS=$DISTRIB_ID else OS=$(uname -s) fi prf "" prf "Welcome to BaseMount setup for $OS" prf "" sleep 2 if [ $OS = Debian ]; then prf "" prf "* Adding BaseMount repository" echo "# Packages by Illumina BaseSpace" | tee /etc/apt/sources.list.d/basemount.list echo "deb [arch=amd64 trusted=yes target=Packages] https://basemount-prod.s3.amazonaws.com/ ubuntu main" | tee -a /etc/apt/sources.list.d/basemount.list prf "" prf "* Removing deprecated BSFS plugin repository" rm -f /etc/apt/sources.list.d/basespacefs.list prf "" prf "* Updating apt sources" apt-get update || echo "Warning: apt-get update had a few warnings" prf "" prf "* Installing BaseMount" apt-get install basemount -y elif [ $OS = RedHat -o $OS = Amazon ]; then prf "" prf "* Removing old BaseMount Yum repositories from /etc/yum.repos.d/" rm -f /etc/yum.repos.d/bintray-basespace-BaseMount-RPM.repo rm -f /etc/yum.repos.d/bintray-basespace-BaseSpaceFS-RPM.repo prf "" prf "* Checking bash-completion package" if ! yum -y install bash-completion ; then curl -o /tmp/bash-completion-20060301-1.noarch.rpm http://s3.amazonaws.com/basemount-early-access/bash-completion-20060301-1.noarch.rpm rpm -ivh /tmp/bash-completion-20060301-1.noarch.rpm rm -f /tmp/bash-completion-20060301-1.noarch.rpm fi prf "" prf "* Installing BaseMount" sudo yum install -y http://basemount-prod.s3.amazonaws.com/basemount-latest.x86_64.rpm else prf "* Sorry, BaseMount does not currently support this linux distribution: $OS" exit 1 fi prf "" prf "=== BaseMount successfully installed ===" prf "" prf "Optional: Refresh bash auto-completion for current user with \"exec bash\" (or log out and back in)" prf "" prf "* You are now ready to use BaseMount. Please run \"basemount \"" prf "* Type \"/usr/local/bin/basemount --help\" for help." prf ""