ubuntu stock kernel + rbenv

by pogodan
3 deployments · 0 still active · last rev. 5 years ago

switches to ubuntu stock kernel (requires linode config changes) then installs RVM

Compatible with: No distros currently supported
						#!/bin/bash
touch /root/.stackscript_status
exec &>> /root/stackscript.log

if [ ! -f /root/updated_kernel.txt ]
  then
  
  export DEBIAN_FRONTEND=noninteractive
  apt-get -y update
  apt-get -y upgrade
  apt-get install -y linux-virtual
  apt-get purge -y grub2 grub-pc
  apt-get install -y grub
  mkdir -p /boot/grub
  update-grub -y

  # update grub menu.lst
  wget 'https://gist.github.com/1182173' -O /boot/grub/menu.lst

  update-grub -y
  touch /root/updated_kernel.txt

  shutdown now
fi

if [ ! -f ~/.rbenv/versions/ruby-1.9.2-p290/bin/bundle ]
  then
  
  echo "[`date`] installing core system stuff" >> /root/.stackscript_status
  apt-get -y install linux-headers-generic build-essential zlib1g-dev libssl-dev libreadline5-dev git-core curl
  apt-get clean

  git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
  echo -e 'export PATH="$HOME/.rbenv/bin:$PATH"\neval "$(rbenv init -)"' > ~/.bash_profile

  echo "[`date`] compile 1.9.2 for `whoami`" >> ~/.stackscript_status
  cd /root
  git clone git://github.com/sstephenson/ruby-build.git
  cd ruby-build
  ./install.sh
  ruby-build 1.9.2-p290 ~/.rbenv/versions/ruby-1.9.2-p290

  bash -l -c 'rbenv global ruby-1.9.2-p290'
  bash -l -c 'rbenv rehash'
  bash -l -c 'gem install bundler -v=1.0.18 --no-ri --no-rdoc'
  bash -l -c 'rbenv rehash'

  echo "[`date`] finished" >> /root/.stackscript_status
fi