Commit 41bc19bd authored by David Morley's avatar David Morley

even smarter

parent 046e8a10
......@@ -32,11 +32,11 @@ $adminemail = '';
//DNS server for dnssec testing. 1.1.1.1 tests the best
$dnsserver = '';
//CA for curl to use - full file path (pull.sh will update monthly to this directory as cacert.pem)
//CA for curl to use - full file path (pull.sh will update this monthly)
$cafullpath = '';
//Mapbox.com API key. https://www.mapbox.com/help/how-access-tokens-work/
$mapboxkey = '';
//Geolite2-city database file in mmdb format - full file path (pull.sh will update monthly to this directory as GeoLite2-City.mmdb)
//Geolite2-city database file in mmdb format - full file path (pull.sh will update this monthly)
$geoip2db = '';
\ No newline at end of file
......@@ -46,13 +46,15 @@ if [ "$HOUR" = 23 ] || [ "$@" = "init" ]; then
fi
if [ "$DAY" = 23 ] || [ "$@" = "init" ]; then
printf "%s" "Updating CA..."
if curl -Lss https://curl.haxx.se/ca/cacert.pem -o ../cacert.pem; then
CACERT_FILE="$(php -r "include __DIR__ . '/../config.php'; echo \$cafullpath;")"
if curl -Lss https://curl.haxx.se/ca/cacert.pem -o "$CACERT_FILE"; then
echo "$HAPPY"
else
echo "$SAD"
fi
printf "%s" "Updating GeoIP2 DB..."
if funzip <(curl -Lss http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz) > ../GeoLite2-City.mmdb; then
GEODB_FILE="$(php -r "include __DIR__ . '/../config.php'; echo \$geoip2db;")"
if funzip <(curl -Lss http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz) > "$GEODB_FILE"; then
echo "$HAPPY"
else
echo "$SAD"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment