File: sxmo_wifitoggle.sh

package info (click to toggle)
sxmo-utils 1.14.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,016 kB
  • sloc: sh: 9,166; ansic: 117; makefile: 68
file content (31 lines) | stat: -rwxr-xr-x 397 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors

# Note: this script should be run as root via doas

# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh

on() {
	rfkill unblock wlan
}

off() {
	rfkill block wlan
}

case "$1" in
	on)
		on
		;;
	off)
		off
		;;
	*) #toggle
		if rfkill list wifi | grep -q "yes"; then
			on
		else
			off
		fi
esac