Hi all,
I have just finished my empeg-menu,
This application will let you start up all kinds of commands fromthe empeg front-buttons.
It will read an imagefile with ascii-characters and a configfile.
The configfile looks like this:
Start inetd:/sbin/inetd
IP home:/sbin/ifconfig eth0 192.168.12.2
IP work:/sbin/ifconfig eth0 130.144.236.58
turn on swap:/sbin/swapon /usr/local/root/swapfile
turn off swap:/sbin/swapoff /usr/local/root/swapfile
mnt ro /:/bin/mount -n -o remount,ro /
mnt rw /:/bin/mount -n -o remount,rw /
mnt ro /drive0:/bin/mount -n -o remount,ro /dev/hda4 /drive0
mnt rw /drive0:/bin/mount -n -o remount,rw /dev/hda4 /drive0
shell on serial:echo "Press q to start shell"; if /usr/local/sbin/getkey q; then /bin/bash; fi
Xterm home:/usr/bin/X11/xterm -display 192.168.11.1:0
Xterm work:/usr/bin/X11/xterm -display 130.144.236.12:0
reboot:/sbin/reboot -f
the empeg will show the titles on the display and you can navigate using left and right. When you push the down-button the associated action will be printed on stdout and the application will exit.
This can be used in your init script like this.
(I've supplied mine)
#!/bin/bash
#
ASCII_IMG=/usr/local/images/ascii.raw
MENU_CFG=/usr/local/menu/menu.cfg
mount -n -o remount,ro /
/bin/mount -n -o nocheck,rw /proc
/bin/mount -n -o nocheck,ro /dev/hda4 /drive0
while :
do
/empeg/bin/player
CMD="1"
while [ -n "$CMD" ]
do
CMD=`blitmenu $ASCII_IMG $MENU_CFG`
eval $CMD
done
echo "Press q to terminate to a shell"
/usr/local/sbin/getkey q && /bin/bash
done
getkey is a program which waits for 5 seconds for a specific key to be pressed. I got it from redhat and modified it, because it didn't work on my serial console.(Probably the same reason that CTRL-C doesn't work).
I will release the source next week; I've got to tidy up a bit ( I haven't programmed in C for some time );
Frank van Gestel