#!/bin/sh
#
# $Id: xnetcardconfig.in,v 1.1.1.1 2004/08/09 20:40:34 bmeurer Exp $
#
# Copyright (c) 2004-2005 os-cillation
# All rights reserved.
#
# Written by Benedikt Meurer <bm@os-cillation.de>.
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to :
#     Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
#     MA 02110-1301, USA.
#

if [ "`id -u`" = "0" ]; then
	exec "/usr/bin/xnetcardconfig.real"
else
	(sudo -S $0) </dev/null >/dev/null 2>&1 || {
		(gksu  -D /usr/share/applications/xfld-xnetcardconfig.desktop -- "$0") >/dev/null 2>&1 || {
			xmessage -center -file - <<EOF
Unable to start the network configuration tool.
Please setup sudo first!
EOF
			exit 1
		}
	}
fi

exit 0
