Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tejastank/3dbebad295b9307424ca69253c4139e8 to your computer and use it in GitHub Desktop.
Save tejastank/3dbebad295b9307424ca69253c4139e8 to your computer and use it in GitHub Desktop.
Install Modoboa Webmail Python on OpenSUSE 12.3
#!/bin/bash
## Install Modoboa Webmail Python on OpenSUSE 12.3
## Author: Nilton OS www.linuxpro.com.br
# Check if user has root privileges
if [[ $EUID -ne 0 ]]; then
echo "You must run the script as root or using sudo"
exit 1
fi
SUSE_VERSION=$(cat /etc/issue | awk '{ print $4 }' | head -n1)
## Create user Modoboa
if [[ $SUSE_VERSION == '12.2' ]]; then
groupadd modoboa
useradd -m -g modoboa --system -s /bin/sh -c 'Modoboa' modoboa
else
useradd -m -U --system -s /bin/sh -c 'Modoboa' modoboa
fi
zypper ar http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_${SUSE_VERSION}/ devel_python
zypper --no-gpg-checks refresh
zypper in -y gcc make git-core sudo python-devel libjpeg8-devel python-rrdtool
zypper in -y python-pip python-virtualenv pcre-devel python-imaging python-mysql python-pycrypto
zypper in -y libxml2-devel libxslt-devel zlib-devel mysql-community-server python-lxml
zypper in -y dovecot21-backend-mysql postfix-mysql dovecot21-fts-lucene
/etc/init.d/postfix start
/etc/init.d/dovecot start
/etc/init.d/mysql start
mysql_secure_installation
echo 'CREATE DATABASE modoboa CHARACTER SET utf8;
CREATE USER "modoboa"@"localhost" IDENTIFIED BY "modoboa";
GRANT ALL PRIVILEGES ON modoboa.* TO "modoboa"@"localhost";'| mysql -u root -p123456
cd /home/modoboa
pip install modoboa
modoboa-admin.py deploy webmail --syncdb
cd webmail
python manage.py runserver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment