X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=crontab.d%2Fupdate.sh;h=05519bb4a14b0b901bc58f585954673e670de73a;hb=21ad1999eaa420b2a03585b086effce0215a5ef4;hp=ebffb990bfa061479bf25553efd764ed48279c2d;hpb=749d4711a8d98f6102668dc3e186c639f7f50db2;p=config%2Fdotfiles.git diff --git a/crontab.d/update.sh b/crontab.d/update.sh index ebffb99..05519bb 100755 --- a/crontab.d/update.sh +++ b/crontab.d/update.sh @@ -70,12 +70,15 @@ for file in "$DIRECTORY"/crontab.*; do echo >> "$CRONTAB" echo "## $file:" >> "$CRONTAB" + # Strip licenses, multiple empty lines and fix $HOME variables in PATH + # (cron doesn't expand variables). START_REGEX='^# This [a-zA-Z]* is free software: you can redistribute it' END_REGEX='^# along with this [a-zA-Z]*. If not, see <[^>]*>\.' < "$file" sed -e "/$START_REGEX/,/$END_REGEX/ d" \ -e "/^#[ ]*$/ d" \ -e "/^# Copyright (C) [0-9][0-9]* / d" \ | cat --squeeze-blank \ + | sed "/^PATH/ s:\$HOME:$HOME:g" \ >> "$CRONTAB" done