Zentyal Server

by jpaytoncfd
126 deployments · 24 still active · last rev. 4 years ago

Sets up ethernet interfaces. Addresses can be found in the remote access tab.

Also downloads the rest of the installation script. Located at the home directory of the user orz-install.sh.

Compatible with: Ubuntu 14.04 LTS
# Script Name: Zentyal SBS installer
# Author: Joe Payton
# Version: 0.1 initial build
# This software may not be reproduced without express consent of the Author
#<UDF name="hostname" label="The hostname for the new Linode.">
#<UDF name="fqdn" label="The new Linode's Fully Qualified Domain Name">
#<UDF name="Username" label="The new Linode's UserName">
#<UDF name="Password" label="The new Linode's Password (Type Slowly, Double Check)">

	# Add user
	sudo adduser $USERNAME --gecos  $F_NAME","$L_NAME","0","$PHONE","$PHONE --disabled-password
	echo $USERNAME":"$PASSWORD | sudo chpasswd
	sudo passwd -l root
	# Find IP Address
	IPADDR=$(/sbin/ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://')
	# apt-get update 
	apt-get update
	apt-get upgrade -y
	apt-get purge -y --auto-remove dnsutils bind9-host libbind9-90 bind9-host mtr
	apt-get autoremove
	# add hostname
	echo $HOSTNAME > /etc/hostname
	hostname -F /etc/hostname
	echo $IPADDR $FQDN $HOSTNAME >> /etc/hosts
	DIR1=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
	apt-add-repository 'deb http://archive.zentyal.org/zentyal 4.0 main extra'
	apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 10E239FF
	wget -q http://keys.zentyal.org/zentyal-4.0-archive.asc -O- | sudo apt-key add -
	apt-add-repository 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /'
	wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key -O- | apt-key add -
	cat << EOF > variables.sh
	apt-get update
	apt-get install -y htop mc
	apt-get install -y apache2
	apt-get install -y debconf-utils
	echo mysql-server-5.5 mysql-server/root_password password $PASSWORD | debconf-set-selections
	echo mysql-server-5.5 mysql-server/root_password_again password $PASSWORD | debconf-set-selections
	echo mysql-server-5.5 mysql-server/root_password select $PASSWORD | debconf-set-selections
	echo mysql-server-5.5 mysql-server/root_password_again select $PASSWORD | debconf-set-selections
	apt-get install -y mysql-server-5.5 mysql-client
	sudo apt-get -y install php5 libapache2-mod-php5 php5-mysql php5-ldap ldap-client
	echo "ServerName "$FQDN | tee /etc/apache2/conf-available/fqdn.conf
	a2enconf fqdn
	service apache2 restart

	echo zentyal-core zentyal-core/port string 9443 | debconf-set-selections
	apt-get install -y zentyal
	echo "ifaces_to_ignore = sit,tun,tap,lo,irda,ppp,virbr,vboxnet,vnet,dummy0,gre0,ip6_vti0,ip6gre0,ip6tnl0,ip_vti0,teql0" > /etc/zentyal/network.conf
	wget http://japayton.com/files/orz-install.sh -O /home/$USERNAME/orz-install.sh
	apt-get install -y tofrodos
	fromdos orz-install.sh