Commit 88b1997e authored by David Morley's avatar David Morley Committed by GitHub
Browse files

Fixpullnbackup (#79)

* fixes for issue 63

* example

* add install note

* quotes

* Fixpullnbackup fixes (#81)

* Fix a few warnings and correct data type for boolean variables.

* Boolean data type for $dnssec, $signup and $ipv6.
Use only $signup instead of also $registrations_open.
Use only $outputssl instead of also $outputresults.

* Weird PSQL requires boolean to be passed as int, else it gives an error: `invalid input syntax for type boolean: ""`

* Remove unnecessary unsets.

* Remove unnecessary foreach loop.

* Fix alignment (visual only).
[skip ci]

* To determine if the request was successful, check for a valid JSON to parse instead of searching the response for a string.

* Rename query result variables to prevent breaking the main loop.

* Add a small debug function to make debug output cleaner and easier to use.

* Add debug flag. Browser: `pull.php?debug`, CLI: `pull.php debug`

* Remove old code that prevents markers from overlapping each other, as mapbox nicely separates them.
parent b5537788
...@@ -42,6 +42,7 @@ psql -u podupuser podupdb < db/tables.sql ...@@ -42,6 +42,7 @@ psql -u podupuser podupdb < db/tables.sql
Edit `config.php` to add your DB and file settings. Edit `config.php` to add your DB and file settings.
touch add.log in location you configured in config.php touch add.log in location you configured in config.php
run db/pull.sh manually or with cron to update your data
============================ ============================
......
This diff is collapsed.
WGET="/usr/bin/wget" SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
if [ -s /tmp/index.google ];then if [ -s /tmp/index.google ];then
echo "already running die" echo "already running die"
exit; exit;
...@@ -6,8 +7,7 @@ else ...@@ -6,8 +7,7 @@ else
echo "Checking for internet"; echo "Checking for internet";
fi fi
$WGET -q --tries=10 --timeout=15 http://www.google.com -O /tmp/index.google wget -q --tries=2 --timeout=15 http://www.google.com -O /tmp/index.google
# &> /dev/null
sleep 2 sleep 2
if [ ! -s /tmp/index.google ];then if [ ! -s /tmp/index.google ];then
...@@ -16,8 +16,8 @@ if [ ! -s /tmp/index.google ];then ...@@ -16,8 +16,8 @@ if [ ! -s /tmp/index.google ];then
exit; exit;
else else
echo "Pulling in new pod data"; echo "Pulling in new pod data";
cd /var/www/poduptime/db cd "$SCRIPT_DIR"
php pull.php debug=1 php pull.php
touch last.data touch last.data
php backup.php php backup.php
rm /tmp/index.google rm /tmp/index.google
......
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