Merge branch 'master' into suites/ascii

suites/ascii
KatolaZ 7 years ago
commit 6c540410c2

@ -1,3 +1,13 @@
2018-05-03 KatolaZ <katolaz@freaknet.org>
* setnet.sh: fixed a bug in essid management
* added "EXIT" button in deep windows
* added config option "SUPPRESS_INFO" to remove useless
notifications
* added config option "SHOW_LO" to hide loopback devices
* Renamed fields in wifi cert configuration
* Updated manpage
2017-03-08 KatolaZ <katolaz@freaknet.org> 2017-03-08 KatolaZ <katolaz@freaknet.org>
* setnet.sh (wifi_restart_wpa): Corrected a bug in the restart of * setnet.sh (wifi_restart_wpa): Corrected a bug in the restart of
@ -10,7 +20,7 @@
2017-01-29 KatolaZ <katolaz@freaknet.org> 2017-01-29 KatolaZ <katolaz@freaknet.org>
* setnet.sh: * setnet.sh:
* removed "Load file" and "New File" in WiFi configuration * removed "Load file" and "New File" in WiFi configuration
2017-01-23 KatolaZ <katolaz@freaknet.org> 2017-01-23 KatolaZ <katolaz@freaknet.org>

6
debian/changelog vendored

@ -1,3 +1,9 @@
setnet (0.4+devuan1) unstable; urgency=medium
* new upstream version -- several fixes
-- Vincenzo (KatolaZ) Nicosia <katolaz@freaknet.org> Thu, 03 May 2018 12:39:33 +0100
setnet (0.3.2+devuan1.2) unstable; urgency=medium setnet (0.3.2+devuan1.2) unstable; urgency=medium
[ KatolaZ ] [ KatolaZ ]

@ -1,5 +1,5 @@
.\" The following requests are required for all man pages. .\" The following requests are required for all man pages.
.Dd January 06, 2017 .Dd May 03, 2018
.Dt SETNET 8 SMM .Dt SETNET 8 SMM
.Os Linux .Os Linux
.Sh NAME .Sh NAME
@ -33,6 +33,13 @@ active TCP/IP connections, running daemons, etc., and to dump those
information to a file. Support for posting a dump of network status to information to a file. Support for posting a dump of network status to
websites like pastebin.com is under development. websites like pastebin.com is under development.
.Pp
setnet.sh uses
.Em /bin/sh
by default. It has been tested with several standard shells, including
bash, busybox, dash, ksh, mksh, posh, sh, yash, and zsh but it should work
correctly with any POSIX-compliant shell.
.Pp .Pp
setnet.sh recognises the following options: setnet.sh recognises the following options:
@ -145,6 +152,11 @@ setnet.sh starts.
.It Ev WIFI_DEVICES .It Ev WIFI_DEVICES
List of wifi devices. This list is used only when automatic detection List of wifi devices. This list is used only when automatic detection
of wifi devices fails. of wifi devices fails.
.It Ev SUPPRESS_INFO
If set to "yes" or "YES", setnet will suppress verbose notifications.
.It Ev SHOW_LO
If set to "yes" or "YES" setnet will include the loopback device in
the list of available network devices.
.El .El
These variables are normally set in the setnetrc configuration file These variables are normally set in the setnetrc configuration file
@ -193,14 +205,14 @@ exists, it takes precedence over
.\" fprintf/stderr type diagnostics) .\" fprintf/stderr type diagnostics)
.\" .Sh DIAGNOSTICS .\" .Sh DIAGNOSTICS
.Sh SEE ALSO .Sh SEE ALSO
ip(8), dhclient(8), wpa_supplicant(8), wpa_cli(8), netstat(8). ip(8), iw(8), dhclient(8), wpa_supplicant(8), wpa_cli(8), netstat(8).
.\" .Sh CONFORMING TO .\" .Sh CONFORMING TO
.\" .Sh HISTORY .\" .Sh HISTORY
.Sh AUTHORS .Sh AUTHORS
setnet.sh is Free Software, distributed under the terms of the GNU setnet.sh is Free Software, distributed under the terms of the GNU
General Public License (GPL), version 3 of the License. General Public License (GPL), version 3 of the License.
.Pp .Pp
setnet.sh is copyleft (c) by setnet.sh is copyleft (c) 2016-2018 by
.An Vincenzo (KatolaZ) Nicosia <katolaz@freaknet.org> .An Vincenzo (KatolaZ) Nicosia <katolaz@freaknet.org>
.Sh BUGS .Sh BUGS

Binary file not shown.

@ -20,7 +20,7 @@
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# #
# Copyleft (C) Vincenzo "KatolaZ" Nicosia (katolaz@freaknet.org) -- # Copyleft (C) Vincenzo "KatolaZ" Nicosia (katolaz@freaknet.org) --
# (2016, 2017) # (2016-2018)
# #
# #
@ -29,11 +29,14 @@
## Initialisation ## Initialisation
## ##
VERSION=0.3.2 VERSION=0.4
TOPSTR="setnet-${VERSION} [user: $(id -run)]" TOPSTR="setnet-${VERSION} [user: $(id -run)]"
DIALOG="dialog --backtitle \"${TOPSTR}\" --clear " DIALOG="dialog --backtitle \"${TOPSTR}\" --clear "
DIALOG_EXTRA="dialog --backtitle \"${TOPSTR}\" --clear --extra-button --extra-label 'Quit' "
############################### ###############################
@ -538,7 +541,7 @@ ${DEV_GW}\nDNS1: ${DEV_DNS1}\nDNS2: ${DEV_DNS2}'\
if [ -n "${DEV_DNS2}" ]; then if [ -n "${DEV_DNS2}" ]; then
echo "nameserver ${DEV_DNS2}" >> /etc/resolv.conf echo "nameserver ${DEV_DNS2}" >> /etc/resolv.conf
fi fi
show_device_conf "${DEVNAME}" [ -z "${SUPPRESS}" ] && show_device_conf "${DEVNAME}"
#fi #fi
} }
@ -556,7 +559,7 @@ config_ip_dhcp(){
if [ $! -ne 0 ];then if [ $! -ne 0 ];then
log "config_ip_dhcp" "dhclient aborted" log "config_ip_dhcp" "dhclient aborted"
fi fi
show_device_conf ${DEVNAME} [ -z "${SUPPRESS}" ] && show_device_conf ${DEVNAME}
} }
@ -566,7 +569,7 @@ configure_ip_address(){
##local ##local
DEVNAME=$1 DEVNAME=$1
eval "${DIALOG} --cancel-label 'Up' \ eval "${DIALOG} --cancel-label 'Up' \
--menu 'Configuring ${DEVNAME}' ${INFO_HEIGHT} ${INFO_WIDTH} 4 \ --menu 'Configuring ${DEVNAME}' ${INFO_HEIGHT} ${INFO_WIDTH} 4 \
'DHCP' ''\ 'DHCP' ''\
'Static' ''" 2>${TMPFILE} 'Static' ''" 2>${TMPFILE}
@ -592,8 +595,8 @@ wifi_essid_from_mac(){
##local ##local
W_MAC=$2 W_MAC=$2
W_ESSID=$(wpa_cli -i "${DEVNAME}" scan_results | grep -E "^${W_MAC}" | \ W_ESSID="$(wpa_cli -i "${DEVNAME}" scan_results | grep -E "^${W_MAC}" | \
sed -r -e 's/\t/\|/g' | cut -d "|" -f 5) sed -r -e 's/\t/\|/g' | cut -d "|" -f 5)"
log "wifi_essid_from_mac" "Recovered ESSID: ${W_ESSID}" log "wifi_essid_from_mac" "Recovered ESSID: ${W_ESSID}"
} }
@ -1013,7 +1016,7 @@ wifi_authenticate(){
log "wifi_authenticate" "Trying open (no WPA) configuration..." log "wifi_authenticate" "Trying open (no WPA) configuration..."
wifi_authenticate_NONE ${DEVNAME} ${W_ESSID} wifi_authenticate_NONE "${DEVNAME}" "${W_ESSID}"
if [ $? = "0" ]; then if [ $? = "0" ]; then
log "wifi_authenticate" "Open connection configured" log "wifi_authenticate" "Open connection configured"
return 0 return 0
@ -1363,7 +1366,7 @@ show_device_menu(){
while true; do while true; do
DEV_STATUS=$(ip -o link | cut -d " " -f 2,9 | grep -E "^${DEVNAME}: " | cut -d " " -f 2) DEV_STATUS=$(ip -o link | cut -d " " -f 2,9 | grep -E "^${DEVNAME}: " | cut -d " " -f 2)
log "show_device_menu" "DEVNAME: ${DEVNAME} DEV_STATUS: ${DEV_STATUS}" log "show_device_menu" "DEVNAME: ${DEVNAME} DEV_STATUS: ${DEV_STATUS}"
eval "${DIALOG} --cancel-label 'Up' --menu\ eval "${DIALOG_EXTRA} --cancel-label 'Up' --menu\
'Device: ${DEVNAME}\nStatus: ${DEV_STATUS}' \ 'Device: ${DEVNAME}\nStatus: ${DEV_STATUS}' \
${WINDOW_HEIGHT} ${WINDOW_WIDTH} 8 \ ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 8 \
'View' 'View current configuration' \ 'View' 'View current configuration' \
@ -1372,10 +1375,12 @@ show_device_menu(){
'Start' 'Bring interface up' \ 'Start' 'Bring interface up' \
'Stop' 'Put interface down' \ 'Stop' 'Put interface down' \
'Restart' 'Restart interface'" 2> ${TMPFILE} 'Restart' 'Restart interface'" 2> ${TMPFILE}
ext=$?
if [ $? -eq 1 ]; then if [ $ext -eq 1 ]; then
return return
fi elif [ $ext -eq 3 ]; then
exit 0
fi
DEV_ACTION=$(cat ${TMPFILE}) DEV_ACTION=$(cat ${TMPFILE})
case ${DEV_ACTION} in case ${DEV_ACTION} in
@ -1417,12 +1422,12 @@ show_devs() {
DEVICE_TAGS="" DEVICE_TAGS=""
for i in $DEVICES; do for i in $DEVICES; do
if [ "$i" != "lo" ]; then if [ "$i" != "lo" -o -n "${SHOW_LO}" ]; then
DEVICE_TAGS="${DEVICE_TAGS} $i $i" DEVICE_TAGS="${DEVICE_TAGS} $i $i"
fi fi
done done
eval "${DIALOG} --cancel-label 'Up' \ eval "${DIALOG_EXTRA} --cancel-label 'Up' \
--menu 'Select Interface to configure' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 4 \ --menu 'Select Interface to configure' ${WINDOW_HEIGHT} ${WINDOW_WIDTH} 4 \
${DEVICE_TAGS}" 2> ${TMPFILE} ${DEVICE_TAGS}" 2> ${TMPFILE}
return $? return $?
@ -1432,14 +1437,17 @@ show_devs() {
##function ##function
dev_config_menu(){ dev_config_menu(){
while true; do while true; do
show_devs show_devs
if [ $? -eq 1 ]; then ext=$?
return if [ ${ext} -eq 1 ]; then
fi return
DEVNAME=$(cat ${TMPFILE}) elif [ ${ext} -eq 3 ]; then
show_device_menu ${DEVNAME} exit 0
done fi
DEVNAME=$(cat ${TMPFILE})
show_device_menu ${DEVNAME}
done
} }
##function ##function
@ -1457,16 +1465,19 @@ Ethernet/Wi-Fi interfaces.
Both Static and DHCP-based IP configuration are supported. Both Static and DHCP-based IP configuration are supported.
At the moment, only WPA-PSK and open (no key) Wi-Fi connections are Setnet supports the configuration of open (no-key), WPA-Personal
available. (WPA-PSK and WPA2-PSK) and WPA-Enterprise (EAP/PEAP and EPA/TLS) Wi-Fi
connections.
For more information, please visit the webpage of the project: For more information, please visit the webpage of the project:
http://kalos.mine.nu/setnet/ http://kalos.mine.nu/setnet/
or, better, RTFM.
Please report bugs at: Please report bugs at:
https://git.devuan.org/KatolaZ/setnet https://git.devuan.org/devuan-packages/setnet
EOF EOF
eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}" eval "${DIALOG} --cr-wrap --textbox ${TMPFILE} ${WINDOW_HEIGHT} ${WINDOW_WIDTH}"
@ -1483,7 +1494,7 @@ show_copyright(){
-------------------------------------------------------------------- --------------------------------------------------------------------
Copyleft (C) Vincenzo "KatolaZ" Nicosia <katolaz@freaknet.org> Copyleft (C) Vincenzo "KatolaZ" Nicosia <katolaz@freaknet.org>
2016, 2017 2016-2018
-------------------------------------------------------------------- --------------------------------------------------------------------
@ -1517,7 +1528,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
-------------------------------------------------------------------- --------------------------------------------------------------------
Copyleft (C) Vincenzo "KatolaZ" Nicosia <katolaz@freaknet.org> Copyleft (C) Vincenzo "KatolaZ" Nicosia <katolaz@freaknet.org>
2016, 2017 2016-2018
-------------------------------------------------------------------- --------------------------------------------------------------------
@ -1990,6 +2001,7 @@ SCRIPTNAME=$1
echo "Usage: ${SCRIPTNAME} [OPTION]" echo "Usage: ${SCRIPTNAME} [OPTION]"
echo "Options:" echo "Options:"
printf "\t -c cfg_file\tLoad configuration from cfg_file.\n" printf "\t -c cfg_file\tLoad configuration from cfg_file.\n"
printf "\t -c trace_file\tDump dialog debug trace to trace_file.\n"
printf "\t -v\t\tPrint version number and exit.\n" printf "\t -v\t\tPrint version number and exit.\n"
printf "\t -h\t\tShow this help.\n" printf "\t -h\t\tShow this help.\n"
@ -2001,7 +2013,7 @@ show_version(){
##local ##local
SCRIPTNAME=$1 SCRIPTNAME=$1
echo "${SCRIPTNAME} -- version ${VERSION}" echo "${SCRIPTNAME} -- version ${VERSION}"
echo "Copyleft (C) Vincenzo \"KatolaZ\" Nicosia (katolaz@freaknet.org) -- 2016, 2017" echo "Copyleft (C) Vincenzo \"KatolaZ\" Nicosia (katolaz@freaknet.org) -- 2016-2018"
echo "This is free software. You can use and redistribute it under the " 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 "terms of the GNU General Public Licence version 3 or (at your option)"
echo "any later version." echo "any later version."
@ -2019,7 +2031,7 @@ show_disclaimer(){
-+- setnet.sh ${VERSION} -+- -+- setnet.sh ${VERSION} -+-
Copyleft (C) KatolaZ (katolaz@freaknet.org) Copyleft (C) KatolaZ (katolaz@freaknet.org)
2016, 2017 2016-2018
-+- This is a beta release of setnet.sh -+- -+- This is a beta release of setnet.sh -+-
@ -2082,6 +2094,24 @@ initialise(){
log "initialise" "SUDO_UID: ${SUDO_UID}" log "initialise" "SUDO_UID: ${SUDO_UID}"
log "initialise" "SUP_UID: ${SUP_UID}" log "initialise" "SUP_UID: ${SUP_UID}"
log "initialise" "USING_SUDO: ${USING_SUDO}" log "initialise" "USING_SUDO: ${USING_SUDO}"
SUPPRESS=""
if [ -n "${SUPPRESS_INFO}" ] &&
[ "${SUPPRESS_INFO}" != "no" ] &&
[ "${SUPPRESS_INFO}" != "NO" ]; then
SUPPRESS="1"
fi
if [ -n "${SHOW_LO}" ] &&
[ "${SHOW_LO}" != "no" ] &&
[ "${SHOW_LO}" != "NO" ]; then
SHOW_LO="1"
else
SHOW_LO=""
fi
log "initialise" "SUPPRESS: ${SUPPRESS}"
} }
@ -2097,8 +2127,9 @@ log_show(){
##function ##function
main(){ main(){
log "main" "SUPPRESS: ${SUPPRESS}"
show_disclaimer [ -z "${SUPPRESS}" ] && show_disclaimer
SETNETRC=$(realpath ${SETNETRC}) SETNETRC=$(realpath ${SETNETRC})
log "main" "Using config file \"${SETNETRC}\"" log "main" "Using config file \"${SETNETRC}\""
@ -2119,23 +2150,22 @@ main(){
log "main" "ACTION: ${ACTION}" log "main" "ACTION: ${ACTION}"
case ${ACTION} in case ${ACTION} in
"Setup") "Setup")
dev_config_menu dev_config_menu
;; ;;
"Info") "Info")
netdiag_menu netdiag_menu
;; ;;
"Dump") "Dump")
dump_menu dump_menu
;; ;;
"Log") "Log")
log_show log_show
;; ;;
"About") "About")
about_menu about_menu
;; ;;
esac esac
done done
} }

@ -26,3 +26,18 @@ TRUNCATE_LOG="yes"
## ##
##WIFI_DEVICES="wlan1 wlan4" ##WIFI_DEVICES="wlan1 wlan4"
##
## SUPPRESS_INFO: if set to "yes", avoid to show information panels
## after certain configuration steps
##
SUPPRESS_INFO="yes"
##
## SHOW_LO: whether we should show loopback devices in the device list
##
SHOW_LO="yes"

Loading…
Cancel
Save