Search results

  • 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!

  1. Martineau

    In Asuswrt, how to display the log timestamp with nano seconds?

    Install Entware from amtm (You will need a USB flash drive attached to the router) amtm then install the Entware date utility opkg install coreutils-date
  2. Martineau

    Need a script that auto reboot if internet is down

    Do you mean when the WAN is retored? ;) See https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts#wan-event So you would create a script that fires on the 'WAN0-connected' event and calls your email script.
  3. Martineau

    Web History Reporting and Management (Traffic Analyzer/Aiprotection Monitor)

    Originally I hard-coded the in-line SendMail() function for a Gmail account and at the time was criticised for not supporting other providers. Things have moved on in the four and a half years since I wrote the script, and external support for other email accounts is now available via the em...
  4. Martineau

    Web History Reporting and Management (Traffic Analyzer/Aiprotection Monitor)

    Running the script with no arguments defaults to filtering records for the current hour for 'today' e.g. sh /jffs/scripts/Traffic*.sh Processing '/jffs/.sys/TrafficAnalyzer/TrafficAnalyzer.db' database....please wait! (TrafficAnalyzer_Report.sh): 28463 v1.15 Traffic Analyzer starting...
  5. Martineau

    Web History Reporting and Management (Traffic Analyzer/Aiprotection Monitor)

    You could try running the report (in debug mode) to calculate the usage for the 24hour period sh -x ./TrafficAnalyzer_Report.sh date=2023/06/27 time= Then cut'n' paste say the last 50 lines of the output e.g. + nvram get tmp_RX_TOTAL + RX_TOTAL=42209946 + nvram unset tmp_RX_TOTAL + nvram...
  6. Martineau

    Web History Reporting and Management (Traffic Analyzer/Aiprotection Monitor)

    It has been a while since I last reviewed these scripts. I have uploaded new versions of both the TrafficAnalyzer and WebHistory scripts e.g. Web History Report so they may be fixed? P.S. Which router and firmware are you using?
  7. Martineau

    In Asuswrt, how to display the log timestamp with nano seconds?

    The BusyBox version of date on Asus routers BusyBox v1.25.1 (2023-05-07 12:35:01 EDT) multi-call binary. Usage: date [OPTIONS] [+FMT] [TIME] Display time (using +FMT), or set time [-s,--set] TIME Set time to TIME -u,--utc Work in UTC (don't convert to local time)...
  8. Martineau

    Is it Possible to limit OpenVPN connect time?

    No problem, but clearly my scripting skills are rapidly dwindling (if I ever had any) having been embarrassed by the lack of a couple of couple of space characters. :rolleyes: Note: I may try and revisit the OpenVPN Management interface to see if the OpenVPN kill command can target a specific...
  9. Martineau

    Is it Possible to limit OpenVPN connect time?

    Whoops! - :oops: there is a typo in this line (there is a missing space character before the first ']') if [ -f /jffs/configs/BlockedVPN${VPN_SERVER_ID}_Users] && [ -n "$(grep -o "$username" /jffs/configs/BlockedVPN${VPN_SERVER_ID}_Users)" ];then # Patch Alpha2 I have now patched the script...
  10. Martineau

    Is it Possible to limit OpenVPN connect time?

    300 secs for 5 mins. Clearly for testing (when I was able) I set the limit to 1 min and that's the version that I had saved to my laptop :oops: )
  11. Martineau

    Is it Possible to limit OpenVPN connect time?

    You will need to create a repository in which to store OVPN Server usernames that you have deemed need to be punished for violating session time limits. NVRAM can be a scarce/limited resource so rather than save the usernames in NVRAM, it is probably better to use /jffs (or /tmp if you don't...
  12. Martineau

    Is it Possible to limit OpenVPN connect time?

    Whoops....my bad! :eek: The script was altered to allow you to pass a list of users to be monitored.... e.g. the following would successfully monitor both users and restart the server if ONE was found to have exceeded the session duration limit. /jffs/scripts/LimitOVPNSession.sh...
  13. Martineau

    Unbound Rarely see thread about Unbound

    https://www.snbforums.com/threads/unbound_manager-manager-installer-utility-for-unbound-recursive-dns-server-general-questions-discussion-thread-2.67968/post-738901
  14. Martineau

    Is it Possible to limit OpenVPN connect time?

    I have successfully used init-start for many years for creating cron jobs but services-start is also a valid choice i.e. both are only called once during the boot process so duplicates are not created. You may delete init-start if it is empty You can dynamically control the MAX users from the...
  15. Martineau

    Is it Possible to limit OpenVPN connect time?

    Did you alter the script to hardcode the USERNAMEs to monitor as instructed in post #13 i.e. https://www.snbforums.com/threads/is-it-possible-to-limit-openvpn-connect-time.85159/post-844119 Issue the following command to see if you get the same response grep -F '"$USERNAME" == "$LIMIT_USER"'...
  16. Martineau

    Is it Possible to limit OpenVPN connect time?

    Did you alter the script to hardcode the USERNAMEs to monitor as instructed in post #13 i.e. https://www.snbforums.com/threads/is-it-possible-to-limit-openvpn-connect-time.85159/post-844119 Issue the following command to see if you get the same response grep -F '"$USERNAME" == "$LIMIT_USER"'...
  17. Martineau

    Is it Possible to limit OpenVPN connect time?

    As shown in post #10 you need to specify 3 args to the script to tell it to perform the desired action. cru a LimitOVPNSession "*/1 * * * * /jffs/scripts/LimitOVPNSession.sh xxxxxx enforce server" You will see a line in syslog if the 300 sec time-limit has been exceeded by a client, together...
  18. Martineau

    Is it Possible to limit OpenVPN connect time?

    It happens No, the script args 'enforce server' will auto restart the server so only one cron job is required for any number of defined users. If you manually run init-start does it show any errors? No
  19. Martineau

    Is it Possible to limit OpenVPN connect time?

    Did you incorrectly copy'n'paste? The first line of any router shell script should normally be #!/bin/sh or if written in Bash #!/full_path_to/bash etc. Did you make the init-start script executable? i.e. check the attributes of all files in the directory ls -l /jffs/scripts It would be...
Top