From e6b1ccf8986b82ba1104c4d92343723dc69442ac Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Wed, 8 Mar 2017 11:26:23 +0000 Subject: [PATCH] deb package 0.3.2 --- debian_package/setnet-0.3.2/ChangeLog | 41 + .../setnet-0.3.2/debian/README.Debian | 132 + .../setnet-0.3.2/debian/README.source | 10 + debian_package/setnet-0.3.2/debian/changelog | 52 + debian_package/setnet-0.3.2/debian/compat | 1 + debian_package/setnet-0.3.2/debian/control | 19 + debian_package/setnet-0.3.2/debian/copyright | 21 + .../setnet-0.3.2/debian/debhelper-build-stamp | 1 + debian_package/setnet-0.3.2/debian/files | 1 + debian_package/setnet-0.3.2/debian/init.d.ex | 26 + debian_package/setnet-0.3.2/debian/install | 5 + .../setnet-0.3.2/debian/manpage.1.ex | 56 + .../setnet-0.3.2/debian/manpage.sgml.ex | 154 ++ .../setnet-0.3.2/debian/manpage.xml.ex | 291 +++ debian_package/setnet-0.3.2/debian/menu.ex | 2 + .../setnet-0.3.2/debian/postinst.ex | 39 + debian_package/setnet-0.3.2/debian/postrm.ex | 37 + debian_package/setnet-0.3.2/debian/preinst.ex | 35 + debian_package/setnet-0.3.2/debian/prerm.ex | 38 + debian_package/setnet-0.3.2/debian/rules | 25 + .../setnet-0.3.2/debian/setnet-docs.docs | 2 + .../setnet-0.3.2/debian/setnet.cron.d.ex | 4 + .../setnet-0.3.2/debian/setnet.debhelper.log | 20 + .../setnet-0.3.2/debian/setnet.default.ex | 10 + .../setnet-0.3.2/debian/setnet.doc-base.EX | 20 + .../setnet-0.3.2/debian/setnet.substvars | 2 + .../debian/setnet/DEBIAN/conffiles | 2 + .../setnet-0.3.2/debian/setnet/DEBIAN/control | 14 + .../setnet-0.3.2/debian/setnet/DEBIAN/md5sums | 7 + .../setnet-0.3.2/debian/setnet/etc/setnetrc | 28 + .../setnet/etc/wpa_supplicant/wpa_setnet.conf | 3 + .../debian/setnet/usr/sbin/setnet.sh | 2208 +++++++++++++++++ .../setnet/usr/share/doc/setnet/ChangeLog | 41 + .../setnet/usr/share/doc/setnet/README.Debian | 132 + .../usr/share/doc/setnet/changelog.Debian.gz | Bin 0 -> 563 bytes .../setnet/usr/share/doc/setnet/changelog.gz | Bin 0 -> 578 bytes .../setnet/usr/share/doc/setnet/copyright | 21 + .../setnet/usr/share/man/man8/setnet.8.gz | Bin 0 -> 3027 bytes .../setnet-0.3.2/debian/source/format | 1 + debian_package/setnet-0.3.2/debian/watch.ex | 39 + debian_package/setnet-0.3.2/setnet.8.gz | Bin 0 -> 3037 bytes debian_package/setnet-0.3.2/setnet.sh | 2208 +++++++++++++++++ debian_package/setnet-0.3.2/setnetrc | 28 + debian_package/setnet-0.3.2/wpa_setnet.conf | 3 + debian_package/setnet_0.3.2-1.debian.tar.xz | Bin 0 -> 9800 bytes debian_package/setnet_0.3.2-1.dsc | 31 + debian_package/setnet_0.3.2-1_all.deb | Bin 0 -> 19392 bytes debian_package/setnet_0.3.2-1_amd64.changes | 42 + debian_package/setnet_0.3.2.orig.tar.xz | Bin 0 -> 15436 bytes 49 files changed, 5852 insertions(+) create mode 100644 debian_package/setnet-0.3.2/ChangeLog create mode 100644 debian_package/setnet-0.3.2/debian/README.Debian create mode 100644 debian_package/setnet-0.3.2/debian/README.source create mode 100644 debian_package/setnet-0.3.2/debian/changelog create mode 100644 debian_package/setnet-0.3.2/debian/compat create mode 100644 debian_package/setnet-0.3.2/debian/control create mode 100644 debian_package/setnet-0.3.2/debian/copyright create mode 100644 debian_package/setnet-0.3.2/debian/debhelper-build-stamp create mode 100644 debian_package/setnet-0.3.2/debian/files create mode 100644 debian_package/setnet-0.3.2/debian/init.d.ex create mode 100644 debian_package/setnet-0.3.2/debian/install create mode 100644 debian_package/setnet-0.3.2/debian/manpage.1.ex create mode 100644 debian_package/setnet-0.3.2/debian/manpage.sgml.ex create mode 100644 debian_package/setnet-0.3.2/debian/manpage.xml.ex create mode 100644 debian_package/setnet-0.3.2/debian/menu.ex create mode 100644 debian_package/setnet-0.3.2/debian/postinst.ex create mode 100644 debian_package/setnet-0.3.2/debian/postrm.ex create mode 100644 debian_package/setnet-0.3.2/debian/preinst.ex create mode 100644 debian_package/setnet-0.3.2/debian/prerm.ex create mode 100755 debian_package/setnet-0.3.2/debian/rules create mode 100644 debian_package/setnet-0.3.2/debian/setnet-docs.docs create mode 100644 debian_package/setnet-0.3.2/debian/setnet.cron.d.ex create mode 100644 debian_package/setnet-0.3.2/debian/setnet.debhelper.log create mode 100644 debian_package/setnet-0.3.2/debian/setnet.default.ex create mode 100644 debian_package/setnet-0.3.2/debian/setnet.doc-base.EX create mode 100644 debian_package/setnet-0.3.2/debian/setnet.substvars create mode 100644 debian_package/setnet-0.3.2/debian/setnet/DEBIAN/conffiles create mode 100644 debian_package/setnet-0.3.2/debian/setnet/DEBIAN/control create mode 100644 debian_package/setnet-0.3.2/debian/setnet/DEBIAN/md5sums create mode 100644 debian_package/setnet-0.3.2/debian/setnet/etc/setnetrc create mode 100644 debian_package/setnet-0.3.2/debian/setnet/etc/wpa_supplicant/wpa_setnet.conf create mode 100755 debian_package/setnet-0.3.2/debian/setnet/usr/sbin/setnet.sh create mode 100644 debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/ChangeLog create mode 100644 debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/README.Debian create mode 100644 debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/changelog.Debian.gz create mode 100644 debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/changelog.gz create mode 100644 debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/copyright create mode 100644 debian_package/setnet-0.3.2/debian/setnet/usr/share/man/man8/setnet.8.gz create mode 100644 debian_package/setnet-0.3.2/debian/source/format create mode 100644 debian_package/setnet-0.3.2/debian/watch.ex create mode 100644 debian_package/setnet-0.3.2/setnet.8.gz create mode 100755 debian_package/setnet-0.3.2/setnet.sh create mode 100644 debian_package/setnet-0.3.2/setnetrc create mode 100644 debian_package/setnet-0.3.2/wpa_setnet.conf create mode 100644 debian_package/setnet_0.3.2-1.debian.tar.xz create mode 100644 debian_package/setnet_0.3.2-1.dsc create mode 100644 debian_package/setnet_0.3.2-1_all.deb create mode 100644 debian_package/setnet_0.3.2-1_amd64.changes create mode 100644 debian_package/setnet_0.3.2.orig.tar.xz diff --git a/debian_package/setnet-0.3.2/ChangeLog b/debian_package/setnet-0.3.2/ChangeLog new file mode 100644 index 0000000..18e95e6 --- /dev/null +++ b/debian_package/setnet-0.3.2/ChangeLog @@ -0,0 +1,41 @@ +2017-03-08 KatolaZ + + * setnet.sh (wifi_restart_wpa): Corrected a bug in the restart of + wpa_supplicant. + +2017-03-07 KatolaZ + + * setnet.sh (check_deps): Corrected a small bug in the parsing of options + +2017-01-29 KatolaZ + + * setnet.sh: + * removed "Load file" and "New File" in WiFi configuration + +2017-01-23 KatolaZ + + * setnet.sh: + * fixed a few minors bugs + +2017-01-20 KatolaZ + + * setnet.sh (0.3): + * implemented check of running shell + * implemented workaround for zsh -- now fully supported + * added chk_out and chk_exit + * all direct commands (e.g., ip, wpa_cli) are now checked + * added support for EAP/PEAP + * added support for EAP/TLS + + +2017-01-07 KatolaZ + + * setnet.sh (configure_device): Improved wifi detection + (netdiag_ping), (netdiag_traceroute),(netdiag_query): + changed dialog to programbox + * solved viasualitation bug in ip config + * added a manpage + * Added configuration variable "WIFI_DEVICES" + * The "Setup interface" menu has been reorganised + * added "Config IP Address" and "Manage Wifi Networking" + diff --git a/debian_package/setnet-0.3.2/debian/README.Debian b/debian_package/setnet-0.3.2/debian/README.Debian new file mode 100644 index 0000000..0cad044 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/README.Debian @@ -0,0 +1,132 @@ ++--------------+ +| setnet | ++--------------+ + +Copyleft (C) Vincenzo "KatolaZ" Nicosia + 2016, 2017 + +=== DESCRIPTION === + +setnet is a shell script with a dialog UI to configure ethernet and +wifi connections. It is meant to be POSIX-compliant, and has been +tested with bash, busybox, dash, ksh, mksh, posh, and yash. It is +still to be considered beta software, so you should use it AT YOUR OWN +RISK, but it is already fully functional. + +=== LICENSE === + +setnet is Free Software, and can be used and distributed under the +terms of the GNU General Public License, either version 3 of the +licence or, at your option, any later version. + +Please see the file LICENSE for more information + +=== DEPENDENCIES === + +In order to run setset, you MUST satisfy this (relatively small) set +of dependencies: + + - a posix-compliant shell (bash, busybox, dash, ksh, mksh, posh, and + yash have been tested) + + - dialog (version 1.2 tested, but it should work with previous + versions as well) + + - dhcp-client (for dhclient, tested with isc-dhcp-client) + + - iproute2 (for ip) + + - wireless-tools (for iwconfig, currently required for interface + identification) + +Most of those tools might already be installed in your system anyway. +In particular, setnet uses: + + - dialog: to provide a minimal Text-based User Interface, + - ip: to configure network interfaces and get information about them, + - dhclient: for DHCP-based IP configuration + - iwconfig: to check whether a network device is a wifi adapter + +In order to use the full set of functionalities provided by setnet, +you MIGHT also need the following packages: + + - wpa_supplicant (for wifi configuration) + + - net-tools (for netstat, to gather information about network status) + + - iputils-ping (for ping) + + - bind9-nost (for host, used to check DNS configuration) + + - traceroute (to trace the route between your host and any other host + in the Internet) + +Again, most of them should be already installed in your system anyway. + +=== USAGE === + +setnet is installed under /usr/sbin/setnet.sh. If invoked with "-h", +it provides a list of supported options: + +$ ./setnet.sh -h +Usage: setnet.sh [OPTION] +Options: + -c cfg_file Load configuration from cfg_file. + -v Print version number and exit. + -h Show this help. +$ + +If the argument "-c" is specified, setnet will use the provided +configuration file. Otherwise, it will look for its configuration file +in one of the following locations: + + - /etc/setnetrc + - ~/.setnetrc + +in the given order. The following configuration variables should be +defined in setnetrc: + + + - WPA_FILE + This is the file configuration file used by wpa_supplicant. + + - LOGNAME + This is the file used for logging. + + - TRUNCATE_LOG + if equal to "yes", the log file will be truncated when setnet + starts + + +=== root vs. mortal users === + +Networking is an amdinistration task, and as such should be performed +by the host administrator, i.e., the user with UID 0 (normally called +"root"). However, in many modern GNU/Linux systems it is customary to +allow normal users to perform some administration tasks. There are at +least two concrete possibilities to allow a particular user (in the +following we call such user "fool") to configure network interfaces +using setnet. + + +-- 1) First approach: using sudo + +If sudo is installed in your system, it is sufficient to add the +following line: + + fool ALL=NOPASSWD: /usr/sbin/setnet.sh + +to the file /etc/sudoers, and the user "fool" will be able to run +setnet.sh with effective UID 0 (i.e., as if it was root), by using the +command: + +[fool@host]$ sudo /usr/sbin/setnet.sh + +and thus will be able to perform all the needed admin tasks to +configure networking. + +-- 2) Second approach: using sup + +......TO BE DOCUMENTED...... + + diff --git a/debian_package/setnet-0.3.2/debian/README.source b/debian_package/setnet-0.3.2/debian/README.source new file mode 100644 index 0000000..acbd725 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/README.source @@ -0,0 +1,10 @@ +setnet for Debian +---------------- + + + + + + -- Vincenzo (KatolaZ) Nicosia Wed, 04 Jan 2017 18:52:56 +0000 + diff --git a/debian_package/setnet-0.3.2/debian/changelog b/debian_package/setnet-0.3.2/debian/changelog new file mode 100644 index 0000000..2473971 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/changelog @@ -0,0 +1,52 @@ +setnet (0.3.2-1) unstable; urgency=medium + + * Version 0.3.2 -- See ChangeLog for details + + -- Vincenzo (KatolaZ) Nicosia Wed, 08 Mar 2017 11:25:07 +0000 + +setnet (0.3.1-1) unstable; urgency=medium + + * Version 0.3.1 -- See ChangeLog for details + + -- Vincenzo (KatolaZ) Nicosia Tue, 07 Mar 2017 11:29:07 +0000 + +setnet (0.3-1) unstable; urgency=medium + + * Version 0.3 -- See ChangeLog for details + + -- Vincenzo (KatolaZ) Nicosia Sun, 29 Jan 2017 15:43:35 +0000 + +setnet (0.2.1-1) unstable; urgency=medium + + + * Version 0.2.1 -- See ChangeLog for details + + -- Vincenzo (KatolaZ) Nicosia Sat, 07 Jan 2017 23:29:44 +0000 + +setnet (0.2-1) unstable; urgency=medium + + * Initial release (20170104) + + == Major Changes == + + + Polished code to make it posix-shell compliant + + + Tested with bash, busybox, dash, ksh, mksh, posh, yash + + + Added support and checks for hard, soft, and optional + dependencies + + + Added standard command line options (-c, -h, -v) + + + Added submenu "Info" with basic network testing tools + + + Added submenu "Dump" to dump network information to a file + + + Added submenu "Log" (shows setnet logfile) + + + Added status information in device configuration panel + + + Added minimal README.Debian file + + + -- Vincenzo (KatolaZ) Nicosia Wed, 04 Jan 2017 18:52:56 +0000 diff --git a/debian_package/setnet-0.3.2/debian/compat b/debian_package/setnet-0.3.2/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian_package/setnet-0.3.2/debian/control b/debian_package/setnet-0.3.2/debian/control new file mode 100644 index 0000000..4070ca4 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/control @@ -0,0 +1,19 @@ +Source: setnet +Section: unknown +Priority: optional +Maintainer: Vincenzo (KatolaZ) Nicosia +Build-Depends: debhelper (>=9) +Standards-Version: 3.9.8 +Homepage: http://kalos.mine.nu/setnet +#Vcs-Git: git://anonscm.debian.org/collab-maint/setnet.git +#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/setnet.git + +Package: setnet +Architecture: all +Depends: bash | busybox | dash | ksh | mksh | posh | yash | zsh, dhcp-client, dialog, iproute2, iw +Suggests: wpasupplicant, pastebinit, net-tools, iputils-ping, bind9-host, traceroute +Description: simple shell/dialog tool to configure networks + setnet is a shell script with a dialog UI to configure ethernet + and wifi connections. It is meant to be POSIX-compliant, and has + been tested on bash, busybox, dash, ksh, mksh, posh, yash, and zsh. + diff --git a/debian_package/setnet-0.3.2/debian/copyright b/debian_package/setnet-0.3.2/debian/copyright new file mode 100644 index 0000000..f425891 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/copyright @@ -0,0 +1,21 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: setnet +Source: + +Files: debian/* +Copyright: 2016 Vincenzo (KatolaZ) Nicosia +License: GPL-3+ + This package 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 3 of the License, or + (at your option) any later version. + . + This package 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, see + . + diff --git a/debian_package/setnet-0.3.2/debian/debhelper-build-stamp b/debian_package/setnet-0.3.2/debian/debhelper-build-stamp new file mode 100644 index 0000000..c166bc0 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/debhelper-build-stamp @@ -0,0 +1 @@ +setnet diff --git a/debian_package/setnet-0.3.2/debian/files b/debian_package/setnet-0.3.2/debian/files new file mode 100644 index 0000000..c9c68f4 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/files @@ -0,0 +1 @@ +setnet_0.3.2-1_all.deb unknown optional diff --git a/debian_package/setnet-0.3.2/debian/init.d.ex b/debian_package/setnet-0.3.2/debian/init.d.ex new file mode 100644 index 0000000..08360e2 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/init.d.ex @@ -0,0 +1,26 @@ +#!/bin/sh +# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. +if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then + set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script +fi +### BEGIN INIT INFO +# Provides: setnet +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: +# Description: +# <...> +# <...> +### END INIT INFO + +# Author: Vincenzo (KatolaZ) Nicosia + +DESC="setnet" +DAEMON=/usr/bin/setnet + +# This is an example to start a single forking daemon capable of writing +# a pid file. To get other behaviors, implement do_start(), do_stop() or +# other functions to override the defaults in /lib/init/init-d-script. +# See also init-d-script(5) diff --git a/debian_package/setnet-0.3.2/debian/install b/debian_package/setnet-0.3.2/debian/install new file mode 100644 index 0000000..dab18fe --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/install @@ -0,0 +1,5 @@ +setnet.sh /usr/sbin +setnetrc /etc/ +wpa_setnet.conf /etc/wpa_supplicant/ +setnet.8.gz /usr/share/man/man8/ +ChangeLog /usr/share/doc/setnet/ diff --git a/debian_package/setnet-0.3.2/debian/manpage.1.ex b/debian_package/setnet-0.3.2/debian/manpage.1.ex new file mode 100644 index 0000000..c48d1ce --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/manpage.1.ex @@ -0,0 +1,56 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" (C) Copyright 2017 Vincenzo (KatolaZ) Nicosia , +.\" +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH Setnet SECTION "January 4 2017" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +setnet \- program to do something +.SH SYNOPSIS +.B setnet +.RI [ options ] " files" ... +.br +.B bar +.RI [ options ] " files" ... +.SH DESCRIPTION +This manual page documents briefly the +.B setnet +and +.B bar +commands. +.PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBsetnet\fP is a program that... +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +For a complete description, see the Info files. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-v, \-\-version +Show version of program. +.SH SEE ALSO +.BR bar (1), +.BR baz (1). +.br +The programs are documented fully by +.IR "The Rise and Fall of a Fooish Bar" , +available via the Info system. diff --git a/debian_package/setnet-0.3.2/debian/manpage.sgml.ex b/debian_package/setnet-0.3.2/debian/manpage.sgml.ex new file mode 100644 index 0000000..8e6d551 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/manpage.sgml.ex @@ -0,0 +1,154 @@ + manpage.1'. You may view + the manual page with: `docbook-to-man manpage.sgml | nroff -man | + less'. A typical entry in a Makefile or Makefile.am is: + +manpage.1: manpage.sgml + docbook-to-man $< > $@ + + + The docbook-to-man binary is found in the docbook-to-man package. + Please remember that if you create the nroff version in one of the + debian/rules file targets (such as build), you will need to include + docbook-to-man in your Build-Depends control field. + + --> + + + FIRSTNAME"> + SURNAME"> + + January 4 2017"> + + SECTION"> + katolaz@freaknet.org"> + + Setnet"> + + + Debian"> + GNU"> + GPL"> +]> + + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2003 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + program to do something + + + + &dhpackage; + + + + + + + + DESCRIPTION + + This manual page documents briefly the + &dhpackage; and bar + commands. + + This manual page was written for the &debian; distribution + because the original program does not have a manual page. + Instead, it has documentation in the &gnu; + Info format; see below. + + &dhpackage; is a program that... + + + + OPTIONS + + These programs follow the usual &gnu; command line syntax, + with long options starting with two dashes (`-'). A summary of + options is included below. For a complete description, see the + Info files. + + + + + + + + Show summary of options. + + + + + + + + Show version of program. + + + + + + SEE ALSO + + bar (1), baz (1). + + The programs are documented fully by The Rise and + Fall of a Fooish Bar available via the + Info system. + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (and may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the &gnu; General Public License, Version 2 any + later version published by the Free Software Foundation. + + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL. + + + +
+ + diff --git a/debian_package/setnet-0.3.2/debian/manpage.xml.ex b/debian_package/setnet-0.3.2/debian/manpage.xml.ex new file mode 100644 index 0000000..ae9864a --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/manpage.xml.ex @@ -0,0 +1,291 @@ + +.
will be generated. You may view the +manual page with: nroff -man .
| less'. A typical entry +in a Makefile or Makefile.am is: + +DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/docbook-xsl/manpages/docbook.xsl +XP = xsltproc -''-nonet -''-param man.charmap.use.subset "0" + +manpage.1: manpage.xml + $(XP) $(DB2MAN) $< + +The xsltproc binary is found in the xsltproc package. The XSL files are in +docbook-xsl. A description of the parameters you can use can be found in the +docbook-xsl-doc-* packages. Please remember that if you create the nroff +version in one of the debian/rules file targets (such as build), you will need +to include xsltproc and docbook-xsl in your Build-Depends control field. +Alternatively use the xmlto command/package. That will also automatically +pull in xsltproc and docbook-xsl. + +Notes for using docbook2x: docbook2x-man does not automatically create the +AUTHOR(S) and COPYRIGHT sections. In this case, please add them manually as + ... . + +To disable the automatic creation of the AUTHOR(S) and COPYRIGHT sections +read /usr/share/doc/docbook-xsl/doc/manpages/authors.html. This file can be +found in the docbook-xsl-doc-html package. + +Validation can be done using: `xmllint -''-noout -''-valid manpage.xml` + +General documentation about man-pages and man-page-formatting: +man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ + +--> + + + + + + + + + + + + + +]> + + + + &dhtitle; + &dhpackage; + + + &dhfirstname; + &dhsurname; + Wrote this manpage for the Debian system. +
+ &dhemail; +
+
+
+ + 2007 + &dhusername; + + + This manual page was written for the Debian system + (and may be used by others). + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU General Public License, + Version 2 or (at your option) any later version published by + the Free Software Foundation. + On Debian systems, the complete text of the GNU General Public + License can be found in + /usr/share/common-licenses/GPL. + +
+ + &dhucpackage; + &dhsection; + + + &dhpackage; + program to do something + + + + &dhpackage; + + + + + + + + + this + + + + + + + + this + that + + + + + &dhpackage; + + + + + + + + + + + + + + + + + + + DESCRIPTION + This manual page documents briefly the + &dhpackage; and bar + commands. + This manual page was written for the Debian distribution + because the original program does not have a manual page. + Instead, it has documentation in the GNU + info + 1 + format; see below. + &dhpackage; is a program that... + + + OPTIONS + The program follows the usual GNU command line syntax, + with long options starting with two dashes (`-'). A summary of + options is included below. For a complete description, see the + + info + 1 + files. + + + + + + + Does this and that. + + + + + + + Show summary of options. + + + + + + + Show version of program. + + + + + + FILES + + + /etc/foo.conf + + The system-wide configuration file to control the + behaviour of &dhpackage;. See + + foo.conf + 5 + for further details. + + + + ${HOME}/.foo.conf + + The per-user configuration file to control the + behaviour of &dhpackage;. See + + foo.conf + 5 + for further details. + + + + + + ENVIRONMENT + + + FOO_CONF + + If used, the defined file is used as configuration + file (see also ). + + + + + + DIAGNOSTICS + The following diagnostics may be issued + on stderr: + + + Bad configuration file. Exiting. + + The configuration file seems to contain a broken configuration + line. Use the option, to get more info. + + + + + &dhpackage; provides some return codes, that can + be used in scripts: + + Code + Diagnostic + + 0 + Program exited successfully. + + + 1 + The configuration file seems to be broken. + + + + + + BUGS + The program is currently limited to only work + with the foobar library. + The upstreams BTS can be found + at . + + + SEE ALSO + + + bar + 1 + , + baz + 1 + , + foo.conf + 5 + + The programs are documented fully by The Rise and + Fall of a Fooish Bar available via the + info + 1 + system. + +
+ diff --git a/debian_package/setnet-0.3.2/debian/menu.ex b/debian_package/setnet-0.3.2/debian/menu.ex new file mode 100644 index 0000000..3f6b8bb --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/menu.ex @@ -0,0 +1,2 @@ +?package(setnet):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\ + title="setnet" command="/usr/bin/setnet" diff --git a/debian_package/setnet-0.3.2/debian/postinst.ex b/debian_package/setnet-0.3.2/debian/postinst.ex new file mode 100644 index 0000000..63f6b54 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/postinst.ex @@ -0,0 +1,39 @@ +#!/bin/sh +# postinst script for setnet +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian_package/setnet-0.3.2/debian/postrm.ex b/debian_package/setnet-0.3.2/debian/postrm.ex new file mode 100644 index 0000000..14fe7e0 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/postrm.ex @@ -0,0 +1,37 @@ +#!/bin/sh +# postrm script for setnet +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian_package/setnet-0.3.2/debian/preinst.ex b/debian_package/setnet-0.3.2/debian/preinst.ex new file mode 100644 index 0000000..09a88b6 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/preinst.ex @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for setnet +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian_package/setnet-0.3.2/debian/prerm.ex b/debian_package/setnet-0.3.2/debian/prerm.ex new file mode 100644 index 0000000..725e2b8 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/prerm.ex @@ -0,0 +1,38 @@ +#!/bin/sh +# prerm script for setnet +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian_package/setnet-0.3.2/debian/rules b/debian_package/setnet-0.3.2/debian/rules new file mode 100755 index 0000000..2f54c47 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/rules @@ -0,0 +1,25 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ + + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + diff --git a/debian_package/setnet-0.3.2/debian/setnet-docs.docs b/debian_package/setnet-0.3.2/debian/setnet-docs.docs new file mode 100644 index 0000000..efea0a6 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet-docs.docs @@ -0,0 +1,2 @@ +README.Debian +README.source diff --git a/debian_package/setnet-0.3.2/debian/setnet.cron.d.ex b/debian_package/setnet-0.3.2/debian/setnet.cron.d.ex new file mode 100644 index 0000000..fd54f7d --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet.cron.d.ex @@ -0,0 +1,4 @@ +# +# Regular cron jobs for the setnet package +# +0 4 * * * root [ -x /usr/bin/setnet_maintenance ] && /usr/bin/setnet_maintenance diff --git a/debian_package/setnet-0.3.2/debian/setnet.debhelper.log b/debian_package/setnet-0.3.2/debian/setnet.debhelper.log new file mode 100644 index 0000000..a058680 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet.debhelper.log @@ -0,0 +1,20 @@ +dh_update_autotools_config +dh_auto_configure +dh_auto_build +dh_auto_test +dh_prep +dh_auto_install +dh_install +dh_installdocs +dh_installchangelogs +dh_installman +dh_perl +dh_link +dh_strip_nondeterminism +dh_compress +dh_fixperms +dh_installdeb +dh_gencontrol +dh_md5sums +dh_builddeb +dh_builddeb diff --git a/debian_package/setnet-0.3.2/debian/setnet.default.ex b/debian_package/setnet-0.3.2/debian/setnet.default.ex new file mode 100644 index 0000000..ade741e --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet.default.ex @@ -0,0 +1,10 @@ +# Defaults for setnet initscript +# sourced by /etc/init.d/setnet +# installed at /etc/default/setnet by the maintainer scripts + +# +# This is a POSIX shell fragment +# + +# Additional options that are passed to the Daemon. +DAEMON_OPTS="" diff --git a/debian_package/setnet-0.3.2/debian/setnet.doc-base.EX b/debian_package/setnet-0.3.2/debian/setnet.doc-base.EX new file mode 100644 index 0000000..42bd26a --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet.doc-base.EX @@ -0,0 +1,20 @@ +Document: setnet +Title: Debian setnet Manual +Author: +Abstract: This manual describes what setnet is + and how it can be used to + manage online manuals on Debian systems. +Section: unknown + +Format: debiandoc-sgml +Files: /usr/share/doc/setnet/setnet.sgml.gz + +Format: postscript +Files: /usr/share/doc/setnet/setnet.ps.gz + +Format: text +Files: /usr/share/doc/setnet/setnet.text.gz + +Format: HTML +Index: /usr/share/doc/setnet/html/index.html +Files: /usr/share/doc/setnet/html/*.html diff --git a/debian_package/setnet-0.3.2/debian/setnet.substvars b/debian_package/setnet-0.3.2/debian/setnet.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian_package/setnet-0.3.2/debian/setnet/DEBIAN/conffiles b/debian_package/setnet-0.3.2/debian/setnet/DEBIAN/conffiles new file mode 100644 index 0000000..3479547 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet/DEBIAN/conffiles @@ -0,0 +1,2 @@ +/etc/setnetrc +/etc/wpa_supplicant/wpa_setnet.conf diff --git a/debian_package/setnet-0.3.2/debian/setnet/DEBIAN/control b/debian_package/setnet-0.3.2/debian/setnet/DEBIAN/control new file mode 100644 index 0000000..2a46202 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet/DEBIAN/control @@ -0,0 +1,14 @@ +Package: setnet +Version: 0.3.2-1 +Architecture: all +Maintainer: Vincenzo (KatolaZ) Nicosia +Installed-Size: 106 +Depends: bash | busybox | dash | ksh | mksh | posh | yash | zsh, dhcp-client, dialog, iproute2, iw +Suggests: wpasupplicant, pastebinit, net-tools, iputils-ping, bind9-host, traceroute +Section: unknown +Priority: optional +Homepage: http://kalos.mine.nu/setnet +Description: simple shell/dialog tool to configure networks + setnet is a shell script with a dialog UI to configure ethernet + and wifi connections. It is meant to be POSIX-compliant, and has + been tested on bash, busybox, dash, ksh, mksh, posh, yash, and zsh. diff --git a/debian_package/setnet-0.3.2/debian/setnet/DEBIAN/md5sums b/debian_package/setnet-0.3.2/debian/setnet/DEBIAN/md5sums new file mode 100644 index 0000000..8fcb337 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet/DEBIAN/md5sums @@ -0,0 +1,7 @@ +13eff60bdff970ae6f7a8710f03a9a64 usr/sbin/setnet.sh +36f4f1c7e6b389cf9a0444827583ab0e usr/share/doc/setnet/ChangeLog +d690d59753d9fcd42667d50efb859a68 usr/share/doc/setnet/README.Debian +e7c5cb04f8c932f77d79ba0d6dda2cc8 usr/share/doc/setnet/changelog.Debian.gz +ef33ece6628473570da1d44d965d77b6 usr/share/doc/setnet/changelog.gz +e5218c2f383b136780a03ba5e3f610b2 usr/share/doc/setnet/copyright +5085750511379132343cff7e67c8c4ba usr/share/man/man8/setnet.8.gz diff --git a/debian_package/setnet-0.3.2/debian/setnet/etc/setnetrc b/debian_package/setnet-0.3.2/debian/setnet/etc/setnetrc new file mode 100644 index 0000000..78cc985 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet/etc/setnetrc @@ -0,0 +1,28 @@ +## +## +## setnetrc -- configuration file for setnet +## +## + +## +## WPA_FILE: The default configuration file for wpa_supplicant +## +WPA_FILE=/etc/wpa_supplicant/wpa_setnet.conf + + +## +## LOGFILE: Location of the logfile +## +LOGFILE=/var/log/setnet.log + +## +## TRUNCATE_LOG: Truncate the log file at startup +## +TRUNCATE_LOG="yes" + +## +## WIFI_DEVICES: List of Wi-Fi devices, to be used if automatic +## detection fails +## + +##WIFI_DEVICES="wlan1 wlan4" diff --git a/debian_package/setnet-0.3.2/debian/setnet/etc/wpa_supplicant/wpa_setnet.conf b/debian_package/setnet-0.3.2/debian/setnet/etc/wpa_supplicant/wpa_setnet.conf new file mode 100644 index 0000000..07d4b6d --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet/etc/wpa_supplicant/wpa_setnet.conf @@ -0,0 +1,3 @@ +ctrl_interface=/var/run/wpa_supplicant +update_config=1 + diff --git a/debian_package/setnet-0.3.2/debian/setnet/usr/sbin/setnet.sh b/debian_package/setnet-0.3.2/debian/setnet/usr/sbin/setnet.sh new file mode 100755 index 0000000..34de178 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet/usr/sbin/setnet.sh @@ -0,0 +1,2208 @@ +#!/bin/sh + +# 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 3 of the License, 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, see . +# +# ---------------------------------------------------------------------- +# +# setnet.sh -- view and configure network interfaces +# +# ---------------------------------------------------------------------- +# +# Copyleft (C) Vincenzo "KatolaZ" Nicosia (katolaz@freaknet.org) -- +# (2016, 2017) +# +# + + +## +## Initialisation +## + +VERSION=0.3.1 + + +TOPSTR="setnet-${VERSION} [user: $(id -run)]" +DIALOG="dialog --backtitle \"${TOPSTR}\" --clear " + + +############################### +## ## +## Internal config variables ## +## ## +############################### + +## +## Required dependencies. If any of those commands is missing, +## the script will exit +## + +HARD_DEPS="ip dhclient dialog iw sed grep cat awk which" + +## +## Suggested dependencies. The script will issue a warning if any of +## those commands is missing +## + +SOFT_DEPS="wpa_cli wpa_supplicant" + +## +## Optional dependencies. The script will check if those dependencies +## exist, and if they do, will set a variable HAS_OPTS which contains +## the names of the commands actually found +## + +OPT_DEPS="host ping traceroute netstat pastebinit" + +################################# + +##################################### +## ## +## HEIGHT/WIDTH of various dialogs ## +## ## +##################################### + +## +## Regular windows +## + +WINDOW_WIDTH=75 +WINDOW_HEIGHT=20 + +## +## Infoboxes +## +INFO_WIDTH=40 +INFO_HEIGHT=10 + + +## +## Forms +## +FORM_WIDTH=60 +FORM_HEIGHT=12 + +## +## Large windows +## + +LARGE_WIDTH=80 +LARGE_HEIGHT=20 + + +################################# + +################################ +## ## +## Supported network families ## +## ## +################################ + +NET_FAMILIES="inet inet6" + +################################# + +## +## Load the configuration file "setnetrc" +## + +##function +load_setnetrc(){ + + WPA_FILE="" + LOGFILE="" + ## If we were given a parameter, that is the rc file to load... + ## + if [ $# -ge 1 ]; then + . "$1" + return + fi + + ## + ## Otherwise, let's look in the standard locations, namely: + ## + + ## + ## 1) /etc/setnetrc + ## + + if [ -f /etc/setnetrc ]; then + SETNETRC=/etc/setnetrc + fi + + ## + ## 2) ~/.setnetrc + ## + + if [ -f ~/.setnetrc ]; then + SETNETRC=~/.setnetrc + fi + + if [ -n "${SETNETRC}" ] && + [ -f "${SETNETRC}" ]; then + . ${SETNETRC} + fi + + if [ -z ${WPA_FILE} ]; then + echo "Could not find WPA_FILE defined anywhere. Exiting" + exit 1 + fi + + if [ -z ${LOGFILE} ]; then + echo "Could not find LOGFILE defined anywhere. Exiting" + exit 1 + fi +} + + +## +## handler called upon exit/signal (NONE HUP INT TRAP TERM QUIT) +## + +##function +cleanup(){ + rm -f ${TMPFILE} + rm -f ${WPA_PIDFILE} +} + + +################### +# # +# LOGGING # +# # +################### + +## +## log() takes two arguments, namely the label and the message +## +## +##function +log(){ + + ##local + LABEL=$1 + ##local + MSG=$2 + + echo "${LABEL}:" "${MSG}" >> "${LOGFILE}" + +} + +## +## Check whether the shell which called the script is supported, or +## exit. Currently, we support the follwing shells: +## +## - bash +## - busybox +## - dash +## - ksh +## - mksh +## - posh +## - sh +## - yash +## + +##function +check_shell(){ + + ## + ## FIXME!!! THIS TEST DOES NOT WORK yet... + ## + + SCRIPT_CMD=$(ps $$ | tail -1 | sed -r -e 's/\ +/\ /g;s/^\ +//g' | cut -d " " -f 5) + CUR_SH=$(basename ${SCRIPT_CMD}) + + case ${CUR_SH} in + ash|bash|busybox|dash|ksh|mksh|posh|sh|yash|zsh) + log "check_shell" "The current shell (${CUR_SH}) is supported" + return + ;; + *) + log "check_shell" "The current shell (${CUR_SH}) is not supported" + echo "The current shell (${CUR_SH}) is not supported. Exiting..." + exit 1 + ;; + esac +} + + +## +## Check dependencies +## +## - check if the current shell is supported through check_shell, and +## set the variable CUR_SH accordingly +## +## - each command in HARD_DEPS MUST exist, or the script exits +## +## - each command in SOFT_DEPS SHOULD exist, or the script will log a +## warning +## +## - each command in OPT_DEPS MIGHT exist, and if it does its name is +## included in the variable "HAS_OPTS" +## + +##function +check_deps(){ + + check_shell + + ## Workaround for zsh + if [ "${CUR_SH}" = "zsh" ]; then + setopt shwordsplit + fi + + for h in $(echo ${HARD_DEPS}); do + _W=$(which ${h}) + if [ -z "${_W}" ]; then + echo "Error: required command \"${h}\" not found. Exiting..." + exit 1 + fi + log "check_deps" "NOTICE: required command '${h}'...found" + done + + for s in $(echo ${SOFT_DEPS}); do + _S=$(which ${s}) + if [ -z "${_S}" ]; then + log "check_deps" "WARNING: suggested command '${s}' not found! Some functions might not work properly" + fi + done + + HAS_OPTS="" + for o in $(echo ${OPT_DEPS}); do + _O=$(which ${o}) + if [ -n "${_O}" ]; then + HAS_OPTS=" ${HAS_OPTS} ${o} " + log "check_deps" "NOTICE: optional command '${o}'...found" + else + log "check_deps" "NOTICE: optional command '${o}' not found!" + fi + done + + log "check_deps" "HAS_OPTS: \"${HAS_OPTS}\"" + +} + + +## +## Set debug mode -- dialog is instructed to dump a trace to the file +## TRACE_FILE provided by the user +## + +##function +set_debug(){ + + TRACE_FILE=$1 + DEBUG_MODE="DEBUG" + DIALOG="${DIALOG} --trace ${TRACE_FILE}" + +} + + +## +## Generic function for unimplemented features. It just pops up a +## message-box and returns +## + +##function +unimplemented(){ + + LABEL=$1 + + eval "${DIALOG} --msgbox 'Sorry! '$LABEL' not implemented, yet!' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2>${TMPFILE} +} + + +##function +check_sudo(){ + + LABEL="$1" + + if [ "${USING_SUDO}" = "1" ]; then + eval "${DIALOG} --msgbox '${LABEL}' ${INFO_HEIGHT} ${INFO_WIDTH} " 2>${TMPFILE} + return 1 + else + return 0 + fi + +} + +## +## Check the output of a command provided as argument against an +## expected output. Return 1 if the check fails, otherwise return 0 +## +##function +chk_out(){ + + EXP_OUT=$1 + shift + log "chk_out" "check output of: $(echo $@)" + ACT_OUT=$($@) + [ "${ACT_OUT}" = "${EXP_OUT}" ] || \ + log "chk_out" "Error: got '${ACT_OUT}' when expecting '${EXP_OUT}'" && \ + return 1 + return 0 + +} + + +## +## Check the exit value of a command provided as argument against an +## expected output -- return 1 if the check fails, otherwise return 0 +## +##function +chk_exit(){ + + EXP_EXIT=$1 + shift + log "chk_exit" "check exit value of: $(echo $@)" + $@ + ACT_EXIT=$? + [ "${ACT_EXIT}" = "${EXP_EXIT}" ] || \ + log "chk_exit" "Error: got '${ACT_EXIT}' when expecting '${EXP_EXIT}'" && \ + return 1 + return 0 +} + + + +########################################## + +##function +edit_file(){ + + ##local + FILEIN=$1 + log "edit_file" "editing file ${FILEIN}" + eval "${DIALOG} --title 'Editing file: ${FILEIN}' \ + --editbox ${FILEIN} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" 2> ${TMPFILE} + + if [ $? -eq 0 ]; then + log "edit_file" "Copying ${TMPFILE} into ${FILEIN}" + if cp "${TMPFILE}" "${FILEIN}" + then + eval "${DIALOG} --msgbox 'File ${FILEIN} saved successfully' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + else + eval "${DIALOG} --msgbox 'Error saving file ${FILEIN}' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + fi + else + log "edit_file" "Editing of ${FILEIN} aborted..." + eval "${DIALOG} --msgbox 'File ${FILEIN} not saved' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + fi +} + + + + +## +## Read all the configured addresses for a given inet family +## +##function +get_addr_family(){ + +##local + DEVNAME=$1 + ##local + DEVFAMILY=$2 + + NUMADDR=$(ip -f "${DEVFAMILY}" addr show "${DEVNAME}" | grep -c "${DEVFAMILY}") + ADDR_STR="" + for i in $(seq ${NUMADDR}); do + ADDR=$(ip -f "${DEVFAMILY}" addr show "${DEVNAME}" | grep "${DEVFAMILY}" | \ + tail -n +$i | head -1 | sed -r -e "s:^\ +::g" | cut -d " " -f 2,4,6 |\ + sed -r -e "s:\ : -- :g") + ADDR_STR="${ADDR_STR}\n${DEVFAMILY}: ${ADDR}\n" + done +} + +## +## Show the current configuration of a given device +## + +##function +show_device_conf(){ + +##local +DEVNAME=$1 + if [ -z "${DEVNAME}" ]; then + return -1 + fi + + DEVMAC=$(ip link show "${DEVNAME}" | tail -n +2 | sed -r 's/^\ +//g' | cut -d " " -f 2) + DEV_STATUS=$(ip -o link | cut -d " " -f 2,9 | grep -E "^${DEVNAME}: " | cut -d " " -f 2) + + DEVCONF="MAC: ${DEVMAC}\nLINK STATUS: ${DEV_STATUS}\n" + + log "show_device_conf" "NET_FAMILIES: \"${NET_FAMILIES}\"" + + for f in ${NET_FAMILIES}; do + get_addr_family ${DEVNAME} ${f} + log "show_device_conf" "family: ${f} ADDR_STR: \"${ADDR_STR}\"" + + if [ -z "${ADDR_STR}" ]; then + DEVCONF="${DEVCONF}${f}: Unconfigured\n" + else + DEVCONF="${DEVCONF}${ADDR_STR}" + fi + log "show_device_conf" "DEVCONF: ${DEVCONF}" + done + + DEVCONF="${DEVCONF}\n== name servers ==\n$(grep '^nameserver' /etc/resolv.conf)" + + eval "${DIALOG} --title 'Current configuration of device: ${DEVNAME}' \ + --msgbox '\n\n${DEVCONF}' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} " + return 0 + +} + + + +##function +config_ip_static(){ + + ##local + DEV_IP="192.168.1.2" + ##local + DEV_NET="192.168.1.0" + ##local + DEV_NETMASK="255.255.255.0" + ##local + DEV_GW="192.168.1.1" + ##local + DEV_DNS1="208.67.222.222" + ##local + DEV_DNS2="208.67.220.220" + + ##local + DEVNAME=$1 + + + eval "${DIALOG} --form 'Set network for device: ${DEVNAME}' \ + ${FORM_HEIGHT} ${FORM_WIDTH} 6 \ + 'IP' 1 1 '${DEV_IP}' 1 16 16 16 \ + 'Network' 2 1 '${DEV_NET}' 2 16 16 16 \ + 'Netmask' 3 1 '${DEV_NETMASK}' 3 16 16 16 \ + 'Gateway' 4 1 '${DEV_GW}' 4 16 16 16 \ + 'Primary DNS' 5 1 '${DEV_DNS1}' 5 16 16 16 \ + 'Secondary DNS' 6 1 '${DEV_DNS2}' 6 16 16 16 " \ + 2> ${TMPFILE} + + if [ $? -eq 1 ]; then + eval "${DIALOG} --infobox 'Configuration of ${DEVNAME} aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + + cat ${TMPFILE} | tr '\n' ' ' >${TMPFILE}_2 + + read DEV_IP DEV_NET DEV_NETMASK DEV_GW DEV_DNS1 DEV_DNS2 <${TMPFILE}_2 + eval "${DIALOG} --msgbox 'Proposed configuration of ${DEVNAME}:\n \ +IP: ${DEV_IP}\nNetwork: ${DEV_NET}\nNetmask: ${DEV_NETMASK}\nGateway: \ +${DEV_GW}\nDNS1: ${DEV_DNS1}\nDNS2: ${DEV_DNS2}'\ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + + rm -f ${TMPFILE}_2 + ## Configure IP + + chk_exit 0 ip link set "${DEVNAME}" down + chk_exit 0 ip link set "${DEVNAME}" up + chk_exit 0 ip address flush dev "${DEVNAME}" + chk_exit 0 ip address add "${DEV_IP}/${DEV_NETMASK}" dev "${DEVNAME}" + + ## Configure GW + #if [ -n "${DEV_GW}" ]; then + chk_exit 0 ip route flush dev "${DEVNAME}" + chk_exit 0 ip route add "${DEV_NET}/${DEV_NETMASK}" dev "${DEVNAME}" + chk_exit 0 ip route add default via "${DEV_GW}" + #fi + ## Configure DNS + #if [ -n "${DEV_DNS1}" ] || + # [ -n "${DEV_DNS1}" ]; then + mv /etc/resolv.conf /etc/resolv.conf.bak + if [ -n "${DEV_DNS1}" ]; then + echo "nameserver ${DEV_DNS1}" >> /etc/resolv.conf + fi + if [ -n "${DEV_DNS2}" ]; then + echo "nameserver ${DEV_DNS2}" >> /etc/resolv.conf + fi + show_device_conf "${DEVNAME}" + #fi +} + +##function +config_ip_dhcp(){ + +##local + DEVNAME=$1 + + ##eval "${DIALOG} --msgbox 'Running \"dhclient ${DEVNAME}\"' ${INFO_HEIGHT} ${INFO_WIDTH}" + dhclient -r ${DEVNAME} 2>/dev/null + dhclient -v ${DEVNAME} 2>&1 | + eval "${DIALOG} --title 'Running dhclient ${DEVNAME}' \ + --programbox ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" 2>${TMPFILE} + if [ $! -ne 0 ];then + log "config_ip_dhcp" "dhclient aborted" + fi + show_device_conf ${DEVNAME} +} + + +##function +configure_ip_address(){ + +##local + DEVNAME=$1 + + eval "${DIALOG} --cancel-label 'Up' \ + --menu 'Configuring ${DEVNAME}' ${INFO_HEIGHT} ${INFO_WIDTH} 4 \ + 'DHCP' ''\ + 'Static' ''" 2>${TMPFILE} + if [ $? -eq 1 ]; then + return + fi + ACTION=$(cat ${TMPFILE}) + case ${ACTION} in + "Static") + config_ip_static ${DEVNAME} + ;; + "DHCP") + config_ip_dhcp ${DEVNAME} + ;; + esac +} + +##function +wifi_essid_from_mac(){ + + ##local + DEVNAME=$1 + ##local + W_MAC=$2 + + W_ESSID=$(wpa_cli -i "${DEVNAME}" scan_results | grep -E "^${W_MAC}" | \ + sed -r -e 's/\t/\|/g' | cut -d "|" -f 5) + + log "wifi_essid_from_mac" "Recovered ESSID: ${W_ESSID}" +} + +##function +wifi_flags_from_mac(){ +##local + DEVNAME=$1 +##local + W_MAC=$2 + + W_FLAGS=$(wpa_cli -i "${DEVNAME}" scan_results | grep -E "^${W_MAC}" | \ + sed -r -e 's/\t/\|/g' | cut -d "|" -f 4) + log "wifi_essid_from_mac" "Recovered W_FLAGS: ${W_FLAGS}" + +} + + +##function +wifi_network_list(){ + +##local + DEVNAME=$1 + wpa_cli -i ${DEVNAME} list_networks | tail -n +2 | sed -r -e 's/\t/\|/g' > ${TMPFILE} + + NETLIST="" + LAST_IFS=$IFS + IFS="|" + while read NETNUM NETESSID NETBSSID NETFLAGS; do + IS_DIS=$(echo ${NETFLAGS} | sed -r -e 's/\[//g;s/\]//g' | grep -c -i disabled ) + if [ ${IS_DIS} -eq 1 ]; then + STATUS="(DIS)" + else + STATUS="(ENAB)" + fi + IS_CUR=$(echo ${NETFLAGS} | sed -r -e 's/\[//g;s/\]//g' | grep -c -i current ) + if [ ${IS_CUR} -eq 1 ]; then + STATUS="${STATUS}(CUR)" + fi + + + NETLIST="${NETLIST} ${NETNUM} \"${NETESSID}-${STATUS}\"" + done < ${TMPFILE} + IFS=${LAST_IFS} + + log "wifi_network_list" "NETLIST: ${NETLIST}" +} + +##function +wpa_authenticate_EAP_TLS(){ + + ##unimplemented "wpa_authenticate_EAP_TLS" + ##return 1 + + + DEVNAME=$1 + W_ESSID=$2 + + ## We first add the new network + NET_NUM=$(wpa_cli -i ${DEVNAME} add_network | tail -1) + + log "wifi_authenticate_EAP_PEAP" "NET_NUM: ${NET_NUM}" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ssid "\"${W_ESSID}\"" + + + ## we get the needed information, namely: + ## + ## - identity + ## - server certificate (ca_cert) + ## - client certificate + ## - + ## + + eval "${DIALOG} --form 'PEAP parameters:' \ + ${FORM_HEIGHT} ${FORM_WIDTH} 3 \ + 'identity' 1 1 '' 1 20 30 80 \ + 'server certificate' 2 1 '' 2 20 30 200 \ + 'client certificate' 3 1 '' 3 20 30 200 \ + 'private key' 4 1 '' 4 20 30 200 \ + 'private key password' 5 1 '' 5 30 30 80 \ + " 2>${TMPFILE} + + if [ $? != "0" ]; then + log "wifi_authenticate_EAP_TLS" "Aborting EAP/TLS authentication" + wpa_cli -i ${DEVNAME} remove_network ${NET_NUM} + return 1 + fi + + ## + ## Now, this is not super-clean, but seems necessary to maintain + ## POSIX shell compatibility + ## + cat ${TMPFILE} | tr '\n' ' ' >${TMPFILE}_2 + read EAP_IDENTITY EAP_SERV_CERT EAP_CLIENT_CERT EAP_PRIV_KEY EAP_PRIV_KEY_PWD <${TMPFILE}_2 + rm -f ${TMPFILE}_2 + ## Remove everything from the temp file + echo "" > ${TMPFILE} + + + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} key_mgmt WPA-EAP + + ## Set eap to PEAP + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} eap TLS + ## Set identity + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} identity "\"${EAP_IDENTITY}\"" + + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ca_cert "\"${EAP_SERV_CERT}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} client_cert "\"${EAP_CLIENT_CERT}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} private_key "\"${EAP_PRIV_KEY}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} private_key_passwd "\"${EAP_PRIV_KEY_PWD}\"" + + eval "${DIALOG} --defaultno --yesno \ + 'Network \"${W_ESSID}\" configured\nSave configuration file?' \ + ${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE} + if [ $? -eq 0 ]; then + ## Save the config file + wifi_save_file ${DEVNAME} + fi + + ## We can now enable the network + chk_out "OK" wpa_cli -i ${DEVNAME} enable_network ${NET_NUM} + + return 0 + +} + + +##function +wpa_authenticate_EAP_PEAP(){ + + ##unimplemented "wpa_authenticate_EAP_PEAP" + + DEVNAME=$1 + W_ESSID=$2 + + ## We first add the new network + NET_NUM=$(wpa_cli -i ${DEVNAME} add_network | tail -1) + + log "wifi_authenticate_EAP_PEAP" "NET_NUM: ${NET_NUM}" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ssid "\"${W_ESSID}\"" + + + ## we get the needed information, namely: + ## + ## - identity + ## - password + ## - server certificate (ca_cert) + ## + + eval "${DIALOG} --form 'PEAP parameters:' \ + ${FORM_HEIGHT} ${FORM_WIDTH} 3 \ + 'identity' 1 1 '' 1 20 30 80 \ + 'password' 2 1 '' 2 20 30 80 \ + 'server certificate' 3 1 '' 3 20 30 80 \ + " 2>${TMPFILE} + + if [ $? != "0" ]; then + log "wifi_authenticate_EAP_PEAP" "Aborting EAP/PEAP authentication" + wpa_cli -i ${DEVNAME} remove_network ${NET_NUM} + return 1 + fi + + ## + ## Now, this is not super-clean, but seems necessary to maintain + ## POSIX shell compatibility + ## + cat ${TMPFILE} | tr '\n' ' ' >${TMPFILE}_2 + read EAP_IDENTITY EAP_PASSWORD EAP_CERT <${TMPFILE}_2 + rm -f ${TMPFILE}_2 + ## Remove identity and password from the temp file + echo "" > ${TMPFILE} + + log "wpa_authenticate_EAP_PEAP" "EAP_IDENTITY: ${EAP_IDENTITY}" + log "wpa_authenticate_EAP_PEAP" "EAP_PASSWORD: ${EAP_PASSWORD}" + log "wpa_authenticate_EAP_PEAP" "EAP_CERT: ${EAP_CERT}" + + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} key_mgmt WPA-EAP + + ## Set eap to PEAP + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} eap PEAP + ## Set identity and password + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} identity "\"${EAP_IDENTITY}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} password "\"${EAP_PASSWORD}\"" + if [ -n "${EAP_CERT}" ]; then + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ca_cert "\"${EAP_CERT}\"" + fi + + eval "${DIALOG} --defaultno --yesno \ + 'Network \"${W_ESSID}\" configured\nSave configuration file?' \ + ${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE} + if [ $? -eq 0 ]; then + ## Save the config file + wifi_save_file ${DEVNAME} + fi + + + ## We can now enable the network + chk_out "OK" wpa_cli -i ${DEVNAME} enable_network ${NET_NUM} + + return 0 + +} + + +## +## Open access point -- no WPA +## +##function +wifi_authenticate_NONE(){ + + DEVNAME="$1" + W_ESSID="$2" + + NET_NUM=$(wpa_cli -i ${DEVNAME} add_network | tail -1) + + log "wifi_authenticate" "NET_NUM: ${NET_NUM}" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ssid "\"${W_ESSID}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} key_mgmt NONE + eval "${DIALOG} --defaultno --yesno \ + 'Network \"${W_ESSID}\" added\nSave configuration file?' \ + ${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE} + if [ $? -eq 0 ]; then + ## Save the config file + wifi_save_file ${DEVNAME} + fi + + ## We can now enable the network + chk_out "OK" wpa_cli -i ${DEVNAME} enable_network ${NET_NUM} + + return 0 + +} + + +##function +wpa_authenticate_PSK(){ + + DEVNAME=$1 + W_ESSID="$2" + + PSK="" + PSK_LENGTH=${#PSK} + while [ ${PSK_LENGTH} -le 7 ]; do + eval "${DIALOG} --insecure --inputbox 'Please insert WPA PSK\n(min 8 characters)' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} + if [ $? -eq 1 ]; then + eval "${DIALOG} --msgbox 'Network configuration aborted!!!' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return 1 + fi + PSK=$(cat ${TMPFILE}) + PSK_LENGTH=${#PSK} + done + + + NET_NUM=$(wpa_cli -i ${DEVNAME} add_network | tail -1) + + log "wifi_authenticate_PSK" "NET_NUM: ${NET_NUM}" + log "wifi_authenticate_PSK" "W_ESSID: ${W_ESSID}" + log "wifi_authenticate_PSK" "PSK: ${PSK}" + + + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ssid "\"${W_ESSID}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} psk "\"${PSK}\"" + ## remove the password from tmpfile + echo "" > ${TMPFILE} + eval "${DIALOG} --defaultno --yesno \ + 'Network \"${W_ESSID}\" added\nSave configuration file?' \ + ${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE} + if [ $? -eq 0 ]; then + ## Save the config file + wifi_save_file ${DEVNAME} + fi + + ## We can now enable the network + chk_out "OK" wpa_cli -i ${DEVNAME} enable_network ${NET_NUM} + + eval "${DIALOG} --msgbox 'Network added successfully' ${INFO_HEIGHT} ${INFO_WIDTH}" + return 0 + + +} + +## +## Manage WPA authentication. Choose among the available +## authentication systems currently supported: +## +## - PSK +## - EAP/PEAP +## - EAP/TLS +## + +##function +wifi_authenticate_WPA(){ + + DEVNAME=$1 + W_ESSID=$2 + + ## + ## Construct the menu with all the available authentication modes + ## + MODES=$(echo $W_FLAGS | sed -r -e 's/\]\[/\n/g;s/\[//g;s/\]//g' | grep -E "^WPA") + log "wifi_authenticate_WPA" "MODES: ${MODES}" + MENU_ITEMS="" + CNT=0 + for m in ${MODES}; do + WPA_TYPE=$(echo ${m} | cut -d "-" -f 1) + HAS_PSK=$(echo ${m} | cut -d "-" -f 2 | grep "PSK") + if [ "${HAS_PSK}" != "" ]; then + MENU_ITEMS="${MENU_ITEMS} '${WPA_TYPE}+PSK' 'Pre-shared key' " + fi + + HAS_EAP=$(echo ${m} | cut -d "-" -f 2 | grep "EAP") + if [ "${HAS_EAP}" != "" ]; then + MENU_ITEMS="${MENU_ITEMS} '${WPA_TYPE}+EAP/PEAP' 'EAP/PEAP' " + MENU_ITEMS="${MENU_ITEMS} '${WPA_TYPE}+EAP/TLS' 'EAP/TLS' " + fi + done + + log "wifi_authenticate_WPA" "MENU_ITEMS: ${MENU_ITEMS}" + + + eval "${DIALOG} --menu 'Select authentication' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 \ + ${MENU_ITEMS} " 2> ${TMPFILE} + + if [ $? != "0" ]; then + ## conf aborted + log "wifi_authenticate_WPA" "configuration aborted" + return 1; + fi + + + SEL_MODE=$(cat ${TMPFILE}) + log "wifi_authenticate_WPA" "SEL_MODE: ${SEL_MODE}" + case ${SEL_MODE} in + "WPA+EAP/PEAP"|"WPA2+EAP/PEAP") + wpa_authenticate_EAP_PEAP ${DEVNAME} ${W_ESSID} + ;; + "WPA+EAP/TLS"|"WPA2+EAP/TLS") + wpa_authenticate_EAP_TLS ${DEVNAME} ${W_ESSID} + ;; + "WPA+PSK"|"WPA2+PSK") + wpa_authenticate_PSK ${DEVNAME} ${W_ESSID} + ;; + *) + log "wifi_authenticate_WPA" "Error. SEL_MODE '${SEL_MODE}' unsupported" + + esac + + +} + + + +## +## Manage the authentication for a given wifi ESSID +## +## We use wpa_cli to check the type of authentication supported by the +## network, and then we call the corresponding function +## + +##function +wifi_authenticate(){ + +##local + DEVNAME=$1 + ##local + W_MAC=$2 + + + log "wifi_authenticate" "configuring ${DEVNAME} on ${W_MAC}" + ## This will set the variable W_ESSID appropriately + wifi_essid_from_mac ${DEVNAME} ${W_MAC} + + ## This will set the variable W_FLAGS appropriately + wifi_flags_from_mac ${DEVNAME} ${W_MAC} + + + log "wifi_authenticate" "configuring essid: ${W_ESSID} on device: ${DEVNAME}" + log "wifi_authenticate" "W_FLAGS: ${W_FLAGS}" + + + ## If the network exists already, we first remove it... + + NET_EXISTS=$(wpa_cli -i ${DEVNAME} list_networks | tail -n +2 | sed -r -e 's/\t/\|/g' \ + | cut -d "|" -f 2 | grep -c "${W_ESSID}$" ) + if [ ${NET_EXISTS} != 0 ]; then + NET_NUM=$(wpa_cli -i ${DEVNAME} list_networks | tail -n +2 | sed -r -e 's/\t/\|/g' \ + | cut -d "|" -f 1,2 | grep "${W_ESSID}$" | cut -d "|" -f 1) + STATUS=$(wpa_cli -i ${DEVNAME} remove_network ${NET_NUM}) + if [ "${STATUS}" != "OK" ]; then + eval "${DIALOG} --msgbox 'Error while removing existing \ + network:\n$essid: {W_ESSID}'" ${INFO_HEIGHT} ${INFO_WIDTH} + return + fi + fi + + ## Check whether WPA is available + + HAS_WPA=$(echo "${W_FLAGS}" | grep -E -c "WPA" ) + + log "wifi_authenticate" "HAS_WPA: \"${HAS_WPA}\"" + + ### This will configure WPA + if [ "${HAS_WPA}" != "0" ]; then + wifi_authenticate_WPA ${DEVNAME} ${W_ESSID} + if [ $? = "0" ]; then + log "wifi_authenticate" "WPA configured" + return 0 + fi + fi + + log "wifi_authenticate" "WPA authentication failed, aborted, or not supported" + + ### ...otherwise, try to configure an open connection (key_mgmt=NONE) + + log "wifi_authenticate" "Trying open (no WPA) configuration..." + + wifi_authenticate_NONE ${DEVNAME} ${W_ESSID} + if [ $? = "0" ]; then + log "wifi_authenticate" "Open connection configured" + return 0 + fi + + log "wifi_authenticate" "Open connection not supported" + + ## No available authentication methods.... + + eval "${DIALOG} --msgbox 'No supported authentication method for ${W_ESSID}'" + return 1 +} + + + + +## +## Configure a new connection from a list of available wi-fi networks +## + +##function +wifi_add(){ + +##local +DEVNAME=$1 + + wpa_cli -i ${DEVNAME} scan + eval "${DIALOG} --timeout 4 --msgbox 'Scanning for networks...' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + wpa_cli -i ${DEVNAME} scan_results | grep -E "^[0-9a-f][0-9a-f]:" | \ + sed -r -e 's/\t/|/g' |\ + sort -t "|" -r -n -k 3 > ${TMPFILE} + + wifinets="" + LAST_IFS=$IFS + IFS="|" + while read W_MAC W_FREQ W_STRNGT W_FLAGS W_ESSID; do + + log "wifi_add" "W_ESSID: \"${W_ESSID}\"" + wifinets="${wifinets} ${W_MAC} \"${W_ESSID} -- ${W_FLAGS}\"" + done < ${TMPFILE} + IFS=${LAST_IFS} + + + log "wifi_add" "Wifi nets: \n${wifinets}\n===" + eval "dialog --menu 'Select a network' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 \ + ${wifinets} " 2> ${TMPFILE} + if [ $? -eq 1 ]; then + return + fi + + W_MAC=$(cat ${TMPFILE}) + + + wifi_authenticate ${DEVNAME} ${W_MAC} + if [ $? != "0" ]; then + eval "${DIALOG} --msgbox 'Error while configuring ${DEVNAME}' " + fi + return $? +} + + +##function +wifi_save_file(){ + +##local +DEVNAME=$1 + + SAVE_STATUS=$(wpa_cli -i ${DEVNAME} save_config | tail -1 ) + if [ "${SAVE_STATUS}" = "OK" ]; then + eval "${DIALOG} --msgbox 'Current configuration dumped to file ${WPA_FILE}' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + else + eval "${DIALOG} --msgbox 'Error while saving configuration to file ${WPA_FILE}' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + fi +} + +##function +wifi_remove(){ + +##local + DEVNAME=$1 + + wifi_network_list ${DEVNAME} + + eval "${DIALOG} --menu 'Select network to remove' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 ${NETLIST}" \ + 2> ${TMPFILE} + + if [ $? -eq 0 ]; then + ## a network has been selected + NETNUM=$(cat ${TMPFILE}) + WPA_STATUS=$(wpa_cli -i ${DEVNAME} remove_network ${NETNUM} | tail -1 ) + if [ "${WPA_STATUS}" = "OK" ]; then + eval "${DIALOG} --defaultno --yesno \ + 'Network ${NETNUM} removed\nSave configuration file?' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} + if [ $? -eq 0 ]; then + ## Save the config file + wifi_save_file ${DEVNAME} + fi + + return + else + eval "${DIALOG} --msgbox 'Network ${NETNUM} NOT removed' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + else + eval "${DIALOG} --msgbox 'No network removed!!!' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + +} + + +##function +wifi_restart_wpa(){ + +##local + DEVNAME=$1 +##local + WPA_FILE=$2 + + WPA_PID=$(ps ax | grep wpa_supplicant | grep " -i ${DEVNAME} " | +sed -r -e 's/^\ +//g' | cut -d " " -f 1) + + if [ -n "${WPA_PID}" ]; then + log "wifi_restart_wpa" "WPA_PID: ${WPA_PID}" + kill -9 ${WPA_PID} + else + log "wifi_restart_wpa" "no wpa_supplicant is running!!!" + fi + 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}" | \ + sed -r -e 's/^\ +//g' | cut -d " " -f 1 ) + WPA_PID_SAVED=$(cat ${WPA_PIDFILE}) + log "wifi_restart_wpa" "WPA_PID: ${WPA_PID} WPA_PID_SAVED: ${WPA_PID_SAVED}" + if [ -n "${WPA_PID}" ] && [ "${WPA_PID}" != "${WPA_PID_SAVED}" ]; then + eval "${DIALOG} --msgbox 'Error restarting wpa_supplicant' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + else + eval "${DIALOG} --msgbox 'wpa_supplicant restarted successfully' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + fi + +} + + + +## +## wifi_enable: show the list of configured networks, and enable the +## one the used has clicked on +## + +##function +wifi_enable(){ + +##local + DEVNAME=$1 + + wifi_network_list ${DEVNAME} + + eval "${DIALOG} --menu 'Select configured network' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 ${NETLIST}" \ + 2> ${TMPFILE} + + if [ $? -eq 0 ]; then + ## a network has been selected + NETNUM=$(cat ${TMPFILE}) + WPA_STATUS=$(wpa_cli -i ${DEVNAME} enable ${NETNUM} | tail -1 ) + if [ "${WPA_STATUS}" = "OK" ]; then + eval "${DIALOG} --msgbox 'Network ${NETNUM} enabled' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + #config_ethernet ${DEVNAME} + return + else + eval "${DIALOG} --msgbox 'Network ${NETNUM} NOT enabled' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + else + eval "${DIALOG} --msgbox 'No network enabled!!!' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi +} + + +##function +wifi_disable(){ + +##local + DEVNAME=$1 + wifi_network_list ${DEVNAME} + eval "${DIALOG} --menu 'Select configured network' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 ${NETLIST}" \ + 2> ${TMPFILE} + + if [ $? -eq 0 ]; then + ## a network has been selected + NETNUM=$(cat ${TMPFILE}) + WPA_STATUS=$(wpa_cli -i ${DEVNAME} disable ${NETNUM} | tail -1 ) + if [ "${WPA_STATUS}" = "OK" ]; then + eval "${DIALOG} --msgbox 'Network ${NETNUM} disabled' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + else + eval "${DIALOG} --msgbox 'Network ${NETNUM} NOT disabled' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + else + eval "${DIALOG} --msgbox 'No network disabled!!!' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi +} + + + + +##function +config_wifi(){ + +##local + DEVNAME=$1 + + while true; do + CUR_NET=$(wpa_cli -i ${DEVNAME} status | grep "^ssid" | cut -d "=" -f 2) + eval "${DIALOG} --cancel-label 'Up' \ + --menu 'Configuring ${DEVNAME}\nCurrent network: ${CUR_NET}\n(Current file: ${WPA_FILE})' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 12 \ + 'Restart' 'Restart wpa_supplicant' \ + 'Enable' 'Enable a configured network' \ + 'Disable' 'Disable a configured network' \ + 'Add' 'Configure a new network' \ + 'Remove' 'Delete an existing network' \ + 'Show' 'Show current configuration file' \ + 'Edit' 'Edit current configuration file' \ + 'Save' 'Save configuration to file' "\ + 2>${TMPFILE} + + if [ $? = "1" ]; then + return + fi + ACTION=$(cat ${TMPFILE}) + case ${ACTION} in + "Restart") + ## Restart wpa_supplicant + wifi_restart_wpa ${DEVNAME} ${WPA_FILE} + ;; + "Enable") + wifi_enable ${DEVNAME} + ;; + "Disable") + wifi_disable ${DEVNAME} + ;; + "Add") + wifi_add ${DEVNAME} + ;; + "Remove") + wifi_remove ${DEVNAME} + ;; + "Show") + eval "${DIALOG} --title 'Current file: ${WPA_FILE}' \ + --textbox ${WPA_FILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + ;; + "Edit") + edit_file ${WPA_FILE} + ;; + "Save") + wifi_save_file ${DEVNAME} + ;; + esac + done + +} + + + +## +## (Re)-Configure +## + +##function +configure_wifi(){ + +##local + DEVNAME=$1 + + ## Automatically Check if the network device is a wifi -- this + ## 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 ${IS_WIFI} in + 1) + config_wifi ${DEVNAME} + ;; + *) + ## Show a message here + eval "${DIALOG} --msgbox '${DEVNAME} is not a WiFi device... ' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + ;; + esac + +} + + +##function +set_device_up(){ + + ##local + DEVNAME=$1 + + chk_exit 0 ip link set ${DEVNAME} up + +} + +##function +set_device_down(){ + + ##local + DEVNAME=$1 + chk_exit 0 ip link set ${DEVNAME} down + +} + +##function +show_device_menu(){ + +##local + DEVNAME=$1 + + while true; do + 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}" + eval "${DIALOG} --cancel-label 'Up' --menu\ + 'Device: ${DEVNAME}\nStatus: ${DEV_STATUS}' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 8 \ + 'View' 'View current configuration' \ + 'Conf' 'Configure IP Address' \ + 'WiFi' 'Manage WiFi networking' \ + 'Start' 'Bring interface up' \ + 'Stop' 'Put interface down' \ + 'Restart' 'Restart interface'" 2> ${TMPFILE} + + if [ $? -eq 1 ]; then + return + fi + + DEV_ACTION=$(cat ${TMPFILE}) + case ${DEV_ACTION} in + "View") + show_device_conf ${DEVNAME} + ;; + "Conf") + configure_ip_address ${DEVNAME} + ;; + "WiFi") + configure_wifi ${DEVNAME} + ;; + "Start") + set_device_up ${DEVNAME} + ;; + "Stop") + set_device_down ${DEVNAME} + ;; + "Restart") + set_device_down ${DEVNAME} + set_device_up ${DEVNAME} + ;; + *) + ;; + + esac + done +} + +## +## Show all the available network devices +## + +##function +show_devs() { + + DEVICES=$(ip link show | awk 'NR % 2 == 1' | cut -d ":" -f 2) + + DEVICE_TAGS="" + + for i in $DEVICES; do + if [ "$i" != "lo" ]; then + DEVICE_TAGS="${DEVICE_TAGS} $i $i" + fi + done + + eval "${DIALOG} --cancel-label 'Up' \ + --menu 'Select Interface to configure' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 4 \ + ${DEVICE_TAGS}" 2> ${TMPFILE} + return $? +} + + +##function +dev_config_menu(){ + + while true; do + show_devs + if [ $? -eq 1 ]; then + return + fi + DEVNAME=$(cat ${TMPFILE}) + show_device_menu ${DEVNAME} + done +} + +##function +show_info(){ + + cat < ${TMPFILE} + + -+- setnet.sh ${VERSION} -+- + +setnet.sh is a simple state-less tool to manage and configure network +interfaces. It is a shell wrapper around the functionalities of +standard command-line tools, including "ip", "dhclient", "wpa_cli", +etc., and can be used to configure network connections via +Ethernet/Wi-Fi interfaces. + +Both Static and DHCP-based IP configuration are supported. + +At the moment, only WPA-PSK and open (no key) Wi-Fi connections are +available. + +For more information, please visit the webpage of the project: + + http://kalos.mine.nu/setnet/ + +Please report bugs at: + + https://git.devuan.org/KatolaZ/setnet + +EOF + eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + return +} + +##function +show_copyright(){ + + cat < ${TMPFILE} + + -+- setnet.sh ${VERSION} -+- + +-------------------------------------------------------------------- + + Copyleft (C) Vincenzo "KatolaZ" Nicosia + 2016, 2017 + +-------------------------------------------------------------------- + + +EOF + eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + return +} + + +##function +show_license(){ + + cat < ${TMPFILE} + + -+- setnet.sh ${VERSION} -+- + +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 3 of the License, 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, see . + +-------------------------------------------------------------------- + + Copyleft (C) Vincenzo "KatolaZ" Nicosia + 2016, 2017 + +-------------------------------------------------------------------- + +EOF + eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + return +} + + + +##function +about_menu(){ + + while true; do + eval "${DIALOG} --cancel-label 'Up' --menu 'setnet ${VERSION} -- About' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 6 \ + 'Info' 'General information' \ + 'Copyleft' 'Copyleft information' \ + 'License' 'How to distribute this program' " \ + 2> ${TMPFILE} + if [ $? -eq 1 ];then + return; + fi + + ACTION=$(cat ${TMPFILE}) + case ${ACTION} in + "Info") + show_info + ;; + "Copyleft") + show_copyright + ;; + "License") + show_license + ;; + esac + done +} + +##function +notfound(){ + + CMDNAME=$1 + + + eval "${DIALOG} --msgbox 'Sorry! Commmand ${CMDNAME} not found!'" \ + ${INFO_HEIGHT} ${INFO_WIDTH} + +} + + +##function +netdiag_DNS(){ + + DUMPFILE=$1 + + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== DNS Configuration (/etc/resolv.conf)\n=====\n\n" >> ${DUMPFILE} + cat /etc/resolv.conf >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi + + ## Dump to dialog + NAMESERVERS=$(grep '^nameserver' /etc/resolv.conf) + MSG_STR="Configured name servers in /etc/resolv.conf ==\n\n${NAMESERVERS}" + + eval "${DIALOG} --title 'DNS servers' --msgbox '${MSG_STR}' "\ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} + +} + +##function +netdiag_resolver(){ + + DUMPFILE=$1 + + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== Resolver Configuration (/etc/nsswitch.conf)\n=====\n\n" >> ${DUMPFILE} + grep -v '^#' /etc/nsswitch.conf >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi + + ## Dump to dialog + RESOLVER=$(grep -v '^#' /etc/nsswitch.conf) + + eval "${DIALOG} --title 'Resolver configuration (/etc/nsswitch.conf)' \ + --msgbox '${RESOLVER}' "\ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} + +} + + +##function +netdiag_routes(){ + + DUMPFILE=$1 + + HAS_NETSTAT=$(echo "${HAS_OPTS}" | grep -c "\ netstat\ ") + if [ ${HAS_NETSTAT} -ne 1 ]; then + notfound "netstat" + return + fi + + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== Routing table\n=====\n\n" >> ${DUMPFILE} + netstat -rn >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi + ## Dump to dialog + ROUTES=$(netstat -rn > ${TMPFILE} ) + + eval "${DIALOG} --no-collapse --title 'Routing table (netstat -rn) [arrows to scroll]'" \ + "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ + ${LARGE_HEIGHT} ${LARGE_WIDTH} +} + +##function +netdiag_ARP(){ + + DUMPFILE=$1 + log "netdiag_ARP" "DUMPFILE: '${DUMPFILE}'" + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== ARP table\n=====\n\n" >> "${DUMPFILE}" + cat /proc/net/arp >> "${DUMPFILE}" + echo "==================================" >> ${DUMPFILE} + return 0 + fi + + # Dump to dialog + ARP=$(cat /proc/net/arp >${TMPFILE}) + + eval "${DIALOG} --no-collapse --title 'ARP table (/proc/net/arp) [arrows to scroll]'" \ + "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ + ${LARGE_HEIGHT} ${LARGE_WIDTH} +} + +##function +netdiag_connections(){ + + DUMPFILE=$1 + + + HAS_NETSTAT=$(echo "${HAS_OPTS}" | grep -c "\ netstat\ ") + if [ ${HAS_NETSTAT} -ne 1 ]; then + notfound "netstat" + return + fi + + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== Active Network Connections\n=====\n\n" >> ${DUMPFILE} + netstat -tnp | sed -r -e 's/$/\n/g' >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi + + ## Dump to dialog + SERV=$(netstat -tnp | sed -r -e 's/$/\n/g' > ${TMPFILE}) + + eval "${DIALOG} --no-collapse "\ + " --title 'Active network connections (netstat -tnp) [arrows to scroll]'" \ + "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ + ${LARGE_HEIGHT} ${LARGE_WIDTH} +} + + +##function +netdiag_services(){ + + DUMPFILE=$1 + + HAS_NETSTAT=$(echo "${HAS_OPTS}" | grep -c "\ netstat\ ") + if [ ${HAS_NETSTAT} -ne 1 ]; then + notfound "netstat" + return + fi + + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== Active network services\n=====\n\n" >> ${DUMPFILE} + netstat -ltnp | sed -r -e 's/$/\n/g' >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi + + + SERV=$(netstat -ltnp | sed -r -e 's/$/\n/g' > ${TMPFILE}) + + eval "${DIALOG} --no-collapse "\ + " --title 'Active network services (netstat -ltnp) [arrows to scroll]'" \ + "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ + ${LARGE_HEIGHT} ${LARGE_WIDTH} +} + + +##function +netdiag_ping(){ + + HAS_PING=$(echo "${HAS_OPTS}" | grep -E -c "\ ping\ ") + if [ ${HAS_PING} -ne 1 ]; then + notfound "ping" + return + fi + eval "${DIALOG} --insecure --inputbox 'Host or IP to ping:' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} + + if [ $? -ne 0 ]; then + eval "${DIALOG} --msgbox 'Ping Aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + else + PINGIP=$(cat ${TMPFILE}) + ping -c 5 ${PINGIP} 2>&1 |\ + eval "${DIALOG} --title 'Ping ${PINGIP}' \ + --programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE} + if [ $! -ne 0 ];then + log "netdiag_ping" "ping aborted" + fi + fi + +} + +##function +netdiag_traceroute(){ + + HAS_TRACERT=$(echo "${HAS_OPTS}" | grep -c "\ traceroute\ ") + if [ ${HAS_TRACERT} -ne 1 ]; then + notfound "traceroute" + return + fi + eval "${DIALOG} --insecure --inputbox 'Host or IP to trace:' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} + + if [ $? -ne 0 ]; then + eval "${DIALOG} --msgbox 'Traceroute Aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + else + TRACEIP=$(cat ${TMPFILE}) + traceroute ${TRACEIP} 2>&1 | \ + eval "${DIALOG} --title 'Traceroute ${TRACEIP}' \ + --programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE} + if [ $! -ne 0 ];then + log "netdiag_traceroute" "traceroute aborted" + fi + fi +} + + +##function +netdiag_lookup(){ + + HAS_HOST=$(echo "${HAS_OPTS}" | grep -c "\ host\ ") + if [ ${HAS_HOST} -ne 1 ]; then + notfound "host" + return + fi + + eval "${DIALOG} --insecure --inputbox 'Hostname or IP to lookup:' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} + + if [ $? -ne 0 ]; then + eval "${DIALOG} --msgbox 'DNS lookup aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + else + QUERYIP=$(cat ${TMPFILE}) + host ${QUERYIP} 2>&1 |\ + eval "${DIALOG} --title 'host ${QUERYIP}' \ + --programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE} + if [ $! -ne 0 ];then + log "netdiag_ping" "host lookup aborted" + fi + + fi +} + +##function +netdiag_devices(){ + + DUMPFILE=$1 + + if [ -n "${DUMPFILE}" ]; then + printf "\n=====\n== Network Devices\n=====\n\n" >> ${DUMPFILE} + ip addr >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi +} + + + +## +## Main menu for network diagnostics +## + +##function +netdiag_menu(){ + + while true; do + eval "${DIALOG} --cancel-label 'Up' --menu 'Network diagnostics' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 \ + 'ARP' 'Show ARP table' \ + 'Connections' 'List active network connections' \ + 'DNS' 'List DNS servers' \ + 'Lookup' 'DNS Lookup' \ + 'Ping' 'Ping a host' \ + 'Resolver' 'Show resolver configuration' \ + 'Routes' 'Show routing table' \ + 'Services' 'List active network daemons' \ + 'Traceroute' 'Show the route to a host' " \ + 2> ${TMPFILE} + if [ $? -eq 1 ];then + return; + fi + + ACTION=$(cat ${TMPFILE}) + case ${ACTION} in + "ARP") + netdiag_ARP + ;; + "Connections") + netdiag_connections + ;; + "DNS") + netdiag_DNS + ;; + "Ping") + netdiag_ping + ;; + "Lookup") + netdiag_lookup + ;; + "Resolver") + netdiag_resolver + ;; + "Routes") + netdiag_routes + ;; + "Services") + netdiag_services + ;; + "Traceroute") + netdiag_traceroute + ;; + esac + done + + +} + +##function +dump_file(){ + + CONF=$1 + + log "dump_file" "CONF: ${CONF}" + + DUMPFILE="/tmp/network_dump.txt" + + eval "${DIALOG} --fselect ${DUMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" \ + 2>${TMPFILE} + + if [ $? -eq 0 ]; then + SEL_FILE=$(cat ${TMPFILE}) + while [ -d "${SEL_FILE}" ]; do + eval "${DIALOG} --fselect ${SEL_FILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" \ + 2>${TMPFILE} + if [ $? -eq 0 ]; then + SEL_FILE=$(cat ${TMPFILE}) + else + eval "${DIALOG} --msgbox 'Dump aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + done + + ## The dump starts here.... + DUMPFILE=${SEL_FILE} + truncate -s 0 ${DUMPFILE} + echo "===== setnet ${VERSION}" >> ${DUMPFILE} + echo "===== Date: $(date)" >> ${DUMPFILE} + echo "===== Network configuration dump: ${CONF} " >> ${DUMPFILE} + for c in ${CONF}; do + eval "netdiag_${c} \"${DUMPFILE}\"" + done + else + eval "${DIALOG} --msgbox 'Dump aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + eval "${DIALOG} --msgbox 'Status dumped to ${DUMPFILE}' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" +} + + +##function +dump_pastebin(){ + + unimplemented "pastebin" +} + +##function +dump_menu(){ + + eval "${DIALOG} --checklist 'Select conf to dump' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 \ + 'ARP' 'ARP table' on \ + 'devices' 'Device configuration' on \ + 'DNS' 'DNS configuration' on \ + 'resolver' 'System resolver configuration' on \ + 'routes' 'Routing table' on \ + 'connections' 'Active network connections' on \ + 'services' 'Active network services' on " 2> ${TMPFILE} + if [ $? -ne 0 ]; then + return + fi + + DUMP_CONF=$(cat ${TMPFILE}) + + eval "${DIALOG} --cancel-label 'Up' \ + --menu 'Dump configuration to:' \ + ${INFO_HEIGHT} ${INFO_WIDTH} 6 \ + 'File' 'Dump to file' \ + 'Pastebin' 'Dump to pastebin'" \ + 2> ${TMPFILE} + if [ $? -eq 1 ];then + return; + fi + + ACTION=$(cat ${TMPFILE}) + case ${ACTION} in + "File") + dump_file "${DUMP_CONF}" + ;; + "Pastebin") + dump_pastebin "${DUMP_CONF}" + ;; + esac +} + + +##function +show_toplevel(){ + + log "show_toplevel" "TMPFILE: ${TMPFILE}" + eval "${DIALOG} --cancel-label 'Quit' --menu 'Main Menu' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 6 \ + 'Setup' 'Setup interfaces' \ + 'Info' 'Network diagnostics' \ + 'Dump' 'Dump current network status' \ + 'Log' 'View setnet log' \ + 'About' 'License & Copyleft'" 2> ${TMPFILE} + + return $? +} + +##function +show_help(){ + +##local +SCRIPTNAME=$1 + echo "Usage: ${SCRIPTNAME} [OPTION]" + echo "Options:" + printf "\t -c cfg_file\tLoad configuration from cfg_file.\n" + printf "\t -v\t\tPrint version number and exit.\n" + printf "\t -h\t\tShow this help.\n" + +} + +##function +show_version(){ + +##local +SCRIPTNAME=$1 + echo "${SCRIPTNAME} -- version ${VERSION}" + echo "Copyleft (C) Vincenzo \"KatolaZ\" Nicosia (katolaz@freaknet.org) -- 2016, 2017" + echo "This is free software. You can use and redistribute it under the " + echo "terms of the GNU General Public Licence version 3 or (at your option)" + echo "any later version." + echo + echo "YOU USE THIS SOFTWARE AT YOUR OWN RISK." + echo "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or" + echo "FITNESS FOR A PARTICULAR PURPOSE." +} + +##function +show_disclaimer(){ + + cat < ${TMPFILE} + + -+- setnet.sh ${VERSION} -+- + + Copyleft (C) KatolaZ (katolaz@freaknet.org) + 2016, 2017 + + -+- This is a beta release of setnet.sh -+- + + THIS IS FREE SOFTWARE + YOU CAN USE AND DISTRIBUTE IT UNDER THE + TERMS OF THE GNU GENERAL PUBLIC LICENSE + + USE THIS SOFTWARE AT YOUR OWN RISK + + There is ABSOLUTELY NO WARRANTY; not even for + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE + + See "About" for more information about + your right and distribution terms +EOF + + eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} 23 60" + return +} + +##function +initialise(){ + + + TMPFILE=$( (tempfile) 2>/dev/null) || TMPFILE=/tmp/setnet_$$ + WPA_PIDFILE=$( (tempfile) 2>/dev/null) || WPA_PIDFILE=/tmp/setnet_wpapid_$$ + + trap cleanup 0 HUP INT TRAP TERM QUIT + + if [ -z ${TRUNCATE_LOG} ] || \ + [ ${TRUNCATE_LOG} = "yes" ] || \ + [ ${TRUNCATE_LOG} = "YES" ]; then + truncate -s 0 ${LOGFILE} + fi + + chmod 600 ${LOGFILE} + + log "initialise" "Starting afresh on $(date)" + log "initialise" "Using TMPFILE: ${TMPFILE}" + log "initialise" "Using LOGFILE: ${LOGFILE}" + + if [ -n ${DEBUG_MODE} ]; then + log "initialise" "Running in debug mode -- dumping dialog trace to ${TRACE_FILE}" + fi + + EUID=$(id -ru) + if [ "${EUID}" = "0" ] && + [ -n "${SUDO_UID}" ] && + [ "${EUID}" != "${SUDO_UID}" ]; then + USING_SUDO="1" + elif [ "${EUID}" = "0" ] && + [ -n "${SUP_UID}" ] && + [ "${EUID}" != "${SUP_UID}" ]; then + USING_SUDO="1" + else + USING_SUDO="0" + fi + + log "initialise" "EUID: ${EUID}" + log "initialise" "SUDO_UID: ${SUDO_UID}" + log "initialise" "SUP_UID: ${SUP_UID}" + log "initialise" "USING_SUDO: ${USING_SUDO}" +} + + +##function +log_show(){ + + eval "${DIALOG} --cr-wrap --title 'setnet log file (${LOGFILE})'\ + --textbox ${LOGFILE} \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + +} + +##function +main(){ + + + show_disclaimer + + SETNETRC=$(realpath ${SETNETRC}) + log "main" "Using config file \"${SETNETRC}\"" + WPA_FILE=$(realpath ${WPA_FILE}) + log "main" "Using WPA config file \"${WPA_FILE}\"" + LOFGILE=$(realpath ${LOGFILE}) + log "main" "Using log file \"${LOGFILE}\"" + + while true; do + show_toplevel + + if [ $? -eq 1 ]; then + cleanup + exit 1 + fi + log "main" "${TMPFILE}" + ACTION=$(cat ${TMPFILE}) + log "main" "ACTION: ${ACTION}" + case ${ACTION} in + "Setup") + dev_config_menu + ;; + "Info") + netdiag_menu + ;; + "Dump") + dump_menu + ;; + "Log") + log_show + ;; + "About") + about_menu + ;; + esac + done + +} + + +## +## The script starts here +## + + +## +## Get command-line arguments +## + +SETNETRC="" + +while getopts ":c:d:hv" opt; do + + case $opt in + c) + #echo "Got option -c ${OPTARG}" + SETNETRC=$(realpath ${OPTARG}) + #echo "SETNETRC: ${SETNETRC}" + ;; + h) + show_help $(basename $0) + exit 1 + ;; + v) + show_version $(basename $0) + exit 1 + ;; + d) + TRACE_FILE=$(realpath ${OPTARG}) + set_debug ${TRACE_FILE} + ;; + \?) + echo "Invalid option: -${OPTARG}" + exit 1 + ;; + :) + echo "Option -${OPTARG} requires an argument" + exit 1 + ;; + esac +done + + +## +## Load the configuration file +## + +load_setnetrc ${SETNETRC} + +## +## Init stuff +## + +initialise + + +## +## Check dependencies. If we are missing someting essential, then exit. +## + +check_deps + +## +## This is the main loop +## + +main + diff --git a/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/ChangeLog b/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/ChangeLog new file mode 100644 index 0000000..18e95e6 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/ChangeLog @@ -0,0 +1,41 @@ +2017-03-08 KatolaZ + + * setnet.sh (wifi_restart_wpa): Corrected a bug in the restart of + wpa_supplicant. + +2017-03-07 KatolaZ + + * setnet.sh (check_deps): Corrected a small bug in the parsing of options + +2017-01-29 KatolaZ + + * setnet.sh: + * removed "Load file" and "New File" in WiFi configuration + +2017-01-23 KatolaZ + + * setnet.sh: + * fixed a few minors bugs + +2017-01-20 KatolaZ + + * setnet.sh (0.3): + * implemented check of running shell + * implemented workaround for zsh -- now fully supported + * added chk_out and chk_exit + * all direct commands (e.g., ip, wpa_cli) are now checked + * added support for EAP/PEAP + * added support for EAP/TLS + + +2017-01-07 KatolaZ + + * setnet.sh (configure_device): Improved wifi detection + (netdiag_ping), (netdiag_traceroute),(netdiag_query): + changed dialog to programbox + * solved viasualitation bug in ip config + * added a manpage + * Added configuration variable "WIFI_DEVICES" + * The "Setup interface" menu has been reorganised + * added "Config IP Address" and "Manage Wifi Networking" + diff --git a/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/README.Debian b/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/README.Debian new file mode 100644 index 0000000..0cad044 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/README.Debian @@ -0,0 +1,132 @@ ++--------------+ +| setnet | ++--------------+ + +Copyleft (C) Vincenzo "KatolaZ" Nicosia + 2016, 2017 + +=== DESCRIPTION === + +setnet is a shell script with a dialog UI to configure ethernet and +wifi connections. It is meant to be POSIX-compliant, and has been +tested with bash, busybox, dash, ksh, mksh, posh, and yash. It is +still to be considered beta software, so you should use it AT YOUR OWN +RISK, but it is already fully functional. + +=== LICENSE === + +setnet is Free Software, and can be used and distributed under the +terms of the GNU General Public License, either version 3 of the +licence or, at your option, any later version. + +Please see the file LICENSE for more information + +=== DEPENDENCIES === + +In order to run setset, you MUST satisfy this (relatively small) set +of dependencies: + + - a posix-compliant shell (bash, busybox, dash, ksh, mksh, posh, and + yash have been tested) + + - dialog (version 1.2 tested, but it should work with previous + versions as well) + + - dhcp-client (for dhclient, tested with isc-dhcp-client) + + - iproute2 (for ip) + + - wireless-tools (for iwconfig, currently required for interface + identification) + +Most of those tools might already be installed in your system anyway. +In particular, setnet uses: + + - dialog: to provide a minimal Text-based User Interface, + - ip: to configure network interfaces and get information about them, + - dhclient: for DHCP-based IP configuration + - iwconfig: to check whether a network device is a wifi adapter + +In order to use the full set of functionalities provided by setnet, +you MIGHT also need the following packages: + + - wpa_supplicant (for wifi configuration) + + - net-tools (for netstat, to gather information about network status) + + - iputils-ping (for ping) + + - bind9-nost (for host, used to check DNS configuration) + + - traceroute (to trace the route between your host and any other host + in the Internet) + +Again, most of them should be already installed in your system anyway. + +=== USAGE === + +setnet is installed under /usr/sbin/setnet.sh. If invoked with "-h", +it provides a list of supported options: + +$ ./setnet.sh -h +Usage: setnet.sh [OPTION] +Options: + -c cfg_file Load configuration from cfg_file. + -v Print version number and exit. + -h Show this help. +$ + +If the argument "-c" is specified, setnet will use the provided +configuration file. Otherwise, it will look for its configuration file +in one of the following locations: + + - /etc/setnetrc + - ~/.setnetrc + +in the given order. The following configuration variables should be +defined in setnetrc: + + + - WPA_FILE + This is the file configuration file used by wpa_supplicant. + + - LOGNAME + This is the file used for logging. + + - TRUNCATE_LOG + if equal to "yes", the log file will be truncated when setnet + starts + + +=== root vs. mortal users === + +Networking is an amdinistration task, and as such should be performed +by the host administrator, i.e., the user with UID 0 (normally called +"root"). However, in many modern GNU/Linux systems it is customary to +allow normal users to perform some administration tasks. There are at +least two concrete possibilities to allow a particular user (in the +following we call such user "fool") to configure network interfaces +using setnet. + + +-- 1) First approach: using sudo + +If sudo is installed in your system, it is sufficient to add the +following line: + + fool ALL=NOPASSWD: /usr/sbin/setnet.sh + +to the file /etc/sudoers, and the user "fool" will be able to run +setnet.sh with effective UID 0 (i.e., as if it was root), by using the +command: + +[fool@host]$ sudo /usr/sbin/setnet.sh + +and thus will be able to perform all the needed admin tasks to +configure networking. + +-- 2) Second approach: using sup + +......TO BE DOCUMENTED...... + + diff --git a/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/changelog.Debian.gz b/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/changelog.Debian.gz new file mode 100644 index 0000000000000000000000000000000000000000..86d5e1da66bf2dda0d1d5dcb7e87a04ddeba9b40 GIT binary patch literal 563 zcmV-30?hp%iwFP!000021GSVvg`dl>IN}Lff|3BE&BnB9^r722O{40hy_w{a zcsO#4@&CKJcMM+}G5PegoAMuNl9{h9Mh!UY6j1dG;IEwr+&U}7aExSh?yo@+_mKd)^ z#%)E+JU(Q;IL`bc;x};^vr6|6Uf_$+Tij7J97KcBzqsN5EPg^9zM01};Tn&3(BYu= zcsM)){XFu?$tkY2bW$jkq)1por%vey{;*reClfx(KTN%;!D2G0r_b=iC}}fF5SxVH z405p~NQZ*iA3P2z#j(6lQfRl)+>&*ySV@;*E^OAryt3=LdFUZ&K9}{7HzTLvam~{k z?PZd%)K*1dN(Z5NzKeoDmtp?K5C<5GqbYTp0qM)y}bLRKv&s=yi#-X-OHG`XuXhWRc_`B zp-Js)bE##{J@NDEa(Z*spVFKUaZB{tuHF32hI?1-JQ{`3=-sw!{{jj=fChgB007f6 BAx!`P literal 0 HcmV?d00001 diff --git a/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/changelog.gz b/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/changelog.gz new file mode 100644 index 0000000000000000000000000000000000000000..2725afb8435f7b05c04a492bb3b64cdb582b3c05 GIT binary patch literal 578 zcmV-I0=@koiwFP!000021D#Y+Z`v>rekQ--lqaZwQTouWnx<6@B($zVqFSZBL`QN7 z7LM)N4$%JkolO|5d!l)WV*7mGci(-N@#y+?FuECxJ_3A4uOuy+R&Z7t=V3P4yj6$k}>P0$8`E;&c1!?Brb zjFBQo<%dZ!KC-yIoJGE-e3KPq+#7sXqm<_?3|c2t#VkM@FSK$;TA*+}^U zq3_y;$Ow!@5tDB+-S{Y6_@=$^ht#2kg$O-m`RbYj9CT?|4f`NWAA*x|DSCjGB1oi3 zMbZI&j_F&>NN9S$_^{yD8T#Afr-vnY97E8AWZJ98^?VsFlCW205V+(1E|i((`2 z%`V?61Xh`0VSD}4+FQ(t#q`wc|K0rEkbOC{C|{$hI3w>%U4hrY5S7JxrS}I$S_Z_e zK-ZuY{$Ra!CWL7%d8P#dYizKhxOac(&Og50q7}H31nKj9HqX9If6gbALhr0v-0EFKc&Hw-a literal 0 HcmV?d00001 diff --git a/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/copyright b/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/copyright new file mode 100644 index 0000000..f425891 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/setnet/usr/share/doc/setnet/copyright @@ -0,0 +1,21 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: setnet +Source: + +Files: debian/* +Copyright: 2016 Vincenzo (KatolaZ) Nicosia +License: GPL-3+ + This package 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 3 of the License, or + (at your option) any later version. + . + This package 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, see + . + diff --git a/debian_package/setnet-0.3.2/debian/setnet/usr/share/man/man8/setnet.8.gz b/debian_package/setnet-0.3.2/debian/setnet/usr/share/man/man8/setnet.8.gz new file mode 100644 index 0000000000000000000000000000000000000000..4ef2416aba481fb8129389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d>auqt~(9ttnrAqHr09O1@>vpVzR;%)valN?}@9UY9;IXSg&udlm3;`ns z;?flgXq)N1uEO}(3&`vJ8XoEolN&T=z0da^->dS}%?mj=BuP?LJCywuUc0YZY@VGy2Cj&iJ=UNBXr^u9NYKY{(@X&60!qm~P@TU}9!5EGi zeSqJ#$`MgV5phZMui5F^aKW{>z`{~(>r9rOt@3!K?v3F_q@r!aWW#qgwoVN)me~Np z!tom}k-MrY?1%9fYf*a26-V^gft7Q?dq#*C-%tE~gop7c>4t_hM9_=D`UTb%9j&QQ~+KuH_?y^`Sqbc>g&Z VlyfeYp&Mnt{ulM@!6pM7002Ib04V?f literal 0 HcmV?d00001 diff --git a/debian_package/setnet-0.3.2/debian/source/format b/debian_package/setnet-0.3.2/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian_package/setnet-0.3.2/debian/watch.ex b/debian_package/setnet-0.3.2/debian/watch.ex new file mode 100644 index 0000000..0f01132 --- /dev/null +++ b/debian_package/setnet-0.3.2/debian/watch.ex @@ -0,0 +1,39 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# See uscan(1) for format + +# Compulsory line, this is a version 4 file +version=4 + +# PGP signature mangle, so foo.tar.gz has foo.tar.gz.sig +#opts="pgpsigurlmangle=s%$%.sig%" + +# HTTP site (basic) +#http://example.com/downloads.html \ +# files/setnet-([\d\.]+)\.tar\.gz debian uupdate + +# Uncommment to examine a FTP server +#ftp://ftp.example.com/pub/setnet-(.*)\.tar\.gz debian uupdate + +# SourceForge hosted projects +# http://sf.net/setnet/ setnet-(.*)\.tar\.gz debian uupdate + +# GitHub hosted projects +#opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%-$1.tar.gz%" \ +# https://github.com//setnet/tags \ +# (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate + +# PyPI +# https://pypi.python.org/packages/source//setnet/ \ +# setnet-(.+)\.tar\.gz debian uupdate + +# Direct Git +# opts="mode=git" http://git.example.com/setnet.git \ +# refs/tags/v([\d\.]+) debian uupdate + + + + +# Uncomment to find new files on GooglePages +# http://example.googlepages.com/foo.html setnet-(.*)\.tar\.gz diff --git a/debian_package/setnet-0.3.2/setnet.8.gz b/debian_package/setnet-0.3.2/setnet.8.gz new file mode 100644 index 0000000000000000000000000000000000000000..247c3031f4e78a33c8db534f2130e7ad807e6c86 GIT binary patch literal 3037 zcmV<33nKI%iwFor2aZ?(19N3`Ze?^XH~^hlZEqvD5&q6!G0=xXF632`qDc@0K^0r} zsj(%+E9ZJefdjQmNrYF+?Q&O&@}a-I&yd^~$vPD1;UIgd<#0GJ&pb1Z{xzW0PSM6> znK|lwOQrgEt!!mUmdZWoQl1V-(j($ zc)FTTSM)u_&(9)SSbEZV{kw?b9nB}tQxVPgWL1@`DzZB~rL@<%-pfqeitJ9|7@L&3 zsNAV|?P$t3N=&}d+q#sMHaQ)2wWCza%xp>Ll`1zfQSONN(|oavXYu7Ri-I09N@!9B zQJ*(DQ_XtH>s1LMXUpxrgOhzfjqhG&%hhZ#7tyj1t$5O~*OzsN)nK!|%BzvrToP2q ztz{-^tIF;Qw3Zg;#tr@DhF{-AG^>ck;0QkDSjwWn9$A_?PpR4|flWH0%9zZ$bFp?| zFSDU3R!e9^61zU?+XvkpYez!oNmi#E0lFA|e>0+Vmt-0$y9eHLEaYb_;W-i)*OweU z78@kf04V<5!a%Uwg(_{<^5-veLD zpnNcHM3YJsrLxYtrcgNzb3lGS zR?%=eS&o-DtW7dYBjCHl%bmvd4^6no>l7%$jhkR|;-=yiS{4y~hF zTU{wjnSN8iEnBIz&Y|a?6BgNnG)mP$Wv1Zdd>7WGO3XG#Kv-vz4kS(CZuA2-{G8Ek zCAV~Y)G0Fi-iinwxCS-0P>J50pz(Qbdcg6UE^$cZZ2ku6QnjwPAsI_t%xUG`W-IYS zQJRBJ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`|ErG<4JQW;TEhu+pKf0IFCS6qXtP5v&BYQ+Tb@l>dIgg4iKuebA=nk)*V4eCngVVt_chWYRo1!J;mZ%05aQPr|i) fgs?vJXB6*0hl6s?#WHlG?AQMS_3ObV0~`PV-|6=R literal 0 HcmV?d00001 diff --git a/debian_package/setnet-0.3.2/setnet.sh b/debian_package/setnet-0.3.2/setnet.sh new file mode 100755 index 0000000..34de178 --- /dev/null +++ b/debian_package/setnet-0.3.2/setnet.sh @@ -0,0 +1,2208 @@ +#!/bin/sh + +# 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 3 of the License, 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, see . +# +# ---------------------------------------------------------------------- +# +# setnet.sh -- view and configure network interfaces +# +# ---------------------------------------------------------------------- +# +# Copyleft (C) Vincenzo "KatolaZ" Nicosia (katolaz@freaknet.org) -- +# (2016, 2017) +# +# + + +## +## Initialisation +## + +VERSION=0.3.1 + + +TOPSTR="setnet-${VERSION} [user: $(id -run)]" +DIALOG="dialog --backtitle \"${TOPSTR}\" --clear " + + +############################### +## ## +## Internal config variables ## +## ## +############################### + +## +## Required dependencies. If any of those commands is missing, +## the script will exit +## + +HARD_DEPS="ip dhclient dialog iw sed grep cat awk which" + +## +## Suggested dependencies. The script will issue a warning if any of +## those commands is missing +## + +SOFT_DEPS="wpa_cli wpa_supplicant" + +## +## Optional dependencies. The script will check if those dependencies +## exist, and if they do, will set a variable HAS_OPTS which contains +## the names of the commands actually found +## + +OPT_DEPS="host ping traceroute netstat pastebinit" + +################################# + +##################################### +## ## +## HEIGHT/WIDTH of various dialogs ## +## ## +##################################### + +## +## Regular windows +## + +WINDOW_WIDTH=75 +WINDOW_HEIGHT=20 + +## +## Infoboxes +## +INFO_WIDTH=40 +INFO_HEIGHT=10 + + +## +## Forms +## +FORM_WIDTH=60 +FORM_HEIGHT=12 + +## +## Large windows +## + +LARGE_WIDTH=80 +LARGE_HEIGHT=20 + + +################################# + +################################ +## ## +## Supported network families ## +## ## +################################ + +NET_FAMILIES="inet inet6" + +################################# + +## +## Load the configuration file "setnetrc" +## + +##function +load_setnetrc(){ + + WPA_FILE="" + LOGFILE="" + ## If we were given a parameter, that is the rc file to load... + ## + if [ $# -ge 1 ]; then + . "$1" + return + fi + + ## + ## Otherwise, let's look in the standard locations, namely: + ## + + ## + ## 1) /etc/setnetrc + ## + + if [ -f /etc/setnetrc ]; then + SETNETRC=/etc/setnetrc + fi + + ## + ## 2) ~/.setnetrc + ## + + if [ -f ~/.setnetrc ]; then + SETNETRC=~/.setnetrc + fi + + if [ -n "${SETNETRC}" ] && + [ -f "${SETNETRC}" ]; then + . ${SETNETRC} + fi + + if [ -z ${WPA_FILE} ]; then + echo "Could not find WPA_FILE defined anywhere. Exiting" + exit 1 + fi + + if [ -z ${LOGFILE} ]; then + echo "Could not find LOGFILE defined anywhere. Exiting" + exit 1 + fi +} + + +## +## handler called upon exit/signal (NONE HUP INT TRAP TERM QUIT) +## + +##function +cleanup(){ + rm -f ${TMPFILE} + rm -f ${WPA_PIDFILE} +} + + +################### +# # +# LOGGING # +# # +################### + +## +## log() takes two arguments, namely the label and the message +## +## +##function +log(){ + + ##local + LABEL=$1 + ##local + MSG=$2 + + echo "${LABEL}:" "${MSG}" >> "${LOGFILE}" + +} + +## +## Check whether the shell which called the script is supported, or +## exit. Currently, we support the follwing shells: +## +## - bash +## - busybox +## - dash +## - ksh +## - mksh +## - posh +## - sh +## - yash +## + +##function +check_shell(){ + + ## + ## FIXME!!! THIS TEST DOES NOT WORK yet... + ## + + SCRIPT_CMD=$(ps $$ | tail -1 | sed -r -e 's/\ +/\ /g;s/^\ +//g' | cut -d " " -f 5) + CUR_SH=$(basename ${SCRIPT_CMD}) + + case ${CUR_SH} in + ash|bash|busybox|dash|ksh|mksh|posh|sh|yash|zsh) + log "check_shell" "The current shell (${CUR_SH}) is supported" + return + ;; + *) + log "check_shell" "The current shell (${CUR_SH}) is not supported" + echo "The current shell (${CUR_SH}) is not supported. Exiting..." + exit 1 + ;; + esac +} + + +## +## Check dependencies +## +## - check if the current shell is supported through check_shell, and +## set the variable CUR_SH accordingly +## +## - each command in HARD_DEPS MUST exist, or the script exits +## +## - each command in SOFT_DEPS SHOULD exist, or the script will log a +## warning +## +## - each command in OPT_DEPS MIGHT exist, and if it does its name is +## included in the variable "HAS_OPTS" +## + +##function +check_deps(){ + + check_shell + + ## Workaround for zsh + if [ "${CUR_SH}" = "zsh" ]; then + setopt shwordsplit + fi + + for h in $(echo ${HARD_DEPS}); do + _W=$(which ${h}) + if [ -z "${_W}" ]; then + echo "Error: required command \"${h}\" not found. Exiting..." + exit 1 + fi + log "check_deps" "NOTICE: required command '${h}'...found" + done + + for s in $(echo ${SOFT_DEPS}); do + _S=$(which ${s}) + if [ -z "${_S}" ]; then + log "check_deps" "WARNING: suggested command '${s}' not found! Some functions might not work properly" + fi + done + + HAS_OPTS="" + for o in $(echo ${OPT_DEPS}); do + _O=$(which ${o}) + if [ -n "${_O}" ]; then + HAS_OPTS=" ${HAS_OPTS} ${o} " + log "check_deps" "NOTICE: optional command '${o}'...found" + else + log "check_deps" "NOTICE: optional command '${o}' not found!" + fi + done + + log "check_deps" "HAS_OPTS: \"${HAS_OPTS}\"" + +} + + +## +## Set debug mode -- dialog is instructed to dump a trace to the file +## TRACE_FILE provided by the user +## + +##function +set_debug(){ + + TRACE_FILE=$1 + DEBUG_MODE="DEBUG" + DIALOG="${DIALOG} --trace ${TRACE_FILE}" + +} + + +## +## Generic function for unimplemented features. It just pops up a +## message-box and returns +## + +##function +unimplemented(){ + + LABEL=$1 + + eval "${DIALOG} --msgbox 'Sorry! '$LABEL' not implemented, yet!' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2>${TMPFILE} +} + + +##function +check_sudo(){ + + LABEL="$1" + + if [ "${USING_SUDO}" = "1" ]; then + eval "${DIALOG} --msgbox '${LABEL}' ${INFO_HEIGHT} ${INFO_WIDTH} " 2>${TMPFILE} + return 1 + else + return 0 + fi + +} + +## +## Check the output of a command provided as argument against an +## expected output. Return 1 if the check fails, otherwise return 0 +## +##function +chk_out(){ + + EXP_OUT=$1 + shift + log "chk_out" "check output of: $(echo $@)" + ACT_OUT=$($@) + [ "${ACT_OUT}" = "${EXP_OUT}" ] || \ + log "chk_out" "Error: got '${ACT_OUT}' when expecting '${EXP_OUT}'" && \ + return 1 + return 0 + +} + + +## +## Check the exit value of a command provided as argument against an +## expected output -- return 1 if the check fails, otherwise return 0 +## +##function +chk_exit(){ + + EXP_EXIT=$1 + shift + log "chk_exit" "check exit value of: $(echo $@)" + $@ + ACT_EXIT=$? + [ "${ACT_EXIT}" = "${EXP_EXIT}" ] || \ + log "chk_exit" "Error: got '${ACT_EXIT}' when expecting '${EXP_EXIT}'" && \ + return 1 + return 0 +} + + + +########################################## + +##function +edit_file(){ + + ##local + FILEIN=$1 + log "edit_file" "editing file ${FILEIN}" + eval "${DIALOG} --title 'Editing file: ${FILEIN}' \ + --editbox ${FILEIN} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" 2> ${TMPFILE} + + if [ $? -eq 0 ]; then + log "edit_file" "Copying ${TMPFILE} into ${FILEIN}" + if cp "${TMPFILE}" "${FILEIN}" + then + eval "${DIALOG} --msgbox 'File ${FILEIN} saved successfully' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + else + eval "${DIALOG} --msgbox 'Error saving file ${FILEIN}' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + fi + else + log "edit_file" "Editing of ${FILEIN} aborted..." + eval "${DIALOG} --msgbox 'File ${FILEIN} not saved' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + fi +} + + + + +## +## Read all the configured addresses for a given inet family +## +##function +get_addr_family(){ + +##local + DEVNAME=$1 + ##local + DEVFAMILY=$2 + + NUMADDR=$(ip -f "${DEVFAMILY}" addr show "${DEVNAME}" | grep -c "${DEVFAMILY}") + ADDR_STR="" + for i in $(seq ${NUMADDR}); do + ADDR=$(ip -f "${DEVFAMILY}" addr show "${DEVNAME}" | grep "${DEVFAMILY}" | \ + tail -n +$i | head -1 | sed -r -e "s:^\ +::g" | cut -d " " -f 2,4,6 |\ + sed -r -e "s:\ : -- :g") + ADDR_STR="${ADDR_STR}\n${DEVFAMILY}: ${ADDR}\n" + done +} + +## +## Show the current configuration of a given device +## + +##function +show_device_conf(){ + +##local +DEVNAME=$1 + if [ -z "${DEVNAME}" ]; then + return -1 + fi + + DEVMAC=$(ip link show "${DEVNAME}" | tail -n +2 | sed -r 's/^\ +//g' | cut -d " " -f 2) + DEV_STATUS=$(ip -o link | cut -d " " -f 2,9 | grep -E "^${DEVNAME}: " | cut -d " " -f 2) + + DEVCONF="MAC: ${DEVMAC}\nLINK STATUS: ${DEV_STATUS}\n" + + log "show_device_conf" "NET_FAMILIES: \"${NET_FAMILIES}\"" + + for f in ${NET_FAMILIES}; do + get_addr_family ${DEVNAME} ${f} + log "show_device_conf" "family: ${f} ADDR_STR: \"${ADDR_STR}\"" + + if [ -z "${ADDR_STR}" ]; then + DEVCONF="${DEVCONF}${f}: Unconfigured\n" + else + DEVCONF="${DEVCONF}${ADDR_STR}" + fi + log "show_device_conf" "DEVCONF: ${DEVCONF}" + done + + DEVCONF="${DEVCONF}\n== name servers ==\n$(grep '^nameserver' /etc/resolv.conf)" + + eval "${DIALOG} --title 'Current configuration of device: ${DEVNAME}' \ + --msgbox '\n\n${DEVCONF}' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} " + return 0 + +} + + + +##function +config_ip_static(){ + + ##local + DEV_IP="192.168.1.2" + ##local + DEV_NET="192.168.1.0" + ##local + DEV_NETMASK="255.255.255.0" + ##local + DEV_GW="192.168.1.1" + ##local + DEV_DNS1="208.67.222.222" + ##local + DEV_DNS2="208.67.220.220" + + ##local + DEVNAME=$1 + + + eval "${DIALOG} --form 'Set network for device: ${DEVNAME}' \ + ${FORM_HEIGHT} ${FORM_WIDTH} 6 \ + 'IP' 1 1 '${DEV_IP}' 1 16 16 16 \ + 'Network' 2 1 '${DEV_NET}' 2 16 16 16 \ + 'Netmask' 3 1 '${DEV_NETMASK}' 3 16 16 16 \ + 'Gateway' 4 1 '${DEV_GW}' 4 16 16 16 \ + 'Primary DNS' 5 1 '${DEV_DNS1}' 5 16 16 16 \ + 'Secondary DNS' 6 1 '${DEV_DNS2}' 6 16 16 16 " \ + 2> ${TMPFILE} + + if [ $? -eq 1 ]; then + eval "${DIALOG} --infobox 'Configuration of ${DEVNAME} aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + + cat ${TMPFILE} | tr '\n' ' ' >${TMPFILE}_2 + + read DEV_IP DEV_NET DEV_NETMASK DEV_GW DEV_DNS1 DEV_DNS2 <${TMPFILE}_2 + eval "${DIALOG} --msgbox 'Proposed configuration of ${DEVNAME}:\n \ +IP: ${DEV_IP}\nNetwork: ${DEV_NET}\nNetmask: ${DEV_NETMASK}\nGateway: \ +${DEV_GW}\nDNS1: ${DEV_DNS1}\nDNS2: ${DEV_DNS2}'\ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + + rm -f ${TMPFILE}_2 + ## Configure IP + + chk_exit 0 ip link set "${DEVNAME}" down + chk_exit 0 ip link set "${DEVNAME}" up + chk_exit 0 ip address flush dev "${DEVNAME}" + chk_exit 0 ip address add "${DEV_IP}/${DEV_NETMASK}" dev "${DEVNAME}" + + ## Configure GW + #if [ -n "${DEV_GW}" ]; then + chk_exit 0 ip route flush dev "${DEVNAME}" + chk_exit 0 ip route add "${DEV_NET}/${DEV_NETMASK}" dev "${DEVNAME}" + chk_exit 0 ip route add default via "${DEV_GW}" + #fi + ## Configure DNS + #if [ -n "${DEV_DNS1}" ] || + # [ -n "${DEV_DNS1}" ]; then + mv /etc/resolv.conf /etc/resolv.conf.bak + if [ -n "${DEV_DNS1}" ]; then + echo "nameserver ${DEV_DNS1}" >> /etc/resolv.conf + fi + if [ -n "${DEV_DNS2}" ]; then + echo "nameserver ${DEV_DNS2}" >> /etc/resolv.conf + fi + show_device_conf "${DEVNAME}" + #fi +} + +##function +config_ip_dhcp(){ + +##local + DEVNAME=$1 + + ##eval "${DIALOG} --msgbox 'Running \"dhclient ${DEVNAME}\"' ${INFO_HEIGHT} ${INFO_WIDTH}" + dhclient -r ${DEVNAME} 2>/dev/null + dhclient -v ${DEVNAME} 2>&1 | + eval "${DIALOG} --title 'Running dhclient ${DEVNAME}' \ + --programbox ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" 2>${TMPFILE} + if [ $! -ne 0 ];then + log "config_ip_dhcp" "dhclient aborted" + fi + show_device_conf ${DEVNAME} +} + + +##function +configure_ip_address(){ + +##local + DEVNAME=$1 + + eval "${DIALOG} --cancel-label 'Up' \ + --menu 'Configuring ${DEVNAME}' ${INFO_HEIGHT} ${INFO_WIDTH} 4 \ + 'DHCP' ''\ + 'Static' ''" 2>${TMPFILE} + if [ $? -eq 1 ]; then + return + fi + ACTION=$(cat ${TMPFILE}) + case ${ACTION} in + "Static") + config_ip_static ${DEVNAME} + ;; + "DHCP") + config_ip_dhcp ${DEVNAME} + ;; + esac +} + +##function +wifi_essid_from_mac(){ + + ##local + DEVNAME=$1 + ##local + W_MAC=$2 + + W_ESSID=$(wpa_cli -i "${DEVNAME}" scan_results | grep -E "^${W_MAC}" | \ + sed -r -e 's/\t/\|/g' | cut -d "|" -f 5) + + log "wifi_essid_from_mac" "Recovered ESSID: ${W_ESSID}" +} + +##function +wifi_flags_from_mac(){ +##local + DEVNAME=$1 +##local + W_MAC=$2 + + W_FLAGS=$(wpa_cli -i "${DEVNAME}" scan_results | grep -E "^${W_MAC}" | \ + sed -r -e 's/\t/\|/g' | cut -d "|" -f 4) + log "wifi_essid_from_mac" "Recovered W_FLAGS: ${W_FLAGS}" + +} + + +##function +wifi_network_list(){ + +##local + DEVNAME=$1 + wpa_cli -i ${DEVNAME} list_networks | tail -n +2 | sed -r -e 's/\t/\|/g' > ${TMPFILE} + + NETLIST="" + LAST_IFS=$IFS + IFS="|" + while read NETNUM NETESSID NETBSSID NETFLAGS; do + IS_DIS=$(echo ${NETFLAGS} | sed -r -e 's/\[//g;s/\]//g' | grep -c -i disabled ) + if [ ${IS_DIS} -eq 1 ]; then + STATUS="(DIS)" + else + STATUS="(ENAB)" + fi + IS_CUR=$(echo ${NETFLAGS} | sed -r -e 's/\[//g;s/\]//g' | grep -c -i current ) + if [ ${IS_CUR} -eq 1 ]; then + STATUS="${STATUS}(CUR)" + fi + + + NETLIST="${NETLIST} ${NETNUM} \"${NETESSID}-${STATUS}\"" + done < ${TMPFILE} + IFS=${LAST_IFS} + + log "wifi_network_list" "NETLIST: ${NETLIST}" +} + +##function +wpa_authenticate_EAP_TLS(){ + + ##unimplemented "wpa_authenticate_EAP_TLS" + ##return 1 + + + DEVNAME=$1 + W_ESSID=$2 + + ## We first add the new network + NET_NUM=$(wpa_cli -i ${DEVNAME} add_network | tail -1) + + log "wifi_authenticate_EAP_PEAP" "NET_NUM: ${NET_NUM}" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ssid "\"${W_ESSID}\"" + + + ## we get the needed information, namely: + ## + ## - identity + ## - server certificate (ca_cert) + ## - client certificate + ## - + ## + + eval "${DIALOG} --form 'PEAP parameters:' \ + ${FORM_HEIGHT} ${FORM_WIDTH} 3 \ + 'identity' 1 1 '' 1 20 30 80 \ + 'server certificate' 2 1 '' 2 20 30 200 \ + 'client certificate' 3 1 '' 3 20 30 200 \ + 'private key' 4 1 '' 4 20 30 200 \ + 'private key password' 5 1 '' 5 30 30 80 \ + " 2>${TMPFILE} + + if [ $? != "0" ]; then + log "wifi_authenticate_EAP_TLS" "Aborting EAP/TLS authentication" + wpa_cli -i ${DEVNAME} remove_network ${NET_NUM} + return 1 + fi + + ## + ## Now, this is not super-clean, but seems necessary to maintain + ## POSIX shell compatibility + ## + cat ${TMPFILE} | tr '\n' ' ' >${TMPFILE}_2 + read EAP_IDENTITY EAP_SERV_CERT EAP_CLIENT_CERT EAP_PRIV_KEY EAP_PRIV_KEY_PWD <${TMPFILE}_2 + rm -f ${TMPFILE}_2 + ## Remove everything from the temp file + echo "" > ${TMPFILE} + + + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} key_mgmt WPA-EAP + + ## Set eap to PEAP + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} eap TLS + ## Set identity + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} identity "\"${EAP_IDENTITY}\"" + + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ca_cert "\"${EAP_SERV_CERT}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} client_cert "\"${EAP_CLIENT_CERT}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} private_key "\"${EAP_PRIV_KEY}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} private_key_passwd "\"${EAP_PRIV_KEY_PWD}\"" + + eval "${DIALOG} --defaultno --yesno \ + 'Network \"${W_ESSID}\" configured\nSave configuration file?' \ + ${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE} + if [ $? -eq 0 ]; then + ## Save the config file + wifi_save_file ${DEVNAME} + fi + + ## We can now enable the network + chk_out "OK" wpa_cli -i ${DEVNAME} enable_network ${NET_NUM} + + return 0 + +} + + +##function +wpa_authenticate_EAP_PEAP(){ + + ##unimplemented "wpa_authenticate_EAP_PEAP" + + DEVNAME=$1 + W_ESSID=$2 + + ## We first add the new network + NET_NUM=$(wpa_cli -i ${DEVNAME} add_network | tail -1) + + log "wifi_authenticate_EAP_PEAP" "NET_NUM: ${NET_NUM}" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ssid "\"${W_ESSID}\"" + + + ## we get the needed information, namely: + ## + ## - identity + ## - password + ## - server certificate (ca_cert) + ## + + eval "${DIALOG} --form 'PEAP parameters:' \ + ${FORM_HEIGHT} ${FORM_WIDTH} 3 \ + 'identity' 1 1 '' 1 20 30 80 \ + 'password' 2 1 '' 2 20 30 80 \ + 'server certificate' 3 1 '' 3 20 30 80 \ + " 2>${TMPFILE} + + if [ $? != "0" ]; then + log "wifi_authenticate_EAP_PEAP" "Aborting EAP/PEAP authentication" + wpa_cli -i ${DEVNAME} remove_network ${NET_NUM} + return 1 + fi + + ## + ## Now, this is not super-clean, but seems necessary to maintain + ## POSIX shell compatibility + ## + cat ${TMPFILE} | tr '\n' ' ' >${TMPFILE}_2 + read EAP_IDENTITY EAP_PASSWORD EAP_CERT <${TMPFILE}_2 + rm -f ${TMPFILE}_2 + ## Remove identity and password from the temp file + echo "" > ${TMPFILE} + + log "wpa_authenticate_EAP_PEAP" "EAP_IDENTITY: ${EAP_IDENTITY}" + log "wpa_authenticate_EAP_PEAP" "EAP_PASSWORD: ${EAP_PASSWORD}" + log "wpa_authenticate_EAP_PEAP" "EAP_CERT: ${EAP_CERT}" + + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} key_mgmt WPA-EAP + + ## Set eap to PEAP + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} eap PEAP + ## Set identity and password + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} identity "\"${EAP_IDENTITY}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} password "\"${EAP_PASSWORD}\"" + if [ -n "${EAP_CERT}" ]; then + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ca_cert "\"${EAP_CERT}\"" + fi + + eval "${DIALOG} --defaultno --yesno \ + 'Network \"${W_ESSID}\" configured\nSave configuration file?' \ + ${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE} + if [ $? -eq 0 ]; then + ## Save the config file + wifi_save_file ${DEVNAME} + fi + + + ## We can now enable the network + chk_out "OK" wpa_cli -i ${DEVNAME} enable_network ${NET_NUM} + + return 0 + +} + + +## +## Open access point -- no WPA +## +##function +wifi_authenticate_NONE(){ + + DEVNAME="$1" + W_ESSID="$2" + + NET_NUM=$(wpa_cli -i ${DEVNAME} add_network | tail -1) + + log "wifi_authenticate" "NET_NUM: ${NET_NUM}" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ssid "\"${W_ESSID}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} key_mgmt NONE + eval "${DIALOG} --defaultno --yesno \ + 'Network \"${W_ESSID}\" added\nSave configuration file?' \ + ${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE} + if [ $? -eq 0 ]; then + ## Save the config file + wifi_save_file ${DEVNAME} + fi + + ## We can now enable the network + chk_out "OK" wpa_cli -i ${DEVNAME} enable_network ${NET_NUM} + + return 0 + +} + + +##function +wpa_authenticate_PSK(){ + + DEVNAME=$1 + W_ESSID="$2" + + PSK="" + PSK_LENGTH=${#PSK} + while [ ${PSK_LENGTH} -le 7 ]; do + eval "${DIALOG} --insecure --inputbox 'Please insert WPA PSK\n(min 8 characters)' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} + if [ $? -eq 1 ]; then + eval "${DIALOG} --msgbox 'Network configuration aborted!!!' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return 1 + fi + PSK=$(cat ${TMPFILE}) + PSK_LENGTH=${#PSK} + done + + + NET_NUM=$(wpa_cli -i ${DEVNAME} add_network | tail -1) + + log "wifi_authenticate_PSK" "NET_NUM: ${NET_NUM}" + log "wifi_authenticate_PSK" "W_ESSID: ${W_ESSID}" + log "wifi_authenticate_PSK" "PSK: ${PSK}" + + + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} ssid "\"${W_ESSID}\"" + chk_out "OK" wpa_cli -i ${DEVNAME} set_network ${NET_NUM} psk "\"${PSK}\"" + ## remove the password from tmpfile + echo "" > ${TMPFILE} + eval "${DIALOG} --defaultno --yesno \ + 'Network \"${W_ESSID}\" added\nSave configuration file?' \ + ${INFO_HEIGHT} ${INFO_WIDTH} " 2> ${TMPFILE} + if [ $? -eq 0 ]; then + ## Save the config file + wifi_save_file ${DEVNAME} + fi + + ## We can now enable the network + chk_out "OK" wpa_cli -i ${DEVNAME} enable_network ${NET_NUM} + + eval "${DIALOG} --msgbox 'Network added successfully' ${INFO_HEIGHT} ${INFO_WIDTH}" + return 0 + + +} + +## +## Manage WPA authentication. Choose among the available +## authentication systems currently supported: +## +## - PSK +## - EAP/PEAP +## - EAP/TLS +## + +##function +wifi_authenticate_WPA(){ + + DEVNAME=$1 + W_ESSID=$2 + + ## + ## Construct the menu with all the available authentication modes + ## + MODES=$(echo $W_FLAGS | sed -r -e 's/\]\[/\n/g;s/\[//g;s/\]//g' | grep -E "^WPA") + log "wifi_authenticate_WPA" "MODES: ${MODES}" + MENU_ITEMS="" + CNT=0 + for m in ${MODES}; do + WPA_TYPE=$(echo ${m} | cut -d "-" -f 1) + HAS_PSK=$(echo ${m} | cut -d "-" -f 2 | grep "PSK") + if [ "${HAS_PSK}" != "" ]; then + MENU_ITEMS="${MENU_ITEMS} '${WPA_TYPE}+PSK' 'Pre-shared key' " + fi + + HAS_EAP=$(echo ${m} | cut -d "-" -f 2 | grep "EAP") + if [ "${HAS_EAP}" != "" ]; then + MENU_ITEMS="${MENU_ITEMS} '${WPA_TYPE}+EAP/PEAP' 'EAP/PEAP' " + MENU_ITEMS="${MENU_ITEMS} '${WPA_TYPE}+EAP/TLS' 'EAP/TLS' " + fi + done + + log "wifi_authenticate_WPA" "MENU_ITEMS: ${MENU_ITEMS}" + + + eval "${DIALOG} --menu 'Select authentication' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 \ + ${MENU_ITEMS} " 2> ${TMPFILE} + + if [ $? != "0" ]; then + ## conf aborted + log "wifi_authenticate_WPA" "configuration aborted" + return 1; + fi + + + SEL_MODE=$(cat ${TMPFILE}) + log "wifi_authenticate_WPA" "SEL_MODE: ${SEL_MODE}" + case ${SEL_MODE} in + "WPA+EAP/PEAP"|"WPA2+EAP/PEAP") + wpa_authenticate_EAP_PEAP ${DEVNAME} ${W_ESSID} + ;; + "WPA+EAP/TLS"|"WPA2+EAP/TLS") + wpa_authenticate_EAP_TLS ${DEVNAME} ${W_ESSID} + ;; + "WPA+PSK"|"WPA2+PSK") + wpa_authenticate_PSK ${DEVNAME} ${W_ESSID} + ;; + *) + log "wifi_authenticate_WPA" "Error. SEL_MODE '${SEL_MODE}' unsupported" + + esac + + +} + + + +## +## Manage the authentication for a given wifi ESSID +## +## We use wpa_cli to check the type of authentication supported by the +## network, and then we call the corresponding function +## + +##function +wifi_authenticate(){ + +##local + DEVNAME=$1 + ##local + W_MAC=$2 + + + log "wifi_authenticate" "configuring ${DEVNAME} on ${W_MAC}" + ## This will set the variable W_ESSID appropriately + wifi_essid_from_mac ${DEVNAME} ${W_MAC} + + ## This will set the variable W_FLAGS appropriately + wifi_flags_from_mac ${DEVNAME} ${W_MAC} + + + log "wifi_authenticate" "configuring essid: ${W_ESSID} on device: ${DEVNAME}" + log "wifi_authenticate" "W_FLAGS: ${W_FLAGS}" + + + ## If the network exists already, we first remove it... + + NET_EXISTS=$(wpa_cli -i ${DEVNAME} list_networks | tail -n +2 | sed -r -e 's/\t/\|/g' \ + | cut -d "|" -f 2 | grep -c "${W_ESSID}$" ) + if [ ${NET_EXISTS} != 0 ]; then + NET_NUM=$(wpa_cli -i ${DEVNAME} list_networks | tail -n +2 | sed -r -e 's/\t/\|/g' \ + | cut -d "|" -f 1,2 | grep "${W_ESSID}$" | cut -d "|" -f 1) + STATUS=$(wpa_cli -i ${DEVNAME} remove_network ${NET_NUM}) + if [ "${STATUS}" != "OK" ]; then + eval "${DIALOG} --msgbox 'Error while removing existing \ + network:\n$essid: {W_ESSID}'" ${INFO_HEIGHT} ${INFO_WIDTH} + return + fi + fi + + ## Check whether WPA is available + + HAS_WPA=$(echo "${W_FLAGS}" | grep -E -c "WPA" ) + + log "wifi_authenticate" "HAS_WPA: \"${HAS_WPA}\"" + + ### This will configure WPA + if [ "${HAS_WPA}" != "0" ]; then + wifi_authenticate_WPA ${DEVNAME} ${W_ESSID} + if [ $? = "0" ]; then + log "wifi_authenticate" "WPA configured" + return 0 + fi + fi + + log "wifi_authenticate" "WPA authentication failed, aborted, or not supported" + + ### ...otherwise, try to configure an open connection (key_mgmt=NONE) + + log "wifi_authenticate" "Trying open (no WPA) configuration..." + + wifi_authenticate_NONE ${DEVNAME} ${W_ESSID} + if [ $? = "0" ]; then + log "wifi_authenticate" "Open connection configured" + return 0 + fi + + log "wifi_authenticate" "Open connection not supported" + + ## No available authentication methods.... + + eval "${DIALOG} --msgbox 'No supported authentication method for ${W_ESSID}'" + return 1 +} + + + + +## +## Configure a new connection from a list of available wi-fi networks +## + +##function +wifi_add(){ + +##local +DEVNAME=$1 + + wpa_cli -i ${DEVNAME} scan + eval "${DIALOG} --timeout 4 --msgbox 'Scanning for networks...' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + wpa_cli -i ${DEVNAME} scan_results | grep -E "^[0-9a-f][0-9a-f]:" | \ + sed -r -e 's/\t/|/g' |\ + sort -t "|" -r -n -k 3 > ${TMPFILE} + + wifinets="" + LAST_IFS=$IFS + IFS="|" + while read W_MAC W_FREQ W_STRNGT W_FLAGS W_ESSID; do + + log "wifi_add" "W_ESSID: \"${W_ESSID}\"" + wifinets="${wifinets} ${W_MAC} \"${W_ESSID} -- ${W_FLAGS}\"" + done < ${TMPFILE} + IFS=${LAST_IFS} + + + log "wifi_add" "Wifi nets: \n${wifinets}\n===" + eval "dialog --menu 'Select a network' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 \ + ${wifinets} " 2> ${TMPFILE} + if [ $? -eq 1 ]; then + return + fi + + W_MAC=$(cat ${TMPFILE}) + + + wifi_authenticate ${DEVNAME} ${W_MAC} + if [ $? != "0" ]; then + eval "${DIALOG} --msgbox 'Error while configuring ${DEVNAME}' " + fi + return $? +} + + +##function +wifi_save_file(){ + +##local +DEVNAME=$1 + + SAVE_STATUS=$(wpa_cli -i ${DEVNAME} save_config | tail -1 ) + if [ "${SAVE_STATUS}" = "OK" ]; then + eval "${DIALOG} --msgbox 'Current configuration dumped to file ${WPA_FILE}' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + else + eval "${DIALOG} --msgbox 'Error while saving configuration to file ${WPA_FILE}' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + fi +} + +##function +wifi_remove(){ + +##local + DEVNAME=$1 + + wifi_network_list ${DEVNAME} + + eval "${DIALOG} --menu 'Select network to remove' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 ${NETLIST}" \ + 2> ${TMPFILE} + + if [ $? -eq 0 ]; then + ## a network has been selected + NETNUM=$(cat ${TMPFILE}) + WPA_STATUS=$(wpa_cli -i ${DEVNAME} remove_network ${NETNUM} | tail -1 ) + if [ "${WPA_STATUS}" = "OK" ]; then + eval "${DIALOG} --defaultno --yesno \ + 'Network ${NETNUM} removed\nSave configuration file?' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} + if [ $? -eq 0 ]; then + ## Save the config file + wifi_save_file ${DEVNAME} + fi + + return + else + eval "${DIALOG} --msgbox 'Network ${NETNUM} NOT removed' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + else + eval "${DIALOG} --msgbox 'No network removed!!!' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + +} + + +##function +wifi_restart_wpa(){ + +##local + DEVNAME=$1 +##local + WPA_FILE=$2 + + WPA_PID=$(ps ax | grep wpa_supplicant | grep " -i ${DEVNAME} " | +sed -r -e 's/^\ +//g' | cut -d " " -f 1) + + if [ -n "${WPA_PID}" ]; then + log "wifi_restart_wpa" "WPA_PID: ${WPA_PID}" + kill -9 ${WPA_PID} + else + log "wifi_restart_wpa" "no wpa_supplicant is running!!!" + fi + 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}" | \ + sed -r -e 's/^\ +//g' | cut -d " " -f 1 ) + WPA_PID_SAVED=$(cat ${WPA_PIDFILE}) + log "wifi_restart_wpa" "WPA_PID: ${WPA_PID} WPA_PID_SAVED: ${WPA_PID_SAVED}" + if [ -n "${WPA_PID}" ] && [ "${WPA_PID}" != "${WPA_PID_SAVED}" ]; then + eval "${DIALOG} --msgbox 'Error restarting wpa_supplicant' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + else + eval "${DIALOG} --msgbox 'wpa_supplicant restarted successfully' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + fi + +} + + + +## +## wifi_enable: show the list of configured networks, and enable the +## one the used has clicked on +## + +##function +wifi_enable(){ + +##local + DEVNAME=$1 + + wifi_network_list ${DEVNAME} + + eval "${DIALOG} --menu 'Select configured network' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 ${NETLIST}" \ + 2> ${TMPFILE} + + if [ $? -eq 0 ]; then + ## a network has been selected + NETNUM=$(cat ${TMPFILE}) + WPA_STATUS=$(wpa_cli -i ${DEVNAME} enable ${NETNUM} | tail -1 ) + if [ "${WPA_STATUS}" = "OK" ]; then + eval "${DIALOG} --msgbox 'Network ${NETNUM} enabled' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + #config_ethernet ${DEVNAME} + return + else + eval "${DIALOG} --msgbox 'Network ${NETNUM} NOT enabled' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + else + eval "${DIALOG} --msgbox 'No network enabled!!!' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi +} + + +##function +wifi_disable(){ + +##local + DEVNAME=$1 + wifi_network_list ${DEVNAME} + eval "${DIALOG} --menu 'Select configured network' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 ${NETLIST}" \ + 2> ${TMPFILE} + + if [ $? -eq 0 ]; then + ## a network has been selected + NETNUM=$(cat ${TMPFILE}) + WPA_STATUS=$(wpa_cli -i ${DEVNAME} disable ${NETNUM} | tail -1 ) + if [ "${WPA_STATUS}" = "OK" ]; then + eval "${DIALOG} --msgbox 'Network ${NETNUM} disabled' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + else + eval "${DIALOG} --msgbox 'Network ${NETNUM} NOT disabled' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + else + eval "${DIALOG} --msgbox 'No network disabled!!!' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi +} + + + + +##function +config_wifi(){ + +##local + DEVNAME=$1 + + while true; do + CUR_NET=$(wpa_cli -i ${DEVNAME} status | grep "^ssid" | cut -d "=" -f 2) + eval "${DIALOG} --cancel-label 'Up' \ + --menu 'Configuring ${DEVNAME}\nCurrent network: ${CUR_NET}\n(Current file: ${WPA_FILE})' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 12 \ + 'Restart' 'Restart wpa_supplicant' \ + 'Enable' 'Enable a configured network' \ + 'Disable' 'Disable a configured network' \ + 'Add' 'Configure a new network' \ + 'Remove' 'Delete an existing network' \ + 'Show' 'Show current configuration file' \ + 'Edit' 'Edit current configuration file' \ + 'Save' 'Save configuration to file' "\ + 2>${TMPFILE} + + if [ $? = "1" ]; then + return + fi + ACTION=$(cat ${TMPFILE}) + case ${ACTION} in + "Restart") + ## Restart wpa_supplicant + wifi_restart_wpa ${DEVNAME} ${WPA_FILE} + ;; + "Enable") + wifi_enable ${DEVNAME} + ;; + "Disable") + wifi_disable ${DEVNAME} + ;; + "Add") + wifi_add ${DEVNAME} + ;; + "Remove") + wifi_remove ${DEVNAME} + ;; + "Show") + eval "${DIALOG} --title 'Current file: ${WPA_FILE}' \ + --textbox ${WPA_FILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + ;; + "Edit") + edit_file ${WPA_FILE} + ;; + "Save") + wifi_save_file ${DEVNAME} + ;; + esac + done + +} + + + +## +## (Re)-Configure +## + +##function +configure_wifi(){ + +##local + DEVNAME=$1 + + ## Automatically Check if the network device is a wifi -- this + ## 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 ${IS_WIFI} in + 1) + config_wifi ${DEVNAME} + ;; + *) + ## Show a message here + eval "${DIALOG} --msgbox '${DEVNAME} is not a WiFi device... ' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + ;; + esac + +} + + +##function +set_device_up(){ + + ##local + DEVNAME=$1 + + chk_exit 0 ip link set ${DEVNAME} up + +} + +##function +set_device_down(){ + + ##local + DEVNAME=$1 + chk_exit 0 ip link set ${DEVNAME} down + +} + +##function +show_device_menu(){ + +##local + DEVNAME=$1 + + while true; do + 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}" + eval "${DIALOG} --cancel-label 'Up' --menu\ + 'Device: ${DEVNAME}\nStatus: ${DEV_STATUS}' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 8 \ + 'View' 'View current configuration' \ + 'Conf' 'Configure IP Address' \ + 'WiFi' 'Manage WiFi networking' \ + 'Start' 'Bring interface up' \ + 'Stop' 'Put interface down' \ + 'Restart' 'Restart interface'" 2> ${TMPFILE} + + if [ $? -eq 1 ]; then + return + fi + + DEV_ACTION=$(cat ${TMPFILE}) + case ${DEV_ACTION} in + "View") + show_device_conf ${DEVNAME} + ;; + "Conf") + configure_ip_address ${DEVNAME} + ;; + "WiFi") + configure_wifi ${DEVNAME} + ;; + "Start") + set_device_up ${DEVNAME} + ;; + "Stop") + set_device_down ${DEVNAME} + ;; + "Restart") + set_device_down ${DEVNAME} + set_device_up ${DEVNAME} + ;; + *) + ;; + + esac + done +} + +## +## Show all the available network devices +## + +##function +show_devs() { + + DEVICES=$(ip link show | awk 'NR % 2 == 1' | cut -d ":" -f 2) + + DEVICE_TAGS="" + + for i in $DEVICES; do + if [ "$i" != "lo" ]; then + DEVICE_TAGS="${DEVICE_TAGS} $i $i" + fi + done + + eval "${DIALOG} --cancel-label 'Up' \ + --menu 'Select Interface to configure' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 4 \ + ${DEVICE_TAGS}" 2> ${TMPFILE} + return $? +} + + +##function +dev_config_menu(){ + + while true; do + show_devs + if [ $? -eq 1 ]; then + return + fi + DEVNAME=$(cat ${TMPFILE}) + show_device_menu ${DEVNAME} + done +} + +##function +show_info(){ + + cat < ${TMPFILE} + + -+- setnet.sh ${VERSION} -+- + +setnet.sh is a simple state-less tool to manage and configure network +interfaces. It is a shell wrapper around the functionalities of +standard command-line tools, including "ip", "dhclient", "wpa_cli", +etc., and can be used to configure network connections via +Ethernet/Wi-Fi interfaces. + +Both Static and DHCP-based IP configuration are supported. + +At the moment, only WPA-PSK and open (no key) Wi-Fi connections are +available. + +For more information, please visit the webpage of the project: + + http://kalos.mine.nu/setnet/ + +Please report bugs at: + + https://git.devuan.org/KatolaZ/setnet + +EOF + eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + return +} + +##function +show_copyright(){ + + cat < ${TMPFILE} + + -+- setnet.sh ${VERSION} -+- + +-------------------------------------------------------------------- + + Copyleft (C) Vincenzo "KatolaZ" Nicosia + 2016, 2017 + +-------------------------------------------------------------------- + + +EOF + eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + return +} + + +##function +show_license(){ + + cat < ${TMPFILE} + + -+- setnet.sh ${VERSION} -+- + +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 3 of the License, 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, see . + +-------------------------------------------------------------------- + + Copyleft (C) Vincenzo "KatolaZ" Nicosia + 2016, 2017 + +-------------------------------------------------------------------- + +EOF + eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + return +} + + + +##function +about_menu(){ + + while true; do + eval "${DIALOG} --cancel-label 'Up' --menu 'setnet ${VERSION} -- About' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 6 \ + 'Info' 'General information' \ + 'Copyleft' 'Copyleft information' \ + 'License' 'How to distribute this program' " \ + 2> ${TMPFILE} + if [ $? -eq 1 ];then + return; + fi + + ACTION=$(cat ${TMPFILE}) + case ${ACTION} in + "Info") + show_info + ;; + "Copyleft") + show_copyright + ;; + "License") + show_license + ;; + esac + done +} + +##function +notfound(){ + + CMDNAME=$1 + + + eval "${DIALOG} --msgbox 'Sorry! Commmand ${CMDNAME} not found!'" \ + ${INFO_HEIGHT} ${INFO_WIDTH} + +} + + +##function +netdiag_DNS(){ + + DUMPFILE=$1 + + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== DNS Configuration (/etc/resolv.conf)\n=====\n\n" >> ${DUMPFILE} + cat /etc/resolv.conf >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi + + ## Dump to dialog + NAMESERVERS=$(grep '^nameserver' /etc/resolv.conf) + MSG_STR="Configured name servers in /etc/resolv.conf ==\n\n${NAMESERVERS}" + + eval "${DIALOG} --title 'DNS servers' --msgbox '${MSG_STR}' "\ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} + +} + +##function +netdiag_resolver(){ + + DUMPFILE=$1 + + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== Resolver Configuration (/etc/nsswitch.conf)\n=====\n\n" >> ${DUMPFILE} + grep -v '^#' /etc/nsswitch.conf >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi + + ## Dump to dialog + RESOLVER=$(grep -v '^#' /etc/nsswitch.conf) + + eval "${DIALOG} --title 'Resolver configuration (/etc/nsswitch.conf)' \ + --msgbox '${RESOLVER}' "\ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} + +} + + +##function +netdiag_routes(){ + + DUMPFILE=$1 + + HAS_NETSTAT=$(echo "${HAS_OPTS}" | grep -c "\ netstat\ ") + if [ ${HAS_NETSTAT} -ne 1 ]; then + notfound "netstat" + return + fi + + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== Routing table\n=====\n\n" >> ${DUMPFILE} + netstat -rn >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi + ## Dump to dialog + ROUTES=$(netstat -rn > ${TMPFILE} ) + + eval "${DIALOG} --no-collapse --title 'Routing table (netstat -rn) [arrows to scroll]'" \ + "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ + ${LARGE_HEIGHT} ${LARGE_WIDTH} +} + +##function +netdiag_ARP(){ + + DUMPFILE=$1 + log "netdiag_ARP" "DUMPFILE: '${DUMPFILE}'" + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== ARP table\n=====\n\n" >> "${DUMPFILE}" + cat /proc/net/arp >> "${DUMPFILE}" + echo "==================================" >> ${DUMPFILE} + return 0 + fi + + # Dump to dialog + ARP=$(cat /proc/net/arp >${TMPFILE}) + + eval "${DIALOG} --no-collapse --title 'ARP table (/proc/net/arp) [arrows to scroll]'" \ + "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ + ${LARGE_HEIGHT} ${LARGE_WIDTH} +} + +##function +netdiag_connections(){ + + DUMPFILE=$1 + + + HAS_NETSTAT=$(echo "${HAS_OPTS}" | grep -c "\ netstat\ ") + if [ ${HAS_NETSTAT} -ne 1 ]; then + notfound "netstat" + return + fi + + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== Active Network Connections\n=====\n\n" >> ${DUMPFILE} + netstat -tnp | sed -r -e 's/$/\n/g' >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi + + ## Dump to dialog + SERV=$(netstat -tnp | sed -r -e 's/$/\n/g' > ${TMPFILE}) + + eval "${DIALOG} --no-collapse "\ + " --title 'Active network connections (netstat -tnp) [arrows to scroll]'" \ + "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ + ${LARGE_HEIGHT} ${LARGE_WIDTH} +} + + +##function +netdiag_services(){ + + DUMPFILE=$1 + + HAS_NETSTAT=$(echo "${HAS_OPTS}" | grep -c "\ netstat\ ") + if [ ${HAS_NETSTAT} -ne 1 ]; then + notfound "netstat" + return + fi + + if [ -n "${DUMPFILE}" ]; then + ## Dump to file + printf "\n=====\n== Active network services\n=====\n\n" >> ${DUMPFILE} + netstat -ltnp | sed -r -e 's/$/\n/g' >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi + + + SERV=$(netstat -ltnp | sed -r -e 's/$/\n/g' > ${TMPFILE}) + + eval "${DIALOG} --no-collapse "\ + " --title 'Active network services (netstat -ltnp) [arrows to scroll]'" \ + "--tab-correct --tab-len 4 --textbox ${TMPFILE} "\ + ${LARGE_HEIGHT} ${LARGE_WIDTH} +} + + +##function +netdiag_ping(){ + + HAS_PING=$(echo "${HAS_OPTS}" | grep -E -c "\ ping\ ") + if [ ${HAS_PING} -ne 1 ]; then + notfound "ping" + return + fi + eval "${DIALOG} --insecure --inputbox 'Host or IP to ping:' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} + + if [ $? -ne 0 ]; then + eval "${DIALOG} --msgbox 'Ping Aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + else + PINGIP=$(cat ${TMPFILE}) + ping -c 5 ${PINGIP} 2>&1 |\ + eval "${DIALOG} --title 'Ping ${PINGIP}' \ + --programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE} + if [ $! -ne 0 ];then + log "netdiag_ping" "ping aborted" + fi + fi + +} + +##function +netdiag_traceroute(){ + + HAS_TRACERT=$(echo "${HAS_OPTS}" | grep -c "\ traceroute\ ") + if [ ${HAS_TRACERT} -ne 1 ]; then + notfound "traceroute" + return + fi + eval "${DIALOG} --insecure --inputbox 'Host or IP to trace:' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} + + if [ $? -ne 0 ]; then + eval "${DIALOG} --msgbox 'Traceroute Aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + else + TRACEIP=$(cat ${TMPFILE}) + traceroute ${TRACEIP} 2>&1 | \ + eval "${DIALOG} --title 'Traceroute ${TRACEIP}' \ + --programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE} + if [ $! -ne 0 ];then + log "netdiag_traceroute" "traceroute aborted" + fi + fi +} + + +##function +netdiag_lookup(){ + + HAS_HOST=$(echo "${HAS_OPTS}" | grep -c "\ host\ ") + if [ ${HAS_HOST} -ne 1 ]; then + notfound "host" + return + fi + + eval "${DIALOG} --insecure --inputbox 'Hostname or IP to lookup:' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" 2> ${TMPFILE} + + if [ $? -ne 0 ]; then + eval "${DIALOG} --msgbox 'DNS lookup aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + else + QUERYIP=$(cat ${TMPFILE}) + host ${QUERYIP} 2>&1 |\ + eval "${DIALOG} --title 'host ${QUERYIP}' \ + --programbox ${LARGE_HEIGHT} ${LARGE_WIDTH}" 2>${TMPFILE} + if [ $! -ne 0 ];then + log "netdiag_ping" "host lookup aborted" + fi + + fi +} + +##function +netdiag_devices(){ + + DUMPFILE=$1 + + if [ -n "${DUMPFILE}" ]; then + printf "\n=====\n== Network Devices\n=====\n\n" >> ${DUMPFILE} + ip addr >> ${DUMPFILE} + echo "==================================" >> ${DUMPFILE} + return 0 + fi +} + + + +## +## Main menu for network diagnostics +## + +##function +netdiag_menu(){ + + while true; do + eval "${DIALOG} --cancel-label 'Up' --menu 'Network diagnostics' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 \ + 'ARP' 'Show ARP table' \ + 'Connections' 'List active network connections' \ + 'DNS' 'List DNS servers' \ + 'Lookup' 'DNS Lookup' \ + 'Ping' 'Ping a host' \ + 'Resolver' 'Show resolver configuration' \ + 'Routes' 'Show routing table' \ + 'Services' 'List active network daemons' \ + 'Traceroute' 'Show the route to a host' " \ + 2> ${TMPFILE} + if [ $? -eq 1 ];then + return; + fi + + ACTION=$(cat ${TMPFILE}) + case ${ACTION} in + "ARP") + netdiag_ARP + ;; + "Connections") + netdiag_connections + ;; + "DNS") + netdiag_DNS + ;; + "Ping") + netdiag_ping + ;; + "Lookup") + netdiag_lookup + ;; + "Resolver") + netdiag_resolver + ;; + "Routes") + netdiag_routes + ;; + "Services") + netdiag_services + ;; + "Traceroute") + netdiag_traceroute + ;; + esac + done + + +} + +##function +dump_file(){ + + CONF=$1 + + log "dump_file" "CONF: ${CONF}" + + DUMPFILE="/tmp/network_dump.txt" + + eval "${DIALOG} --fselect ${DUMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" \ + 2>${TMPFILE} + + if [ $? -eq 0 ]; then + SEL_FILE=$(cat ${TMPFILE}) + while [ -d "${SEL_FILE}" ]; do + eval "${DIALOG} --fselect ${SEL_FILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" \ + 2>${TMPFILE} + if [ $? -eq 0 ]; then + SEL_FILE=$(cat ${TMPFILE}) + else + eval "${DIALOG} --msgbox 'Dump aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + done + + ## The dump starts here.... + DUMPFILE=${SEL_FILE} + truncate -s 0 ${DUMPFILE} + echo "===== setnet ${VERSION}" >> ${DUMPFILE} + echo "===== Date: $(date)" >> ${DUMPFILE} + echo "===== Network configuration dump: ${CONF} " >> ${DUMPFILE} + for c in ${CONF}; do + eval "netdiag_${c} \"${DUMPFILE}\"" + done + else + eval "${DIALOG} --msgbox 'Dump aborted' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" + return + fi + eval "${DIALOG} --msgbox 'Status dumped to ${DUMPFILE}' \ + ${INFO_HEIGHT} ${INFO_WIDTH}" +} + + +##function +dump_pastebin(){ + + unimplemented "pastebin" +} + +##function +dump_menu(){ + + eval "${DIALOG} --checklist 'Select conf to dump' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 10 \ + 'ARP' 'ARP table' on \ + 'devices' 'Device configuration' on \ + 'DNS' 'DNS configuration' on \ + 'resolver' 'System resolver configuration' on \ + 'routes' 'Routing table' on \ + 'connections' 'Active network connections' on \ + 'services' 'Active network services' on " 2> ${TMPFILE} + if [ $? -ne 0 ]; then + return + fi + + DUMP_CONF=$(cat ${TMPFILE}) + + eval "${DIALOG} --cancel-label 'Up' \ + --menu 'Dump configuration to:' \ + ${INFO_HEIGHT} ${INFO_WIDTH} 6 \ + 'File' 'Dump to file' \ + 'Pastebin' 'Dump to pastebin'" \ + 2> ${TMPFILE} + if [ $? -eq 1 ];then + return; + fi + + ACTION=$(cat ${TMPFILE}) + case ${ACTION} in + "File") + dump_file "${DUMP_CONF}" + ;; + "Pastebin") + dump_pastebin "${DUMP_CONF}" + ;; + esac +} + + +##function +show_toplevel(){ + + log "show_toplevel" "TMPFILE: ${TMPFILE}" + eval "${DIALOG} --cancel-label 'Quit' --menu 'Main Menu' \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 6 \ + 'Setup' 'Setup interfaces' \ + 'Info' 'Network diagnostics' \ + 'Dump' 'Dump current network status' \ + 'Log' 'View setnet log' \ + 'About' 'License & Copyleft'" 2> ${TMPFILE} + + return $? +} + +##function +show_help(){ + +##local +SCRIPTNAME=$1 + echo "Usage: ${SCRIPTNAME} [OPTION]" + echo "Options:" + printf "\t -c cfg_file\tLoad configuration from cfg_file.\n" + printf "\t -v\t\tPrint version number and exit.\n" + printf "\t -h\t\tShow this help.\n" + +} + +##function +show_version(){ + +##local +SCRIPTNAME=$1 + echo "${SCRIPTNAME} -- version ${VERSION}" + echo "Copyleft (C) Vincenzo \"KatolaZ\" Nicosia (katolaz@freaknet.org) -- 2016, 2017" + echo "This is free software. You can use and redistribute it under the " + echo "terms of the GNU General Public Licence version 3 or (at your option)" + echo "any later version." + echo + echo "YOU USE THIS SOFTWARE AT YOUR OWN RISK." + echo "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or" + echo "FITNESS FOR A PARTICULAR PURPOSE." +} + +##function +show_disclaimer(){ + + cat < ${TMPFILE} + + -+- setnet.sh ${VERSION} -+- + + Copyleft (C) KatolaZ (katolaz@freaknet.org) + 2016, 2017 + + -+- This is a beta release of setnet.sh -+- + + THIS IS FREE SOFTWARE + YOU CAN USE AND DISTRIBUTE IT UNDER THE + TERMS OF THE GNU GENERAL PUBLIC LICENSE + + USE THIS SOFTWARE AT YOUR OWN RISK + + There is ABSOLUTELY NO WARRANTY; not even for + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE + + See "About" for more information about + your right and distribution terms +EOF + + eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} 23 60" + return +} + +##function +initialise(){ + + + TMPFILE=$( (tempfile) 2>/dev/null) || TMPFILE=/tmp/setnet_$$ + WPA_PIDFILE=$( (tempfile) 2>/dev/null) || WPA_PIDFILE=/tmp/setnet_wpapid_$$ + + trap cleanup 0 HUP INT TRAP TERM QUIT + + if [ -z ${TRUNCATE_LOG} ] || \ + [ ${TRUNCATE_LOG} = "yes" ] || \ + [ ${TRUNCATE_LOG} = "YES" ]; then + truncate -s 0 ${LOGFILE} + fi + + chmod 600 ${LOGFILE} + + log "initialise" "Starting afresh on $(date)" + log "initialise" "Using TMPFILE: ${TMPFILE}" + log "initialise" "Using LOGFILE: ${LOGFILE}" + + if [ -n ${DEBUG_MODE} ]; then + log "initialise" "Running in debug mode -- dumping dialog trace to ${TRACE_FILE}" + fi + + EUID=$(id -ru) + if [ "${EUID}" = "0" ] && + [ -n "${SUDO_UID}" ] && + [ "${EUID}" != "${SUDO_UID}" ]; then + USING_SUDO="1" + elif [ "${EUID}" = "0" ] && + [ -n "${SUP_UID}" ] && + [ "${EUID}" != "${SUP_UID}" ]; then + USING_SUDO="1" + else + USING_SUDO="0" + fi + + log "initialise" "EUID: ${EUID}" + log "initialise" "SUDO_UID: ${SUDO_UID}" + log "initialise" "SUP_UID: ${SUP_UID}" + log "initialise" "USING_SUDO: ${USING_SUDO}" +} + + +##function +log_show(){ + + eval "${DIALOG} --cr-wrap --title 'setnet log file (${LOGFILE})'\ + --textbox ${LOGFILE} \ + ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" + +} + +##function +main(){ + + + show_disclaimer + + SETNETRC=$(realpath ${SETNETRC}) + log "main" "Using config file \"${SETNETRC}\"" + WPA_FILE=$(realpath ${WPA_FILE}) + log "main" "Using WPA config file \"${WPA_FILE}\"" + LOFGILE=$(realpath ${LOGFILE}) + log "main" "Using log file \"${LOGFILE}\"" + + while true; do + show_toplevel + + if [ $? -eq 1 ]; then + cleanup + exit 1 + fi + log "main" "${TMPFILE}" + ACTION=$(cat ${TMPFILE}) + log "main" "ACTION: ${ACTION}" + case ${ACTION} in + "Setup") + dev_config_menu + ;; + "Info") + netdiag_menu + ;; + "Dump") + dump_menu + ;; + "Log") + log_show + ;; + "About") + about_menu + ;; + esac + done + +} + + +## +## The script starts here +## + + +## +## Get command-line arguments +## + +SETNETRC="" + +while getopts ":c:d:hv" opt; do + + case $opt in + c) + #echo "Got option -c ${OPTARG}" + SETNETRC=$(realpath ${OPTARG}) + #echo "SETNETRC: ${SETNETRC}" + ;; + h) + show_help $(basename $0) + exit 1 + ;; + v) + show_version $(basename $0) + exit 1 + ;; + d) + TRACE_FILE=$(realpath ${OPTARG}) + set_debug ${TRACE_FILE} + ;; + \?) + echo "Invalid option: -${OPTARG}" + exit 1 + ;; + :) + echo "Option -${OPTARG} requires an argument" + exit 1 + ;; + esac +done + + +## +## Load the configuration file +## + +load_setnetrc ${SETNETRC} + +## +## Init stuff +## + +initialise + + +## +## Check dependencies. If we are missing someting essential, then exit. +## + +check_deps + +## +## This is the main loop +## + +main + diff --git a/debian_package/setnet-0.3.2/setnetrc b/debian_package/setnet-0.3.2/setnetrc new file mode 100644 index 0000000..78cc985 --- /dev/null +++ b/debian_package/setnet-0.3.2/setnetrc @@ -0,0 +1,28 @@ +## +## +## setnetrc -- configuration file for setnet +## +## + +## +## WPA_FILE: The default configuration file for wpa_supplicant +## +WPA_FILE=/etc/wpa_supplicant/wpa_setnet.conf + + +## +## LOGFILE: Location of the logfile +## +LOGFILE=/var/log/setnet.log + +## +## TRUNCATE_LOG: Truncate the log file at startup +## +TRUNCATE_LOG="yes" + +## +## WIFI_DEVICES: List of Wi-Fi devices, to be used if automatic +## detection fails +## + +##WIFI_DEVICES="wlan1 wlan4" diff --git a/debian_package/setnet-0.3.2/wpa_setnet.conf b/debian_package/setnet-0.3.2/wpa_setnet.conf new file mode 100644 index 0000000..07d4b6d --- /dev/null +++ b/debian_package/setnet-0.3.2/wpa_setnet.conf @@ -0,0 +1,3 @@ +ctrl_interface=/var/run/wpa_supplicant +update_config=1 + diff --git a/debian_package/setnet_0.3.2-1.debian.tar.xz b/debian_package/setnet_0.3.2-1.debian.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..04be08bb60e4ac1f7d2db3bddc2e8820322cecd0 GIT binary patch literal 9800 zcmV-OCb!xBH+ooF000E$*0e?f03iVu0001VFXf})@BbzTT>vr}NNor1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RvXBxgkuTlzC2`f-&f3d~zx1Fbr2=Ad zs>oWj_~3BMT;qq|sgwG3gee*UlKtaoEe-lb5*`ucvsPQ0000> i2tec@&i*q10i#TS-~#}SH%P9r#Ao{g000001X)^NYa25F literal 0 HcmV?d00001 diff --git a/debian_package/setnet_0.3.2-1.dsc b/debian_package/setnet_0.3.2-1.dsc new file mode 100644 index 0000000..c078c1e --- /dev/null +++ b/debian_package/setnet_0.3.2-1.dsc @@ -0,0 +1,31 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +Format: 3.0 (quilt) +Source: setnet +Binary: setnet +Architecture: all +Version: 0.3.2-1 +Maintainer: Vincenzo (KatolaZ) Nicosia +Homepage: http://kalos.mine.nu/setnet +Standards-Version: 3.9.8 +Build-Depends: debhelper (>= 9) +Package-List: + setnet deb unknown optional arch=all +Checksums-Sha1: + f0b0101f9e953a39975d3dd1ab0aa8534bbcef11 15436 setnet_0.3.2.orig.tar.xz + 40e5ddbb73b279af3601dd9a6cc72721b6d17432 9800 setnet_0.3.2-1.debian.tar.xz +Checksums-Sha256: + 3b421e24529f4c9d178b5171f914acf6520dd0277ad0e3aba25bc66dcb1f50d8 15436 setnet_0.3.2.orig.tar.xz + 06f83b05c76024e2c8e23b681735e60dcf86aa74c271c556f4c452ccb5341903 9800 setnet_0.3.2-1.debian.tar.xz +Files: + 1639e9c8ef4753277bc38c990c599a76 15436 setnet_0.3.2.orig.tar.xz + 64f4450de0a8b1b8a392d4dd61327a9a 9800 setnet_0.3.2-1.debian.tar.xz + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iEYEARECAAYFAli/6kEACgkQXyCzrgtfBi+AGwCfds8K5diw3wX020n5jL3pi6aO +RGsAn2c4K2lsaMOncQ4unNdVZLkuf9Ae +=b1MZ +-----END PGP SIGNATURE----- diff --git a/debian_package/setnet_0.3.2-1_all.deb b/debian_package/setnet_0.3.2-1_all.deb new file mode 100644 index 0000000000000000000000000000000000000000..fa79af51f7edc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gKo&H$ z(7(ORDDUY#leP!JdGN_`c}*@{Z5R$6ZuB7b13?NU(3v!}9QUgsH1Kv^#TUO58$Gc;Fb#_W000000a;pA)u literal 0 HcmV?d00001 diff --git a/debian_package/setnet_0.3.2-1_amd64.changes b/debian_package/setnet_0.3.2-1_amd64.changes new file mode 100644 index 0000000..10b5350 --- /dev/null +++ b/debian_package/setnet_0.3.2-1_amd64.changes @@ -0,0 +1,42 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +Format: 1.8 +Date: Wed, 08 Mar 2017 11:25:07 +0000 +Source: setnet +Binary: setnet +Architecture: source all +Version: 0.3.2-1 +Distribution: unstable +Urgency: medium +Maintainer: Vincenzo (KatolaZ) Nicosia +Changed-By: Vincenzo (KatolaZ) Nicosia +Description: + setnet - simple shell/dialog tool to configure networks +Changes: + setnet (0.3.2-1) unstable; urgency=medium + . + * Version 0.3.2 -- See ChangeLog for details +Checksums-Sha1: + 8ebb0ebadfe63eb1a7bfe9667b3956649e84146c 1043 setnet_0.3.2-1.dsc + f0b0101f9e953a39975d3dd1ab0aa8534bbcef11 15436 setnet_0.3.2.orig.tar.xz + 40e5ddbb73b279af3601dd9a6cc72721b6d17432 9800 setnet_0.3.2-1.debian.tar.xz + 71d46951a786c0b32fe7a4838b90b9bda45234ea 19392 setnet_0.3.2-1_all.deb +Checksums-Sha256: + 4259b746e1cfc1ad954c124fe5855ffaff7663262b63d1003d5ebb9f9631d2e3 1043 setnet_0.3.2-1.dsc + 3b421e24529f4c9d178b5171f914acf6520dd0277ad0e3aba25bc66dcb1f50d8 15436 setnet_0.3.2.orig.tar.xz + 06f83b05c76024e2c8e23b681735e60dcf86aa74c271c556f4c452ccb5341903 9800 setnet_0.3.2-1.debian.tar.xz + 64f28b5abbb7c7f1fec1aaedf04a27d4d664f4eaec085515ba2c72c0410e1da4 19392 setnet_0.3.2-1_all.deb +Files: + 03a91f80cbaf76864c864d1e7630d01f 1043 unknown optional setnet_0.3.2-1.dsc + 1639e9c8ef4753277bc38c990c599a76 15436 unknown optional setnet_0.3.2.orig.tar.xz + 64f4450de0a8b1b8a392d4dd61327a9a 9800 unknown optional setnet_0.3.2-1.debian.tar.xz + 3ad97356b1166d86003715d4ce2fb929 19392 unknown optional setnet_0.3.2-1_all.deb + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iEYEARECAAYFAli/6kQACgkQXyCzrgtfBi+xlQCdHr0Tu30kDP/5nI5f7w2XkM6f +pgIAmwR1CIPeOC037dKP51UzrT4Sik1v +=QBA8 +-----END PGP SIGNATURE----- diff --git a/debian_package/setnet_0.3.2.orig.tar.xz b/debian_package/setnet_0.3.2.orig.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..a50e116a249f8b5ce4fa2bfa8affd4bae7cd0fa4 GIT binary patch literal 15436 zcmV-SJhQ|7H+ooF000E$*0e?f03iVu0001VFXf}*7ympAT>v?mO7EuOhCI_Gnx{dU zu0FD$9e^SX^DR2evVB}brB}z^sC%wt1M`7tRa=wq71fpfTs%U1rg1@hG7JU{K*cS* zlM`q8Lgd%@YDb5e3JBJ*(R-h*VNcm$Qk{gNRJ*No~YySM4OJo>lUhL zXFQAoF1kU86DWtTDONWrq>~QwYg!k9jE7bpqh6`>7P!AISzj$_`b8DLpI<%WW=zb2 z>In`a?Dcak)kmLP|9&6uK@ybCL&~(ZRhDUvf2x#x7o_%cIr24OkSB-;`&4>(4elOW zV+kekwa*=$B8z16)^vsoHb8cw--R)&?P&0n*lhN=L}Vd%w}??$00Wd|<4;=#@MxnX zuT=D6#;4U3T_PM<^QHvqCjvr+4;h-f3^Z#=iAGc6T+~_B5Hj?@E8moT@YUJ z8?jb6Ycj3{^&_A7((%Bg?SpnIq#T4}IUUGfqaqqr-&kw&UrO{nZh6o1n8SLUNkWJT zF5g-sdX&}@m1J(E9}1pkuP-ZtK;5|EOM}=`e08djAS9)x^g^!WhKcR!1<^xs#dT1+ zyo+%_a!y5}R z&OT`HIBTAho-4cCHfVLq8&_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