What's new

iOS Shortcut for Diversion

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

That‘s confirmed. Running any of the commands in the terminal works, but the iOS Shortcut is left hanging with no action or output. Let me try to get to the bottom of this new mystery.
 
The bad news: It looks like that the beloved and underrated Diversion Shortcuts app is dead with the release of Asuswrt-Merlin 386.7 firmware :( :mad:

My bad: This is something I did not check during the beta test of 386.7 despite the obvious pointers and strong hints, see here and in previous messages by me and other members: https://www.snbforums.com/threads/a...ta-is-now-available.79282/page-17#post-769599

For some reason, logging in with SSH to your router through a standard SSH client e.g. Xshell, any Linux terminal, MobaXterm appears to work.
Using a more exotic client like SmarTTY that @jsbeddow was using or in this very case, the iOS Shortcuts app changes how the $PATH environment is set for the console.
This is something for @RMerlin to re-consider.

The iOS app returns the following when running these commands:
Code:
user@router: echo $PATH
/usr/sbin:/usr/bin:/sbin:/bin

user@router: which sh
/usr/sbin/sh
The expected output is the following in previous Asuswrt-Merlin releases, with Entware installed:
Code:
user@router: echo $PATH
/opt/bin:/opt/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/home/tlc:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin

user@router: which sh
/opt/bin/sh

OR in some cases

user@router: which sh
/bin/sh

Interestingly, the output of which $SHELL returns correctly /bin/sh for both pre 386.7 and the current latest release.

The good news: Changing the iOS Shortcuts app command to the full path of the Diversion file will fix this calamity in technological marvels.
Changing all occurrences in your Diversion iOS Shortcuts app from
Code:
diversion sh-<rest of command>
to
Code:
/opt/bin/diversion sh-<rest of command>
does the trick for now.
I will release an update for the Shortcuts app ASAP.

Thanks for your attention and be patient.
 
The bad news: It looks like that the beloved and underrated Diversion Shortcuts app is dead with the release of Asuswrt-Merlin 386.7 firmware :( :mad:

My bad: This is something I did not check during the beta test of 386.7 despite the obvious pointers and strong hints, see here and in previous messages by me and other members: https://www.snbforums.com/threads/a...ta-is-now-available.79282/page-17#post-769599

For some reason, logging in with SSH to your router through a standard SSH client e.g. Xshell, any Linux terminal, MobaXterm appears to work.
Using a more exotic client like SmarTTY that @jsbeddow was using or in this very case, the iOS Shortcuts app changes how the $PATH environment is set for the console.
This is something for @RMerlin to re-consider.

The iOS app returns the following when running these commands:
Code:
user@router: echo $PATH
/usr/sbin:/usr/bin:/sbin:/bin

user@router: which sh
/usr/sbin/sh
The expected output is the following in previous Asuswrt-Merlin releases, with Entware installed:
Code:
user@router: echo $PATH
/opt/bin:/opt/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/home/tlc:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin

user@router: which sh
/opt/bin/sh

OR in some cases

user@router: which sh
/bin/sh

Interestingly, the output of which $SHELL returns correctly /bin/sh for both pre 386.7 and the current latest release.

The good news: Changing the iOS Shortcuts app command to the full path of the Diversion file will fix this calamity in technological marvels.
Changing all occurrences in your Diversion iOS Shortcuts app from
Code:
diversion sh-<rest of command>
to
Code:
/opt/bin/diversion sh-<rest of command>
does the trick for now.
I will release an update for the Shortcuts app ASAP.

Thanks for your attention and be patient.
Surprised this behavior can't be changed with /jffs/configs/profile.add or over ridden by some other custom script method.
 
Last edited:
This is something for @RMerlin to re-consider.
Re-consider what? I didn't change anything...

Why are these clients overriding the current default path with an arbitrary (broken) one?
 
Re-consider what? I didn't change anything...

Why are these clients overriding the current default path with an arbitrary (broken) one?
I think I might have found why this has changed. In the latest Dropbear changelog:

Code:
+- Add /usr/sbin and /sbin to $PATH when logging in as root.
+  Patch from Raphaël Hertzog
+  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903403

I haven't reviewed the change, but I suspect it might possibly be adding it at the start of the PATH instead of the end with some clients (why only these clients however I don't know).

If you are able to reproduce the issue, try compiling a test build with that change reverted.


Or, try just changing the DEFAULT_ROOT_PATH in default_options.h then recompile it.

EDIT: Untested, but in theory should be fixed with https://github.com/RMerl/asuswrt-merlin.ng/commit/eddf5e9f42a3c806d52346f1952fe4d71d1c7b6d .
 
Last edited:
iOS Shortcut v1.4 is now available

What's new in v1.4
- Compatibility fix for Asuswrt-Merlin 386.7
- Adds amtm script update check!

amtm can return a list of available script updates through an SSH command and its SSH UI. To make use of the former, I added this command to the Diversion Shortcuts app, rather than create a new amtm Shortcuts app.
So now you can comfortably check for script updates from the comfort of your bed, if you like that sort of thing :cool:

How to install on your iOS device
See this page on diversion.ch or read instructions in post #1. Once the new Shortcut is configured and working, you may safely delete older version(s) from your Library.


Sorry, this update is obsolete as it requires a Diversion update first. I will get to it ASAP.
 
Last edited:
iOS Shortcut v1.4 is now available

What's new in v1.4
- Compatibility fix for Asuswrt-Merlin 386.7
- Adds amtm script update check!

amtm can return a list of available script updates through an SSH command and its SSH UI. To make use of the former, I added this command to the Diversion Shortcuts app, rather than create a new amtm Shortcuts app.
So now you can comfortably check for script updates from the comfort of your bed, if you like that sort of thing :cool:

How to install on your iOS device
See this page on diversion.ch or read instructions in post #1. Once the new Shortcut is configured and working, you may safely delete older version(s) from your Library.
So the shortcut seems to be not working correctly.. I tried the disable diversion service and it didn't actually disable it meaning if I go to the Lan / Diversion tab it says its still on & then I can't actually disable it -- The shortcut also produces some weird output -- I've saved a video to my dropbox heres the link - https://www.dropbox.com/s/vbmxxqi2s9z2lhd/Screen Recording 2022-06-26 at 11.32.08 AM.mov?dl=0
 

Attachments

  • Screen Shot 2022-06-26 at 11.28.38 AM.png
    Screen Shot 2022-06-26 at 11.28.38 AM.png
    196.6 KB · Views: 53
  • Screen Shot 2022-06-26 at 11.30.11 AM.png
    Screen Shot 2022-06-26 at 11.30.11 AM.png
    233.8 KB · Views: 53
So the shortcut seems to be not working correctly.. I tried the disable diversion service and it didn't actually disable it meaning if I go to the Lan / Diversion tab it says its still on & then I can't actually disable it -- The shortcut also produces some weird output -- I've saved a video to my dropbox heres the link - https://www.dropbox.com/s/vbmxxqi2s9z2lhd/Screen Recording 2022-06-26 at 11.32.08 AM.mov?dl=0
Sorry, the Diversion Shortcuts app v1.4 requires an as of yet unreleased Diversion update. I will get to it as soon as I can.
 
I think I might have found why this has changed. In the latest Dropbear changelog:

Code:
+- Add /usr/sbin and /sbin to $PATH when logging in as root.
+  Patch from Raphaël Hertzog
+  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903403

I haven't reviewed the change, but I suspect it might possibly be adding it at the start of the PATH instead of the end with some clients (why only these clients however I don't know).

