View Single Post
Old 06-21-2021, 06:02 PM   #536
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,808
Karma: 7423683
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by Cootey View Post
I see. It hadn't occurred to me that WiFi may have been shutting off. I could enable ForceWifiOn in 'Kobo eReader.conf', but that will call for more frequent charging.

Do you mean like this?

Code:
menu_item :main    :Telnet             :cmd_spawn          :quiet:/bin/mount -t devpts | /bin/grep -q /dev/pts || { /bin/mkdir -p /dev/pts && /bin/mount -t devpts devpts /dev/pts; }
chain_success                        :cmd_spawn          :quiet:/usr/bin/pkill -f "^/usr/bin/tcpsvd -E 0.0.0.0 1023" || true && exec /usr/bin/tcpsvd -E 0.0.0.0 1023 /usr/sbin/telnetd -i -l /bin/login
chain_success                        :dbg_toast          :Started Telnet server on port 1023.
chain_always : nickel_setting : enable : force_wifi
Try something like this:

Code:
menu_item:main:Telnet:cmd_output:500:quiet:/usr/bin/pkill -f "^/usr/bin/tcpsvd -E 0.0.0.0 1023"
  chain_success:skip:10
    chain_failure:cmd_spawn:quiet:/bin/mount -t devpts | /bin/grep -q /dev/pts || { /bin/mkdir -p /dev/pts && /bin/mount -t devpts devpts /dev/pts; }
    chain_success:cmd_spawn:quiet:exec /usr/bin/tcpsvd -E 0.0.0.0 1023 /usr/sbin/telnetd -i -l /bin/login
    chain_success:skip:2
      chain_failure:dbg_toast:Error starting Telnet server on port 1023
    chain_always:skip:4
      chain_success:dbg_toast:Started Telnet server on port 1023
      chain_always:nickel_setting:enable:force_wifi
      chain_always:nickel_wifi:disable
      chain_always:nickel_wifi:autoconnect
  chain_always:skip:4
    chain_success:dbg_toast:Stopped Telnet server on port 1023
    chain_always:nickel_setting:disable:force_wifi
    chain_always:nickel_wifi:disable
    chain_always:nickel_wifi:enable
If you're confused by the skips, they're basically if/else, and they're implemented that way so execution is always guaranteed to move forward for stability (fun fact: it was inspired by libpam auth stacks).

I haven't tested this, and I don't know if the wifi toggle (to apply the force_wifi setting) is too fast for Nickel to pick up.

Last edited by geek1011; 06-21-2021 at 06:11 PM.
geek1011 is offline   Reply With Quote