04-12-2023, 12:55 AM | #1 |
0000000000101010
Posts: 5,174
Karma: 10057265
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
|
Solved - Disable flight mode, enable WIFI - programmatically?
Does anybody know if you can disable flight-mode and enable WIFI programmatically? From pbterm or bash script etc? (Ideally on PB632)
I've tried running "/ebrmain/cramfs/bin/netagent connect" This command seems to be accepted, but it has no effect on either flight-mode or WIFI. EDIT - managed to work out the commands: Flight mode on: "/ebrmain/cramfs/bin/netagent flightmode on" Flight Mode off: "/ebrmain/cramfs/bin/netagent flightmode off" Flight mode status: "/ebrmain/cramfs/bin/netagent flightmode status" Bluetooth on: "/ebrmain/cramfs/bin/netagent bt on" Bluetooth off: "/ebrmain/cramfs/bin/netagent bt off" Bluetooth status: "/ebrmain/cramfs/bin/netagent bt status" WIFI on: "/ebrmain/cramfs/bin/netagent net on" WIFI off: "/ebrmain/cramfs/bin/netagent net off" "/ebrmain/cramfs/bin/netagent net status" does not work, gives null response However, you can test WIFI status using: Code:
if [ -d "/sys/class/net/eth0" ]; then echo "WIFI on"; fi You can also test if you're connected to a network using: Code:
if [[ $(cat /sys/class/net/eth0/carrier) == 1 ]]; then echo "Connected to network"; fi And I use this to test for access to the internet: Code:
test="$(curl -Is http://www.google.com | head -n 1)" if [ "${test:13:2}" == "OK" ]; then echo "Connected to internet"; fi Last edited by neil_swann80; 04-15-2023 at 04:05 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sleep Disable/Enable KUAL+ extensions | j.p.s | Kindle Developer's Corner | 14 | 07-12-2023 05:17 AM |
Is there a way to enable text selection/Highlight on one book and disable on another? | ldmobi | KOReader | 1 | 01-15-2022 02:18 PM |
How to disable/enable (not hide) a custom column? | timediver | Library Management | 5 | 10-16-2017 04:45 AM |
Enable/disable search highlighting | katiez | Library Management | 2 | 12-05-2013 02:42 PM |
Store chooser / enable, disable dialog | user_none | Calibre | 8 | 05-20-2011 07:27 AM |