Skip to content

Instantly share code, notes, and snippets.

@chicks
Created September 12, 2012 20:53
Show Gist options
  • Save chicks/3709839 to your computer and use it in GitHub Desktop.
Save chicks/3709839 to your computer and use it in GitHub Desktop.
SugarCRM on SLES Baseline Cheat Sheet
#! /bin/bash
pkg=../pkg/sugarshell-SLES-6.2.1.tar.gz
host=$1
key=../files/ibmcloud_imagebuilder_rsa
user=idcuser
ssh="ssh -i $key $user@$host"
chkconfig=/sbin/chkconfig
service=/sbin/service
perl=/usr/bin/perl
function cmd() {
echo $ssh $1
$ssh $1
}
[[ -n "$1" ]] || { echo "Usage: $0 <ip address>"; exit 0 ; }
# fix idcuser's path
$ssh 'echo "export PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH" >> ~/.profile'
# disable cups
cmd "sudo $chkconfig cups off"
cmd "sudo $service cups stop"
# disable rpcbind
cmd "sudo $chkconfig rpcbind off"
cmd "sudo $service rpcbind stop"
# enable mysql
cmd "sudo $chkconfig mysql on"
cmd "sudo $service mysql start"
# enable httpd
cmd "sudo $chkconfig apache2 on"
cmd "sudo $service apache2 start"
# install packages
cmd "sudo zypper --non-interactive in php5 php5-mysql apache2-mod_php5 php5-mbstring"
# open http on firewall
cmd "sudo /sbin/SuSEfirewall2 open EXT TCP ssh"
cmd "sudo /sbin/SuSEfirewall2 open EXT TCP http"
cmd "sudo /sbin/SuSEfirewall2 open EXT TCP https"
cmd "sudo /sbin/rcSuSEfirewall2 restart"
cd ..
make all
cd baseline
cat $pkg | $ssh tar zxvf -
# Install the login message
cmd "echo 'cat ~/files/first_login' >> ~/.bashrc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment