From 0cbc6a1a1a2f2865aa22305844358e2226ea6c58 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Tue, 7 Mar 2017 11:19:29 +0000 Subject: [PATCH] Debian package release 0.3.1 --- debian_package/setnet-0.3.1/ChangeLog | 36 + .../setnet-0.3.1/debian/README.Debian | 132 + .../setnet-0.3.1/debian/README.source | 10 + debian_package/setnet-0.3.1/debian/changelog | 46 + debian_package/setnet-0.3.1/debian/compat | 1 + debian_package/setnet-0.3.1/debian/control | 19 + debian_package/setnet-0.3.1/debian/copyright | 21 + .../setnet-0.3.1/debian/debhelper-build-stamp | 1 + debian_package/setnet-0.3.1/debian/files | 1 + debian_package/setnet-0.3.1/debian/init.d.ex | 26 + debian_package/setnet-0.3.1/debian/install | 5 + .../setnet-0.3.1/debian/manpage.1.ex | 56 + .../setnet-0.3.1/debian/manpage.sgml.ex | 154 ++ .../setnet-0.3.1/debian/manpage.xml.ex | 291 +++ debian_package/setnet-0.3.1/debian/menu.ex | 2 + .../setnet-0.3.1/debian/postinst.ex | 39 + debian_package/setnet-0.3.1/debian/postrm.ex | 37 + debian_package/setnet-0.3.1/debian/preinst.ex | 35 + debian_package/setnet-0.3.1/debian/prerm.ex | 38 + debian_package/setnet-0.3.1/debian/rules | 25 + .../setnet-0.3.1/debian/setnet-docs.docs | 2 + .../setnet-0.3.1/debian/setnet.cron.d.ex | 4 + .../setnet-0.3.1/debian/setnet.debhelper.log | 20 + .../setnet-0.3.1/debian/setnet.default.ex | 10 + .../setnet-0.3.1/debian/setnet.doc-base.EX | 20 + .../setnet-0.3.1/debian/setnet.substvars | 2 + .../debian/setnet/DEBIAN/conffiles | 2 + .../setnet-0.3.1/debian/setnet/DEBIAN/control | 14 + .../setnet-0.3.1/debian/setnet/DEBIAN/md5sums | 7 + .../setnet-0.3.1/debian/setnet/etc/setnetrc | 28 + .../setnet/etc/wpa_supplicant/wpa_setnet.conf | 4 + .../debian/setnet/usr/sbin/setnet.sh | 2205 +++++++++++++++++ .../setnet/usr/share/doc/setnet/ChangeLog | 36 + .../setnet/usr/share/doc/setnet/README.Debian | 132 + .../usr/share/doc/setnet/changelog.Debian.gz | Bin 0 -> 550 bytes .../setnet/usr/share/doc/setnet/changelog.gz | Bin 0 -> 542 bytes .../setnet/usr/share/doc/setnet/copyright | 21 + .../setnet/usr/share/man/man8/setnet.8.gz | Bin 0 -> 3027 bytes .../setnet-0.3.1/debian/source/format | 1 + debian_package/setnet-0.3.1/debian/watch.ex | 39 + debian_package/setnet-0.3.1/setnet.8.gz | Bin 0 -> 3037 bytes debian_package/setnet-0.3.1/setnet.sh | 2205 +++++++++++++++++ debian_package/setnet-0.3.1/setnetrc | 28 + debian_package/setnet-0.3.1/wpa_setnet.conf | 4 + debian_package/setnet_0.3.1-1.debian.tar.xz | Bin 0 -> 9780 bytes debian_package/setnet_0.3.1-1.dsc | 31 + debian_package/setnet_0.3.1-1_all.deb | Bin 0 -> 19308 bytes debian_package/setnet_0.3.1-1_amd64.changes | 42 + debian_package/setnet_0.3.1.orig.tar.xz | Bin 0 -> 15400 bytes 49 files changed, 5832 insertions(+) create mode 100644 debian_package/setnet-0.3.1/ChangeLog create mode 100644 debian_package/setnet-0.3.1/debian/README.Debian create mode 100644 debian_package/setnet-0.3.1/debian/README.source create mode 100644 debian_package/setnet-0.3.1/debian/changelog create mode 100644 debian_package/setnet-0.3.1/debian/compat create mode 100644 debian_package/setnet-0.3.1/debian/control create mode 100644 debian_package/setnet-0.3.1/debian/copyright create mode 100644 debian_package/setnet-0.3.1/debian/debhelper-build-stamp create mode 100644 debian_package/setnet-0.3.1/debian/files create mode 100644 debian_package/setnet-0.3.1/debian/init.d.ex create mode 100644 debian_package/setnet-0.3.1/debian/install create mode 100644 debian_package/setnet-0.3.1/debian/manpage.1.ex create mode 100644 debian_package/setnet-0.3.1/debian/manpage.sgml.ex create mode 100644 debian_package/setnet-0.3.1/debian/manpage.xml.ex create mode 100644 debian_package/setnet-0.3.1/debian/menu.ex create mode 100644 debian_package/setnet-0.3.1/debian/postinst.ex create mode 100644 debian_package/setnet-0.3.1/debian/postrm.ex create mode 100644 debian_package/setnet-0.3.1/debian/preinst.ex create mode 100644 debian_package/setnet-0.3.1/debian/prerm.ex create mode 100755 debian_package/setnet-0.3.1/debian/rules create mode 100644 debian_package/setnet-0.3.1/debian/setnet-docs.docs create mode 100644 debian_package/setnet-0.3.1/debian/setnet.cron.d.ex create mode 100644 debian_package/setnet-0.3.1/debian/setnet.debhelper.log create mode 100644 debian_package/setnet-0.3.1/debian/setnet.default.ex create mode 100644 debian_package/setnet-0.3.1/debian/setnet.doc-base.EX create mode 100644 debian_package/setnet-0.3.1/debian/setnet.substvars create mode 100644 debian_package/setnet-0.3.1/debian/setnet/DEBIAN/conffiles create mode 100644 debian_package/setnet-0.3.1/debian/setnet/DEBIAN/control create mode 100644 debian_package/setnet-0.3.1/debian/setnet/DEBIAN/md5sums create mode 100644 debian_package/setnet-0.3.1/debian/setnet/etc/setnetrc create mode 100644 debian_package/setnet-0.3.1/debian/setnet/etc/wpa_supplicant/wpa_setnet.conf create mode 100755 debian_package/setnet-0.3.1/debian/setnet/usr/sbin/setnet.sh create mode 100644 debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/ChangeLog create mode 100644 debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/README.Debian create mode 100644 debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/changelog.Debian.gz create mode 100644 debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/changelog.gz create mode 100644 debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/copyright create mode 100644 debian_package/setnet-0.3.1/debian/setnet/usr/share/man/man8/setnet.8.gz create mode 100644 debian_package/setnet-0.3.1/debian/source/format create mode 100644 debian_package/setnet-0.3.1/debian/watch.ex create mode 100644 debian_package/setnet-0.3.1/setnet.8.gz create mode 100755 debian_package/setnet-0.3.1/setnet.sh create mode 100644 debian_package/setnet-0.3.1/setnetrc create mode 100644 debian_package/setnet-0.3.1/wpa_setnet.conf create mode 100644 debian_package/setnet_0.3.1-1.debian.tar.xz create mode 100644 debian_package/setnet_0.3.1-1.dsc create mode 100644 debian_package/setnet_0.3.1-1_all.deb create mode 100644 debian_package/setnet_0.3.1-1_amd64.changes create mode 100644 debian_package/setnet_0.3.1.orig.tar.xz diff --git a/debian_package/setnet-0.3.1/ChangeLog b/debian_package/setnet-0.3.1/ChangeLog new file mode 100644 index 0000000..146dc46 --- /dev/null +++ b/debian_package/setnet-0.3.1/ChangeLog @@ -0,0 +1,36 @@ +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.1/debian/README.Debian b/debian_package/setnet-0.3.1/debian/README.Debian new file mode 100644 index 0000000..0cad044 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/README.source b/debian_package/setnet-0.3.1/debian/README.source new file mode 100644 index 0000000..acbd725 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/changelog b/debian_package/setnet-0.3.1/debian/changelog new file mode 100644 index 0000000..042204f --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/changelog @@ -0,0 +1,46 @@ +setnet (0.3.1-1) unstable; urgency=medium + + * Version 0.3.1 -- See Changelog for details + + -- Vincenzo (KatolaZ) Nicosia Tue, 07 Mar 2017 11:12:55 +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.1/debian/compat b/debian_package/setnet-0.3.1/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian_package/setnet-0.3.1/debian/control b/debian_package/setnet-0.3.1/debian/control new file mode 100644 index 0000000..37d3f0c --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/copyright b/debian_package/setnet-0.3.1/debian/copyright new file mode 100644 index 0000000..f425891 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/debhelper-build-stamp b/debian_package/setnet-0.3.1/debian/debhelper-build-stamp new file mode 100644 index 0000000..c166bc0 --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/debhelper-build-stamp @@ -0,0 +1 @@ +setnet diff --git a/debian_package/setnet-0.3.1/debian/files b/debian_package/setnet-0.3.1/debian/files new file mode 100644 index 0000000..3c44e6a --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/files @@ -0,0 +1 @@ +setnet_0.3.1-1_all.deb unknown optional diff --git a/debian_package/setnet-0.3.1/debian/init.d.ex b/debian_package/setnet-0.3.1/debian/init.d.ex new file mode 100644 index 0000000..08360e2 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/install b/debian_package/setnet-0.3.1/debian/install new file mode 100644 index 0000000..dab18fe --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/manpage.1.ex b/debian_package/setnet-0.3.1/debian/manpage.1.ex new file mode 100644 index 0000000..c48d1ce --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/manpage.sgml.ex b/debian_package/setnet-0.3.1/debian/manpage.sgml.ex new file mode 100644 index 0000000..8e6d551 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/manpage.xml.ex b/debian_package/setnet-0.3.1/debian/manpage.xml.ex new file mode 100644 index 0000000..ae9864a --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/menu.ex b/debian_package/setnet-0.3.1/debian/menu.ex new file mode 100644 index 0000000..3f6b8bb --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/postinst.ex b/debian_package/setnet-0.3.1/debian/postinst.ex new file mode 100644 index 0000000..63f6b54 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/postrm.ex b/debian_package/setnet-0.3.1/debian/postrm.ex new file mode 100644 index 0000000..14fe7e0 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/preinst.ex b/debian_package/setnet-0.3.1/debian/preinst.ex new file mode 100644 index 0000000..09a88b6 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/prerm.ex b/debian_package/setnet-0.3.1/debian/prerm.ex new file mode 100644 index 0000000..725e2b8 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/rules b/debian_package/setnet-0.3.1/debian/rules new file mode 100755 index 0000000..2f54c47 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/setnet-docs.docs b/debian_package/setnet-0.3.1/debian/setnet-docs.docs new file mode 100644 index 0000000..efea0a6 --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/setnet-docs.docs @@ -0,0 +1,2 @@ +README.Debian +README.source diff --git a/debian_package/setnet-0.3.1/debian/setnet.cron.d.ex b/debian_package/setnet-0.3.1/debian/setnet.cron.d.ex new file mode 100644 index 0000000..fd54f7d --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/setnet.debhelper.log b/debian_package/setnet-0.3.1/debian/setnet.debhelper.log new file mode 100644 index 0000000..a058680 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/setnet.default.ex b/debian_package/setnet-0.3.1/debian/setnet.default.ex new file mode 100644 index 0000000..ade741e --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/setnet.doc-base.EX b/debian_package/setnet-0.3.1/debian/setnet.doc-base.EX new file mode 100644 index 0000000..42bd26a --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/setnet.substvars b/debian_package/setnet-0.3.1/debian/setnet.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/setnet.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian_package/setnet-0.3.1/debian/setnet/DEBIAN/conffiles b/debian_package/setnet-0.3.1/debian/setnet/DEBIAN/conffiles new file mode 100644 index 0000000..3479547 --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/setnet/DEBIAN/conffiles @@ -0,0 +1,2 @@ +/etc/setnetrc +/etc/wpa_supplicant/wpa_setnet.conf diff --git a/debian_package/setnet-0.3.1/debian/setnet/DEBIAN/control b/debian_package/setnet-0.3.1/debian/setnet/DEBIAN/control new file mode 100644 index 0000000..b5bd4d3 --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/setnet/DEBIAN/control @@ -0,0 +1,14 @@ +Package: setnet +Version: 0.3.1-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.1/debian/setnet/DEBIAN/md5sums b/debian_package/setnet-0.3.1/debian/setnet/DEBIAN/md5sums new file mode 100644 index 0000000..5fa95ba --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/setnet/DEBIAN/md5sums @@ -0,0 +1,7 @@ +1152eaf05f53bce6d223998bc6ba2f1f usr/sbin/setnet.sh +76a40a9d9c3b85dd6679be3b50dfbf90 usr/share/doc/setnet/ChangeLog +d690d59753d9fcd42667d50efb859a68 usr/share/doc/setnet/README.Debian +58703686a3ad132923e9aa821f3b5558 usr/share/doc/setnet/changelog.Debian.gz +ec9c62185a8fcc9231df4d2cefdcb990 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.1/debian/setnet/etc/setnetrc b/debian_package/setnet-0.3.1/debian/setnet/etc/setnetrc new file mode 100644 index 0000000..78cc985 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/setnet/etc/wpa_supplicant/wpa_setnet.conf b/debian_package/setnet-0.3.1/debian/setnet/etc/wpa_supplicant/wpa_setnet.conf new file mode 100644 index 0000000..9ce4275 --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/setnet/etc/wpa_supplicant/wpa_setnet.conf @@ -0,0 +1,4 @@ +ctrl_interface=/var/run/wpa_supplicant +update_config=1 +GROUP=wheel + diff --git a/debian_package/setnet-0.3.1/debian/setnet/usr/sbin/setnet.sh b/debian_package/setnet-0.3.1/debian/setnet/usr/sbin/setnet.sh new file mode 100755 index 0000000..80c7df1 --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/setnet/usr/sbin/setnet.sh @@ -0,0 +1,2205 @@ +#!/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 + + +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) + + log "wifi_restart_wpa" "WPA_PID: ${WPA_PID}" + kill -9 ${WPA_PID} + + 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.1/debian/setnet/usr/share/doc/setnet/ChangeLog b/debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/ChangeLog new file mode 100644 index 0000000..146dc46 --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/ChangeLog @@ -0,0 +1,36 @@ +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.1/debian/setnet/usr/share/doc/setnet/README.Debian b/debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/README.Debian new file mode 100644 index 0000000..0cad044 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/setnet/usr/share/doc/setnet/changelog.Debian.gz b/debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/changelog.Debian.gz new file mode 100644 index 0000000000000000000000000000000000000000..4af5b9cdb3708f909f0599516a36b0ae95e5c349 GIT binary patch literal 550 zcmV+>0@?i^iwFP!000021Fe)@Z`v>vhOf)7c*Pa81SJ91H5=2a(Ti^DG_6%9?am}8 z#KW;8+bN~LekTF3g3zW_%Y~JkNH{{T2^mJ=xZn7vQ*Px?rrzY>Fr7B$Gki5lx`HyKCL?%*QY;D5qhj{QfL%(l zudI|5+HW*>X@df(CnR zuUPMH_X9|NePLmTm${0p<=fw$+*ES%(S&scq#$GwJ0TQLk&WKZwL%pCsYl(0&Tp| z%4OL!k*`M653eQPa>%izR_~dY-)k(P5|VO2#qk3jV39(`KZ%8aLaR#D!D3{?1^fDq z>`ENdO)EyVLTT&bbuVu)!k?_y&4e(WB`>rqe4VHLk341hntU*v-;=Gl{2bUB0UBg;5-A=S77Ueeu}f!gK1&o>t|HZv gbKM+$L&fFr1hHrjr98`i0XN78g*5~K0I5j@>Hq)$ literal 0 HcmV?d00001 diff --git a/debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/copyright b/debian_package/setnet-0.3.1/debian/setnet/usr/share/doc/setnet/copyright new file mode 100644 index 0000000..f425891 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/debian/setnet/usr/share/man/man8/setnet.8.gz b/debian_package/setnet-0.3.1/debian/setnet/usr/share/man/man8/setnet.8.gz new file mode 100644 index 0000000000000000000000000000000000000000..4ef2416aba481fb8129389d57bfa72a0c4cd643b GIT binary patch literal 3027 zcmV;^3oP^>iwFP!000021D#oIZzH!6{?1=9(1$`UITdoNY$T%ll>RRBT9zmJ>e~^0^VQeiVX>lkx|&Z{^gYGT z&mvk_deV9QyNKc)%_q-O5zY5xRh6qMvO7GbwAZ=b%S_vf>`vhro0Ph!+^Kl&Xv#NA zOuo_Ex|EeRIURMiqg2bxY)R*pDmOAw?uhu)e6fsY@#Qg#f*vwTXi^4IpEo*F&3ek~ zRS6+y%k92{lYKvp?_Orh)od{r(XtS&c+#-fmvx8LV6(l-tC81S5>&>mWhQE?%I*rZ zmKNs54gKYYU*AMDtBA$m2tMUl%A&v?S(-XesoE)lO*)~Iy!DsEE4fNoE#4s{Jx%80kNEJ%K!~@OyN0asnM07j2fma+`C#0LCY2~k zWu0|Rp>i7LhThZ(YJXf#ZkMXG29~Cwdy0SY23StM;Rk;=!Cy_;8bztCqTzJ1953-f zP@R8YJ;gUJBWzt1rmR#N(WMa*>7@i&K-7Vj%3YVK_Vh!@2x1;*xg1a@2t-v zfDO+FxZmYEQzLd-1q*W^!PX`_MC@s2%G_E6b+U6SBO&41gQC^lay(o1ojszm&U2QT zO0{uJ3&aI~>X^p$lk=cJ4%_QrQHUa-L+OZt7#>-;_(T1U0Ex>A-h{ic9h zwo+@IL(e@YEV2h_l&XWuOu@L^A21I#;f}nurqKXZA#dA z!?9r72#{8!iV<=R9oI1Y@yj-xB^0Zw<`dzqAmb|3$kz95mW{9>!xpYx&_l3sT!BHL z$b;0Gvum>rL7;(xG(^glI1@Mt^-eU<1>G8v>HKYg)LP^TALiet9bR55mA5A$Z7U8e zgr?OjzO#kN1r9zBqD`H9v%E7vbN%16Itu=vq%KQNzi{+f0O8n3A&s6VcO=sk=?O!# z%1vg|Y$@6=IOQ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(~$4nzl;5DHf{|1zUmE znu80Di~B_Z@*IBsWAeP@VEBJA5Zn0QFx0rvcOnV0nv1Y&ZB&-sIF8%AO|)@c{AO$` zmUSgMRu{M0nM zIa*%h8cTd>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.1/debian/source/format b/debian_package/setnet-0.3.1/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian_package/setnet-0.3.1/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian_package/setnet-0.3.1/debian/watch.ex b/debian_package/setnet-0.3.1/debian/watch.ex new file mode 100644 index 0000000..0f01132 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/setnet.8.gz b/debian_package/setnet-0.3.1/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$Wv1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C&^Pr2fV9y_pdE_lxf@#6c5zmM=R9wpt-kcPbb zRDP!cw+@19nCro+YyHkusz>qb{o?cM?0y`-F8Sw3xRuASf}h^r{=Inm;$Ors5q;dL z{;<+(=`|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.1/setnet.sh b/debian_package/setnet-0.3.1/setnet.sh new file mode 100755 index 0000000..80c7df1 --- /dev/null +++ b/debian_package/setnet-0.3.1/setnet.sh @@ -0,0 +1,2205 @@ +#!/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 + + +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) + + log "wifi_restart_wpa" "WPA_PID: ${WPA_PID}" + kill -9 ${WPA_PID} + + 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.1/setnetrc b/debian_package/setnet-0.3.1/setnetrc new file mode 100644 index 0000000..78cc985 --- /dev/null +++ b/debian_package/setnet-0.3.1/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.1/wpa_setnet.conf b/debian_package/setnet-0.3.1/wpa_setnet.conf new file mode 100644 index 0000000..9ce4275 --- /dev/null +++ b/debian_package/setnet-0.3.1/wpa_setnet.conf @@ -0,0 +1,4 @@ +ctrl_interface=/var/run/wpa_supplicant +update_config=1 +GROUP=wheel + diff --git a/debian_package/setnet_0.3.1-1.debian.tar.xz b/debian_package/setnet_0.3.1-1.debian.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..92546df5466d46e3c8416d1a184a7b90d03fc98f GI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qPLWNx3o>drg6yvmtJ^jq=S3`c$IC){KbWz|(`9cs7MwSYJPgJ2!YL9P-+`-5FA< zo_6|lrL6h%pI+6g1u7YH(|*&p>${B_1WsG_%Tgcq_eqna6&4pixbaw44+i@ff;6zT zjB&Cl`UGkh#;IZzwPH+oTg``oAJYq*GJ%=kT?3#?RpKdexJ4m(7#Ms#)U{eG6>=j8 zen%lou?sxE3NW(vVC!|>L~MM8^GZiaj>=$XR$tHUEG+OP7f#carWwK;f_vNBZ5v8_ zO!WH)8vm;BC)NzaST}Di#t&9l^z}`7D(tMuC4--3LOR(H%`bf%J0GY&7iO;wxLHQ? z6`I*0_`{Oo>#+ngBYKC(inq=9=g%VF?Cw{ zgIcnKCAZo~+sw&)r0KU~Yg4^qm}O_!hJJXc9V#*(!RvcCHCHHW(FhjuMPq5=Q%VR` zxL~y4uvq1gy%w7e&p^%UWz$C@h8;5?Fg*YO0002u7@GfJPJ77!0gX(6-~#~5Q|^ +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: + 1a398f488a42d883dca76cb4906e43c925330b97 15400 setnet_0.3.1.orig.tar.xz + d7f67afafe65c992afd08779a1d31bed58fdfb6d 9780 setnet_0.3.1-1.debian.tar.xz +Checksums-Sha256: + b8a5d4febd04c11aa80b3efef9a26351d6d9aed6ff7d00c76bac8c4f92a0a511 15400 setnet_0.3.1.orig.tar.xz + ebed223a2d8aef6bd81c3371033bb4df838763431fdfd7ebd6f6a1e040d8e0e8 9780 setnet_0.3.1-1.debian.tar.xz +Files: + 781408649882bf211bbc5c8317a33aeb 15400 setnet_0.3.1.orig.tar.xz + 6fab0a2415688e31f4c4b01bd9e84da7 9780 setnet_0.3.1-1.debian.tar.xz + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iEYEARECAAYFAli+lq4ACgkQXyCzrgtfBi/u9gCcDvPw9pj6MAhfFIQYpnLrYX/B +pZMAn1NxckmL4mDAcbyEXhQ/VcNjsJHt +=LMS4 +-----END PGP SIGNATURE----- diff --git a/debian_package/setnet_0.3.1-1_all.deb b/debian_package/setnet_0.3.1-1_all.deb new file mode 100644 index 0000000000000000000000000000000000000000..d842cacfce9f3e5058c27d3747838a39886680f4 GIT binary patch literal 19308 zcmafaQ>-uy4BfSD+qP}nwrzgbwr$(CZQHhe@BS^@9=DUGO_TQVG$&0<$YbbaY{3U* zVrpb*Xh&;gX=muTC^KMDfie*y&fCQUbLn++xOY_m@&jdFTDmGyB}@@lGz+$?V?sdKG`)dTvo1DwjVpD@#`S?Xtf

7@yGYZ5L#8;`mYNQL?8wlCJjpeEyZP@NspwxfUazW$5^dA`$j)*vMW z+O{mu!369Bo4fKkWBJ~Fn9YEc7U(mjO?Y-tv5uV7)cmxe4N^0&Ehr}!Dx&wWy0XD<`M2|c~Il?lHgR3Mq>RvQu3E(8Aw>1mLgaY8u zYZgup3joMV??xTpR)0RhEZk6+V@D@$epQ}%Z;QWmgIi@EeFQA0e{(yZpR5>5LQE;j zqLNdll#zifvOABBrXhn+1q)r%!azJ_mCNpus*Sd@SPKq|t197*)tPFEsi#6Ml@oJ0 zT&E^v*F(QdUlqn?^nNX0BFVCJ7Rri5SR*5?0HA`-6#}(}ra#gB`1X4GJ-$hLg1u&B z1+FPcjdYlXKzuk^f#abKo&8Wm1<#y_eByxi;Z1U#{G^HO-82renl&8Yq%_NFC^}RF zTc;b4zR8&^6cG1937O65$*MU`+0D^Xg;LpVBh1c+Ztd<~dm+K6tUf?zD8@>x41|rO zIu%l>sC6H$rg5OL(4qV~<0bP5EZD3Q*rXT9lB> z4-w3onV^)uwOQIQGvU&H4jlO}m)Vl5n&tNxX`*uL2iq&=hRR(m3mdj>%NaaqOj&g} z#>N!AkFX#XdS(a(DXDfj=o7ufBvrpG#IuKeH_+4DviXSE{^|<6=$}fliJqzG!HT*^ zx_8P6h_oJBF$cZHRoiO6p!`>x8~=8)_&=X^BCw4zJK+@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X|6=tb@YvphiNZV)pvXi_v)Ye^I5;-Jm~*(U2=W-SL=X3ZbM)U9opyxsGQB<>%~|RZrvNnIt=WiK z=#6UJ!AH#PBQa0MN*dk9ac2gOg-mqzg~+DcDcX6eN^b8+RgfWTQ>X$!SO45f;N!<0 z3vkl)h9v2Lg!sDf5&0|I+|F2}ahz4qU?m)wJG&>6N38eD_|oa? z>$HMI;*Xl;)AkwOBT;WdG!UmrNt_Z5ztQCsMT3KQ47GYUNpQ4bdj_fk@6O8OeGiR! z?3>$1kf|?B$rGWwO?jF9TT9|=%}bBjxj`mBi!FgEkE#EOw+m;q%<$Tk@lJLrcy)x`- zQSZmg8Haw1QN;0*UE^B6Ap|e5@CBpp%VDiQkVg^0TC^lLdAXaWE%Y(mwY} z;nQ(2bNv_JR3*d)H!|`yB4nHxqqWGCI9%0gekq5{93Y5@4(n+eU%p>JsL1$J@Yy*D{Vd5Qh6 zK$r{Cv3i&7CHhQk-5ko}L7=OdlEvN3)%93(5d2yAbV1w&^yhJw-;7);P(8n<2&pn~bxDui)aS^bb1j|-dFKV{x2npfeNuL1P=6x&x0oaWJfPe*^E-q$1Fb#_W K000000a;p=bx~pf literal 0 HcmV?d00001 diff --git a/debian_package/setnet_0.3.1-1_amd64.changes b/debian_package/setnet_0.3.1-1_amd64.changes new file mode 100644 index 0000000..b7681bf --- /dev/null +++ b/debian_package/setnet_0.3.1-1_amd64.changes @@ -0,0 +1,42 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +Format: 1.8 +Date: Tue, 07 Mar 2017 11:12:55 +0000 +Source: setnet +Binary: setnet +Architecture: source all +Version: 0.3.1-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.1-1) unstable; urgency=medium + . + * Version 0.3.1 -- See Changelog for details +Checksums-Sha1: + fbc26f1422d3edde6d9ef895f6f801a7fcbe0132 1043 setnet_0.3.1-1.dsc + 1a398f488a42d883dca76cb4906e43c925330b97 15400 setnet_0.3.1.orig.tar.xz + d7f67afafe65c992afd08779a1d31bed58fdfb6d 9780 setnet_0.3.1-1.debian.tar.xz + e3ab49600e536f319ffb40ff054176b048af6c55 19308 setnet_0.3.1-1_all.deb +Checksums-Sha256: + 59837c1c21416f1375bdaebf9d5779ea4699ac44fa05e9ecccf91f6cfb38fcd1 1043 setnet_0.3.1-1.dsc + b8a5d4febd04c11aa80b3efef9a26351d6d9aed6ff7d00c76bac8c4f92a0a511 15400 setnet_0.3.1.orig.tar.xz + ebed223a2d8aef6bd81c3371033bb4df838763431fdfd7ebd6f6a1e040d8e0e8 9780 setnet_0.3.1-1.debian.tar.xz + a865382549c974780bc17e99278abc693fcece0f060a9a039bfc0dd8bbaedc9a 19308 setnet_0.3.1-1_all.deb +Files: + 53bc50c8929d800c324f2c5fcfe4adde 1043 unknown optional setnet_0.3.1-1.dsc + 781408649882bf211bbc5c8317a33aeb 15400 unknown optional setnet_0.3.1.orig.tar.xz + 6fab0a2415688e31f4c4b01bd9e84da7 9780 unknown optional setnet_0.3.1-1.debian.tar.xz + dbf0cae47b5f559986eb1c16b5d64f3b 19308 unknown optional setnet_0.3.1-1_all.deb + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iEYEARECAAYFAli+lrEACgkQXyCzrgtfBi+vfgCeLa1xOavgefYNns8jCmWwC5P2 +Dz4AoJF3mJoFrTDCVy60GwACvMcdyjvB +=BuaL +-----END PGP SIGNATURE----- diff --git a/debian_package/setnet_0.3.1.orig.tar.xz b/debian_package/setnet_0.3.1.orig.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..0acd6c0d4e78d2411bba09555b4fe68fcaf341ce GIT binary patch literal 15400 zcmV+@JlDhhH+ooF000E$*0e?f03iVu0001VFXf}*7ymovT>v?mO7EuOhCI_Gnx`_n z(O6X?)BNA|xQJBBR!6Bo7I* zSWqA4#U!TYL*i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