SomeWhereOverTheRainBow
Part of the Furniture
IWIK how @thelonelycoder is doing (ping!).... I hope @thelonelycoder will consider adding this by the next AMTM release.
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/VPNMON-R2/master/vpnmon-r2-1.5b4.sh" -o "/jffs/scripts/vpnmon-r2.sh" && chmod a+rx "/jffs/scripts/vpnmon-r2.sh"
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/VPNMON-R2/master/vpnmon-r2-1.4.sh" -o "/jffs/scripts/vpnmon-r2.sh" && chmod a+rx "/jffs/scripts/vpnmon-r2.sh"
Mon May 16 00:00:02 EDT 2022 - VPNMON-R2 - **VPN2 Ping/http failed**
Mon May 16 00:00:02 EDT 2022 - VPNMON-R2 ----------> ERROR: WAN DOWN
Mon May 16 00:00:19 EDT 2022 - VPNMON-R2 ----------> ERROR: WAN DOWN
Mon May 16 00:00:35 EDT 2022 - VPNMON-R2 ----------> ERROR: WAN DOWN
Mon May 16 00:00:51 EDT 2022 - VPNMON-R2 ----------> ERROR: WAN DOWN
Mon May 16 00:01:07 EDT 2022 - VPNMON-R2 ----------> ERROR: WAN DOWN
Mon May 16 00:01:24 EDT 2022 - VPNMON-R2 - WAN Connection Re-established -- Resetting VPN
Mon May 16 00:01:24 EDT 2022 - VPNMON-R2 - Executing VPN Reset
Mon May 16 00:01:32 EDT 2022 - VPNMON-R2 - Killed all VPN Client Connections
Mon May 16 00:02:34 EDT 2022 - VPNMON-R2 - Updated Skynet Whitelist
Mon May 16 00:02:41 EDT 2022 - VPNMON-R2 - Refreshed VPN Slots 1 - 5 from 2031 SuperRandom NordVPN Server Locations
Mon May 16 00:02:41 EDT 2022 - VPNMON-R2 - Randomly selected VPN1 Client ON
Mon May 16 00:02:41 EDT 2022 - VPNMON-R2 - Successfully updated YazFi guest network(s) with the current VPN slot.
Mon May 16 00:02:41 EDT 2022 - VPNMON-R2 - VPN Reset Finished
Mon May 16 00:02:58 EDT 2022 - VPNMON-R2 - API call made to update city to Denver
admin@AsusRouter:/jffs/scripts# ./vpnmon-r2.sh -monitor
Delaying VPNMON-R2 start-up for 30 seconds...
_ ______ _ ____ _______ _ __ ____ ___
| | / / __ \/ | / / |/ / __ \/ | / / / __ \__ \
| | / / /_/ / |/ / /|_/ / / / / |/ /_____/ /_/ /_/ /
| |/ / ____/ /| / / / / /_/ / /| /_____/ _, _/ __/
|___/_/ /_/ |_/_/ /_/\____/_/ |_/ /_/ |_/____/ v1.5b4
Mon May 16 16:18:44 AEST 2022 -------- Last Reset: 0d 00h:05m:39s
./vpnmon-r2.sh: line 1560: timeout: not found
./vpnmon-r2.sh: line 1560: timeout: not found
./vpnmon-r2.sh: line 1560: timeout: not found
./vpnmon-r2.sh: line 1560: timeout: not found
./vpnmon-r2.sh: line 1560: timeout: not found
VPN State 1: 2: 3: 4: 5: --------- Interval: 60 Sec
-----------------------------------------------------------------
- VPN1 Disconnected
-----------------------------------------------------------------
[Checking WAN Connectivity]...
[Checking WAN Connectivity]...ACTIVE
[Checking NordVPN Server Load]...
Ping Lo:0 Hi:0 ms | Load: 0% | Config: VPNMGR
[Gathering VPN RX and TX Stats]... | Ttl RX:0.00 GB TX:0.00 GB
-----------------------------------------------------------------
Connection has failed, VPNMON-R2 is executing VPN Reset
Checking WAN Connectivity...
Checking WAN Connectivity...ACTIVE
Step 1 - Kill all VPN Client Connections
Nice catch, Steve. I think I left some debug code in there... hey - it was a late night! I've since removed it, and re-uploaded Beta 4. Please give it a shot at your convenience! I just retested it on my end and got similar results as before.@Viktor Jaep, thanks for your continued work on this, Beta 4 is not looking that flash for me however unfortunately
I've rolled back to Beta 3 for now, as I have limited time to test at the moment.
It looks like it's not longer detecting my VPN is connected on initial startup, even though it definitely IS!
It then just keeps looping around as it never sees the VPN as being up, so I can't tell you whether the "WAN Down" situation is improved as I can't get it running in stable fashion.
I ran it manually using "-config" and went back through the Config steps again (feedback on selections is now great BTW), adding in "my" 30 second delay and then let it run.
First few lines of my SSH session log ...
Code:admin@AsusRouter:/jffs/scripts# ./vpnmon-r2.sh -monitor Delaying VPNMON-R2 start-up for 30 seconds... _ ______ _ ____ _______ _ __ ____ ___ | | / / __ \/ | / / |/ / __ \/ | / / / __ \__ \ | | / / /_/ / |/ / /|_/ / / / / |/ /_____/ /_/ /_/ / | |/ / ____/ /| / / / / /_/ / /| /_____/ _, _/ __/ |___/_/ /_/ |_/_/ /_/\____/_/ |_/ /_/ |_/____/ v1.5b4 Mon May 16 16:18:44 AEST 2022 -------- Last Reset: 0d 00h:05m:39s ./vpnmon-r2.sh: line 1560: timeout: not found ./vpnmon-r2.sh: line 1560: timeout: not found ./vpnmon-r2.sh: line 1560: timeout: not found ./vpnmon-r2.sh: line 1560: timeout: not found ./vpnmon-r2.sh: line 1560: timeout: not found VPN State 1: 2: 3: 4: 5: --------- Interval: 60 Sec ----------------------------------------------------------------- - VPN1 Disconnected ----------------------------------------------------------------- [Checking WAN Connectivity]... [Checking WAN Connectivity]...ACTIVE [Checking NordVPN Server Load]... Ping Lo:0 Hi:0 ms | Load: 0% | Config: VPNMGR [Gathering VPN RX and TX Stats]... | Ttl RX:0.00 GB TX:0.00 GB ----------------------------------------------------------------- Connection has failed, VPNMON-R2 is executing VPN Reset Checking WAN Connectivity... Checking WAN Connectivity...ACTIVE Step 1 - Kill all VPN Client Connections
VPN was definitely up and connected.
Here is a Onedrive link to a .Zip file with my SSH session log, and the VPNMON-R2 log and config ...
Cheers,
Stephen
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/VPNMON-R2/master/vpnmon-r2-1.5b4.sh" -o "/jffs/scripts/vpnmon-r2.sh" && chmod a+rx "/jffs/scripts/vpnmon-r2.sh"
Please give it a shot at your convenience! I just retested it on my end and got similar results as before.
Here is how I did it.As an aside, is post-mount the right place to be doing the auto-start? Are there other options?
I keep looking at my watch saying "It MUST be daytime over in Australia by now! Hope Steve's test goes WELL!" Lol.Thanks, will give it a crack tomorrow and report back.
Beautiful late autumn day here so decided a long walk in the sunshine had priority!Hope Steve's test goes WELL!" Lol.
I'm SO happy to hear all went well (for the most part)! That walk was certainly well-deserved!Beautiful late autumn day here so decided a long walk in the sunshine had priority!
I was literally writing my reply when your message popped up! Don't want you fretting any longer so ...
Yes, it works! Just installed the "newer" Beta 4 and pulled the power to my Cable Modem and it all appears to do what it should now as per your guide.
Slight hiccup is that your "Startup Delay" doesn't seem to fix the problems with my other scripts not firing correctly, whereas as my "old' method of just putting a "sleep 30" at the top of your script does still work. I need to play with that some more to confirm and also try and figure out what @iTyPsIDg is doing with his script and whether I want to go there as well?
But we are up and running with a solid base to continue the experiments so thought you'd want the good news whilst I play further.
sleep 30; sh /jffs/scripts/vpnmon-r2.sh -screen
Yes, it does, same difference I think but saves me having to modify your script each time you update it ...This might just work in your post-mount script?
Yes, it does, same difference I think but saves me having to modify your script each time you update it ...
Since post-mount is a blocking script with a maximum execution timeout of 120 seconds, use care when deliberately introducing delays.This might just work in your post-mount script?
does that time out extend to scripts that are spawn from it with one line of code?Since post-mount is a blocking script with a maximum execution timeout of 120 seconds, use care when deliberately introducing delays.
If the script is spawned withdoes that time out extend to scripts that are spawn from it with one line of code?
&
then it won’t delay the completion of post-mount
.Even with those level of precautions, I still would consider proceeding with @dave14305 words of caution. @dave14305 , would you recommend any potential events the script could be started from using service-event-end or service-event maybeIf the script is spawned with&
then it won’t delay the completion ofpost-mount
.
"$1" restart
and "$2" diskmon
?If the script is spawned with&
then it won’t delay the completion ofpost-mount
.
/jffs/scripts/vpnmon-r2.sh -screen & # vpnmon-r2
From my understanding it prevents your router from proceeding forward. the & statement in your one liner allows the process to work in the background instead of the foreground (i.e. a spawn of post-mount); in theory as dave suggest, it would allow your script to run with the sleep inside it without breaking post-mounts rule. however, you would need your sleep to be inside the script spawn from the one liner and not separate inside the post-mount.Want to learn about this behavior a bit more... perhaps you guys can clear my confusion, @dave14305 and @SomeWhereOverTheRainBow?
1.) The 120 seconds max execution timeout... does this mean if you put a sleep statement in the post-mount that would exceed the 120s, it just wouldn't complete from that point forward? Or would it bork up your router? What if it spawns a script with that sleep statement that runs immediately after the script executes?
2.) Spawning the script with an &... would something like this be acceptable?
Code:/jffs/scripts/vpnmon-r2.sh -screen & # vpnmon-r2
You probably could get away with doing your script and the sleep like this.Want to learn about this behavior a bit more... perhaps you guys can clear my confusion, @dave14305 and @SomeWhereOverTheRainBow?
1.) The 120 seconds max execution timeout... does this mean if you put a sleep statement in the post-mount that would exceed the 120s, it just wouldn't complete from that point forward? Or would it bork up your router? What if it spawns a script with that sleep statement that runs immediately after the script executes?
2.) Spawning the script with an &... would something like this be acceptable?
Code:/jffs/scripts/vpnmon-r2.sh -screen & # vpnmon-r2
(sleep 120 && /jffs/scripts/vpnmon-r2.sh -screen) & # vpnmon-r2
( )
allows the capture to be done in a subshell that is casted into the &
@Viktor JaepPerhaps that's the fix you're looking for, Obiwan Kenobi!
(sleep 30 && /jffs/scripts/vpnmon-r2.sh -screen) & # vpnmon-r2
/jffs/scripts/vpnmon-r2.sh -screen & # vpnmon-r2
grep: bad regex '\b(*error*|Undefined)\b': Invalid preceding regular expression
Thread starter | Title | Forum | Replies | Date |
---|---|---|---|---|
(Not specifically) VPNMON-R3 1.11 failure domino effect | Asuswrt-Merlin AddOns | 20 | ||
VPNMON VPNMON-R3 Custom Server List Generation Tutorials and Examples | Asuswrt-Merlin AddOns | 63 |
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!