Skip to content

Instantly share code, notes, and snippets.

@taylor
Created December 9, 2013 01:34
Show Gist options
  • Select an option

  • Save taylor/7866209 to your computer and use it in GitHub Desktop.

Select an option

Save taylor/7866209 to your computer and use it in GitHub Desktop.
#!/bin/bash
osdistro=""
function determine_distro() {
if [ -f /etc/lsb-release ] ; then
DISTRO=$(grep DISTRIB_ID /etc/lsb-release | awk -F= '{print $2}')
elif [ -f /etc/redhat-release ] ; then
if [ $(grep -qi centos /etc/yum.conf ; echo $?) ] ; then
DISTRO="centos"
else
DISTRO="redhat"
fi
else
DISTRO="unknown"
fi
}
determine_distro
if [ "$DISTRO" = "unknown" ] ; then
echo "Distro unknown"
exit 1
fi
ARCH="$(uname -m)"
function base_install() {
case $DISTRO in
centos|redhat)
pkgmgr=yum
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/$ARCH/epel-release-5-4.noarch.rpm
yum groupinstall "Development Tools"
;;
arch)
pkgmgr=pacman
echo "Unsupported distro $DISTRO" ; exit 1
;;
ubuntu|debian)
pkgmgr="apt-get"
apt-get install -y build-essentials
echo "Unsupported distro $DISTRO" ; exit 1
;;
*)
echo "Unsupported distro $DISTRO"
exit 1
;;
esac
}
base_install
case $DISTRO in
centos|redhat)
$pkgmr install -y git vim-enhanced
;;
arch)
echo "Unsupported distro $DISTRO" ; exit 1
;;
ubuntu|debian)
echo "Unsupported distro $DISTRO" ; exit 1
;;
*)
echo "Unsupported distro $DISTRO"
exit 1
;;
esac
echo "Getting tasty configs"
curl -qs -o $HOME/.tmux.conf codecafe.com/taylor/tmux
mkdir $HOME/src
cd $HOME/src
echo "Building tmux from source"
curl -qs https://gist.github.com/taylor/7521521/raw/83c655c89788d3276c994c0dd8bd2eb43ed87146/tmux-source-install.sh | bash -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment