Parse and serialize rules.json
TL;DR: - Write FromJSON instances to decode rules.json file - Prefer Text to String and use the OverloadedStrings language extension - Read /etc/hosts and append the serialized rules.json to the end Notes: - I can remove some of the FromJSON instances and use GHC Generics to define them for me. TODO: - Define the systemd timer unit for this to run - Ensure script can run with root privileges
This commit is contained in:
parent
059af12bea
commit
75595b0126
5 changed files with 216 additions and 110 deletions
|
|
@ -5,9 +5,9 @@
|
|||
"www.facebook.com",
|
||||
"twitter.com",
|
||||
"www.twitter.com",
|
||||
"youtube.com"
|
||||
"www.youtube.com"
|
||||
"instagram.com"
|
||||
"youtube.com",
|
||||
"www.youtube.com",
|
||||
"instagram.com",
|
||||
"www.instagram.com"
|
||||
],
|
||||
"allowed": []
|
||||
|
|
@ -18,8 +18,10 @@
|
|||
],
|
||||
"allowed": [
|
||||
{
|
||||
"day": "Tuesday",
|
||||
"timeslots": []
|
||||
"day": "Sunday",
|
||||
"timeslots": [
|
||||
"18:35-18:39"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue