Skip to content

Instantly share code, notes, and snippets.

@neopunisher
Last active October 12, 2015 21:39
Show Gist options
  • Save neopunisher/4091137 to your computer and use it in GitHub Desktop.
Save neopunisher/4091137 to your computer and use it in GitHub Desktop.
Setup a centos with ius
# to autorun: curl -L http://j.mp/iusinstall | sh
ask4 () {
echo -n "$1 [Y]es/[N]o? "
read answer
finish="-1"
while [ "$finish" = '-1' ]
do
finish="1"
if [ "$answer" = '' ];
then
answer=""
else
case $answer in
[Yy]* ) answer="y";;
[Nn]* ) answer="n";;
*) finish="-1";
echo -n 'Please respond with [Y]es/[N]o:';
read answer;;
esac
fi
done
}
cd /usr/local/src/
echo Release:
cat /etc/*-release | head -n1
echo Arch:
uname -a
echo Disk Useage:
df -h
echo Running as:
whoami
RELEASE=`cat /etc/*-release | head -n1 | grep '6.' -c`
ARCH=`uname -a | grep -c x86_64`
if [ "$RELEASE" == "1" ]; then
#echo "You have Centos 6"
if [ "$ARCH" == "1" ]; then
#echo "You have 64 bit arch"
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-11.ius.el6.noarch.rpm
else
#echo "You have i386 bit arch"
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/i386/epel-release-6-5.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/i386/ius-release-1.0-11.ius.el6.noarch.rpm
fi
else
#echo "You have Centos 5"
if [ "$ARCH" == "1" ]; then
#echo "You have 64 bit arch"
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-11.ius.el5.noarch.rpm
else
#echo "You have i386 bit arch"
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-11.ius.el5.noarch.rpm
fi
fi
yum update -y
yum remove -y epel-release
rpm -Uvh epel-release*.rpm ius-release*.rpm
yum install -y yum-plugin-replace nano git curl wget ntp
/sbin/service ntpd start
/sbin/chkconfig ntpd on
ask4 "Install PHP stuff?"
if [ "$answer" == "y" ]; then
yum install -y php php-pear php-cli php-common php-devel php-gd php-mbstring php-mcrypt
yum replace php -y --replace-with php54
/sbin/service httpd restart
/sbin/chkconfig httpd on
ask4 "Update Pear Plugins?"
if [ "$answer" == "y" ]; then
pear upgrade-all
fi
fi
ask4 "Install mySQL stuff?"
if [ "$answer" == "y" ]; then
yum install -y php-mysql php-pdo mysql mysql-libs mysql-server
yum replace mysql -y --replace-with mysql55
/sbin/service mysqld start
/sbin/chkconfig mysqld on
ask4 "Setup mySQL root?"
if [ "$answer" == "y" ]; then
/usr/bin/mysql_secure_installation
fi
fi
ask4 "Install Dev Tools?"
if [ "$answer" == "y" ]; then
yum groupinstall -y "Development Tools"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment