-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.go
48 lines (37 loc) · 1.03 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"github.com/omerxx/go-blocksite/block"
"github.com/omerxx/go-blocksite/config"
"github.com/omerxx/go-blocksite/state"
"github.com/txn2/txeh"
)
// // TODO
// func backupHostsFile() {}
// // TODO
// func createStateIfdoesntExist() {}
// // TODO
// func showBlockList() {}
// // TODO
// func unblockAllAndSave() {}
// // TODO
// func blockFromSavedFile() {}
// // TODO
// func setSchedule() {}
// // TODO
// func generateSocialBlcokList() {}
// // TODO
// func generateMediaBlockList() {}
func main() {
configuration := config.ReadConfig()
config.RunPreflightChecks(configuration)
hosts, err := txeh.NewHostsDefault()
if err != nil {
panic(err)
}
blacklistConfiguredSites := []string{}
blacklistConfiguredSites = config.HandleOptions(blacklistConfiguredSites, configuration)
blacklistConfiguredSites = block.BlockSites(hosts, blacklistConfiguredSites)
state.AddMultiple(blacklistConfiguredSites)
cleanedTargets := block.CleanBlocks(hosts, blacklistConfiguredSites)
state.RemoveMultiple(cleanedTargets)
}