Wireless connection...

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Softline
Level 1
Level 1
Posts: 6
Joined: Sat Dec 16, 2017 1:32 pm

Wireless connection...

Post by Softline »

I am using Mint 18.3 Sylvia on a old Dell Inspiron1501 32 BIT laptop with 1.8GB RAM.

I have never been able to connect to the internet wirelessly with it, although a hard wired connection works well. Because I have recently moved apartment, it is no longer practical for me to use the hard wired connetion.

I have a new laptop with W10, a tablet and smartphone with Android and after searching for my modem and then entering the password, all three immediately connected and I could use them without problem.

The Dell Inspiron has a dual OS, the second being the original XP and this also works wirelessly perfectly.

Try as I may, I cannot get Mint to connect wirelessly and I need somebody to hold my hand and take me through the wireless set up process. Failing that, a Dummies Guide if possible...

Softline
User avatar
Pierre
Level 20
Level 20
Posts: 11235
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Wireless connection...

Post by Pierre »

Open the Terminal and run this:

Code: Select all

wget -N -t 5 -T 10 https://github.com/UbuntuForums/wireless-info/raw/master/wireless-info && chmod +x wireless-info && ./wireless-info

Code: Select all

cat wireless-info.txt | nc termbin.com 9999
Post URL from Terminal - back here, on your reply.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Softline
Level 1
Level 1
Posts: 6
Joined: Sat Dec 16, 2017 1:32 pm

Re: Wireless connection...

Post by Softline »

The first input gave me:-
wget, - - timeout :Invalid time period ` | 0htps :// github. com/Ubuntu Forums wireless-info/raw /master /wireless-info `

The second input gave me :-
No such file or directory nc :getaddrinfo:Temporary failure in name resolution.

A computer illiterate like me needs an automatic type connection as in Android and Windows !

Thanking you for your help...
Softline
JeremyB
Level 20
Level 20
Posts: 11933
Joined: Fri Feb 21, 2014 8:17 am

Re: Wireless connection...

Post by JeremyB »

Try copy/pasting commands into terminal, use right click options to copy and paste
Softline
Level 1
Level 1
Posts: 6
Joined: Sat Dec 16, 2017 1:32 pm

Re: Wireless connection...

Post by Softline »

I can't copy and paste the command line into Mint because, not being able to use Mint online, I am on this forum using the XP OS and then closing XP to open Mint, loosing the copied data...
I copied the 2 command lines you gave (incorrectly?) onto paper, closed XP, opened Mint and then entered them...
JeremyB
Level 20
Level 20
Posts: 11933
Joined: Fri Feb 21, 2014 8:17 am

Re: Wireless connection...

Post by JeremyB »

The commands need internet to download the file. On XP download https://github.com/UbuntuForums/wireles ... eless-info
Copy it to Mint desktop, rename it so it is just called wireless-info, then in terminal

Code: Select all

cd Desktop
chmod +x wireless-info
./wireless-info
There should be a file called wireless-info.txt on the desktop now, copy that back to XP and post the contents
Hoser Rob
Level 16
Level 16
Posts: 6938
Joined: Sat Dec 15, 2012 8:57 am

Re: Wireless connection...

Post by Hoser Rob »

Softline wrote:
Sat Dec 08, 2018 10:51 am
I can't copy and paste the command line into Mint because, not being able to use Mint online, I am on this forum using the XP OS and then closing XP to open Mint, loosing the copied data...
I copied the 2 command lines you gave (incorrectly?) onto paper, closed XP, opened Mint and then entered them...
Serioulsly? If you installed Mint you probably have a USB stick, no???
Softline
Level 1
Level 1
Posts: 6
Joined: Sat Dec 16, 2017 1:32 pm

Re: Wireless connection...

Post by Softline »

Jeremy B

You are right of course, but I am a computer illiterate !
Softline
Level 1
Level 1
Posts: 6
Joined: Sat Dec 16, 2017 1:32 pm

Re: Wireless connection...

Post by Softline »

Sorry, that reply should have been addressed to Hoser Rob !
Softline
Level 1
Level 1
Posts: 6
Joined: Sat Dec 16, 2017 1:32 pm

Re: Wireless connection...

Post by Softline »

Jeremy B

OK, I tried all three commands and pasted the results under them. I'm sure that I have done this incorrectly!

1)
wget -N -t 5 -T 10 https://github.com/UbuntuForums/wireles ... eless-info && \

chmod +x wireless-info && \
./wireless-info
laurence@laurence-Inspiron-1501 ~ $ wget -N -t 5 -T 10 https://github.com/UbuntuForums/wireles ... eless-info && \
> chmod +x wireless-info && \
> ./wireless-info
--2018-12-08 19:58:04-- https://github.com/UbuntuForums/wireles ... eless-info
Resolving github.com (github.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘github.com’
laurence@laurence-Inspiron-1501 ~ $

2)
cat wireless-info.txt | nc termbin.com 9999
laurence@laurence-Inspiron-1501 ~ $ cat wireless-info.txt | nc termbin.com 9999
cat: wireless-info.txt: No such file or directory
nc: getaddrinfo: Temporary failure in name resolution
laurence@laurence-Inspiron-1501 ~ $

