#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/pcmcia-debug # # Creation: 2008-10-06 hb # Last Update: $Id$ # # Copyright (c) 2008-@@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. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib # --------------------------------------------------------------------------- # select to work # --------------------------------------------------------------------------- select_to_work() { clrhome # entry action_entry="ls insert eject suspend resume reset info status config ident" echo mecho --info "PCMCIA debug tools" echo techo --begin '5 4r 1 32' echo idx=1 echo "${action_entry}" | while read entry do entry="$(echo "${entry}" | sed 's/^ *//')" techo --row "" "${idx}." "" "${entry}" idx=$((${idx} + 1)) done techo --end echo _ask_tmpfile=$(mktemp -t XXXXXXXXXXXXX) /var/install/bin/ask "Select" "" "1-$(echo "${action_entry}" | wc -l)" "^$=Return" "0=Exit" >${_ask_tmpfile} rc=${?} read action_to_do < ${_ask_tmpfile} rm -f ${_ask_tmpfile} # if ask break, ask returned 255 if [ ${rc} = 255 ] then exit 127 fi case ${action_to_do} in '') exit 0 ;; 0) exit 127 ;; *) # get action line action_line="$(echo "${action_entry}" | sed -n "${action_to_do}p" | sed 's/^ *//')" # set action line set -- ${action_line} action=${1} /usr/sbin/pccardctl ${action} echo anykey select_to_work ;; esac } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- select_to_work exit 0 # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------