Fix crontab generation
authorJason Stephenson <jason@sigio.com>
Tue, 4 Dec 2018 20:55:43 +0000 (15:55 -0500)
committerJason Stephenson <jason@sigio.com>
Tue, 4 Dec 2018 20:55:43 +0000 (15:55 -0500)
The old cat with heredoc wasn't working to build the crontab properly
on Xenial in buildeg.sh.  We change it to use a sed command instead.
This also gives us a little more control over where the SHELL variable
goes in the output file.

Signed-off-by: Jason Stephenson <jason@sigio.com>
scripts/postbuild.sh

index 46b2b5d..fa3bb7a 100755 (executable)
@@ -194,11 +194,9 @@ osrf_control --localhost --start-all
 sudo systemctl restart apache2
 
 # Setup crontab
-cat -  Open-ILS/examples/crontab.example > /home/opensrf/crontab <<EOF_CRONTAB
-# Fix shell as master crontab example doesn't ensure we are using bash
-SHELL=/bin/bash
-
-EOF_CRONTAB
+sed -e '/^OPENILS/i\\
+SHELL      = /bin/bash' \
+/home/opensrf/Evergreen/Open-ILS/examples/crontab.example > /home/opensrf/crontab
 crontab /home/opensrf/crontab
 
 echo "Complete at: \$(date)"