forked from axiom-team/astrXbian
SHELL=/bin/bash
This commit is contained in:
parent
c3ac260137
commit
9d0b30b0ee
|
@ -19,13 +19,18 @@ echo '
|
||||||
# Get crontab
|
# Get crontab
|
||||||
crontab -l > /tmp/mycron
|
crontab -l > /tmp/mycron
|
||||||
# Remove any previous line containing "cron_MINUTE"
|
# Remove any previous line containing "cron_MINUTE"
|
||||||
awk -i inplace -v rmv="cron_MINUTE" '!index($0,rmv)' /tmp/mycron && echo "Astroport cron was there"
|
awk -i inplace -v rmv="cron_MINUTE" '!index($0,rmv)' /tmp/mycron
|
||||||
# DOUBLE CHECK (awk = nawk or gawk -i ?)
|
# DOUBLE CHECK (awk = nawk or gawk -i ?)
|
||||||
crontest=$(cat /tmp/mycron | grep -F 'cron_MINUTE')
|
crontest=$(cat /tmp/mycron | grep -F 'cron_MINUTE')
|
||||||
# ADD cron_MINUTE.sh TO cron ?
|
# ADD cron_MINUTE.sh TO cron ?
|
||||||
if [[ ! $crontest ]]; then
|
if [[ ! $crontest ]]; then
|
||||||
# NOT LOGGING TO FILE >> /tmp/astroport.log (TO MUCH DATA)
|
# NOT LOGGING TO FILE >> /tmp/astroport.log (TO MUCH DATA)
|
||||||
echo "* * * * * $MY_PATH/../cron_MINUTE.sh 2>&1>/dev/null" >> /tmp/mycron && crontab /tmp/mycron \
|
rm -f /tmp/newcron
|
||||||
|
[[ ! $(cat /tmp/mycron | grep -F 'SHELL') ]] && echo "SHELL=/bin/bash" >> /tmp/newcron
|
||||||
|
[[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron
|
||||||
|
cat /tmp/mycron >> /tmp/newcron
|
||||||
|
echo "* * * * * $MY_PATH/../cron_MINUTE.sh 2>&1>/dev/null" >> /tmp/newcron
|
||||||
|
crontab /tmp/newcron
|
||||||
else
|
else
|
||||||
echo "No operation needed. Your crontab is: " && crontab -l
|
echo "No operation needed. Your crontab is: " && crontab -l
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue