#!/bin/bash #--------------------------------------------------------------------------- # /var/install/bin/pre-setup-services-sane-backend-menu # # Creation: 2010-06-03 dr_snuggles # Last update: $Id$ # # Copyright (c) 2010 the eisfair team, team(at)eisfair(dot)org # Copyright (c) 2012-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net # # 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 dynamic menu-file for sane-backend-config # --------------------------------------------------------------------------- # create backend menu entry # --------------------------------------------------------------------------- create_backend_menu_entry() { idx=1 while [ ${idx} -le ${SANE_BACKEND_N} ] do eval backend='${SANE_BACKEND_'${idx}'_NAME}' { echo -n "" } >> ${menu_file} idx=$((${idx} + 1)) done chmod 0640 ${menu_file} } # --------------------------------------------------------------------------- # create backend menu header # --------------------------------------------------------------------------- create_backend_menu_header() { { echo "Sane backend configuration" echo "${package_name}" echo "" echo "" } > ${menu_file} chmod 0640 ${menu_file} } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- main() { package_name="${2}" menu_file="${4}" # include config . /etc/config.d/${package_name} create_backend_menu_header create_backend_menu_entry } # --------------------------------------------------------------------------- # exec main # --------------------------------------------------------------------------- main "${@}" # ---------------------------------------------------------------------------- # end # ----------------------------------------------------------------------------