Commit e8e4cc40 authored by David Morley's avatar David Morley

little more user friendly

parent 2418bc31
......@@ -12,4 +12,7 @@
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
\ No newline at end of file
along with this program. If not, see <http://www.gnu.org/licenses/>.
This product includes GeoLite2 data created by MaxMind, available from
<a href="http://www.maxmind.com">http://www.maxmind.com</a>.
\ No newline at end of file
......@@ -34,6 +34,7 @@ psql -U podupuser podupdb < db/tables.sql
Edit `config.php` to add your DB and file settings.
touch add.log in location you configured in config.php
start your first run with `db/pull.sh init`
run `db/pull.sh` manually or with cron to update your data
run `db/pull.sh debug` to debug output
......
......@@ -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
//CA for curl to use - full file path (pull.sh will update monthly to this directory as cacert.pem)
$cafullpath = '';
//Mapbox.com API key. https://www.mapbox.com/help/how-access-tokens-work/
$mapboxkey = '';
//GeoIp2 city database file in mmdb format - full file path
//Geolite2-city database file in mmdb format - full file path (pull.sh will update monthly to this directory as GeoLite2-City.mmdb)
$geoip2db = '';
\ No newline at end of file
#!/usr/bin/env sh
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
FLAG_FILE="/tmp/poduptime.pulling"
HOUR=`date +%H`
DAY=`date +%d`
HAPPY=" :-)"
SAD=" :-("
......@@ -24,7 +25,7 @@ if ! wget -q --spider --tries=2 --timeout=15 https://www.google.com; then
fi
echo "$HAPPY"
if [ "$HOUR" = 23 ]; then
if [ "$HOUR" = 23 ] || [ "$@" = "init" ]; then
printf "%s" "Pulling in master versions..."
if php pull-masterversions.php; then
echo "$HAPPY"
......@@ -43,11 +44,19 @@ if [ "$HOUR" = 23 ]; then
else
echo "$SAD"
fi
printf "%s" "Updating CA..."
if wget -q https://curl.haxx.se/ca/cacert.pem -O ../cacert.pem; then
echo "$HAPPY"
else
echo "$SAD"
if [ "$DAY" = 23 ] || [ "$@" = "init" ]; then
printf "%s" "Updating CA..."
if wget -q https://curl.haxx.se/ca/cacert.pem -O ../cacert.pem; then
echo "$HAPPY"
else
echo "$SAD"
fi
printf "%s" "Updating GeoIP2 DB..."
if funzip <(curl -L http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz) > ../GeoLite2-City.mmdb; then
echo "$HAPPY"
else
echo "$SAD"
fi
fi
fi
......
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