3)
cd Desktop
chmod +x wireless-info
./wireless-info
SCRIPTDATE="2018-10-22 05:34 +0200"
FILEBASE="wireless-info"
OUTPUTDIR="$PWD"
OUTPUTDIRFB="/tmp"

MODMATCHES="(air|ar5|at7|ath[^3]?|b43|bcma|brcm|carl|ipw|iwl|ndis|r(818|8192[eu]|871|92su)|8(188|189|192|723|812)[acde][esu]|rt[23567]|rtl|ssb|wl|(cfg|mac)80211)"
LSMODMATCHES="(wmi|(dell|ideapad)[-_]laptop)"
IFACEMATCHES="(wlan[0-9]|eth[0-9])"
DMESGMATCHES="(firmware|[nN]etwork|sdio|SDIO)"
NMPROFMATCHES="\(\[connection\]\|id=\|type=\|permissions=\|autoconnect=\|\[802-11-wireless\]\|\[wifi\]\|ssid=\|bssid=\|mac-address\(-blacklist\)\?=\|mtu=\|\[802-1x\]\|[[:graph:]]*ca-certs\?=\|\[ipv[46]\]\|method=\)"

DMESGEXCL="apparmor|(cfg|mac)80211"
MODINFOEXCL="alias"
MODPROBEXCL="(alsa-base|blacklist-(firewire|framebuffer|modem|oss|watchdog)|fglrx|nvidia|fbdev|bumblebee)"
PMUTILSEXCL="/etc/pm/(power.d/(95hdparm-apm|intel-audio-powersave|sata_alpm)|sleep.d/(10_grub-common|10_unattended-upgrades.*|novatel_3g.*))"

NETMGRNAMES=("NetworkManager" "Wicd" "ConnMan")
NETMGRPATHS=("/usr/sbin/NetworkManager" "/usr/sbin/wicd" "/usr/sbin/connmand")
DEC2BI=({0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1})
DEC2HEX=($(printf "%02x " {0..255}))

export LANG="en_US.UTF-8"
export LANGUAGE="en_US:en"
export LC_ALL="en_US.UTF-8"

if [ -t 0 ]; then
DIALOGAPP="terminal"
DIALOGBREAK=" "
TERMOUT="yes"
elif [ -x /usr/bin/zenity ]; then
DIALOGAPP="zenity"
DIALOGBREAK="\n"
elif [ -x /usr/bin/kdialog ]; then
DIALOGAPP="kdialog"
DIALOGBREAK="\n"
else
exit 1
fi

if [ -t 0 ]; then
SUDO="sudo"
elif [ -x /usr/bin/pkexec ]; then
SUDO="pkexec"
elif [ -x /usr/bin/gksudo ]; then
SUDO="gksudo"
GKSUDO="yes"
elif [ -x /usr/bin/kdesudo ]; then
SUDO="kdesudo"
KDESUDO="yes"
KDESUDOCMT=" needs administrative privileges. Please enter your password."
fi

dialog_info () {
case $DIALOGAPP in
terminal)
printf "%b\n" "$1"
;;
zenity)
zenity --info --text="$1"
;;
kdialog)
kdialog --msgbox "$1"
;;
esac
}

dialog_error () {
case $DIALOGAPP in
terminal)
printf "%b\n" "$1" >&2
;;
zenity)
zenity --error --text="$1"
;;
kdialog)
kdialog --error "$1"
;;
esac
}

dialog_question () {
case $DIALOGAPP in
terminal)
local INPUT
read -r -p "$1 [Y/n]: " INPUT
echo "${INPUT,,}"
;;
zenity)
zenity --question --text="$1" || echo "no"
;;
kdialog)
kdialog --yesno "$1" || echo "no"
;;
esac
}

ip6-mac () {
for MAC in "$@"; do
OCT1BI=${DEC2BI[0x${MAC:0:2}]}
OCT1BI7=$((${OCT1BI:6:1} - 1))
OCT1BIM="${OCT1BI:0:6}${OCT1BI7#-}${OCT1BI:7}"
IP6S+=${IP6S:+$'\n'}"${DEC2HEX[2#$OCT1BIM]}${MAC:3:2}:${MAC:6:2}ff:fe${MAC:9:2}:${MAC:12:2}${MAC:15:2}"
done
sed 's/\(^\|:\)0\+\([[:alnum:]]\)/\1\2/g;s/^\([0:]\+\)/\\(::\\|\1\\)/' <<< "$IP6S"
}

