Compare commits

...

4 Commits

Author SHA1 Message Date
Andros Fenollosa
d91ab1a426 Warinings were added for MacOS 2025-11-24 09:07:44 +01:00
Andros Fenollosa
7d156ff2f3 Merge pull request #32 from andremarzano/master
Crontab Fix MacOS
2025-11-24 09:05:08 +01:00
andremarzano
e73f7312af Implement terminal color detection
Add terminal color support based on output type
2025-11-21 16:14:10 -03:00
andremarzano
d2711cf469 Enhance crontab setup instructions for MacOS
Updated crontab instructions for MacOS users to include PATH and TERM settings.
2025-11-21 16:12:31 -03:00
2 changed files with 18 additions and 5 deletions

View File

@@ -110,7 +110,7 @@ But if you get a response with HTML, it means that the domain is not blocked (ma
Open your `cron`. Open your `cron`.
``` bash ``` bash
crontab -e sudo crontab -e
``` ```
Add the following line at the end. Add the following line at the end.
@@ -119,13 +119,20 @@ Add the following line at the end.
@daily maza update @daily maza update
``` ```
Some users have reported problems creating daemons on MacOS. Fixed with `TERM=dumb`. **Note for macOS users:** Cron runs with a minimal environment. You need to set the PATH to include all required binaries and `TERM=dumb` to prevent color output errors:
``` ```
PATH=/bin:/usr/bin:/usr/local/bin:/opt/homebrew/bin
TERM=dumb TERM=dumb
@daily maza update @daily maza update
``` ```
The PATH includes:
- `/bin` - bash
- `/usr/bin` - env
- `/usr/local/bin` - maza
- `/opt/homebrew/bin` - gsed (Apple Silicon) or adjust for Intel Macs if needed
## 🔪 Uninstall ## 🔪 Uninstall
``` bash ``` bash

12
maza
View File

@@ -11,9 +11,15 @@ THIS_OS=$(uname -mrs)
PROGNAME=$(basename "$0") PROGNAME=$(basename "$0")
[[ -z "${XDG_CONFIG_HOME}" ]] && CONFIG=$HOME/.config/maza/ || CONFIG=$XDG_CONFIG_HOME/maza/ [[ -z "${XDG_CONFIG_HOME}" ]] && CONFIG=$HOME/.config/maza/ || CONFIG=$XDG_CONFIG_HOME/maza/
HOST_FILE=/etc/hosts HOST_FILE=/etc/hosts
COLOR_RED=$(tput setaf 1) if [ -t 1 ]; then
COLOR_GREEN=$(tput setaf 2) COLOR_RED=$(tput setaf 1 2>/dev/null || true)
COLOR_RESET=$(tput sgr0) COLOR_GREEN=$(tput setaf 2 2>/dev/null || true)
COLOR_RESET=$(tput sgr0 2>/dev/null || true)
else
COLOR_RED=""
COLOR_GREEN=""
COLOR_RESET=""
fi
LIST="list" LIST="list"
LIST_DNSMASQ="dnsmasq.conf" LIST_DNSMASQ="dnsmasq.conf"
CUSTOM_DOMAINS="custom-domains" CUSTOM_DOMAINS="custom-domains"