Commit 41bc19bd authored by dmorley's avatar dmorley
Browse files

even smarter

parent 046e8a10
...@@ -32,11 +32,11 @@ $adminemail = ''; ...@@ -32,11 +32,11 @@ $adminemail = '';
//DNS server for dnssec testing. 1.1.1.1 tests the best //DNS server for dnssec testing. 1.1.1.1 tests the best
$dnsserver = ''; $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 = ''; $cafullpath = '';
//Mapbox.com API key. https://www.mapbox.com/help/how-access-tokens-work/ //Mapbox.com API key. https://www.mapbox.com/help/how-access-tokens-work/
$mapboxkey = ''; $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 = ''; $geoip2db = '';
\ No newline at end of file
...@@ -46,13 +46,15 @@ if [ "$HOUR" = 23 ] || [ "$@" = "init" ]; then ...@@ -46,13 +46,15 @@ if [ "$HOUR" = 23 ] || [ "$@" = "init" ]; then
fi fi
if [ "$DAY" = 23 ] || [ "$@" = "init" ]; then if [ "$DAY" = 23 ] || [ "$@" = "init" ]; then
printf "%s" "Updating CA..." 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" echo "$HAPPY"
else else
echo "$SAD" echo "$SAD"
fi fi
printf "%s" "Updating GeoIP2 DB..." 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" echo "$HAPPY"
else else
echo "$SAD" 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