|
4 | 4 | # |
5 | 5 | # Original Creation Date: 2023-Oct-01 by @ExtremeFiretop. |
6 | 6 | # Official Co-Author: @Martinski W. - Date: 2023-Nov-01 |
7 | | -# Last Modified: 2024-Aug-15 |
| 7 | +# Last Modified: 2024-Aug-16 |
8 | 8 | ################################################################### |
9 | 9 | set -u |
10 | 10 |
|
@@ -147,7 +147,7 @@ theLGExitStr="${GRNct}e${NOct}=Exit to Log Options Menu" |
147 | 147 | routerLoginFailureMsg="Please try the following: |
148 | 148 | 1. Confirm that you are *not* already logged into the router webGUI using a web browser. |
149 | 149 | 2. Check that the \"Enable Access Restrictions\" option from the webGUI is *not* set up |
150 | | - to restrict access to the router webGUI from the current network client you're using. |
| 150 | + to restrict access to the router webGUI from the router's IP address. |
151 | 151 | 3. Confirm your password via the \"Set Router Login Credentials\" option from the Main Menu." |
152 | 152 |
|
153 | 153 | [ -t 0 ] && ! tty | grep -qwi "NOT" && isInteractive=true |
@@ -619,6 +619,7 @@ readonly PRODUCT_ID="$(_GetRouterProductID_)" |
619 | 619 |
|
620 | 620 | ##FOR TESTING/DEBUG ONLY## |
621 | 621 | ##readonly PRODUCT_ID="TUF-AX3000_V2" |
| 622 | +##readonly MODEL_ID="$PRODUCT_ID" |
622 | 623 | ##FOR TESTING/DEBUG ONLY## |
623 | 624 |
|
624 | 625 | readonly FW_FileName="${PRODUCT_ID}_firmware" |
@@ -2595,6 +2596,27 @@ _GetLoginCredentials_() |
2595 | 2596 | local oldPWSDstring thePWSDstring |
2596 | 2597 | local loginCredsENC loginCredsDEC |
2597 | 2598 |
|
| 2599 | + # Check if Access Restrictions are enabled # |
| 2600 | + local accRestriction restrictRuleList routerIP ruleMatch |
| 2601 | + accRestriction="$(nvram get enable_acc_restriction)" |
| 2602 | + |
| 2603 | + if [ "$accRestriction" = "1" ]; then |
| 2604 | + # Get the restrict_rulelist and the router IP address # |
| 2605 | + restrictRuleList="$(nvram get restrict_rulelist)" |
| 2606 | + routerIP="$(nvram get lan_ipaddr)" |
| 2607 | + |
| 2608 | + # Check if the router IP is followed by >1 or >3 |
| 2609 | + ruleMatch="$(echo "$restrictRuleList" | grep -oE "${routerIP}>[13]")" |
| 2610 | + |
| 2611 | + if [ -z "$ruleMatch" ] || echo "$restrictRuleList" | grep -qE "${routerIP}>2"; then |
| 2612 | + printf "${REDct}WARNING: Access Restrictions are enabled!${NOct}\n" |
| 2613 | + printf "${REDct}Please add the routers IP with 'Web UI' access under 'Administration -> System -> Access restriction list' to permit login to the WebUI.${NOct}\n" |
| 2614 | + printf "${REDct}The alternative option is to disable 'Access restrictions' if unrequired.${NOct}\n" |
| 2615 | + _WaitForEnterKey_ |
| 2616 | + return 1 |
| 2617 | + fi |
| 2618 | + fi |
| 2619 | + |
2598 | 2620 | # Get the Username from NVRAM # |
2599 | 2621 | userName="$(nvram get http_username)" |
2600 | 2622 |
|
|
0 commit comments