Allow non root user to connect to a wifi
This commit is contained in:
parent
e09e3d872f
commit
76728e78e4
@ -868,4 +868,4 @@ CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
|
|||||||
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
|
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
|
||||||
CONFIG_CRYPTO_CHACHA20_NEON=m
|
CONFIG_CRYPTO_CHACHA20_NEON=m
|
||||||
CONFIG_CRYPTO_AES_ARM64_BS=m
|
CONFIG_CRYPTO_AES_ARM64_BS=m
|
||||||
|
CONFIG_QCOM_WCNSS_CTRL=y
|
||||||
|
@ -8,4 +8,5 @@ Defaults passwd_tries=3
|
|||||||
Defaults insults
|
Defaults insults
|
||||||
Defaults log_input,log_output
|
Defaults log_input,log_output
|
||||||
|
|
||||||
www-data ALL=(root) NOPASSWD: /bin/sh /update.sh
|
www-data ALL=(admin) NOPASSWD: /bin/sh /update.sh
|
||||||
|
upgrade ALL=(root) NOPASSWD: /usr/sbin/iw wlan0 scan, /sbin/iw wlan0 link, /bin/cat /etc/wpa_supplicant.conf, /bin/sh /wifi/connect.sh *, /bin/sh /wifi/disconnect.sh
|
||||||
|
0
conf/etc/wpa_supplicant.conf
Normal file
0
conf/etc/wpa_supplicant.conf
Normal file
10
conf/wifi/connect.sh
Executable file
10
conf/wifi/connect.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$#" -ne 2 ]; then
|
||||||
|
echo "Usage: connect.sh: <ssid> <psk>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
/usr/bin/wpa_passphrase "$1" "$2" > /etc/wpa_supplicant.conf
|
||||||
|
/usr/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
|
||||||
|
/usr/sbin/dhclient wlan0
|
3
conf/wifi/disconnect.sh
Executable file
3
conf/wifi/disconnect.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
/usr/sbin/wpa_cli -i wlan0 terminate
|
Loading…
Reference in New Issue
Block a user