This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
access_restrictions [2023/05/10 19:58] – -format-bullet Field 4 days of week hogwild | access_restrictions [2023/10/26 17:20] (current) – [Scripting Access Restrictions] -format hogwild | ||
---|---|---|---|
Line 2: | Line 2: | ||
Access Restriction rules are coded as strings separated by pipe ( | ) symbols. These are stored in NVRAM as variables named //rrule0//, //rrule1//, //rrule2// and so on. | Access Restriction rules are coded as strings separated by pipe ( | ) symbols. These are stored in NVRAM as variables named //rrule0//, //rrule1//, //rrule2// and so on. | ||
+ | |||
+ | \\ | ||
To see what's in the first rule, we can issue the following command at a FreshTomato shell prompt: | To see what's in the first rule, we can issue the following command at a FreshTomato shell prompt: | ||
Line 27: | Line 29: | ||
**Field 1:** indicates whether the rule is currently enabled (1) or disabled (0). | **Field 1:** indicates whether the rule is currently enabled (1) or disabled (0). | ||
- | **Field 2:** specifies the start time, (time to start applying this rule), in minutes elapsed since midnight. In this case, start time is 5:40 AM, so the router should enforce this rule starting at 9:00 AM. | + | **Field 2:** specifies the start time, (time to start applying this rule), in minutes elapsed since midnight. |
- | **Field 3:** is the end time, (time to stop applying | + | In this case, start time is 5:40 AM, so the router should enforce |
- | **Field 4:** specifies | + | **Field 3:** is the end time, (time to stop applying this rule). This is coded similarly to the start time. |
+ | |||
+ | Both the second and third fields will be -1 if you select the //‘All Day’// option in the Access Restrictions menu. | ||
+ | |||
+ | **Field 4:** specifies on which days the rule will be applied. | ||
+ | |||
+ | It is coded in binary: | ||
* 1 = Sunday | * 1 = Sunday | ||
* 2 = Monday | * 2 = Monday | ||
- | * 3=Tuesday | + | * 4 = Tuesday |
- | * 4=Wednesday | + | * 8 = Wednesday |
- | * 5=Thursday | + | * 16 = Thursday |
- | * 6=Saturday | + | * 32 = Friday |
- | * 6=Sunday | + | * 64 = Saturday |
- | For multiple days, add the corresponding numbers for each day. In the above example the fourth field is 62 which is equal to 2+4+8+16+32 . This means the rule should be active on Mon, Tue, Wed, Thu, and Fri. In other words, only on week days. If you had checked the option | + | \\ |
+ | |||
+ | For multiple days, simply | ||
+ | |||
+ | In the above example, the fourth field is 62, which is equal to 2 + 4 + 8 + 16 + 32 . This means the rule should be active on Mon, Tue, Wed, Thu, and Fri. That is, only on weekdays. If you had checked the // | ||
**Field 5:** shows the IP or MAC Address range on your network for which the rule should be applied. | **Field 5:** shows the IP or MAC Address range on your network for which the rule should be applied. | ||
- | **Field 6:** has the // | + | **Field 6:** has the // |
- | **Field 7:** contains the Domains/ | + | **Field 7:** contains the Domains/ |
- | **Field 8:** stores | + | In the example above, domain names ending with " |
+ | |||
+ | **Field 8:** stores a binary coded value if ActiveX, Flash or Java are set to be blocked. | ||
+ | |||
+ | * A "1" | ||
+ | * A "2" | ||
+ | * A "4" | ||
+ | |||
+ | \\ | ||
- | **Field 9:** stores the name that you gave to the above rule. | + | **Field 9:** stores the name that you gave to the rule being edited. |
- | | + | \\ Now that we have a basic sense of how Access Restriction rules work, we can write shell scripts to control the rules. |
\\ | \\ | ||
Line 95: | Line 115: | ||
done | done | ||
</ | </ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | If you have JFFS enabled in FreshTomato, | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
===== Credits ===== | ===== Credits ===== |