#! /bin/sh #---------------------------------------------------------------------------- # /var/install/bin/system-base-set-menu-style - set menu style # # Creation: 2005-08-06 dv # Last Update: $Id$ # # Copyright (c) 2001-2008 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. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib #---------------------------------------------------------------------------- # main #---------------------------------------------------------------------------- # set page titel clrhome mecho -info "Set eisfair menu style" echo echo # set menu style:executable menu_style="Classic text style:/var/install/bin/show-menu Curses style:/var/install/bin/show-menu.cui" # get current menu executable current_menu_exec=`grep "^MENU=" /etc/config.d/setup | sed "s#^MENU=['\"]##; s/['\"].*$//"` # show current menu style echo -n "Current eisfair menu style: " _OLD_IFS=${IFS} IFS=: # get the display name from current menu executable echo "${menu_style}" | while read _style _menu_exec do if [ "${_menu_exec}" = "${current_menu_exec}" ] then # strip leading spaces _style="`echo "${_style}" | sed 's/^ *//'`" mecho -info "${_style}" else continue fi done # show avialable menu styles techo begin 6r 32* echo echo _idx=1 echo "${menu_style}" | while read _style _menu_exec do # strip leading spaces _style="`echo "${_style}" | sed 's/^ *//'`" techo row "${_idx}." "${_style}" _idx=`expr ${_idx} + 1` done echo echo techo end style_to_work=`/var/install/bin/ask "Select" "" "1-$(echo "${menu_style}" | wc -l)" "^$=Return" "0=Exit"` case "${style_to_work}" in "") IFS=${_OLD_IFS} exit 0 ;; 0) IFS=${_OLD_IFS} exit 127 ;; *) # get the entry to write menu_line="`echo "${menu_style}" | sed -n "${style_to_work}p" | sed 's/^ *//'`" set -- ${menu_line} if [ "${2}" != "${current_menu_exec}" ] then # write in config file sed -e "s#^MENU=['\"].*['\"]#MENU='${2}'#" /etc/config.d/setup >/tmp/edit-$$ cp /tmp/edit-$$ /etc/config.d/setup rm -f /tmp/edit-$$ IFS=${_OLD_IFS} echo mecho -info -n "You need to " mecho -n "Exit " mecho -info "from the currently running" mecho -info "menu to make the changes take effekt." echo _my_answer=`/var/install/bin/ask "Select" "" "^$=Return" "0=Exit"` case ${_my_answer} in '') exit 0 ;; 0) exit 127 ;; esac fi ;; esac exit 0