exec 3>&1 4>&2
exec 1> "$OUTPUTDIR/$FILEBASE.txt" || {
dialog_error "${TERMOUT+\n}Cannot write output file in \"$OUTPUTDIR\",${DIALOGBREAK}trying in \"$OUTPUTDIRFB\" instead.${TERMOUT+\n}"
OUTPUTDIR="$OUTPUTDIRFB"
exec 1> "$OUTPUTDIR/$FILEBASE.txt" || {
dialog_error "${TERMOUT+\n}Cannot write output file in \"$OUTPUTDIR\" either, aborting.${TERMOUT+\n}"
exit 1
}
}
exec 2>&1

printf "\n########## wireless info START ##########\n\n"
REPORTDATE=$(date +"%d %b %Y %H:%M %Z %z")
SCRIPTDATE=$(date -u -d "$SCRIPTDATE" +"%d %b %Y %H:%M %Z %z")
LASTBOOTDT=$(last -FRn 1 reboot | sed -n 's/.*system boot[ ]\+\(.\+\) - .*/\1/p')
LASTBOOTDT=$(date -d "$LASTBOOTDT" +"%d %b %Y %H:%M %Z %z")
printf "Report from: %s\n\n" "$REPORTDATE"
printf "Booted last: %s\n\n" "$LASTBOOTDT"
printf "Script from: %s\n" "$SCRIPTDATE"

printf "\n##### release ###########################\n\n"
lsb_release -idrc

printf "\n##### kernel ############################\n\n"
uname -srvmpio
echo
sed 's/root=[^ ]*//;s/[ ]\+/, /g;s/^BOOT_IMAGE=[^ ]*/Parameters:/' /proc/cmdline

printf "\n##### desktop ###########################\n\n"
if [ -n "$DESKTOP_SESSION" ]; then
DESKTOP="$DESKTOP_SESSION"
else
DESKTOP=$(sed -n 's/^Session=\(.\+\)$/\1/p' "$HOME/.dmrc")
DESKDMRC=" (from ~/.dmrc)"
fi
if [ -n "$DESKTOP" ]; then
if [ -f "/usr/share/xsessions/$DESKTOP.desktop" ]; then
DESKTOP=$(sed -n 's/^Name=\(.\+\)$/\1/p' "/usr/share/xsessions/$DESKTOP.desktop")
fi
echo "${DESKTOP/ Session/}${DESKDMRC}"
else
printf "\nCould not be determined.\n"
fi

printf "\n##### lspci #############################\n\n"
lspci -nnk | grep -iA 2 '^[^[:space:]].*net' | sed '/^--$/d; /^[^[:space:]]/ i\\'

printf "\n##### lsusb #############################\n\n"
lsusb

printf "\n##### PCMCIA card info ##################\n\n"
if [ -x /sbin/pccardctl ]; then
pccardctl info
else
echo "'pccardctl' is not installed (package \"pcmciautils\")."
fi

printf "\n##### rfkill ############################\n\n"
rfkill list all

printf "\n##### secure boot #######################\n\n"
if [ -x /usr/bin/mokutil ]; then
mokutil --sb-state
else
echo "'mokutil' is not installed (package \"mokutil\")."
fi

printf "\n##### lsmod #############################\n\n"
LSMOD=$(lsmod | egrep "(^|[[:punct:] ])($MODMATCHES|$LSMODMATCHES)[^[:punct:] ]*([[:punct:] ]|$)")
echo "$LSMOD"

