X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=crontab.d%2Fupdate.sh;h=05519bb4a14b0b901bc58f585954673e670de73a;hb=e705d5d7358e42a35dba8994f0ea4c445e4f0c81;hp=ca08be1c080a5b18112fed33f602a6f6cd220280;hpb=a29bfecac4e3aaa9b47e213d6df04ff247871dce;p=config%2Fdotfiles.git diff --git a/crontab.d/update.sh b/crontab.d/update.sh index ca08be1..05519bb 100755 --- a/crontab.d/update.sh +++ b/crontab.d/update.sh @@ -52,6 +52,9 @@ echo "###################################" >> "$CRONTAB" echo >> "$CRONTAB" echo "# It was generated from '$DIRECTORY/*' on `date -R`." >> "$CRONTAB" +# Enforce C sort order ($LANGUAGE is a GNU extension). +LC_ALL=C +LANGUAGE=C NO_MATCHES= for file in "$DIRECTORY"/crontab.*; do @@ -67,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