Last active
August 29, 2015 14:00
-
-
Save centminmod/88c3f88bca1e477295b0 to your computer and use it in GitHub Desktop.
Centmin Mod installer.sh using Github repository https://github.com/centminmod/centminmod. Using latest beta branches https://github.com/centminmod/centminmod/branches. To run installer.sh directly type: curl -sL https://gist.github.com/centminmod/88c3f88bca1e477295b0/raw/installer.sh | bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
####################################################### | |
# centminmod.com cli installer | |
# To run installer.sh type: | |
# curl -sL https://gist.github.com/centminmod/88c3f88bca1e477295b0/raw/installer.sh | bash | |
####################################################### | |
branchname=123.07beta21 | |
DOWNLOAD="${branchname}.zip" | |
INSTALLDIR='/usr/local/src' | |
#SCRIPT_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})) | |
####################################################### | |
# | |
DEF=${1:-novalue} | |
if [[ ! -f /usr/bin/bc || ! -f /usr/bin/wget || ! -f /bin/nano || ! -f /usr/bin/unzip ]]; then | |
yum -y install unzip bc wget yum-plugin-fastestmirror | |
fi | |
if [ -f /etc/selinux/config ]; then | |
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config && setenforce 0 | |
fi | |
yumupdater() { | |
yum clean all | |
yum -y update | |
yum -y install expect imake bind-utils readline readline-devel libedit libedit-devel libatomic_ops-devel time yum-downloadonly coreutils autoconf cronie crontabs cronie-anacron nc gcc gcc-c++ automake openssl openssl-devel curl curl-devel openldap openldap-devel libtool make libXext-devel unzip patch sysstat zlib zlib-devel libc-client-devel openssh gd gd-devel pcre pcre-devel flex bison file libgcj gettext gettext-devel e2fsprogs-devel libtool-libs libtool-ltdl-devel libidn libidn-devel krb5-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel libXpm-devel glib2 glib2-devel bzip2 bzip2-devel vim-minimal nano ncurses ncurses-devel e2fsprogs gmp-devel pspell-devel aspell-devel numactl lsof pkgconfig gdbm-devel tk-devel bluez-libs-devel iptables* rrdtool diffutils libc-client libc-client-devel which ImageMagick ImageMagick-devel ImageMagick-c++ ImageMagick-c++-devel perl-ExtUtils-MakeMaker perl-Time-HiRes cyrus-sasl cyrus-sasl-devel strace pam pam-devel cmake libaio libaio-devel libevent libevent-devel git | |
} | |
cminstall() { | |
cd $INSTALLDIR | |
if [[ ! -f "${DOWNLOAD}" ]]; then | |
wget -cnv --no-check-certificate https://github.com/centminmod/centminmod/archive/${DOWNLOAD} --tries=3 | |
rm -rf centminmod-* | |
unzip ${DOWNLOAD} | |
fi | |
cd centminmod-${branchname} | |
chmod +x centmin.sh | |
./centmin.sh install | |
tail -1 /root/centminlogs/centminmod_yumtimes_*.log | |
tail -1 /root/centminlogs/*_install.log | |
if [[ -z $(alias | grep cmdir) ]]; then | |
# setup command shortcut aliases | |
# given the known download location | |
alias cmdir="pushd /usr/local/src/centminmod-${branchname}" | |
alias centmin="pushd /usr/local/src/centminmod-${branchname}; bash centmin.sh" | |
echo "alias cmdir='pushd /usr/local/src/centminmod-${branchname}'" >> /root/.bashrc | |
echo "alias centmin='cd /usr/local/src/centminmod-${branchname}; bash centmin.sh'" >> /root/.bashrc | |
source /root/.bashrc | |
echo | |
echo "Created command shortcuts:" | |
echo "* type cmdir to change to Centmin Mod install directory" | |
echo " at /usr/local/src/centminmod-${branchname}" | |
echo "* type centmin call and run centmin.sh" | |
echo " at /usr/local/src/centminmod-${branchname}/centmin.sh" | |
fi | |
} | |
if [[ "$DEF" = 'novalue' ]]; then | |
cminstall | |
fi | |
case "$1" in | |
install) | |
cminstall | |
;; | |
yumupdate) | |
yumupdater | |
cminstall | |
;; | |
*) | |
if [[ "$DEF" = 'novalue' ]]; then | |
echo | |
else | |
echo "./$0 {install|yumupdate}" | |
fi | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment