commit 7f1149e7cd838f6ca16adb152e08fd4565cb97fe parent a154f4212367d15674b9520ad4a717b2e18dc1fb Author: Fred Großkopf <fred@kuandu.systems> Date: Wed, 29 Apr 2026 10:53:11 +0200 Updates install.sh sets up cronjob Diffstat:
| M | install.sh | | | 17 | +++++++++++++++++ |
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/install.sh b/install.sh @@ -60,6 +60,22 @@ setup_logrotation() { fi } +setup_cron() { + cron_line="*/5 * * * * $BIN_DIR/gitpages-update.sh" + + if [ ! -f "$BIN_DIR/gitpages-update.sh" ]; then + error "Cannot setup cron: $BIN_DIR/gitpages-update.sh not found." + fi + + if crontab -u gitpages -l 2> /dev/null | grep -qF "$cron_line"; then + log "Cronjob already exists and is configured correctly." + else + # Just echo the line into the crontab command + echo "$cron_line" | crontab -u gitpages - + log "Cronjob set for gitpages user." + fi +} + main() { [ $# -ne 1 ] && usage GIT_USER="$1" @@ -83,6 +99,7 @@ main() { install_scripts setup_config setup_logrotation + setup_cron log "Installation complete." }