4 # check MariaDB or MySQL
 
   5 maria=$(mysql -V |grep MariaDB) || true
 
   7 # check, whether mkrimi user exists
 
   8 if ! mysql -umkrimi -pmkrimi mkrimi -e";"
 
  10         echo "Installation of mkrimi user ..."
 
  11         # unix_socket authentification for MariaDB 10
 
  15 create user mkrimi@localhost identified by 'mkrimi';
 
  16 create database mkrimi;
 
  17 grant all on mkrimi.* to mkrimi@localhost;
 
  20                 echo "Password of mysql root:"
 
  22                 mysql -uroot -p$pw <<END1
 
  23 create user mkrimi@localhost identified by 'mkrimi';
 
  24 create database mkrimi;
 
  25 grant all on mkrimi.* to mkrimi@localhost;
 
  31 if ! mysql -umkrimi -pmkrimi mkrimi -e"select * from medium;" >/dev/null 2>&1
 
  33         echo "Installation of mkrimi schema ..."
 
  34         mysql -umkrimi -pmkrimi mkrimi </usr/share/php/verleihnix/Verleihnix/impl/data/build/sql/schema.sql
 
  37 # Apache configuration
 
  38 sctl=$(which systemctl) || sctl=$(which sysd2sysv) || (echo "install sysd2sysv"; exit 1)
 
  40 # activate verleihnix configuration
 
  41 if ! test -e /etc/apache2/sites-enabled/verleihnix.conf
 
  43         ln -s /etc/apache2/sites-available/verleihnix.conf /etc/apache2/sites-enabled
 
  44         echo "verleihnix-apache2 configration enabled"