This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
access_restrictions [2023/05/10 20:11] – [Scripting Access Restrictions] condense, bullet Field 8 options 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 12: | Line 14: | ||
\\ | \\ | ||
- | |||
- | \\ | ||
The returned string might look something like this: | The returned string might look something like this: | ||
Line 43: | Line 43: | ||
* 1 = Sunday | * 1 = Sunday | ||
* 2 = Monday | * 2 = Monday | ||
- | * 3 = Tuesday | + | * 4 = Tuesday |
- | * 4 = Wednesday | + | * 8 = Wednesday |
- | * 5 = Thursday | + | * 16 = Thursday |
- | * 6 = Saturday | + | * 32 = Friday |
- | * 7 = Sunday | + | * 64 = Saturday |
- | For multiple days, add the corresponding numbers for each day. | + | \\ |
+ | |||
+ | 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 // | + | 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. | ||
Line 66: | Line 68: | ||
* A " | * A " | ||
* A " | * A " | ||
+ | |||
+ | \\ | ||
**Field 9:** stores the name that you gave to the rule being edited. | **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. | + | \\ Now that we have a basic sense of how Access Restriction rules work, we can write shell scripts to control the rules. |
\\ | \\ | ||
Line 111: | Line 115: | ||
done | done | ||
</ | </ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | If you have JFFS enabled in FreshTomato, | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||