printf "\n##### interfaces ########################\n\n"
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 /bin/ip ]; then
IFCONFIG=$(ip address show)
elif [ -x /sbin/ifconfig ]; then
IFCONFIG=$(ifconfig -a)
else
echo "'ip' is not installed (package \"iproute2\")."
fi
echo "$IFCONFIG"
IFCONFIG=$(sed -n '1h; 1!H; ${g;s/\n /\\ /g;p}' <<< "$IFCONFIG")
IFACESETH=($(sed -n 's#^[0-9]\+: \([^ :]\+\):.* link/ether.*#\1#p; s/^\([^ :]\+\):\?.* \(Link encap:Ethernet\|ether\).*/\1/p' <<< "$IFCONFIG"))
if (( ${#IFACESETH[@]} > 0 )); then
IFETHMATCHES=${IFACESETH[@]}
IFACEMATCHES="($IFACEMATCHES|(${IFETHMATCHES// /|}))"
fi

printf "\n##### iwconfig ##########################\n\n"
iwconfig

printf "\n##### route #############################\n\n"
if [ -x /bin/ip ]; then
ip route show
elif [ -x /sbin/route ]; then
route -n
else
echo "'ip' is not installed (package \"iproute2\")."
fi

printf "\n##### resolv.conf #######################\n\n"
stat -c "[%a %U %N]" /etc/resolv.conf
grep -v '^#' /etc/resolv.conf

printf "\n##### network managers ##################\n\n"
printf "Installed:\n\n"
for NETMGRNR in "${!NETMGRPATHS[@]}"; do
if [ -f "${NETMGRPATHS[$NETMGRNR]}" ]; then
NETMGRINST+=("${NETMGRNAMES[$NETMGRNR]}")
fi
done
printf "\t%s\n" "${NETMGRINST[@]:-None found.}"
NETMGRMATCHES=${NETMGRPATHS[@]/#*\//|}
NETMGRMATCHES=${NETMGRMATCHES// |/|}
NETMGRMATCHES="(${NETMGRMATCHES#|})"
printf "\nRunning:\n\n"
ps -ef | egrep "( |/)$NETMGRMATCHES($| )" || printf "\tNone found.\n"

printf "\n##### NetworkManager info ###############\n\n"
if [ -x /usr/bin/nm-tool ]; then
nm-tool
elif [ -x /usr/bin/nmcli ]; then
nmcli -f all device show | sed '/^GENERAL.DEVICE:[ ]\+lo$/,/^$/d; /^AP\[[0-9]\+\]\./d'
echo
nmcli -f SSID,BSSID,MODE,CHAN,FREQ,RATE,SIGNAL,BARS,SECURITY,ACTIVE,IN-USE device wifi list
else
echo "NetworkManager is not installed (package \"network-manager\")."
fi

printf "\n##### NetworkManager.state ##############\n\n"
cat -s /var/lib/NetworkManager/NetworkManager.state

printf "\n##### NetworkManager config #############\n\n"
for NMCONFFILE in $(find /{etc,usr/lib}/NetworkManager/{NetworkManager.conf,conf.d} -name "*.conf" 2> /dev/null | sort); do
NMCONFCNT=$(egrep -v '^(#|$)' $NMCONFFILE)
if [ -n "$NMCONFCNT" ]; then
printf "[[%s]]\n%s\n\n" "$NMCONFFILE" "$NMCONFCNT"
fi
done

printf "\n##### NetworkManager profiles ###########\n\n"
if [ -d /etc/NetworkManager/system-connections ]; then
if [ -n "$SUDO" ]; then
trap "" 2 3
NMPROFILES=$(find /etc/NetworkManager/system-connections -maxdepth 1 -type f -exec $SUDO${GKSUDO+ -D grep --}${KDESUDO+ -d --comment "<b>grep</b>$KDESUDOCMT" --} grep -vH '^$' {} +) && SUDOSUCCESS="yes" || SUDOSUCCESS="no"
trap 2 3
if [ "$SUDOSUCCESS" = "yes" ]; then
ORIGIFS="$IFS"
IFS=$'\n'
for NMWLPRFFILE in $(sed -n 's/^\(.\+\):type=\(802-11-wireless\|wifi\).*$/\1/p' <<< "$NMPROFILES"); do
NMWLPRFFLPERMS=$(stat -c "%a %U" "$NMWLPRFFILE")
NMWLPROFILE=($(sed -n "s;^$NMWLPRFFILE:\($NMPROFMATCHES.*\)$;\1 |;p" <<< "$NMPROFILES"))
NMWLPROFSOUT+="[[$NMWLPRFFILE]] ($NMWLPRFFLPERMS)"$'\n'"${NMWLPROFILE[@]}"$'\n\n'
done
IFS="$ORIGIFS"
sed 's# | \[#\n\[#g;s#\] |#\]#g;s/ |$//' <<< "$NMWLPROFSOUT" | sed '/^\[[^]]*\]$/d'
else
printf "\nAcquisition of admin privileges failed.\n"
fi
else
echo "No way to acquire admin privileges found."
fi
else
echo "No NetworkManager profiles found."
fi

printf "\n##### Netplan config ####################\n\n"
for NPLANFILE in $(find /{lib,etc,run}/netplan -name "*.yaml" 2> /dev/null | sort); do
NPLANFLCNT=$(egrep -v '^(#|$)' $NPLANFILE)
if [ -n "$NPLANFLCNT" ]; then
printf "[%s]\n%s\n\n" "$NPLANFILE" "$NPLANFLCNT"
fi
done

printf "\n##### iw reg get ########################\n\n"
if [ -x /sbin/iw ]; then
if IWREGGET=$(iw reg get 2>&1) && [ -f /etc/timezone ]; then
REGION=$(cat /etc/timezone)
printf "Region: %s (based on set time zone)\n\n" "$REGION"
fi
echo "$IWREGGET"
else
echo "'iw' is not installed (package \"iw\")."
fi

printf "\n##### iwlist channels ###################\n\n"
if [ -x /sbin/iwlist ]; then
iwlist chan
else
echo "'iwlist' is not installed (package \"wireless-tools\")."
fi

printf "\n##### iwlist scan #######################\n\n"
if [ -x /sbin/iwlist ]; then
if [ -n "$SUDO" ]; then
trap "" 2 3
IWLISTSCAN=$($SUDO${KDESUDO+ -d} iwlist scan) && SUDOSUCCESS="yes" || SUDOSUCCESS="no"
trap 2 3
if [ "$SUDOSUCCESS" = "yes" ]; then
if [[ $IWLISTSCAN = *Frequency:* ]]; then
printf "Channel occupancy:\n\n"
grep '^[ ]*Frequency:' <<< "$IWLISTSCAN" | sort | uniq -c | sed 's/^[ ]\+\([ ][0-9]\+\)[ ]\+/ \1 APs on /'
echo
fi
grep -v '^[ ]*IE: Unknown:' <<< "$IWLISTSCAN"
else
printf "\nAcquisition of admin privileges failed.\n"
fi
else
echo "No way to acquire admin privileges found."
fi
else
echo "'iwlist' is not installed (package \"wireless-tools\")."
fi

printf "\n##### module infos ######################\n\n"
MODULES=$(egrep -o "^$MODMATCHES[^ ]*" <<< "$LSMOD")
for MODULE in $MODULES; do
MODINFO=$(modinfo $MODULE | egrep -v "^$MODINFOEXCL:")
printf "[%s]\n%s\n\n" "$MODULE" "$MODINFO"
done

printf "\n##### module parameters #################\n\n"
for MODULE in $MODULES; do
if [ -d /sys/module/$MODULE/parameters ]; then
MODPARAMS=$(grep -H '^[[:graph:]]' /sys/module/$MODULE/parameters/* | sed 's#^.*/##;s/:/: /')
printf "[%s]\n%s\n\n" "$MODULE" "$MODPARAMS"
fi
done

printf "\n##### /etc/modules ######################\n\n"
grep -v '^#' /etc/modules

printf "\n##### modprobe options ##################\n\n"
for MODPROBEFILE in $(find /etc/modprobe.{conf,d} -name "*.conf" -regextype posix-egrep -not -regex ".*$MODPROBEXCL.*" 2> /dev/null | sort); do
MODPROBEOPTS=$(egrep -v '^(#|$)' $MODPROBEFILE)
if [ -n "$MODPROBEOPTS" ]; then
printf "[%s]\n%s\n\n" "$MODPROBEFILE" "$MODPROBEOPTS"
fi
done

printf "\n##### rc.local ##########################\n\n"
grep -v '^#' /etc/rc.local

printf "\n##### pm-utils ##########################\n\n"
for PMUTILSFILE in $(find /etc/pm/*.d \( -type f -o -type l \) -regextype posix-egrep -not -regex "$PMUTILSEXCL" | sort); do
PMUTFLCONT=$(egrep -v '^(#|$)' $PMUTILSFILE)
if [ -n "$PMUTFLCONT" ]; then
PMUTFLPERMS=$(stat -c "%a %U" $PMUTILSFILE)
printf "[%s] (%s)\n%s\n\n" "$PMUTILSFILE" "$PMUTFLPERMS" "$PMUTFLCONT"
fi
done

printf "\n##### udev rules ########################\n\n"
for UDEVRLFILE in $(find /etc/udev/rules.d -name "*net*.rules" | sort); do
UDEVRULES=$(grep -B1 '^[^#]' $UDEVRLFILE | egrep -v '^(--)?$')
if [ -n "$UDEVRULES" ]; then
printf "[%s]\n%s\n\n" "$UDEVRLFILE" "$UDEVRULES"
fi
done

printf "\n##### dmesg #############################\n\n"
dmesg | tail -n 100 | egrep "[[:punct:] ]($MODMATCHES|$IFACEMATCHES|$DMESGMATCHES)[^[:punct:] ]*[[:punct:] ]" | egrep -v "$DMESGEXCL" | uniq -cf 2 | sed 's/^[ ]\+1[ ]\+//;s/^[ ]\+\([0-9]\+\)[ ]\+\(.\+\)$/\2 (repeated \1 times)/'

printf "\n########## wireless info END ############\n\n"

exec 2>&4 4>&-
exec 1>&3 3>&-

##### MAC address masking #####

RESULTS=$(cat -s "$OUTPUTDIR/$FILEBASE.txt")$'\n'

ORIGIFS="$IFS"
IFS=$'\n'

IFACESIDS=($(sed -n "/\([[:alnum:]]\{2\}:\)\{5\}[[:alnum:]]\{2\}/ {/\(00:\)\{5\}00/! {s/^[0-9]\+: \([^ :]\+\):.*/'\1'/p; s/^\([^ :]\+\):\? .*/'\1'/p}}" <<< "$IFCONFIG"))
IFACESMACS=($(sed -n '/\(00:\)\{5\}00/! s#.*\(HWaddr\|link/[^ ]\+\|ether\) \(\([[:alnum:]]\{2\}:\)\{5\}[[:alnum:]]\{2\}\).*#\2#p' <<< "$IFCONFIG"))
IFACESIP6S=($(ip6-mac "${IFACESMACS[@]}"))

WLAPSIWLIDS=($(sed -n "/^[ ]*Cell [0-9]\+/,/^[ ]*ESSID:/ {/^[ ]*Cell [0-9]\+/h; /^[ ]*ESSID:/ {H;g;s/^[ ]*Cell 0\?\([0-9]\+\).*ESSID:\"\(.*\)\"$/'\2' [AC\1]/p}}" <<< "$IWLISTSCAN"))
WLAPSIWLMACS=($(sed -n 's/^[ ]*Cell [0-9]\+.*Address: \([^ ]\+\)/\1/p' <<< "$IWLISTSCAN"))
WLAPSIWLIP6S=($(ip6-mac "${WLAPSIWLMACS[@]}"))

WLAPSNMRAW=$(sed -n '/^##### NetworkManager info #####/,/^##### / {/^[ ]*Wireless Access Points/,/^$/ {/Wireless Access Points/d;s/^[ ]\+\*\?//;s/:[ ]\+/\t/;p}; /^SSID[ ]\+BSSID[ ]\+/,/^$/ {/^SSID[ ]\{2,\}BSSID[ ]\{2,\}/d;s/[ ]\{2,\}/\t/;p}}' <<< "$RESULTS")
WLAPSNMIDS=($(awk -F '\t' '{print "'\''" $1 "'\''"}' <<< "$WLAPSNMRAW"))
WLAPSNMMACS=($(grep -o '\([[:alnum:]]\{2\}:\)\{5\}[[:alnum:]]\{2\}' <<< "$WLAPSNMRAW"))
WLAPSNMIP6S=($(ip6-mac "${WLAPSNMMACS[@]}"))

IFS="$ORIGIFS"

for IFACENR in "${!IFACESMACS[@]}"; do
MACMASKSED+="s;${IFACESMACS[$IFACENR]};<MAC ${IFACESIDS[$IFACENR]} [IF$(($IFACENR + 1))]>;I;"
MACMASKSED+=" /${IFACESIP6S[$IFACENR]}/ s;${IFACESIP6S[$IFACENR]/#\\(::/\(};<IP6 ${IFACESIDS[$IFACENR]} [IF$(($IFACENR + 1))]>;I;"
IFACEMACC=${IFACESMACS[$IFACENR]//:/}
if [[ ${IFACESIDS[$IFACENR],,} =~ ${IFACEMACC,,} ]]; then
MACMASKSED+="s;\(${IFACESIDS[$IFACENR]:1:3}\)$IFACEMACC;\1<IF from MAC [IF$(($IFACENR + 1))]>;Ig;"
fi
done

for WLAPIWLNR in "${!WLAPSIWLMACS[@]}"; do
MACMASKSED+="s;${WLAPSIWLMACS[$WLAPIWLNR]};<MAC ${WLAPSIWLIDS[$WLAPIWLNR]}>;I;"
MACMASKSED+=" /${WLAPSIWLIP6S[$WLAPIWLNR]}/ s;${WLAPSIWLIP6S[$WLAPIWLNR]/#\\(::/\(};<IP6 ${WLAPSIWLIDS[$WLAPIWLNR]}>;I;"
done

for WLAPNMNR in "${!WLAPSNMMACS[@]}"; do
MACMASKSED+="s;${WLAPSNMMACS[$WLAPNMNR]};<MAC ${WLAPSNMIDS[$WLAPNMNR]} [AN$(($WLAPNMNR + 1))]>;I;"
MACMASKSED+=" /${WLAPSNMIP6S[$WLAPNMNR]}/ s;${WLAPSNMIP6S[$WLAPNMNR]/#\\(::/\(};<IP6 ${WLAPSNMIDS[$WLAPNMNR]} [AN$(($WLAPNMNR + 1))]>;I;"
done

sed "$MACMASKSED /\([[:alnum:]]\{2\}:\)\{6,\}/! s/\([[:alnum:]]\{2\}:\)\{5\}[[:alnum:]]\{2\}/<MAC address>/g" <<< "$RESULTS" > "$OUTPUTDIR/$FILEBASE.txt"

##### The End #####

dialog_info "${TERMOUT+\n}Results saved in \"$OUTPUTDIR/$FILEBASE.txt\".${TERMOUT+\n}"

if (( $(stat -c %s "$OUTPUTDIR/$FILEBASE.txt") > 19968 )); then
tar -czf "$OUTPUTDIR/$FILEBASE.tar.gz" -C "$OUTPUTDIR" "$FILEBASE.txt" && \
dialog_info "Results also archived in \"$OUTPUTDIR/$FILEBASE.tar.gz\",${DIALOGBREAK}as they exceed the 19.5 kB size limit for \".txt\" attachments${DIALOGBREAK}on the Ubuntu Forums.${TERMOUT+\n}" || \
dialog_error "Results exceed the 19.5 kB size limit for \".txt\" attachments${DIALOGBREAK}on the Ubuntu Forums, but archive could not be created.${TERMOUT+\n}"
fi

if [ -x /usr/bin/pastebinit ] && ping -nc 3 -w 6 -i 0.2 paste.ubuntu.com > /dev/null 2>&1; then
PASTEBIN=$(dialog_question "Do you also want to post them${DIALOGBREAK}to your default 'pastebinit' provider?")
if [[ ! $PASTEBIN =~ ^no?$ ]]; then
PASTERESULT=$(pastebinit -i "$OUTPUTDIR/$FILEBASE.txt" -f text 2>&1) && PASTESUCCESS="yes"
if [ "$PASTESUCCESS" = "yes" ]; then
dialog_info "${TERMOUT+\n}Pastebin successful:\n\n${PASTERESULT}${TERMOUT+\n}"
else
if [ -n "$PASTERESULT" ]; then
dialog_error "${TERMOUT+\n}Pastebin failed, error message is:\n\n${PASTERESULT}${TERMOUT+\n}"
else
dialog_error "${TERMOUT+\n}Pastebin failed, no error message given.${TERMOUT+\n}"
fi
fi
else
echo
fi
fi







laurence@laurence-Inspiron-1501 ~ $ cd Desktop
laurence@laurence-Inspiron-1501 ~/Desktop $ chmod +x wireless-info
chmod: cannot access 'wireless-info': No such file or directory
laurence@laurence-Inspiron-1501 ~/Desktop $ ./wireless-info
bash: ./wireless-info: No such file or directory
laurence@laurence-Inspiron-1501 ~/Desktop $ SCRIPTDATE="2018-10-22 05:34 +0200"
laurence@laurence-Inspiron-1501 ~/Desktop $ FILEBASE="wireless-info"
laurence@laurence-Inspiron-1501 ~/Desktop $ OUTPUTDIR="$PWD"
laurence@laurence-Inspiron-1501 ~/Desktop $ OUTPUTDIRFB="/tmp"
laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ MODMATCHES="(air|ar5|at7|ath[^3]?|b43|bcma|brcm|carl|ipw|iwl|ndis|r(818|8192[eu]|871|92su)|8(188|189|192|723|812)[acde][esu]|rt[23567]|rtl|ssb|wl|(cfg|mac)80211)"
laurence@laurence-Inspiron-1501 ~/Desktop $ LSMODMATCHES="(wmi|(dell|ideapad)[-_]laptop)"
laurence@laurence-Inspiron-1501 ~/Desktop $ IFACEMATCHES="(wlan[0-9]|eth[0-9])"
laurence@laurence-Inspiron-1501 ~/Desktop $ DMESGMATCHES="(firmware|[nN]etwork|sdio|SDIO)"
laurence@laurence-Inspiron-1501 ~/Desktop $ NMPROFMATCHES="\(\[connection\]\|id=\|type=\|permissions=\|autoconnect=\|\[802-11-wireless\]\|\[wifi\]\|ssid=\|bssid=\|mac-address\(-blacklist\)\?=\|mtu=\|\[802-1x\]\|[[:graph:]]*ca-certs\?=\|\[ipv[46]\]\|method=\)"
laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ DMESGEXCL="apparmor|(cfg|mac)80211"
laurence@laurence-Inspiron-1501 ~/Desktop $ MODINFOEXCL="alias"
laurence@laurence-Inspiron-1501 ~/Desktop $ MODPROBEXCL="(alsa-base|blacklist-(firewire|framebuffer|modem|oss|watchdog)|fglrx|nvidia|fbdev|bumblebee)"
laurence@laurence-Inspiron-1501 ~/Desktop $ PMUTILSEXCL="/etc/pm/(power.d/(95hdparm-apm|intel-audio-powersave|sata_alpm)|sleep.d/(10_grub-common|10_unattended-upgrades.*|novatel_3g.*))"
laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ NETMGRNAMES=("NetworkManager" "Wicd" "ConnMan")
laurence@laurence-Inspiron-1501 ~/Desktop $ NETMGRPATHS=("/usr/sbin/NetworkManager" "/usr/sbin/wicd" "/usr/sbin/connmand")
laurence@laurence-Inspiron-1501 ~/Desktop $ DEC2BI=({0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1})
laurence@laurence-Inspiron-1501 ~/Desktop $ DEC2HEX=($(printf "%02x " {0..255}))laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ export LANG="en_US.UTF-8"
laurence@laurence-Inspiron-1501 ~/Desktop $ export LANGUAGE="en_US:en"
laurence@laurence-Inspiron-1501 ~/Desktop $ export LC_ALL="en_US.UTF-8"
laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ if [ -t 0 ]; then
> DIALOGAPP="terminal"
> DIALOGBREAK=" "
> TERMOUT="yes"
> elif [ -x /usr/bin/zenity ]; then
> DIALOGAPP="zenity"
> DIALOGBREAK="\n"
> elif [ -x /usr/bin/kdialog ]; then
> DIALOGAPP="kdialog"
> DIALOGBREAK="\n"
> else
> exit 1
> fi
laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ if [ -t 0 ]; then
> SUDO="sudo"
> elif [ -x /usr/bin/pkexec ]; then
> SUDO="pkexec"
> elif [ -x /usr/bin/gksudo ]; then
> SUDO="gksudo"
> GKSUDO="yes"
> elif [ -x /usr/bin/kdesudo ]; then
> SUDO="kdesudo"
> KDESUDO="yes"
> KDESUDOCMT=" needs administrative privileges. Please enter your password."
> fi
laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ dialog_info () {
> case $DIALOGAPP in
> terminal)
> printf "%b\n" "$1"
> ;;
> zenity)
> zenity --info --text="$1"
> ;;
> kdialog)
> kdialog --msgbox "$1"
> ;;
> esac
> }
laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ dialog_error () {
> case $DIALOGAPP in
> terminal)
> printf "%b\n" "$1" >&2
> ;;
> zenity)
> zenity --error --text="$1"
> ;;
> kdialog)
> kdialog --error "$1"
> ;;
> esac
> }
laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ dialog_question () {
> case $DIALOGAPP in
> terminal)
> local INPUT
> read -r -p "$1 [Y/n]: " INPUT
> echo "${INPUT,,}"
> ;;
> zenity)
> zenity --question --text="$1" || echo "no"
> ;;
> kdialog)
> kdialog --yesno "$1" || echo "no"
> ;;
> esac
> }
laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ ip6-mac () {
> for MAC in "$@"; do
> OCT1BI=${DEC2BI[0x${MAC:0:2}]}
> OCT1BI7=$((${OCT1BI:6:1} - 1))
> OCT1BIM="${OCT1BI:0:6}${OCT1BI7#-}${OCT1BI:7}"
> IP6S+=${IP6S:+$'\n'}"${DEC2HEX[2#$OCT1BIM]}${MAC:3:2}:${MAC:6:2}ff:fe${MAC:9:2}:${MAC:12:2}${MAC:15:2}"
> done
> sed 's/\(^\|:\)0\+\([[:alnum:]]\)/\1\2/g;s/^\([0:]\+\)/\\(::\\|\1\\)/' <<< "$IP6S"
> }
laurence@laurence-Inspiron-1501 ~/Desktop $
laurence@laurence-Inspiron-1501 ~/Desktop $ exec 3>&1 4>&2
laurence@laurence-Inspiron-1501 ~/Desktop $ exec 1> "$OUTPUTDIR/$FILEBASE.txt" || {
> dialog_error "${TERMOUT+\n}Cannot write output file in \"$OUTPUTDIR\",${DIALOGBREAK}trying in \"$OUTPUTDIRFB\" instead.${TERMOUT+\n}"
> OUTPUTDIR="$OUTPUTDIRFB"
> exec 1> "$OUTPUTDIR/$FILEBASE.txt" || {
> dialog_error "${TERMOUT+\n}Cannot write output file in \"$OUTPUTDIR\" either, aborting.${TERMOUT+\n}"
> exit 1
> }
> }
laurence@laurence-Inspiron-1501 ~/Desktop $ exec 2>&1
[sudo] password for laurence:
[sudo] password for laurence:
[sudo] password for laurence:
frosh
Level 1
Level 1
Posts: 17
Joined: Sun Dec 09, 2018 12:56 pm

Re: Wireless connection...

Post by frosh »

Hey,

the first two commands don't make sense if you don't actually have an internet connection. This is why you got error messages. The first line was supposed to download and execute the script, the second line was supposed to upload the output of the script and give you back a link that you could post here. Just for clarification.

After that it looks like you just copied the script in here.

Please give it another try, or we can't help you.

Step 1: Download script on XP, put it on USB and then put it on your Linux desktop.

Step 2: Open the terminal and then change into your desktop folder with this command:

Code: Select all

cd Desktop/
Step 3: Change permissions for the script with this command:

Code: Select all

chmod +x wireless-info
Step 4: Execute the script:

Code: Select all

./wireless-info
This will put another file in the same folder (Desktop/) called wireless-info.txt. Post the content of that file here.
Post Reply

Return to “Newbie Questions”