View Single Post
Old 06-21-2022, 07:27 PM   #797
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 876
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Quote:
Originally Posted by Rid View Post
Would I be able to get an example of the syntax please?

I have only scripted in Windows before and I really don't where I should be looking for cmd's that work with Kobo. I have used linux cmd's to move and delete files etc but when it comes to the wifi there seems to be a lot of different ways it can be done and I am unable to get it to work.

I am making a huge guess here that there might be different versions of linux out there that have different cmd's or I am just barking up the wrong tree on all of this?
You can use NDB to call most of the same actions as NickelMenu, including stuff like Wifi management.

Documentation is here, specifically, look at the qndb portion of that page. Then look at the API documentation to find out what methods to call.

For Wifi, there is currently wfmConnectWireless wfmConnectWirelessSilently wfmSetAirplaneMode methods available. You'll probably also want to listen for the wmNetworkConnected and wmNetworkFailedToConnect signals as well.

This is completely untested, but the following might work:
Code:
#!/bin/sh

signal=$(qndb -s wmNetworkConnected -s wmNetworkFailedToConnect -t 60 -m wfmConnectWireless)

# Note, It's been a while, this may be wrong, I'll double check later
if [ "$signal" = "wmNetworkConnected" ]; then
    # connected, do stuff here
elif [ "$signal" = "wmNetworkFailedToConnect" ]; then
    # did not connect, do cleanup here
else
    # timeout happened
fi
If you search for help on creating/running linux shell scripts, search for 'POSIX shell', or 'busybox'. Avoid answers that are considered "bash specific".

Last edited by sherman; 06-21-2022 at 07:30 PM.
sherman is offline   Reply With Quote