#!/bin/sh
#
# $Revision: 1.9 $, $Date: 2003/07/24 14:50:05 $
#

[ -f /etc/pldconf/ustawienia ] && . /etc/pldconf/ustawienia
export PLDCONF_VERSION
export PLDCONF_EDITOR

if [ ! -x /usr/bin/less ]
then 
	echo 'Musisz zainstalowa less jeeli chcesz przeglda pomoc pldconf'
	echo 'W Dodaj/Usu programy zaznacz sekcj "Informacje o systemie"'
	echo 'Jeeli drani Ci ten komunikat usu go z /usr/bin/pldconf'
	echo '<enter>'
	read
fi

if [ `id -nu` = root ]
then

eval `dml -t "    _p_l_d_c_o_n_f $PLDCONF_VERSION"<< EOF
<meta title="pldconf" width=33> 
<br>
<menu id=res_menu res=1 height=12> 
<item id=ustawienia> Ustawienia pldconf
<item id=poldek> Dodaj/Usu programy
<item id=X> rodowisko graficzne
<item id=net> Sie 
<item id=win> Partycje Windows
<item id=boot> Uruchamianie systemu
<item id=printer> Drukarka
<item id=inne> Inne 
<item id=sysinfo> Informacje o systemie
<item id=pomoc> Pomoc
<item id=autorzy> Autorzy
<item id=exit> Wyjcie
</menu>
EOF`

case $res_menu in 
	ustawienia)
		exec /usr/share/pldconf/ustawienia.sh
	;;
	poldek)
		exec /usr/share/pldconf/poldek.sh
	;;
	X)
		exec /usr/share/pldconf/X/X_menu.sh
	;;
	net)
		exec /usr/share/pldconf/NET/net_menu.sh 
	;;
	win)
		exec /usr/share/pldconf/win.pl
	;;
	boot)
		exec /usr/share/pldconf/BOOT/boot_menu.sh
	;;
	printer)
		exec /usr/share/pldconf/printer.sh
	;;
	inne)
		exec /usr/share/pldconf/inne.sh
	;;
	sysinfo)
		exec /usr/share/pldconf/SYSINFO/sysinfo_menu.sh
	;;
	pomoc)
		less /usr/share/pldconf/POMOC/README_pomoc.txt
		exec /usr/bin/pldconf
	;;
	autorzy)
		exec /usr/share/pldconf/autorzy.sh
	;;
	exit)
		exit
	;;
esac

else 
	exec /usr/share/pldconf/menu_user.sh
fi
