/etc/cron.daily/custombuild: line 6: syntax error near unexpected token `fi'

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,358
Location
www.poralix.com
Hello,

probably very rare case, but still:

Code:
#Cronjob Settings
cron=[COLOR=#008000]yes[/COLOR]
cron_frequency=daily
[email protected]
notifications=[COLOR=#ff0000]no[/COLOR]
da_autoupdate=[COLOR=#ff0000]no[/COLOR]
updates=[COLOR=#ff0000]no[/COLOR]
webapps_updates=[COLOR=#ff0000]no[/COLOR]

brings /etc/cron.daily/custombuild to the following view:

Code:
#!/bin/sh
cd /usr/local/directadmin/custombuild
./build update >/dev/null 2>&1
AVAIL_UPDATES="`./build versions_nobold | grep -c -e 'update is available.'`"
if [ "${AVAIL_UPDATES}" -gt 0 ]; then
fi
exit 0;

that of course drops an error:

Code:
/etc/cron.daily/custombuild: line 6: syntax error near unexpected token `fi'
/etc/cron.daily/custombuild: line 6: `fi'

Could you please fix it, even adding

Code:
echo "" > /dev/null

between then and fi
 
Thanks for the report.
Indeed it would be rare, but a bug regardless.
I could see it happen if an Admin wanted their data to be downloaded and ready for the next time the log ... but who don't need to be notified of the new versions.

I've changed the code in CB 1.2 and 2.0 so that it it would look like this in that case:
Code:
#!/bin/shcd /usr/local/directadmin/custombuild
./build update >/dev/null 2>&1
exit 0;
John
 
Back
Top