#!/bin/sh ########################################################################### # # Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file wifi_disconnect.sh # # @author (last) Behrouz NematiPour # @date (last) 15-Jan-2025 # @author (original) Behrouz NematiPour # @date (original) 15-Jan-2025 # ############################################################################ # Description # Disconnects from the given SSID($1) # Parameters # $1: the SSID name # Returns # No specific response # Considerations # - The system has to be already connected to the given SSID # sources . ./_errors_ . ./_functions_ # variables PARAM_COUNT=1 SSID_NAME="$(trim "$1")" # functions # checks check_param_count "$#" "$PARAM_COUNT" check_empty_string "$SSID_NAME" "$ERR_MTPARAM_WIFI_SSID" # main sudo nmcli connection delete "$SSID_NAME" check_result "$?" "$ERR_CMDFAIL_WIFI_DISCONNECT"