#!/bin/sh #--------------------------------------------------------------------------- # /var/install/bin/pre-setup-services-databases-menu # # Creation: 2017-05-06 hbfl # Last Update: $Id$ # # Copyright (c) 2017-@@YEAR@@ the eisfair team, team(at)eisfair(dot)org # # 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. #--------------------------------------------------------------------------- # create the modules file for databases # that was found in the menu-root from the system # --------------------------------------------------------------------------- # create databases menu # --------------------------------------------------------------------------- create_databases_menu() { menu_files=$(ls -v /var/install/menu/setup.services.databases.*.menu 2>/dev/null | awk -F. '{ print $1"."$2"."$3"."$4"."$NF}' | uniq | sed 's#^\(.*.setup.services.databases.\)\([a-z]*\)\([0-9]*\)\(\..*\)#\2:\3:\1\2\3\4#g' | sort -t: -k1,1 -k2,2n -k3 | cut -d: -f3) { echo '' echo 'database-common' echo 'Database server administration' for menu in ${menu_files} do package_entry="$(grep '' ${menu} | sed 's###g')" menu_entry="$(grep '' ${menu} | sed 's#</*title>##g')" echo "<menu file=\"setup.services.databases.${package_entry}.menu\">${menu_entry}</menu>" done } > ${menu_file} chmod 0640 ${menu_file} } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- main() { menu_file="${4}" create_databases_menu exit 0 } # --------------------------------------------------------------------------- # exec main # --------------------------------------------------------------------------- main "${@}" # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------