#!/bin/bash -e # # Take a look # https://www.erlang-solutions.com/downloads/ # # then Look at the download URL, like # href="https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_23.2.3-1~ubuntu~xenial_arm64.deb" # # The version number would be # 23.2.3-1 #----------- # VARIABLES #----------- ERLANG_VERSION=${ERLANG_VERSION-23.2-1} LINUX_DISTRIBUTION=${LINUX_DISTRIBUTION-$(lsb_release -cs)} #----------- # HELPERS #----------- set_env() { KEY=$1 VAL=$2 echo "export $KEY=$VAL" >> $HOME/.bash_aliases } #----------- # INSTALLER #----------- if [ "$(which brew)" == "" ]; then LINUX_DISTRIBUTION=${LINUX_DISTRIBUTION-$(lsb_release -cs)} locale-gen en_US.UTF-8 set_env ERLANG_VERSION $ERLANG_VERSION source $HOME/.bash_aliases apt-get update apt-get install -y wget git build-essential libsctp1 wget https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_${ERLANG_VERSION}~ubuntu~${LINUX_DISTRIBUTION}_amd64.deb dpkg --force-depends -i esl-erlang_${ERLANG_VERSION}~ubuntu~${LINUX_DISTRIBUTION}_amd64.deb else brew install erlang fi