forked from freifunk-franken/VPNkeyXchange
Add hoodfile via hoodid
This commit is contained in:
parent
c6d416fd9a
commit
360b41e3c0
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
hoodfile=$(grep -l "id\": \"$1\"" hood/* )
|
||||
[ -z $hoodfile ] && echo "no hood $1" && exit
|
||||
|
||||
cat $hoodfile
|
17
index.php
17
index.php
|
@ -1,10 +1,15 @@
|
|||
<?php
|
||||
$lat = $_GET['lat'];
|
||||
$lo = $_GET['long'];
|
||||
|
||||
if ((!is_numeric($lat)) || (!is_numeric($lo))) {exit("lat/long not numeric!");};
|
||||
|
||||
$hoodfile = shell_exec("./get_hood.sh $lat $lo");
|
||||
$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