m trying to upgrade the hardware and OS of a really old linux server for a customer.
Everythings good but one this. For the first time ever, this server has custom shells for a specific program they have running the business. Its a courier company this text based menu system to enter details.
This shell is a simple text menu with numerical options. there are multiple users set to use the shell and it appears to be kept in the /bin directory.
file contents:
Code:
BANNERNAME=" LITE COURIERS"
MENUNAME=" Main Menu"
##############
# Functions #
##############
alias ll="ls -l"
if [ $TERM = "ansi" ]
then
echo "- Found ansi terminal. Forcing to VT100"
set TERM=vt100
export TERM
fi
main_menu () {
draw_screen
get_input
check_input
if [ $? = 10 ] ; then main_menu ; fi
}
#----------------------
draw_screen () {
clear
echo "*******************************************************************************"
echo "$BANNERNAME"
echo "$MENUNAME"
echo "*******************************************************************************"
echo ""
echo " 1 - Courier Information System"
echo
echo " 2 - Start X Windows (Console Only)"
echo
echo " 3 - Command Prompt"
echo
#echo " 4 - Start Internet Connection"
#echo
#echo " 5 - Stop Internet Connection"
#echo
#echo " 6 - Backup to Remote Machine"
#echo
echo " x - Log Off"
echo
echo
echo -n " Enter Choice: "
}
#----------------------
get_input () {
read INPUT
}
#----------------------
check_input () {
case $INPUT in
1 ) /cis/cisa.sh
main_menu;;
2 ) go_start_X
main_menu;;
3 ) bash
main_menu;;
# 4 ) touch /tmp/dialup_monitor.startkey
# if [ $? = 0 ] ; then echo Executed ; sleep 1
# else echo Uhmm did not work ; sleep 1 ; fi
# main_menu;;
# 5 ) touch /tmp/dialup_monitor.stopkey
# if [ $? = 0 ] ; then echo "- Executed" ; sleep 1
# else echo Uhmm did not work ; sleep 1 ; fi
# main_menu;;
# 6 ) /usr/utils/backup_to_remote_machine
# if [ $? = 0 ] ; then echo "- Executed" ; sleep 1
# else echo Uhmm did not work ; sleep 1 ; fi
# echo "Press any key to continue"
# read $TEMP
# main_menu;;
x | X ) clear
exit;;
* ) echo "- Bad input. Try again"
sleep 2
return 10;;
esac
}
#----------------------
go_start_X () {
if [ "$TERM" != "linux" ]
then
echo "- Sorry, your not on the console"
sleep 2
else
startx
fi
}
#----------------------
##############
# Main #
##############
main_menu
So anyone had experience getting custom shells working. Im guessing this would use libs to create the semi gui. And it I dont understand what this ANSI/VT100 thing is. I tried just copying the "MENU" file over to the new PC's /bin directory but it gives me "Permission denied" when I try to login to an account using it.
Any help would be a huge help guys
Also, im upgrading from an approx 8 year old redhat distro to CentOS 4.4 so its still redhat.