#!/bin/sh #---------------------------------------------------------------------------------- # /var/install/bin/vbox-view-vboxgetty-log - view vboxgetty log file # # Copyright (c) 2002-2019 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2005-02-27 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. #---------------------------------------------------------------------------------- # read eislib . /var/install/include/eislib #exec 2> /tmp/vboxlog-trace-$$.test #set -x ### set file names ### vboxfile=/etc/config.d/vbox ### load configuration ### . ${vboxfile} log_dir=/var/log log_file=vboxgetty ### view log file ### clrhome mecho --info "Viewing \"${log_file}\"" mecho if [ "${START_VBOX}" = 'yes' -a ${VBOX_USER_N} -gt 0 ] then techo --begin 1 3 2 30 idx=1 while [ ${idx} -le ${VBOX_USER_N} ] do eval vboxport='$VBOX_USER_'${idx}'_ISDN_PORT' vboxport=`echo ${vboxport} | sed 's#/dev/##g'` techo --row "" ${idx} - vboxgetty-${vboxport}.log idx=`expr ${idx} + 1` done techo techo --end idx=`expr ${idx} - 1` endflag=0 until [ ${endflag} -eq 1 ] do mecho -n "Please enter log file number (1-${idx}), (q)uit: " read nbr case "${nbr}" in [qQ] ) endflag=1 exit 1 ;; [0-9] | [1-9][0-5] ) ### number entered ### if [ ${nbr} -ge 1 -a ${nbr} -le ${idx} ] then eval vboxport='$VBOX_USER_'${nbr}'_ISDN_PORT' vboxport=`echo ${vboxport} | sed 's#/dev/##g'` if [ -s ${log_dir}/${log_file}-${vboxport}.log ] then # display messages /var/install/bin/doc ${log_dir}/${log_file}-${vboxport}.log else mecho --warn "Could not find desired log file or file is empty, please try again later!" fi endflag=1 else mecho --warn "number not in range, try again!" fi ;; * ) ;; esac done fi anykey