View Single Post
Old 06-23-2021, 04:55 AM   #537
Cootey
Absentminded Reader
Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.
 
Cootey's Avatar
 
Posts: 1,345
Karma: 7442365
Join Date: Apr 2017
Device: Kobo Mini, Libra Colour & Elipsa; Kindle Paperwhite 3 & 4; iOS apps
Quote:
Originally Posted by geek1011 View Post
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.
Fantastic! Thank you for working that up. I've got an all day event today on the books already, but I know what I'll be playing with later tonight. I'll let you know how it goes.

(Also, I appreciate the extra code to study. It'll help me understand your tool better. )

Last edited by Cootey; 06-23-2021 at 05:34 AM.
Cootey is offline   Reply With Quote