add postinstall.sh

This commit is contained in:
Guobao Jiang 2014-02-12 14:10:55 +08:00
parent 760d0b80d6
commit 4fe27fd1cc
3 changed files with 49 additions and 2 deletions

20
vagrant/postinstall.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
################################################################
# NAME
# postinstall.sh post install some sw and configure after
# vagrant virtual machine installed for ubuntu
# NOTE
# the base box is ubuntu 12.04 lts, which is download from
#
################################################################
echo "postinstall start."
VAGRANTPATH="/vagrant"
# change source list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
cp ${VAGRANTPATH}/sources.list /etc/apt/
sudo apt-get update
# install some necessary sowftware
sudo apt-get install -y emacs zsh

View File

@ -1,2 +1,7 @@
echo "abcd" >> abcd.txt
echo "$ifconfig" >> abcd.txt
echo "begin posinstall.sh" >> pos.log
echo "`date`" >> pos.log
echo "---------------------------" >> pos.log
/bin/bash /vagrant/postinstall.sh >> pos.log 2>&1
echo "---------------------------" >> pos.log
echo "finish posinstall.sh" >> pos.log
echo "`date`" >> pos.log

22
vagrant/sources.list Normal file
View File

@ -0,0 +1,22 @@
deb http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ precise-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ precise-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ precise-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-updates universe main multiverse restricted
deb http://ftp.sjtu.edu.cn/ubuntu/ precise main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu-cn/ precise main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe