#!/bin/sh
#
# Gtkdialog box to manage network connexion.
# - SliTaz GNU/Linux 2008.
#
VERSION=20080113
# Check if user is root.
check_root()
{
if test $(id -u) != 0 ; then
echo -e "
You must be root to run `basename $0`. Please type 'su' and
root password to become super-user.\n"
exit 0
fi
}
# Interafce status with ifconfig without arguments to show all
# active connections.
#
export IFCONFIG='
date
ifconfig
'
# The main dialog with notebook, start/stop buttons and all options.
# Note than /etc/network.conf is seded wehwn an interafce is activate
#
export NET_BOX='
. /etc/network.conf; echo $INTERFACE
INTERFACE-bUDHCPC_OPTS
. /etc/network.conf; echo "$IP"
IP
. /etc/network.conf; echo "$NETMASK"
NETMASK
. /etc/network.conf; echo "$GATEWAY"
GATEWAY
. /etc/network.conf; echo "$DNS_SERVER"
DNS_SERVER/etc/hostsHOSTS/etc/hostnameHOSTNAME/etc/network.confCONFIG_FILE
'
# Only root can configure network.
check_root
gtkdialog --program=NET_BOX
exit 0