public inbox for network@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH 2/2] wireless-networks: add hidden command
@ 2017-08-24 12:47 Jonatan Schlag
  0 siblings, 0 replies; only message in thread
From: Jonatan Schlag @ 2017-08-24 12:47 UTC (permalink / raw)
  To: network

[-- Attachment #1: Type: text/plain, Size: 1340 bytes --]

Fixes: #11475

Signed-off-by: Jonatan Schlag <jonatan.schlag(a)ipfire.org>
---
 src/functions/functions.wireless-networks | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/functions/functions.wireless-networks b/src/functions/functions.wireless-networks
index 4fedcb9..58256b9 100644
--- a/src/functions/functions.wireless-networks
+++ b/src/functions/functions.wireless-networks
@@ -49,7 +49,7 @@ cli_wireless_network() {
 			local handle="$(wireless_network_hash "${ssid}")"
 
 			case "${key}" in
-				modes|pre_shared_key|priority)
+				hidden|modes|pre_shared_key|priority)
 					wireless_network_${key} "${handle}" "$@"
 					;;
 				show)
@@ -364,6 +364,26 @@ wireless_network_modes() {
 	fi
 }
 
+wireless_network_hidden() {
+	if [ ! $# -eq 2 ]; then
+		log ERROR "Not enough arguments"
+		return ${EXIT_ERROR}
+	fi
+
+	local handle=${1}
+	local hidden=${2}
+
+	if ! isbool hidden; then
+		log ERROR "Invalid value '${hidden}'"
+		return ${EXIT_ERROR}
+	fi
+
+	if ! wireless_network_write_config_key "${handle}" "HIDDEN" "${hidden}"; then
+		log ERROR "Could not write configuration settings"
+		return ${EXIT_ERROR}
+	fi
+}
+
 wireless_network_pre_shared_key() {
 	if [ ! $# -eq 2 ]; then
 		log ERROR "Not enough arguments"
-- 
2.6.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-24 12:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-24 12:47 [PATCH 2/2] wireless-networks: add hidden command Jonatan Schlag

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox