Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 17324  / 3 Years ago, tue, july 27, 2021, 7:21:36

OS: Ubuntu 11.10 with gnome-shell



I've few access points on my saved list which I want to remove and never connect to.
I can't seem to find way to delete these.



How should I remove (at least not auto connect) from saved access point list?


More From » wireless

 Answers
3
ctrl + t {for terminal prompt}
cd /etc/NetworkManager/system-connections
sudo rm {wireless_hotspot_name}


Hope that helps



EDIT FROM ONE YEAR LATER



Seems like this turned into a fairly popular answer, so I went ahead and wrote an automated script to do this for everyone. Just copy the below script into into /usr/local/bin/wireless and remember to run command sudo chmod +x /usr/local/bin/wireless



Glad to see this is continually helping fellow *buntu users ;)
newest version(s) will be on GitHub



#!/bin/bash
# Review and Remove Wireless Access Points on DEB based Systems
# Make sure to place script in /usr/local/bin

# CPR : Jd Daniel :: GabelBombe
# MOD : 2013-12-09 @ 12:27:02

# INP : $ wireless -{flag} {arg}

##===============================================================##
##===============================================================##

clear

# If the user is not root
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2 ; exit 1
fi


declare -r VERSION='1.2b'
declare -r net_dir='/etc/NetworkManager/system-connections'


function list ()
{
cd "${net_dir}"

export count=$(ls |wc -l) # used in drop function

files=$(ls) # simple ls

echo -e "
Found ${count} wireless connections"

for f in $files; do
echo -e " * $f"
done
}

function drop ()
{
# make sure that we have a working file and directory...
cd "${net_dir}" ; [ -f "$OPTARG" ] || { echo -e "
Connection does not exist..." ; exit 1; }

# confirmation for removal
printf "
Do you want to delete $OPTARG [y/n] " ; read -r resp

# strtolower, and rm
if [ 'y' == "$(echo $resp | awk '{print tolower($0)}')" ]; then
rm -f ${net_dir}/${OPTARG}
fi
}

function flush ()
{
# make sure that we have a directory with files...
cd "${net_dir}" ; list ; [ 0 -ge "${count}" ] && { echo -e " Exiting, Nothing to flush..." ; exit 1 ; }

# confirmation for removing all files
printf "
All Wireless Connections will be removed, continue? [y/n] " ; read -r resp

# strtolower, and rm
if [ 'y' == "$(echo $resp | awk '{print tolower($0)}')" ]; then
rm -f ${net_dir}/*
fi
}

function version ()
{
echo -e "
wireless (GNU wireless network purge) v${VERSION}"
echo -e "
Copyright (C) 2013 Hydra Code, LLC."
echo -e " License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
echo -e "

Written by Jd Daniel (GabelBombe) http://github.com/GabelBombe"
exit 0
}

function help ()
{
echo -e "
Usage: wireless [OPTION]... [FILE]..."
echo -e " List, remove single or flush the contents of your Wireless Network Manager"
echo -e "
The options below may be used to perform the above actions, this program will only"
echo -e " run a single flag or parameter at a time. Flag chaining is only available for -d"
echo -e " -l, --list List the contents of your 'Network Manager'"
echo -e " -d, --drop [conn] Drop a single (or multiple) wireless connections"
echo -e " -f, --flush Flush all wireless connections."
echo -e " --help Display this help menu and exit"
echo -e " --version Display version information and exit"
exit 0
}

##===============================================================##
##===============================================================##

# no long-opts supported except --help
while getopts ':ld:f-:' OPT; do
case $OPT in

l) list ;;
d) dirList="${dirList} $OPTARG" ; drop ;;
f) flush ;;
-) #long option
case $OPTARG in

list) list ;;
drop) drop ;;
flush) flush ;;
help) help ;;
version) version ;;

esac
;;
: ) echo -e "
Missing option argument for -$OPTARG" >&2; exit 1;;
* ) echo -e "
Unknown flag supplied ${OPTARG}
Try wireless --help"; exit 1;;
esac
done

shift $(($OPTIND - 1))

##===============================================================##
##===============================================================##

[#39403] Wednesday, July 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nguai

Total Points: 216
Total Questions: 108
Total Answers: 116

Location: Hong Kong
Member since Thu, Dec 16, 2021
2 Years ago
;