forked from freifunk-franken/VPNkeyXchange
add index.php with get_hood_by_id
The routers pull "URL/index.php?lat&log" So index.php is needed. Signed-off-by: Robert Langhammer <rlanghammer@web.de>
This commit is contained in:
parent
c64fcef377
commit
1fae580e59
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
hoodfile=$(grep -l "id\": \"$1\"" hood/* )
|
||||
[ -z $hoodfile ] && echo "no hood $1" && exit
|
||||
|
||||
cat $hoodfile
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
$lat = $_GET['lat'] ?? null;
|
||||
$lo = $_GET['long'] ?? null;
|
||||
$hoodid = $_GET['hoodid'] ?? null;
|
||||
|
||||
if (empty($hoodid)) {
|
||||
if ((!is_numeric($lat)) || (!is_numeric($lo))) {exit("lat/long not numeric!");};
|
||||
$hoodfile = shell_exec("./get_hood.sh $lat $lo");
|
||||
}
|
||||
else {
|
||||
if ((!is_numeric($hoodid))) {exit("hoodid not numeric!");};
|
||||
$hoodfile = shell_exec("./get_hoodid.sh $hoodid");
|
||||
}
|
||||
echo $hoodfile;
|
||||
?>
|
Loading…
Reference in New Issue