If you are able to reproduce the issue, try compiling a test build with that change reverted.


Or, try just changing the DEFAULT_ROOT_PATH in default_options.h then recompile it.

EDIT: Untested, but in theory should be fixed with https://github.com/RMerl/asuswrt-merlin.ng/commit/eddf5e9f42a3c806d52346f1952fe4d71d1c7b6d .
I don‘t have an Ubuntu system running. Would you be able to compile a version for my RT-AC86U so I can test it?
This goes deeper as I had to change Diversion to use the full path to the Diversion file everywhere or else the withdrawn iOS Shortcuts v1.4 release still wont work.
Thanks.
 
I can confirm that fixes the $PATH issue with these exotic SSH clients, including that with SmarTTY with the option enabled to use "Smart Terminal".
It also fixes the Diversion Shortcuts app v1.3 that users complained about.

Here's the output of SmarTTY:
Code:
Welcome to Smart Terminal.
user@router:~$ echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
 
I think I might have found why this has changed. In the latest Dropbear changelog:

Code:
+- Add /usr/sbin and /sbin to $PATH when logging in as root.
+  Patch from Raphaël Hertzog
+  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903403

This proves @Tech9 point about watching out for those drop bears...

Reference:
 
Will you be pushing an updated release tag for this patch? Or does it only impact certain routers?
I don't have anything planned yet at this time. If this is the only issue, then it will most likely have to wait for the next major release.
 
I can confirm that fixes the $PATH issue with these exotic SSH clients, including that with SmarTTY with the option enabled to use "Smart Terminal".
It also fixes the Diversion Shortcuts app v1.3 that users complained about.

Here's the output of SmarTTY:
Code:
Welcome to Smart Terminal.
user@router:~$ echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
So what is happening with this? Is it going to be fixed in the next release of merlin firmware ?
 
See Post 95.
 
So what is happening with this? Is it going to be fixed in the next release of merlin firmware ?
Yes, it will be fixed with the next firmware release. In the meantime I try to get updates out for Diversion, amtm and the Diversion iOS Shortcut.
 
Let's try this again, I hope this time it lasts :cool: ;)

iOS Shortcut v1.4 is now available

What's new in v1.4

- Compatibility fix for Asuswrt-Merlin 386.7.
- Adds amtm script update check!
- This version requires Diversion 4.3.0 installed, see release notes here.

amtm can return a list of available script updates through an SSH command and its SSH UI. To make use of the former, I added this command to the Diversion Shortcuts app, rather than create a new amtm Shortcuts app.
So now you can comfortably check for script updates from the comfort of your bed, if you like that sort of thing :cool:

How to install on your iOS device
See this page on diversion.ch or read instructions in post #1. Once the new Shortcut is configured and working, you may safely delete older version(s) from your Library.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top