dotfiles/bin/software-install.sh

133 lines
3 KiB
Bash
Raw Normal View History

#!/bin/bash
function install_linux_software {
#-------------------------------
# Check the OS and set install command
#-------------------------------
if [ -x "$(which yum)" ]; then
INSTALLCMD="yum install -y"
elif [ -x "$(which apt-get)" ]; then
INSTALLCMD="apt-get install -y"
else
2016-02-18 07:01:05 +00:00
echo "Sorry, I don't know how to install software on this OS yet."
exit 1
fi
#-------------------------------
2016-02-07 18:39:49 +00:00
xargs sudo ${INSTALLCMD} <<-EOF
ack
2016-03-01 10:20:34 +00:00
archey
2016-02-29 11:52:27 +00:00
bash-completion
git
htop
mosh
2016-03-01 10:20:34 +00:00
nmap
2016-03-01 18:59:18 +00:00
p7zip
2016-03-01 10:23:04 +00:00
pv
ss
vim
EOF
}
function install_osx_software {
#-------------------------------
# Install Homebrew if missing
#-------------------------------
if [ ! -x /usr/local/bin/brew ]; then
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
#-------------------------------
#-------------------------------
# Update Brew formulae if older than 24 hours
#-------------------------------
find /usr/local/.git -name FETCH_HEAD -mtime +0 -exec brew update \;
#-------------------------------
#-------------------------------
# Install the basics
#-------------------------------
xargs brew install <<-EOF
ack
2016-03-01 10:20:34 +00:00
archey
2016-02-29 11:52:27 +00:00
bash-completion
git
coreutils
2016-02-16 08:27:02 +00:00
htop-osx
mosh
2016-03-01 10:20:34 +00:00
nmap
2016-03-01 18:59:18 +00:00
p7zip
2016-03-01 10:23:04 +00:00
pv
python3
2016-03-01 10:20:34 +00:00
rename
vim
EOF
#-------------------------------
#-------------------------------
# Install Casks
#-------------------------------
xargs brew cask install <<-EOF
1password
alfred
bbc-iplayer-downloads
beardedspice
bittorrent-sync
2016-03-01 18:56:27 +00:00
cleanmymac
day-o
dropbox
firefox
flux
gitx
gpgtools
google-chrome
google-drive
google-hangouts
handbrake
iterm2
sonos
textmate
vlc
vmware-fusion
wireshark
xquartz
yubikey-neo-manager
yubikey-personalization-gui
EOF
#-------------------------------
2016-02-09 08:30:03 +00:00
#-------------------------------
# Clean up
#-------------------------------
brew cleanup
brew cask cleanup
2016-02-09 08:30:03 +00:00
#-------------------------------
}
echo "#-------------------------------"
echo "# START: $(date)"
echo "#-------------------------------"
#-------------------------------
# Check for Mac OS X
#-------------------------------
if [ $(uname -s) == "Darwin" ]; then
install_osx_software
else
install_linux_software
fi
#-------------------------------
#-------------------------------
# Ensure Vim plugins are up-to-date
#-------------------------------
vim -T dumb +PluginInstall! +PluginClean! +qall 2>/dev/null |\
sed -E s/'\[[0-9]{1,2};[0-9]{1,2}[mKH]'//g
#-------------------------------
echo "#-------------------------------"
echo "# END: $(date)"
echo "#-------------------------------"
exit 0