Page 1 of 1

Bash install script.

Posted: Mon Feb 12, 2018 3:34 am
by djdole
Thought I'd share a bash script I threw together years ago.
It's current as of 1.12.0.
When run, it will download 1.12.0, and proceed to run through the setup steps on the forums install page.
Alternatively the user can pass in whatever version number they wish, and that version will be downloaded and installed.
The user will still need to scroll through the eula, and manually type 'yes' to agree.

Code: Select all

#!/bin/bash
sh_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
script="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
script=${script/"./"/""}
app=$(basename "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )")

if [ $# -eq 0 ]
then
  echo "No arguments supplied"
  version=1.12.0
else
  version=$1
fi

bin_file=makemkv-bin-$version
oss_file=makemkv-oss-$version

if [ "$EUID" -ne 0 ]
  then echo "$script must be run as root"
  exit
fi

echo Intalling $app prereqs...
apt-get -y install build-essential pkg-config libc6-dev libssl-dev libexpat1-dev libavcodec-dev libg$

  echo Intalling makemkv-oss...
  echo   Downloading $oss_file
    pushd /tmp
    wget http://www.makemkv.com/download/$oss_file.tar.gz
  echo   Unzipping $oss_file.tar.gz
    gunzip -f $oss_file.tar.gz
    tar -xvf $oss_file.tar
  echo   Making $oss_file
    cd $oss_file
    ./configure
    make
  echo   Installing $oss_file
    make install
  popd

  echo Intalling makemkv-bin...
  echo   Downloading $bin_file
    pushd /tmp
    wget http://www.makemkv.com/download/$bin_file.tar.gz
  echo   Unzipping $bin_file.tar.gz
    gunzip -f $bin_file.tar.gz
    tar -xvf $bin_file.tar
  echo   Making $bin_file
    cd $bin_file
    make
  echo   Installing $bin_file
    make install
  popd