#!/bin/bash

# Copyright Jean-Philippe Guillemin <jp.guillemin@free.fr>. 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 of the License, or (at your option)
# any later version. Please take a look at http://www.gnu.org/copyleft/gpl.htm
#
# Xnetconf is a complete GTK network configuration tool for Zenwalk Linux
#

version="1.1"

# Set the locale in en_US, to avoid problems with Xlib
LANG=en_US

# Path needs to be extended in case you're only half a root :)
export PATH="${PATH}:/usr/sbin:/sbin"

# Some globals

export MAXNICS=4
export inetconf='/etc/rc.d/rc.inet1.conf'
export resolv='/etc/resolv.conf'
export hosts='/etc/hosts'
export hostnamefile='/etc/HOSTNAME'
export rcinet1='/etc/rc.d/rc.inet1'
export dhcpclient='/sbin/dhcpcd'

# Save some config files
cat $inetconf > $inetconf.old
cat $hosts > $hosts.old
cat $resolv > $resolv.old

# Load the Xnetpkg GUI definition
. /usr/libexec/xnetconf-gui

# Start the GUI
gtkdialog -i /usr/libexec/xnetconf-functions --program=MAIN 2>/dev/null 1>&2

exit 0

