diff options
author | MartiMcFly | 2016-12-13 01:42:56 +0100 |
---|---|---|
committer | MartiMcFly | 2016-12-13 01:42:56 +0100 |
commit | 7536dae31d5c9584e549594e59e8d65c341e3aa6 (patch) | |
tree | 9b83f7bda615900af58150e6c382294855bcbe0e /install | |
parent | 87a55e9f5b8c37035415a05223f41d9106301e43 (diff) | |
download | aur-7536dae31d5c9584e549594e59e8d65c341e3aa6.tar.gz |
quick full install
Diffstat (limited to 'install')
-rw-r--r-- | install | 126 |
1 files changed, 11 insertions, 115 deletions
@@ -1,12 +1,5 @@ #!/bin/bash -installlog="/tmp/zarafa-install.log" - -function setconf() { - # 1: field / 2: value / 3: file - sed -i "s|^#*\s*\($1\).*|\1 = $2|" $3 -} - # care about existing files function installdir() { local owner="$1" @@ -49,114 +42,17 @@ post_install() { install --backup=simple --suffix .pacsave -o zarafa -g zarafa -m 0600 ${cfg} /etc/zarafa done - # => server.cfg - _mysql_password="$(< /dev/urandom tr -dc A-Za-z0-9 | head -c16)" - setconf "mysql_password" "${_mysql_password}" "/etc/zarafa/server.cfg" - - # => ical.cfg - if [[ -e "/etc/localtime" ]]; - then - setconf "server_timezone" "$(readlink -f /etc/localtime | sed 's|/usr/share/zoneinfo/||' | tr '_' ' ')" "/etc/zarafa/ical.cfg" - fi - - # => presence.cfg - _presence_password="$(< /dev/urandom tr -dc A-Za-z0-9 | head -c16)" - setconf "server_secret_key" "${_presence_password}" "/etc/zarafa/presence.cfg" - - # => optimization - echo "[....] Install optimizations" - /usr/share/doc/zarafa/zarafa-pietma/install-optimization.sh >> $installlog 2>> $installlog - echo "[DONE] Install optimizations" - - # => mysql-database - if [[ ! -e "/.arch-chroot" ]] \ - && [[ -e "/var/lib/mysql" ]] \ - && [[ "$(ls -A /var/lib/mysql)" == "" ]]; - then - echo "[....] Initialize MySQL database" - mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql | tail -n +1 >> $installlog 2>> $installlog - echo "[DONE] Initialize MySQL database" - - echo "[....] Start MySQL database" - systemctl start mysqld >> $installlog 2>> $installlog - echo "[DONE] Start MySQL database" - - echo "[....] Secure MySQL database" - /usr/share/doc/zarafa/zarafa-pietma/install-mysql-secure.sh >> $installlog 2>> $installlog - echo "[DONE] Secure MySQL database" - - echo "[....] Create Zarafa database" - mysql -u root -e "CREATE DATABASE IF NOT EXISTS zarafa;" >> $installlog 2>> $installlog - mysql -u root -e "GRANT ALL PRIVILEGES ON zarafa.* TO zarafa@localhost IDENTIFIED BY '${_mysql_password}';" >> $installlog 2>> $installlog - echo "[DONE] Create Zarafa database" - - echo "[....] Start Zarafa and install database tables (this will take a while >1min)" - systemctl start zarafa-server >> $installlog 2>> $installlog - sleep 60 >> $installlog 2>> $installlog - echo "[DONE] Start Zarafa and install database tables" - - echo "[....] Stop Zarafa and MySQL" - systemctl stop zarafa-server >> $installlog 2>> $installlog - systemctl stop mysqld >> $installlog 2>> $installlog - echo "[DONE] Stop Zarafa and MySQL" - else -cat <<EOF - -Please initialize MySQL: - - $ mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql - -Please secure MySQL: - - $ systemctl start mysqld - $ mysql_secure_installation - -Please create Zarafa database: - - $ mysql -u root -p - mysql> CREATE DATABASE IF NOT EXISTS zarafa; - mysql> GRANT ALL PRIVILEGES ON zarafa.* TO zarafa@localhost IDENTIFIED BY '${_mysql_password}'; - -Please start Zarafa-Server and create database tables - - $ systemctl start zarafa-server - -EOF - fi - - # => ssl-keys / -certificates - if [[ ! -e "/.arch-chroot" ]] \ - && [ ! -e "/etc/ssl/private/zarafa.key" ] \ - && [ ! -e "/etc/ssl/private/zarafa.crt" ] \ - && [ ! -e "/etc/ssl/private/zarafa.dh" ]; - then - echo "[....] Create SSL-Keys/Certificates and trust them (this will take a while >10min)" - /usr/share/doc/zarafa/zarafa-pietma/install-ssl.sh | tail -n +1 >> $installlog 2>> $installlog - echo "[DONE] Create SSL-Keys/Certificates and trust them" - else -cat <<EOF - -Please create SSL-Keys/Certificates and add to trusted - - $ /usr/share/doc/zarafa/zarafa-pietma/install-ssl.sh - -EOF - fi - - -cat <<EOF - -Open The Full Installation Log - - $ cat ${installlog} - -Read More - - https://wiki.archlinux.org/index.php/MySQL - https://pietma.com/run-and-access-zarafa/ - https://pietma.com/optimize-zarafa-and-mysql-mariadb/ - -EOF + echo + echo "Please install Zarafa:" + echo + echo " $ /usr/share/doc/zarafa/install.sh" + echo + echo "Read More" + echo + echo " https://wiki.archlinux.org/index.php/MySQL" + echo " https://pietma.com/run-and-access-zarafa/" + echo " https://pietma.com/optimize-zarafa-and-mysql-mariadb/" + echo return 0 } |