aboutsummaryrefslogtreecommitdiffstats
path: root/wireless-info
diff options
context:
space:
mode:
authorLibravatar Krytarik Raido <krytarik@tuxgarage.com>2018-01-10 21:04:04 +0100
committerLibravatar Krytarik Raido <krytarik@tuxgarage.com>2018-01-10 21:04:04 +0100
commit0907e3e266d07a8628c41471a3abadb47b5e427a (patch)
tree17fadcc0d1f3e08907062f43382576bc43885598 /wireless-info
parent502e3d2ee227c85ace6cb50a8f59e49f2e4d69ff (diff)
downloadwireless-info-0907e3e266d07a8628c41471a3abadb47b5e427a.tar.bz2
wireless-info-0907e3e266d07a8628c41471a3abadb47b5e427a.tar.xz
wireless-info-0907e3e266d07a8628c41471a3abadb47b5e427a.tar.zst
Account for partial interface configuration (Fixes #6)
Diffstat (limited to 'wireless-info')
-rwxr-xr-xwireless-info9
1 files changed, 7 insertions, 2 deletions
diff --git a/wireless-info b/wireless-info
index f6ce2e2..8ab2247 100755
--- a/wireless-info
+++ b/wireless-info
@@ -25,7 +25,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-SCRIPTDATE="2017-12-05 04:13 +0100"
+SCRIPTDATE="2018-01-10 21:04 +0100"
FILEBASE="wireless-info"
OUTPUTDIR="$PWD"
OUTPUTDIRFB="/tmp"
@@ -196,7 +196,12 @@ LSMOD=$(lsmod | egrep "(^|[[:punct:] ])($MODMATCHES|$LSMODMATCHES)[^[:punct:] ]*
echo "$LSMOD"
printf "\n##### interfaces ########################\n\n"
-sed '/^#/d;s/^wpa-psk [[:graph:]]\+/wpa-psk <WPA key removed>/' /etc/network/interfaces
+for IFACESFILE in $(find /etc/network/interfaces{,.d} -type f 2> /dev/null | sort); do
+ IFACESFLCNT=$(sed '/^#/d;s/^wpa-psk [[:graph:]]\+/wpa-psk <WPA key removed>/' $IFACESFILE)
+ if [ -n "$IFACESFLCNT" ]; then
+ printf "[%s]\n%s\n\n" "$IFACESFILE" "$IFACESFLCNT"
+ fi
+done
printf "\n##### ifconfig ##########################\n\n"
if [ -x /sbin/ifconfig ]; then