Commit 7cee72b3 authored by Paul Cammish's avatar Paul Cammish
Browse files

Initial commit

parents
This is a basic auto-install script which can be used to install *Sympl* with minimal intervention, and point the user to important resources.
#!/bin/bash
if [ $( id -u $(whoami) ) != 0 ]; then
echo "Sorry, this must be run as root."
exit 1
fi
codename=$( lsb_release -c | cut -f 2 )
case "x$1" in
"x") version="$codename";;
"x--testing") version="$codename-testing" ;;
*) echo "Unknown parameter: $1"; exit 1 ;;
esac
echo
echo "-----------------------------------------------------------------------"
echo " Sympl Installer v0.1"
echo "-----------------------------------------------------------------------"
echo
echo "This script will help you install Sympl on a Debian Linux server with minimal"
echo " hassle, and give you some intial pointers."
echo
echo "Installing Sympl from '$version' repository."
if [ "x$(which debconf-set-selections)" = "x" ]; then
echo Installing debconf to set defaults...
apt-get -qq update
apt-get -qq -y install debconf
if [ "x$(which debconf-set-selections)" = "x" ]; then
echo "Unable to set defaults, you will need to install manually, sorry."
exit 0
else
echo "OK"
fi
fi
echo "phpmyadmin phpmyadmin/reconfigure-webserver select apache2" | debconf-set-selections
echo "roundcube-core roundcube/dbconfig-install boolean true" | debconf-set-selections
echo "roundcube-core roundcube/database-type select mysql" | debconf-set-selections
echo "roundcube-core roundcube/mysql/app-pass password" | debconf-set-selections
echo "roundcube-core roundcube/reconfigure-webserver select apache2" | debconf-set-selections
echo -n "Adding repository key..."
wget -qO- http://mirror.mythic-beasts.com/mythic/support@mythic-beasts.com.gpg.key | apt-key add -
if [ "$(find /etc/apt/sources.list.d/ -mindepth 1 -maxdepth 1 -type f -name 'sympl_*.list' | wc -l )" != "0" ]; then
echo -n "Removing previous Sympl repo..."
find /etc/apt/sources.list.d/ -mindepth 1 -maxdepth 1 -type f -name 'sympl_*.list' -delete
echo "OK"
fi
echo -n "Adding repository to apt..."
echo "deb http://packages.mythic-beasts.com/mythic/ $version main" > "/etc/apt/sources.list.d/sympl_$version.list"
echo "OK"
echo -n "Updating apt..."
apt-get -qq update
echo "OK"
echo "Installing Sympl... (this will take a while)"
echo "Starting in 5 seconds - Ctrl-C to cancel!"
sleep 5
apt-get -qq -y install --install-recommends sympl-core
if [ $? != 0 ]; then
echo "Something went wrong. Exiting."
exit 0
fi
clear
echo -n "Thanks for installing..."
/etc/update-motd.d/00-sympl-banner
read -n 1 -p 'Press any key for important information!'
echo "
1. This system now has a system user named 'sympl', which has inherited the
password of the 'root' user.
You should change this password IMMEDIATELY.
Ensure the password is complex as it has access to the whole system.
Consider using SSH Keys where possible.
2. If you need to access MySQL/MariaDB, there a 'sympl' user hase been
created for that purpose.
You can use the 'mysql' command without specifying a username/password.
If you need it, the username is 'sympl', and password is in
/home/sympl/mysql_password, but you should not use this anywhere else,
and instead create individual users as needed.
3. Documentation is at https://wiki.sympl.host.
Help can be found at https://forum.sympl.host.
If yoiu encounter a bug, you can log it at https://bugs.sympl.host.
4. To get started, check http://wiki.sympl.host/Get_Started
Setting new password for 'sympl' user:"
passwd sympl
echo
echo "All done!"
echo
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment