install-common-programs.sh 954 Bytes
Newer Older
1 2
#!/bin/bash
: ${username=$SUDO_USER}
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

function enter_yesno {
    while true ; do
        echo -n "${1} (Y/N)? " 1>&2
         read -n 1 reply
        echo
        case "$reply" in
            Y*|y*) return 0 ;;
            N*|n*) return 1 ;;
        esac
        echo "Invalid input, try again ..." 1>&2
    done
}

# if they want LaTeX, install it
if enter_yesno "Install MacTex?"
then
20 21 22 23
  sudo -u $username /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  sudo -u $username brew tap caskroom/cask
  sudo -u $username brew cask install mactex
  sudo -u $username brew cask install texmaker
24
fi
25 26 27 28 29 30

# if they want Office2016, install it
if enter_yesno "Install Office 2016?"
then
  mkdir it-share
  mount -t smbfs //$admuser@nas01.ist.local/it it-share
31
  installer -pkg it-share/3_Software/02_Microsoft/office2016mac/Microsoft_Office_2016_Volume_Installer.pkg -target /
32 33
  umount it-share
  rm -r it-share
34
fi