#!/bin/sh #---------------------------------------------------------------------------------- # /var/install/bin/capi2text-edit - edit owncloud configuration file # # Copyright (c) 2017-2024 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. #---------------------------------------------------------------------------------- # activate debug output #debug_capi2text=true if ${debug_capi2text:-false} then exec 2> /tmp/$(basename ${0})-trace-$$.log set -x ask_debug=true export ask_debug fi 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 `find /var/install/packages -maxdepth 1 -name 'mariadb-client' -printf '%f\n' -o \ -name 'mariadb' -printf '%f\n' -o -name 'mariadb[0-9]*' -printf '%f\n' -o \ -name 'mysql' -printf '%f\n' -o -name 'mysql[0-9]*' -printf '%f\n'` do mysql_basedir='' my_path='' my_port='' 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 # :mariadb100:3306:/usr/lib/mysql/100/bin: 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