Several fixes. Added manpage.

EAP-support release-0.2.1
KatolaZ 8 years ago
parent 7376d8543e
commit 3fbc818cca
  1. 232
      setnet.8
  2. BIN
      setnet.8.gz
  3. 218
      setnet.sh

@ -0,0 +1,232 @@
.\" The following requests are required for all man pages.
.Dd January 06, 2017
.Dt SETNET 8 SMM
.Os Linux
.Sh NAME
.Nm setnet.sh
.Nd minimalist shell script for network configuration with dialog interface
.Sh SYNOPSIS
.Nm setnet.sh
.Op Fl c Ar config_file
.Op Fl h
.Op Fl v
.Sh DESCRIPTION
.Pp
setnet.sh is a shell script for network management, with a terminal
user interface based on dialog(1). It works as a wrapper around the
basic tools for the configuration of Ethernet and Wi-Fi interfaces,
including ip(8), dhclient(8), and wpa_cli(8).
.Pp
setnet.sh allows to configure static and/or DHCP-based connections to
a LAN/WLAN, and to manage the authentication to a Wi-Fi network. At
present, only open authentication (no key) and WPA-Personal
authentication (WPA-PSK/WPA2-PSK) are supported. The support for basic
WPA-Enterprise authentication (WPA-EAP-PEAP and WPA-EAP-TLS) is under
development.
.Pp
setnet.sh can be also used as a minimal interface to basic network
diagnostics tools, including ping(8), host(1), traceroute(1), and
netstat(8). It allows to show some information about network status,
including the routing table, content of resolv.conf and nsswitch.conf,
active TCP/IP connections, running daemons, etc., and to dump those
information to a file. Support for posting a dump of network status to
websites like pastebin.com is under development.
.Pp
setnet.sh recognises the following options:
.Bl -tag -width Ds
.It Fl c Ar config_file
specify a configuration file
.It Fl h
print a minimal help and exit
.It Fl v
show version and exit
.El
.Pp
The main setnet.sh menu allows to choose from five sections, as
described below:
.Bl -tag -width Ds
.It Ic Setup
This section allows to configure a network interface, selected from
the list of available network devices (as returned by "ip -o
link"). Once a device has been selected, it is possible to choose on
of the following functions
.Bl -tag -width
.It Ic View
View current device configuration, i.e., MAC address, link status, IP
address, etc.
.It Ic WiFi
(available only for wi-fi devices) Manage the association to a Wi-Fi
network. This allows to restart wpa_supplicant, to manage the
currently configured networks, to add a new network, and to show (and
modify) the configuration file used by wpa_supplicant.
.It Ic Conf
Configure the IP address of the device. It is possible to choose
between
.Em DHCP-based
and
.Em Static
IP configuration.
.It Ic Start
Bring the interface up (using "ip link set <DEVNAME> up").
.It Ic Stop
Bring the interface down (using "ip link set <DEVNAME> down").
.It Ic Restart
Restart the interface by putting it first down and then up again.
.El
.It Ic Info
This section provides information about the current network status and
allows to perform basic diagnostic tasks. The following functions are
available:
.Bl -tag -width
.It Ic ARP
Show the current ARP table
.It Ic Connections
List active network connections by running "netstat -tnp"
.It Ic DNS
List the configured DNS, by showing the "nameserver" entries in
.Pa /etc/resolv.conf.
.It Ic Lookup
Perform a DNS lookup through "host <HOST>". If <HOST> is a FQDN, the
result will be the IP address(es) associated to that domain name. If
<HOST> is an IP address, the result is the list of FQDNs associated to
that address.
.It Ic Ping
Ping a host, using its IP of FQDN (Fully-Qualified Domain Name) by
running "ping -c 5 <HOST>".
.It Ic Resolver
Show the system resolver configuration, i.e. the content of the file
.Pa /etc/nsswitch.conf
.It Ic Routes
Show the current routing table
.It Ic Services
Show a list of processes (daemons) listening on TCP ports, by running
"netstat -ltnp".
.It Ic Traceroute
Show the route to a given host, as obtained by running the command
"traceroute <HOST>".
.El
.It Ic Dump
Dump information about current network status to a file. The user can
choose which information to include from a checklist. The support for
dumping network information to web applications like
.Em pastebin
is currently under development.
.It Ic Log
Show the logfile written by setnet.sh
.It Ic About
Provide information about copyright, contributors, and license.
.El
.\" This next request is for sections 1, 6, 7 & 8 only
.Sh ENVIRONMENT
.Pp
setnet.sh uses the following environment variables:
.Bl -tag -width Ds
.It Ev WPA_FILE
The configuration file for wpa_supplicant(1) (default to
.Pa /etc/wpa_supplicant/wpa_setnet.conf
.Li ).
.It Ev LOGFILE
The file used by setnet.sh for logging (default to
.Pa /var/log/setnet.log
.Li ).
.It Ev TRUNCATE_LOG
If it is set to "yes" or "YES", the log file is truncated when
setnet.sh starts.
.It Ev WIFI_DEVICES
List of wifi devices. This list is used only when automatic detection
of wifi devices fails.
.El
These variables are normally set in the setnetrc configuration file
(see
.Sy FILES
below). setnet.sh will exit if either
.Ev WPA_FILE
or
.Ev LOGFILE
are undefined.
.Sh FILES
setnet.sh uses a configuration file which defines the environment
variables described in
.Sy ENVIRONMENT
above. setnet.sh looks for the following files:
.Bl -bullet -offset indent
.It
the
.Em config_file
provided through the option
.Sy -c
(if any).
.It
the file
.Em /etc/setnetrc
(if it exists)
.It
the file
.Em ~/.setnetrc
(if it exists)
.El
in that order. If a
.Em config_file
is provided, the other files are ignored. Otherwise, if
.Em ~/.setnetrc
exists, it takes precedence over
.Em /etc/setnetrc.
.\" .Sh EXAMPLES
.\" This next request is for sections 1, 6, 7 & 8 only
.\" (command return values (to shell) and
.\" fprintf/stderr type diagnostics)
.\" .Sh DIAGNOSTICS
.Sh SEE ALSO
ip(8), dhclient(8), wpa_supplicant(8), wpa_cli(8), netstat(8).
.\" .Sh CONFORMING TO
.\" .Sh HISTORY
.Sh AUTHORS
setnet.sh is Free Software, distributed under the terms of the GNU
General Public License (GPL), version 3 of the License.
.Pp
setnet.sh is copyleft (c) by
.An Vincenzo (KatolaZ) Nicosia <katolaz@freaknet.org>
.Sh BUGS
At present, setnet.sh can reliably manage no more than one Wi-Fi
device at a time. This is due to the fact that the configuration file
for wpa_supplicant is defined in the environment variable
.Ev WPA_FILE.
There is no limitation on the number of Ethernet devices that
setnet.sh can manage, but you should be careful with having more than
one
.Sy dhclient
processes running, since each of them will try to add a default
gateway to the kernel routing table.
.Sh SECURITY CONSIDERATIONS
Configuring networking is an administration task, and setnet.sh
requires root privileges to work properly. It is possible to allow a
regular user to run setnet.sh, e.g. by using sudo(8) or sup(1) (see
https://sup.dyne.org/ for more information about sup).
.Pp
setnet.sh can recognise if it is running under sudo(8) or sup(1), by
looking at the content of the environment variables SUDO_UID/SUP_UID,
SUDO_GID/SUP_GID, and SUDO_USER/SUP_USER. When setnet.sh is run under
sudo(8) or sup(1), some functionalities are disabled. In particular,
loading and editing an alternate wpa_supplicant configuration file is
forbidden (and for obvious reasons, since this would in principle
allow the sudoer to edit *any* file in your system).

Binary file not shown.

@ -29,7 +29,7 @@
## Initialisation ## Initialisation
## ##
VERSION=0.2 VERSION=0.2.1
TOPSTR="setnet-${VERSION} [user: $(id -run)]" TOPSTR="setnet-${VERSION} [user: $(id -run)]"
@ -121,7 +121,7 @@ load_setnetrc(){
WPA_FILE="" WPA_FILE=""
LOGFILE="" LOGFILE=""
## If we were given a parameter, is the rc file to load... ## If we were given a parameter, that is the rc file to load...
## ##
if [ $# -ge 1 ]; then if [ $# -ge 1 ]; then
. "$1" . "$1"
@ -148,7 +148,10 @@ load_setnetrc(){
SETNETRC=~/.setnetrc SETNETRC=~/.setnetrc
fi fi
if [ -n "${SETNETRC}" ] &&
[ -f "${SETNETRC}" ]; then
. ${SETNETRC} . ${SETNETRC}
fi
if [ -z ${WPA_FILE} ]; then if [ -z ${WPA_FILE} ]; then
echo "Could not find WPA_FILE defined anywhere. Exiting" echo "Could not find WPA_FILE defined anywhere. Exiting"
@ -325,15 +328,15 @@ edit_file(){
log "edit_file" "Copying ${TMPFILE} into ${FILEIN}" log "edit_file" "Copying ${TMPFILE} into ${FILEIN}"
if cp "${TMPFILE}" "${FILEIN}" if cp "${TMPFILE}" "${FILEIN}"
then then
eval "${DIALOG} --clear --msgbox 'File ${FILEIN} saved successfully' \ eval "${DIALOG} --msgbox 'File ${FILEIN} saved successfully' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
else else
eval "${DIALOG} --clear --msgbox 'Error saving file ${FILEIN}' \ eval "${DIALOG} --msgbox 'Error saving file ${FILEIN}' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
fi fi
else else
log "edit_file" "Editing of ${FILEIN} aborted..." log "edit_file" "Editing of ${FILEIN} aborted..."
eval "${DIALOG} --clear --msgbox 'File ${FILEIN} not saved' \ eval "${DIALOG} --msgbox 'File ${FILEIN} not saved' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
fi fi
} }
@ -396,7 +399,7 @@ DEVNAME=$1
DEVCONF="${DEVCONF}\n== name servers ==\n$(grep '^nameserver' /etc/resolv.conf)" DEVCONF="${DEVCONF}\n== name servers ==\n$(grep '^nameserver' /etc/resolv.conf)"
eval "${DIALOG} --clear --title 'Current configuration of device: ${DEVNAME}' \ eval "${DIALOG} --title 'Current configuration of device: ${DEVNAME}' \
--msgbox '\n\n${DEVCONF}' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} " --msgbox '\n\n${DEVCONF}' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} "
return 0 return 0
@ -405,26 +408,26 @@ DEVNAME=$1
##function ##function
config_ethernet_static(){ config_ip_static(){
##local ##local
DEV_IP="192.168.1.2" DEV_IP="192.168.1.2"
##local ##local
DEV_NET="192.168.1.0" DEV_NET="192.168.1.0"
##local ##local
DEV_NETMASK="255.255.255.0" DEV_NETMASK="255.255.255.0"
##local ##local
DEV_GW="192.168.1.1" DEV_GW="192.168.1.1"
##local ##local
DEV_DNS1="208.67.222.222" DEV_DNS1="208.67.222.222"
##local ##local
DEV_DNS2="208.67.220.220" DEV_DNS2="208.67.220.220"
##local ##local
DEVNAME=$1 DEVNAME=$1
exec 3>&1 exec 3>&1
eval "${DIALOG} --clear --form 'Set network for device: ${DEVNAME}' \ eval "${DIALOG} --form 'Set network for device: ${DEVNAME}' \
${FORM_HEIGHT} ${FORM_WIDTH} 0 \ ${FORM_HEIGHT} ${FORM_WIDTH} 0 \
'IP' 1 1 '${DEV_IP}' 1 16 16 16 \ 'IP' 1 1 '${DEV_IP}' 1 16 16 16 \
'Network' 2 1 '${DEV_NET}' 2 16 16 16 \ 'Network' 2 1 '${DEV_NET}' 2 16 16 16 \
@ -442,7 +445,8 @@ DEVNAME=$1
read -d "*" DEV_IP DEV_NET DEV_NETMASK DEV_GW DEV_DNS1 DEV_DNS2 < ${TMPFILE} read -d "*" DEV_IP DEV_NET DEV_NETMASK DEV_GW DEV_DNS1 DEV_DNS2 < ${TMPFILE}
eval "${DIALOG} --msgbox 'Proposed configuration of ${DEVNAME}:\n \ eval "${DIALOG} --msgbox 'Proposed configuration of ${DEVNAME}:\n \
${DEV_IP}\n${DEV_NET}\n${DEV_NETMASK}\n${DEV_GW}\n${DEV_DNS1}\n${DEV_DNS2}'\ IP: ${DEV_IP}\nNetwork: ${DEV_NET}\nNetmask: ${DEV_NETMASK}\nGateway: \
${DEV_GW}\nDNS1: ${DEV_DNS1}\nDNS2: ${DEV_DNS2}'\
${WINDOW_HEIGHT} ${WINDOW_WIDTH}" ${WINDOW_HEIGHT} ${WINDOW_WIDTH}"
## Configure IP ## Configure IP
@ -453,11 +457,14 @@ ${DEV_IP}\n${DEV_NET}\n${DEV_NETMASK}\n${DEV_GW}\n${DEV_DNS1}\n${DEV_DNS2}'\
ip address add "${DEV_IP}/${DEV_NETMASK}" dev "${DEVNAME}" ip address add "${DEV_IP}/${DEV_NETMASK}" dev "${DEVNAME}"
## Configure GW ## Configure GW
#if [ -n "${DEV_GW}" ]; then
ip route flush dev "${DEVNAME}" ip route flush dev "${DEVNAME}"
ip route add "${DEV_NET}/${DEV_NETMASK}" dev "${DEVNAME}" ip route add "${DEV_NET}/${DEV_NETMASK}" dev "${DEVNAME}"
ip route add default via "${DEV_GW}" ip route add default via "${DEV_GW}"
#fi
## Configure DNS ## Configure DNS
#if [ -n "${DEV_DNS1}" ] ||
# [ -n "${DEV_DNS1}" ]; then
mv /etc/resolv.conf /etc/resolv.conf.bak mv /etc/resolv.conf /etc/resolv.conf.bak
if [ -n "${DEV_DNS1}" ]; then if [ -n "${DEV_DNS1}" ]; then
echo "nameserver ${DEV_DNS1}" >> /etc/resolv.conf echo "nameserver ${DEV_DNS1}" >> /etc/resolv.conf
@ -466,10 +473,11 @@ ${DEV_IP}\n${DEV_NET}\n${DEV_NETMASK}\n${DEV_GW}\n${DEV_DNS1}\n${DEV_DNS2}'\
echo "nameserver ${DEV_DNS2}" >> /etc/resolv.conf echo "nameserver ${DEV_DNS2}" >> /etc/resolv.conf
fi fi
show_device_conf "${DEVNAME}" show_device_conf "${DEVNAME}"
#fi
} }
##function ##function
config_ethernet_dhcp(){ config_ip_dhcp(){
##local ##local
DEVNAME=$1 DEVNAME=$1
@ -477,23 +485,22 @@ config_ethernet_dhcp(){
##eval "${DIALOG} --msgbox 'Running \"dhclient ${DEVNAME}\"' ${INFO_HEIGHT} ${INFO_WIDTH}" ##eval "${DIALOG} --msgbox 'Running \"dhclient ${DEVNAME}\"' ${INFO_HEIGHT} ${INFO_WIDTH}"
dhclient -r ${DEVNAME} 2>/dev/null dhclient -r ${DEVNAME} 2>/dev/null
dhclient -v ${DEVNAME} 2>&1 | dhclient -v ${DEVNAME} 2>&1 |
eval "${DIALOG} --clear --title 'Running dhclient...' \ eval "${DIALOG} --title 'Running dhclient ${DEVNAME}' \
--programbox ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" 2>${TMPFILE} --programbox ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" 2>${TMPFILE}
if [ $! -ne 0 ];then if [ $! -ne 0 ];then
log "config_ethernet_dhcp" "dhclient aborted" log "config_ip_dhcp" "dhclient aborted"
fi fi
show_device_conf ${DEVNAME} show_device_conf ${DEVNAME}
} }
##function ##function
config_ethernet(){ configure_ip_address(){
##local ##local
DEVNAME=$1 DEVNAME=$1
while true; do eval "${DIALOG} --cancel-label 'Up' \
eval "${DIALOG} --clear --cancel-label 'Up' \
--menu 'Configuring ${DEVNAME}' ${INFO_HEIGHT} ${INFO_WIDTH} 4 \ --menu 'Configuring ${DEVNAME}' ${INFO_HEIGHT} ${INFO_WIDTH} 4 \
'DHCP' ''\ 'DHCP' ''\
'Static' ''" 2>${TMPFILE} 'Static' ''" 2>${TMPFILE}
@ -503,14 +510,12 @@ config_ethernet(){
ACTION=$(cat ${TMPFILE}) ACTION=$(cat ${TMPFILE})
case ${ACTION} in case ${ACTION} in
"Static") "Static")
config_ethernet_static ${DEVNAME} config_ip_static ${DEVNAME}
;; ;;
"DHCP") "DHCP")
config_ethernet_dhcp ${DEVNAME} config_ip_dhcp ${DEVNAME}
;; ;;
esac esac
done
} }
##function ##function
@ -623,7 +628,7 @@ wifi_authenticate(){
eval "${DIALOG} --insecure --inputbox 'Please insert WPA PSK\n(8 characters)' \ eval "${DIALOG} --insecure --inputbox 'Please insert WPA PSK\n(8 characters)' \
${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE}
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
eval "${DIALOG} --clear --msgbox 'Network configuration aborted!!!' \ eval "${DIALOG} --msgbox 'Network configuration aborted!!!' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return 1 return 1
fi fi
@ -638,7 +643,7 @@ wifi_authenticate(){
wpa_cli -i ${DEVNAME} set_network ${NET_NUM} psk \"${PSK}\" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} psk \"${PSK}\"
## remove the password from tmpfile ## remove the password from tmpfile
echo "" > ${TMPFILE} echo "" > ${TMPFILE}
eval "${DIALOG} --clear --defaultno --yesno \ eval "${DIALOG} --defaultno --yesno \
'Network \"${W_ESSID}\" added\nSave configuration file?' \ 'Network \"${W_ESSID}\" added\nSave configuration file?' \
${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE} ${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE}
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -660,7 +665,7 @@ wifi_authenticate(){
log "wifi_authenticate" "NET_NUM: ${NET_NUM}" log "wifi_authenticate" "NET_NUM: ${NET_NUM}"
wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ssid "\"${W_ESSID}\"" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ssid "\"${W_ESSID}\""
wpa_cli -i ${DEVNAME} set_network ${NET_NUM} key_mgmt NONE wpa_cli -i ${DEVNAME} set_network ${NET_NUM} key_mgmt NONE
eval "${DIALOG} --clear --defaultno --yesno \ eval "${DIALOG} --defaultno --yesno \
'Network \"${W_ESSID}\" added\nSave configuration file?' \ 'Network \"${W_ESSID}\" added\nSave configuration file?' \
${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE} ${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE}
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -763,7 +768,7 @@ wifi_remove(){
NETNUM=$(cat ${TMPFILE}) NETNUM=$(cat ${TMPFILE})
WPA_STATUS=$(wpa_cli -i ${DEVNAME} remove_network ${NETNUM} | tail -1 ) WPA_STATUS=$(wpa_cli -i ${DEVNAME} remove_network ${NETNUM} | tail -1 )
if [ "${WPA_STATUS}" = "OK" ]; then if [ "${WPA_STATUS}" = "OK" ]; then
eval "${DIALOG} --clear --defaultno --yesno \ eval "${DIALOG} --defaultno --yesno \
'Network ${NETNUM} removed\nSave configuration file?' \ 'Network ${NETNUM} removed\nSave configuration file?' \
${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE}
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -773,12 +778,12 @@ wifi_remove(){
return return
else else
eval "${DIALOG} --clear --msgbox 'Network ${NETNUM} NOT removed' \ eval "${DIALOG} --msgbox 'Network ${NETNUM} NOT removed' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
fi fi
else else
eval "${DIALOG} --clear --msgbox 'No network removed!!!' \ eval "${DIALOG} --msgbox 'No network removed!!!' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
fi fi
@ -800,16 +805,16 @@ sed -r -e 's/^\ +//g' | cut -d " " -f 1)
log "wifi_restart_wpa" "WPA_PID: ${WPA_PID}" log "wifi_restart_wpa" "WPA_PID: ${WPA_PID}"
kill -9 ${WPA_PID} kill -9 ${WPA_PID}
wpa_supplicant -B -i ${DEVNAME} -c ${WPA_FILE} -P${WPA_PIDFILE} 2>/dev/null wpa_supplicant -B -i ${DEVNAME} -c ${WPA_FILE} -P${WPA_PIDFILE} 2>&1 >/dev/null
WPA_PID=$(ps ax | grep wpa_supplicant | grep " -i ${DEVNAME}" | \ WPA_PID=$(ps ax | grep wpa_supplicant | grep " -i ${DEVNAME}" | \
sed -r -e 's/^\ +//g' | cut -d " " -f 1 ) sed -r -e 's/^\ +//g' | cut -d " " -f 1 )
WPA_PID_SAVED=$(cat ${WPA_PIDFILE}) WPA_PID_SAVED=$(cat ${WPA_PIDFILE})
log "wifi_restart_wpa" "WPA_PID: ${WPA_PID} WPA_PID_SAVED: ${WPA_PID_SAVED}" log "wifi_restart_wpa" "WPA_PID: ${WPA_PID} WPA_PID_SAVED: ${WPA_PID_SAVED}"
if [ -n "${WPA_PID}" ] && [ "${WPA_PID}" != "${WPA_PID_SAVED}" ]; then if [ -n "${WPA_PID}" ] && [ "${WPA_PID}" != "${WPA_PID_SAVED}" ]; then
eval "${DIALOG} --clear --msgbox 'Error restarting wpa_supplicant' \ eval "${DIALOG} --msgbox 'Error restarting wpa_supplicant' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
else else
eval "${DIALOG} --clear --msgbox 'wpa_supplicant restarted successfully' \ eval "${DIALOG} --msgbox 'wpa_supplicant restarted successfully' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
fi fi
@ -839,17 +844,17 @@ wifi_enable(){
NETNUM=$(cat ${TMPFILE}) NETNUM=$(cat ${TMPFILE})
WPA_STATUS=$(wpa_cli -i ${DEVNAME} enable ${NETNUM} | tail -1 ) WPA_STATUS=$(wpa_cli -i ${DEVNAME} enable ${NETNUM} | tail -1 )
if [ "${WPA_STATUS}" = "OK" ]; then if [ "${WPA_STATUS}" = "OK" ]; then
eval "${DIALOG} --clear --msgbox 'Network ${NETNUM} enabled' \ eval "${DIALOG} --msgbox 'Network ${NETNUM} enabled' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
config_ethernet ${DEVNAME} #config_ethernet ${DEVNAME}
return return
else else
eval "${DIALOG} --clear --msgbox 'Network ${NETNUM} NOT enabled' \ eval "${DIALOG} --msgbox 'Network ${NETNUM} NOT enabled' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
fi fi
else else
eval "${DIALOG} --clear --msgbox 'No network enabled!!!' \ eval "${DIALOG} --msgbox 'No network enabled!!!' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
fi fi
@ -871,16 +876,16 @@ wifi_disable(){
NETNUM=$(cat ${TMPFILE}) NETNUM=$(cat ${TMPFILE})
WPA_STATUS=$(wpa_cli -i ${DEVNAME} disable ${NETNUM} | tail -1 ) WPA_STATUS=$(wpa_cli -i ${DEVNAME} disable ${NETNUM} | tail -1 )
if [ "${WPA_STATUS}" = "OK" ]; then if [ "${WPA_STATUS}" = "OK" ]; then
eval "${DIALOG} --clear --msgbox 'Network ${NETNUM} disabled' \ eval "${DIALOG} --msgbox 'Network ${NETNUM} disabled' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
else else
eval "${DIALOG} --clear --msgbox 'Network ${NETNUM} NOT disabled' \ eval "${DIALOG} --msgbox 'Network ${NETNUM} NOT disabled' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
fi fi
else else
eval "${DIALOG} --clear --msgbox 'No network disabled!!!' \ eval "${DIALOG} --msgbox 'No network disabled!!!' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
fi fi
@ -915,7 +920,7 @@ wifi_load_file(){
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
SEL_FILE=$(cat ${TMPFILE}) SEL_FILE=$(cat ${TMPFILE})
else else
eval "${DIALOG} --clear --msgbox 'WPA_FILE was not modified' \ eval "${DIALOG} --msgbox 'WPA_FILE was not modified' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
fi fi
@ -923,19 +928,19 @@ wifi_load_file(){
if [ -f "${SEL_FILE}" ]; then if [ -f "${SEL_FILE}" ]; then
WPA_FILE=${SEL_FILE} WPA_FILE=${SEL_FILE}
eval "${DIALOG} --clear --defaultno --yesno \ eval "${DIALOG} --defaultno --yesno \
'WPA_FILE changed to ${WPA_FILE}\nRestart wpa_supplicant?' \ 'WPA_FILE changed to ${WPA_FILE}\nRestart wpa_supplicant?' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
wifi_restart_wpa ${DEVNAME} ${WPA_FILE} wifi_restart_wpa ${DEVNAME} ${WPA_FILE}
fi fi
else else
eval "${DIALOG} --clear --msgbox 'Invalid file name!\n WPA_FILE *not* changed' \ eval "${DIALOG} --msgbox 'Invalid file name!\n WPA_FILE *not* changed' \
${WINDOW_HEIGHT} ${WINDOW_WIDTH}" ${WINDOW_HEIGHT} ${WINDOW_WIDTH}"
return return
fi fi
else else
eval "${DIALOG} --clear --msgbox 'WPA_FILE was not modified' \ eval "${DIALOG} --msgbox 'WPA_FILE was not modified' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
fi fi
@ -950,7 +955,7 @@ config_wifi(){
DEVNAME=$1 DEVNAME=$1
while true; do while true; do
eval "${DIALOG} --clear --cancel-label 'Up' \ eval "${DIALOG} --cancel-label 'Up' \
--menu 'Configuring ${DEVNAME}\n(Current file: ${WPA_FILE})' \ --menu 'Configuring ${DEVNAME}\n(Current file: ${WPA_FILE})' \
${WINDOW_HEIGHT} ${WINDOW_WIDTH} 12 \ ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 12 \
'Restart' 'Restart wpa_supplicant' \ 'Restart' 'Restart wpa_supplicant' \
@ -1010,24 +1015,37 @@ config_wifi(){
## ##
## (Re)-Configure a network device ## (Re)-Configure
## ##
##function ##function
configure_device(){ configure_wifi(){
##local ##local
DEVNAME=$1 DEVNAME=$1
## Check if the network device is a wifi -- this should be more robust... ## Automatically Check if the network device is a wifi -- this
iw ${DEVNAME} info 2>&1 >/dev/null ## should be robust...
! iw ${DEVNAME} info 2>&1 >/dev/null
IS_WIFI=$?
log "configure_device" "Device ${DEVNAME} -- IS_WIFI: ${IS_WIFI} (automatic)"
if [ "${IS_WIFI}" = "0" ] && \
[ -n "${WIFI_DEVICES}" ]; then
## WIFI_DEVICES is set, hence we check whether the current
## device is in the list
IS_WIFI=$(echo " ${WIFI_DEVICES} " | grep -E -c "(\ ${DEVNAME}\ )")
log "configure_device" "Device ${DEVNAME} -- IS_WIFI: ${IS_WIFI} (config file)"
fi
case $? in case ${IS_WIFI} in
0) 1)
config_wifi ${DEVNAME} config_wifi ${DEVNAME}
;; ;;
*) *)
config_ethernet ${DEVNAME} ## Show a message here
eval "${DIALOG} --msgbox '${DEVNAME} is not a WiFi device... ' \
${INFO_HEIGHT} ${INFO_WIDTH}"
;; ;;
esac esac
@ -1063,11 +1081,12 @@ show_device_menu(){
while true; do while true; do
DEV_STATUS=$(ip -o link | cut -d " " -f 2,9 | grep -E "^${DEVNAME}: " | cut -d " " -f 2) DEV_STATUS=$(ip -o link | cut -d " " -f 2,9 | grep -E "^${DEVNAME}: " | cut -d " " -f 2)
log "show_device_menu" "DEVNAME: ${DEVNAME} DEV_STATUS: ${DEV_STATUS}" log "show_device_menu" "DEVNAME: ${DEVNAME} DEV_STATUS: ${DEV_STATUS}"
eval "${DIALOG} --clear --cancel-label 'Up' --menu\ eval "${DIALOG} --cancel-label 'Up' --menu\
'Device: ${DEVNAME}\nStatus: ${DEV_STATUS}' \ 'Device: ${DEVNAME}\nStatus: ${DEV_STATUS}' \
${WINDOW_HEIGHT} ${WINDOW_WIDTH} 8 \ ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 8 \
'View' 'View current configuration' \ 'View' 'View current configuration' \
'Conf' 'Configure device' \ 'Conf' 'Configure IP Address' \
'WiFi' 'Manage WiFi networking' \
'Start' 'Bring interface up' \ 'Start' 'Bring interface up' \
'Stop' 'Put interface down' \ 'Stop' 'Put interface down' \
'Restart' 'Restart interface'" 2> ${TMPFILE} 'Restart' 'Restart interface'" 2> ${TMPFILE}
@ -1082,7 +1101,10 @@ show_device_menu(){
show_device_conf ${DEVNAME} show_device_conf ${DEVNAME}
;; ;;
"Conf") "Conf")
configure_device ${DEVNAME} configure_ip_address ${DEVNAME}
;;
"WiFi")
configure_wifi ${DEVNAME}
;; ;;
"Start") "Start")
set_device_up ${DEVNAME} set_device_up ${DEVNAME}
@ -1118,7 +1140,7 @@ show_devs() {
fi fi
done done
eval "${DIALOG} --clear --cancel-label 'Up' \ eval "${DIALOG} --cancel-label 'Up' \
--menu 'Select Interface to configure' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 4 \ --menu 'Select Interface to configure' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 4 \
${DEVICE_TAGS}" 2> ${TMPFILE} ${DEVICE_TAGS}" 2> ${TMPFILE}
return $? return $?
@ -1165,7 +1187,7 @@ Please report bugs at:
https://git.devuan.org/KatolaZ/setnet https://git.devuan.org/KatolaZ/setnet
EOF EOF
eval "${DIALOG} --clear --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}"
return return
} }
@ -1185,7 +1207,7 @@ show_copyright(){
EOF EOF
eval "${DIALOG} --clear --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}"
return return
} }
@ -1218,7 +1240,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
-------------------------------------------------------------------- --------------------------------------------------------------------
EOF EOF
eval "${DIALOG} --clear --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}"
return return
} }
@ -1259,7 +1281,7 @@ notfound(){
CMDNAME=$1 CMDNAME=$1
eval "${DIALOG} --clear --msgbox 'Sorry! Commmand ${CMDNAME} not found!'" \ eval "${DIALOG} --msgbox 'Sorry! Commmand ${CMDNAME} not found!'" \
${INFO_HEIGHT} ${INFO_WIDTH} ${INFO_HEIGHT} ${INFO_WIDTH}
} }
@ -1282,7 +1304,7 @@ netdiag_DNS(){
NAMESERVERS=$(grep '^nameserver' /etc/resolv.conf) NAMESERVERS=$(grep '^nameserver' /etc/resolv.conf)
MSG_STR="Configured name servers in /etc/resolv.conf ==\n\n${NAMESERVERS}" MSG_STR="Configured name servers in /etc/resolv.conf ==\n\n${NAMESERVERS}"
eval "${DIALOG} --clear --title 'DNS servers' --msgbox '${MSG_STR}' "\ eval "${DIALOG} --title 'DNS servers' --msgbox '${MSG_STR}' "\
${WINDOW_HEIGHT} ${WINDOW_WIDTH} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}
} }
@ -1303,7 +1325,7 @@ netdiag_resolver(){
## Dump to dialog ## Dump to dialog
RESOLVER=$(grep -v '^#' /etc/nsswitch.conf) RESOLVER=$(grep -v '^#' /etc/nsswitch.conf)
eval "${DIALOG} --clear --title 'Resolver configuration (/etc/nsswitch.conf)' \ eval "${DIALOG} --title 'Resolver configuration (/etc/nsswitch.conf)' \
--msgbox '${RESOLVER}' "\ --msgbox '${RESOLVER}' "\
${WINDOW_HEIGHT} ${WINDOW_WIDTH} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}
@ -1331,7 +1353,7 @@ netdiag_routes(){
## Dump to dialog ## Dump to dialog
ROUTES=$(netstat -rn > ${TMPFILE} ) ROUTES=$(netstat -rn > ${TMPFILE} )
eval "${DIALOG} --clear --no-collapse --title 'Routing table (netstat -rn) [arrows to scroll]'" \ eval "${DIALOG} --no-collapse --title 'Routing table (netstat -rn) [arrows to scroll]'" \
"--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\
${LARGE_HEIGHT} ${LARGE_WIDTH} ${LARGE_HEIGHT} ${LARGE_WIDTH}
} }
@ -1352,7 +1374,7 @@ netdiag_ARP(){
# Dump to dialog # Dump to dialog
ARP=$(cat /proc/net/arp >${TMPFILE}) ARP=$(cat /proc/net/arp >${TMPFILE})
eval "${DIALOG} --clear --no-collapse --title 'ARP table (/proc/net/arp) [arrows to scroll]'" \ eval "${DIALOG} --no-collapse --title 'ARP table (/proc/net/arp) [arrows to scroll]'" \
"--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\
${LARGE_HEIGHT} ${LARGE_WIDTH} ${LARGE_HEIGHT} ${LARGE_WIDTH}
} }
@ -1380,7 +1402,7 @@ netdiag_connections(){
## Dump to dialog ## Dump to dialog
SERV=$(netstat -tnp | sed -r -e 's/$/\n/g' > ${TMPFILE}) SERV=$(netstat -tnp | sed -r -e 's/$/\n/g' > ${TMPFILE})
eval "${DIALOG} --clear --no-collapse "\ eval "${DIALOG} --no-collapse "\
" --title 'Active network connections (netstat -tnp) [arrows to scroll]'" \ " --title 'Active network connections (netstat -tnp) [arrows to scroll]'" \
"--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\
${LARGE_HEIGHT} ${LARGE_WIDTH} ${LARGE_HEIGHT} ${LARGE_WIDTH}
@ -1409,7 +1431,7 @@ netdiag_services(){
SERV=$(netstat -ltnp | sed -r -e 's/$/\n/g' > ${TMPFILE}) SERV=$(netstat -ltnp | sed -r -e 's/$/\n/g' > ${TMPFILE})
eval "${DIALOG} --clear --no-collapse "\ eval "${DIALOG} --no-collapse "\
" --title 'Active network services (netstat -ltnp) [arrows to scroll]'" \ " --title 'Active network services (netstat -ltnp) [arrows to scroll]'" \
"--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\
${LARGE_HEIGHT} ${LARGE_WIDTH} ${LARGE_HEIGHT} ${LARGE_WIDTH}
@ -1419,7 +1441,7 @@ netdiag_services(){
##function ##function
netdiag_ping(){ netdiag_ping(){
HAS_PING=$(echo ${HAS_OPTS} | grep -c " ping ") HAS_PING=$(echo ${HAS_OPTS} | grep -E -c "\ ping\ ")
if [ ${HAS_PING} -ne 1 ]; then if [ ${HAS_PING} -ne 1 ]; then
notfound "ping" notfound "ping"
return return
@ -1428,13 +1450,13 @@ netdiag_ping(){
${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
eval "${DIALOG} --clear --msgbox 'Ping Aborted' \ eval "${DIALOG} --msgbox 'Ping Aborted' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
else else
PINGIP=$(cat ${TMPFILE}) PINGIP=$(cat ${TMPFILE})
ping -c 5 ${PINGIP} 2>&1 |\ ping -c 5 ${PINGIP} 2>&1 |\
eval "${DIALOG} --clear --title 'Ping ${PINGIP}' \ eval "${DIALOG} --title 'Ping ${PINGIP}' \
--programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE} --programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE}
if [ $! -ne 0 ];then if [ $! -ne 0 ];then
log "netdiag_ping" "ping aborted" log "netdiag_ping" "ping aborted"
@ -1455,13 +1477,13 @@ netdiag_traceroute(){
${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
eval "${DIALOG} --clear --msgbox 'Traceroute Aborted' \ eval "${DIALOG} --msgbox 'Traceroute Aborted' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
else else
TRACEIP=$(cat ${TMPFILE}) TRACEIP=$(cat ${TMPFILE})
traceroute ${TRACEIP} 2>&1 | \ traceroute ${TRACEIP} 2>&1 | \
eval "${DIALOG} --clear --title 'Traceroute ${TRACEIP}' \ eval "${DIALOG} --title 'Traceroute ${TRACEIP}' \
--programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE} --programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE}
if [ $! -ne 0 ];then if [ $! -ne 0 ];then
log "netdiag_traceroute" "traceroute aborted" log "netdiag_traceroute" "traceroute aborted"
@ -1471,7 +1493,7 @@ netdiag_traceroute(){
##function ##function
netdiag_query(){ netdiag_lookup(){
HAST_HOST=$(echo ${HAS_OPTS} | grep -c " host ") HAST_HOST=$(echo ${HAS_OPTS} | grep -c " host ")
if [ $? -ne 1 ]; then if [ $? -ne 1 ]; then
@ -1479,20 +1501,20 @@ netdiag_query(){
return return
fi fi
eval "${DIALOG} --insecure --inputbox 'Hostname or IP to query:' \ eval "${DIALOG} --insecure --inputbox 'Hostname or IP to lookup:' \
${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
eval "${DIALOG} --clear --msgbox 'DNS query aborted' \ eval "${DIALOG} --msgbox 'DNS lookup aborted' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
else else
QUERYIP=$(cat ${TMPFILE}) QUERYIP=$(cat ${TMPFILE})
host ${QUERYIP} 2>&1 |\ host ${QUERYIP} 2>&1 |\
eval "${DIALOG} --clear --title 'host ${QUERYIP}' \ eval "${DIALOG} --title 'host ${QUERYIP}' \
--programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE} --programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE}
if [ $! -ne 0 ];then if [ $! -ne 0 ];then
log "netdiag_ping" "host query aborted" log "netdiag_ping" "host lookup aborted"
fi fi
fi fi
@ -1526,8 +1548,8 @@ netdiag_menu(){
'ARP' 'Show ARP table' \ 'ARP' 'Show ARP table' \
'Connections' 'List active network connections' \ 'Connections' 'List active network connections' \
'DNS' 'List DNS servers' \ 'DNS' 'List DNS servers' \
'Lookup' 'DNS Lookup' \
'Ping' 'Ping a host' \ 'Ping' 'Ping a host' \
'Query' 'DNS Query' \
'Resolver' 'Show resolver configuration' \ 'Resolver' 'Show resolver configuration' \
'Routes' 'Show routing table' \ 'Routes' 'Show routing table' \
'Services' 'List active network daemons' \ 'Services' 'List active network daemons' \
@ -1551,8 +1573,8 @@ netdiag_menu(){
"Ping") "Ping")
netdiag_ping netdiag_ping
;; ;;
"Query") "Lookup")
netdiag_query netdiag_lookup
;; ;;
"Resolver") "Resolver")
netdiag_resolver netdiag_resolver
@ -1592,7 +1614,7 @@ dump_file(){
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
SEL_FILE=$(cat ${TMPFILE}) SEL_FILE=$(cat ${TMPFILE})
else else
eval "${DIALOG} --clear --msgbox 'Dump aborted' \ eval "${DIALOG} --msgbox 'Dump aborted' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
fi fi
@ -1608,11 +1630,11 @@ dump_file(){
eval "netdiag_${c} \"${DUMPFILE}\"" eval "netdiag_${c} \"${DUMPFILE}\""
done done
else else
eval "${DIALOG} --clear --msgbox 'Dump aborted' \ eval "${DIALOG} --msgbox 'Dump aborted' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
return return
fi fi
eval "${DIALOG} --clear --msgbox 'Status dumped to ${DUMPFILE}' \ eval "${DIALOG} --msgbox 'Status dumped to ${DUMPFILE}' \
${INFO_HEIGHT} ${INFO_WIDTH}" ${INFO_HEIGHT} ${INFO_WIDTH}"
} }
@ -1626,7 +1648,7 @@ dump_pastebin(){
##function ##function
dump_menu(){ dump_menu(){
eval "${DIALOG} --clear --checklist 'Select conf to dump' \ eval "${DIALOG} --checklist 'Select conf to dump' \
${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 \ ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 \
'ARP' 'ARP table' on \ 'ARP' 'ARP table' on \
'devices' 'Device configuration' on \ 'devices' 'Device configuration' on \
@ -1641,7 +1663,7 @@ dump_menu(){
DUMP_CONF=$(cat ${TMPFILE}) DUMP_CONF=$(cat ${TMPFILE})
eval "${DIALOG} --clear --cancel-label 'Up' \ eval "${DIALOG} --cancel-label 'Up' \
--menu 'Dump configuration to:' \ --menu 'Dump configuration to:' \
${INFO_HEIGHT} ${INFO_WIDTH} 6 \ ${INFO_HEIGHT} ${INFO_WIDTH} 6 \
'File' 'Dump to file' \ 'File' 'Dump to file' \
@ -1667,7 +1689,7 @@ dump_menu(){
show_toplevel(){ show_toplevel(){
log "show_toplevel" "TMPFILE: ${TMPFILE}" log "show_toplevel" "TMPFILE: ${TMPFILE}"
eval "${DIALOG} --clear --cancel-label 'Quit' --menu 'Main Menu' \ eval "${DIALOG} --cancel-label 'Quit' --menu 'Main Menu' \
${WINDOW_HEIGHT} ${WINDOW_WIDTH} 6 \ ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 6 \
'Setup' 'Setup interfaces' \ 'Setup' 'Setup interfaces' \
'Info' 'Network diagnostics' \ 'Info' 'Network diagnostics' \
@ -1717,7 +1739,7 @@ show_disclaimer(){
Copyleft (C) KatolaZ (katolaz@freaknet.org) Copyleft (C) KatolaZ (katolaz@freaknet.org)
2016, 2017 2016, 2017
-+- This is an alpha release of setnet.sh -+- -+- This is a beta release of setnet.sh -+-
THIS IS FREE SOFTWARE THIS IS FREE SOFTWARE
YOU CAN USE AND DISTRIBUTE IT UNDER THE YOU CAN USE AND DISTRIBUTE IT UNDER THE
@ -1732,7 +1754,7 @@ show_disclaimer(){
your right and distribution terms your right and distribution terms
EOF EOF
eval "${DIALOG} --clear --cr-wrap --textbox ${TMPFILE} 23 60" eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} 23 60"
return return
} }
@ -1777,7 +1799,7 @@ initialise(){
##function ##function
log_show(){ log_show(){
eval "${DIALOG} --clear --cr-wrap --title 'setnet log file (${LOGFILE})'\ eval "${DIALOG} --cr-wrap --title 'setnet log file (${LOGFILE})'\
--textbox ${LOGFILE} \ --textbox ${LOGFILE} \
${WINDOW_HEIGHT} ${WINDOW_WIDTH}" ${WINDOW_HEIGHT} ${WINDOW_WIDTH}"

Loading…
Cancel
Save