Quote:
Originally Posted by geek1011
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.

)