#!/bin/sh
# Starts the proper linuxconf front-end
NEWTCONF=/bin/gecko
if [ "$1" = "--text" ] ; then
	shift
	if [ -x $NEWTCONF ] ; then
		exec $NEWTCONF $@
	fi
elif [ "$DISPLAY" != "" ] ; then
	GNOMECONF=/usr/bin/gnome-linuxconf
	WXXTCONF=/usr/X11R6/bin/wxxt-linuxconf
	if [ -x $GNOMECONF ] ; then
		exec $GNOMECONF $@
	elif [ -x $WXXTCONF ] ; then
		exec $WXXTCONF $@
	elif [ -x $NEWTCONF ] ; then
		exec $NEWTCONF $@
	fi
else
	if [ -x $NEWTCONF ] ; then
		exec $NEWTCONF $@
	fi
fi
if [ "$1" = "--pipe" ] ; then
	# tell linuxconf to switch in ncurse mode
	if [ "$2" != "" ] ; then
		echo ncurses >&$2
	else
		echo ncurses
	fi
else
	echo No suitable linuxconf front-end installed
fi
exit -1

