Skip to content

Commit

Permalink
Allow user to set crond's log level
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel Leroy committed Dec 20, 2022
1 parent 0ef8d39 commit 2ce3379
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ services:
### Environment variables
| Variable | Meaning | Example |
|----------------|---------------------------------------------------------------------------|---------------------------------|
| `TZ` | Timezone | `TZ=Europe/Paris` |
| `CRON` | Cron schedule expression (tip: use [crontab.guru](https://crontab.guru/)) | `CRON=20 4 * * *` |
| `MAC_ADDRESS` | Mac address of the computer you want to wake up | `MAC_ADDRESS=AA:BB:CC:DD:EE:FF` |
| `BROADCAST_IP` | IP address of the subnet to broadcast the magic packet to | `BROADCAST_IP=192.168.0.255` |
| Variable | Meaning | Example |
|------------------|---------------------------------------------------------------------------|---------------------------------|
| `TZ` | Timezone | `TZ=Europe/Paris` |
| `CRON` | Cron schedule expression (tip: use [crontab.guru](https://crontab.guru/)) | `CRON=20 4 * * *` |
| `MAC_ADDRESS` | Mac address of the computer you want to wake up | `MAC_ADDRESS=AA:BB:CC:DD:EE:FF` |
| `BROADCAST_IP` | IP address of the subnet to broadcast the magic packet to | `BROADCAST_IP=192.168.0.255` |
| `CRON_LOG_LEVEL` | Log level of `crond`. Goes from 0 (most verbose) to 8 (default) | `CRON_LOG_LEVEL=2` |
3 changes: 2 additions & 1 deletion start-script.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh

echo "$CRON /app/wol-script" >> /var/spool/cron/crontabs/root
/usr/sbin/crond -f -l 2 -L /dev/stdout
: "${CRON_LOG_LEVEL:=8}"
/usr/sbin/crond -f -l $CRON_LOG_LEVEL -L /dev/stdout

0 comments on commit 2ce3379

Please sign in to comment.