Index: scripts/wifi_disconnect_network.sh =================================================================== diff -u -r15f9b824713355427ea8a1de5e0a7ecca5392c28 -rb743e6d20c409d112cfe5a82366dbdf79460203c --- scripts/wifi_disconnect_network.sh (.../wifi_disconnect_network.sh) (revision 15f9b824713355427ea8a1de5e0a7ecca5392c28) +++ scripts/wifi_disconnect_network.sh (.../wifi_disconnect_network.sh) (revision b743e6d20c409d112cfe5a82366dbdf79460203c) @@ -15,21 +15,29 @@ # ############################################################################ -if [ $# -eq 0 ]; then - currentFile=$(basename "$0") - echo "Usage: ./$currentFile " - exit 0 -fi +# Description +# Lists all the available Access Points using nmcli command of NetworkManager module. +# Parameters +# No Parameters +# Returns +# Exit code -iface=$1 +# sources +. ./_errors_ +. ./_functions_ -# stop the wpa service -sudo systemctl stop wpa_supplicant@"$iface".service +# variables +PARAM_COUNT=0 -#remove the wpa configuration file -sudo rm -f /etc/wpa_supplicant/wpa_supplicant-"$iface".conf +# checks +check_param_count "$#" "$PARAM_COUNT" -#Shutoff wifi interface -sudo ip link set $iface down +# main +nmcli connection delete $(nmcli -t -f NAME connection show --active) +check_result "$?" "$ERR_CMDFAIL_WIFI_DELETE_CONNECTION" +# exit gracefully +sleep 0.1 +echo "" +exit 0