Merge pull request #9 from chillout2k/devel

ENV parsing is more compliant now
This commit is contained in:
Dominik Chilla 2020-11-11 22:57:45 +01:00 committed by GitHub
commit 3c76c029f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,3 @@
#!/bin/sh
# serialize ENV for cron-jobs
TMP_FILE=/tmp/cron_env
OUT_FILE=/cron_env
@ -10,6 +8,10 @@ while read -r line; do
if [ $? = 0 ]; then
continue
fi
if ! [[ ${line} =~ ^[a-zA-Z0-9_]+=.+$ ]]; then
echo "$0: Messed up ENV: ${line}"
continue
fi
echo "${line}" | grep -q "\s"
if [ $? = 0 ]; then
# double-quote blank separated values for $(export)
@ -23,5 +25,4 @@ while read -r line; do
done <"${TMP_FILE}"
unlink "${TMP_FILE}"
# start crond in background
/usr/sbin/crond -b -S
/usr/sbin/crond -b -S