🕐 Scheduled Blocking Mode
+
This mode automatically blocks the app during specified times on specific days. The system checks conditions every minute to enable or disable blocking as needed.
Setup Instructions:
- Download the script and save it (e.g.,
messages_blocker.sh)
- Make it executable:
chmod +x messages_blocker.sh
- If you didn't upload a school_days.txt file:
💡 Tip: Use the School Day Calendar Generator to create this file!
It generates a properly formatted school_days.txt with all your selected dates.
After downloading, navigate to the folder containing the file and move it to /usr/local/etc/ using:
sudo mv school_days.txt /usr/local/etc/school_days.txt
- Run the setup script with sudo:
sudo ./messages_blocker.sh
Note: If you uploaded a school_days.txt file or provided IP addresses, they will be automatically included in the script. You can edit these files later at /usr/local/etc/.
What it creates:
- Blocking daemon - continuously terminates the app when conditions are met
- Checker daemon - runs every 60 seconds to evaluate blocking conditions
- Master checker script - contains all the blocking logic
- School days file - list of dates when blocking should occur
- School IP addresses file - list of locations where blocking should occur
- Log file at
/var/log/[appname]_check.log
- Uninstaller script for easy removal
How it works:
The checker daemon evaluates conditions every minute. When all conditions are met (correct time, school day, at school IP), it loads the blocking daemon. When any condition fails, it unloads the blocking daemon. This ensures blocking works even after the computer wakes from sleep or changes networks.
To remove/uninstall:
Run the uninstaller script that was created during setup:
sudo /usr/local/bin/uninstall_[appname]_blocker.sh
📝 Notes
- These scripts require sudo/administrator privileges to run
- The blocking works by continuously killing the app process - the app cannot be opened while blocking is active
- Make sure you have the correct app name (it's case-sensitive)
- Scheduled Blocking mode only occurs when all conditions are met: correct time, school day, and at specified IP address
Check if blocking is active:
To verify if an app is currently being blocked:
sudo launchctl list | grep com.block.[appname]
Replace [appname] with your app name (e.g., com.block.messages, com.block.safari). If you see output, blocking is active. No output means blocking is not running.
Check if checker is running:
To verify the checker daemon is running:
sudo launchctl list | grep com.check.[appname]
This should always show output if the system is installed correctly.
View logs (Scheduled Blocking only):
To see when blocking was enabled/disabled:
tail -f /var/log/[appname]_check.log
Replace [appname] with your app name (e.g., messages_check.log, safari_check.log). Logs only appear when blocking state changes.