我一直在尝试设置 Launchd 以在周一至周五上午 9 点至下午 3 点之间阻止 osX 10.12.2 上 Chrome 的多个网站
我将 launchd 设置为 cp /etc/hosts_BLOCKED_sites.txt /etc/hosts
Launchd 似乎正在正确复制文件。
$ ls -la /etc/hosts
-rw------- 1 root wheel 619 Dec 29 09:00 /etc/hosts
Run Code Online (Sandbox Code Playgroud)
$ sudo cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Blocked sites redirected to 0.0.0.0
127.0.0.1 reddit.com
127.0.0.1 www.reddit.com
127.0.0.1 …
Run Code Online (Sandbox Code Playgroud)