#!/bin/sh #---------------------------------------------------------------------------------- # /var/install/bin/owncloud-edit - edit owncloud configuration file # # Copyright (c) 2017-2021 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2017-06-26 jed # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------------- pgmname=`basename $0` module_name="`echo "${pgmname}" | cut -d- -f1 | cut -d. -f1`" tmpfile=/var/run/${module_name}-sql-package-list # create list of available MySQL/MariaDB packages { for SERVER in `{ /usr/bin/eisman search --fields=name --installed "mariadb" /usr/bin/eisman search --fields=name --installed "mysql" /usr/bin/eisman search --fields=name --installed "postgresql" } | grep -v "^\-----" | sed 's/^name *//' | grep -E "^mariadb-client$|^mariadb$|^mariadb[0-9]+$|^mysql$|^mysql[0-9]+$|^postgresql[0-9]+$"` do mysql_basedir='' my_path='' my_port='' echo "${SERVER}" | grep -q "^postgresql" if [ $? -ne 0 ] then # MySQL / MariaDB if [ -f /etc/config.d/${SERVER} ] then my_path=`echo ${SERVER} | sed 's|[^[:digit:]]||g'` if [ -n "${my_path}" ] then # load new dynamic configuration . /srv/mysql/defaults.info else # load old, static configuration . /var/lib/mysql/defaults.info fi my_port=`grep "^.*_CONNECT_PORT" /etc/config.d/${SERVER} | sed 's/^.*_CONNECT_PORT=.\([0-9]*\).*$/\1/'` fi fi # mariadb100:3306:/usr/lib/mysql/100/bin: # postgresql96::: echo "${SERVER}:${my_port}:${mysql_basedir}:" done } > ${tmpfile} # edit parameter file /var/install/bin/edit --apply "${module_name}" "Edit ${module_name} services configuration" # remove temporary file rm -f ${tmpfile} exit 0