AllskyTeam / allsky

A Raspberry Pi operated Wireless Allsky Camera
MIT License
1.17k stars 181 forks source link

Allow "eval" with settings file #3610

Closed EricClaeys closed 4 months ago

EricClaeys commented 4 months ago

Some scripts, like check_allsky.sh, do a lot of calls to settings() to get setting values. Each call reads the settings file which is ok if only a few settings' values are needed, but is very slow with lots of settings. This PR modifies the convertJSON.php script to accept an option that outputs each setting and its value in a way that the "eval" command in bash can set them all at one.

Since it uses the settings name all the scripts that used their own names had to be changed. For example:

DAY_DELAY="$( settings .daydelay )"

now has to use the ${daydelay} variable. This isn't difficult it was just time consuming with lots of names needing to be changed.