#!/bin/sh

badrequest() {
	echo 'Status: 400 Bad Request'
	echo
	exit 1
}

( gluon-list-mesh-interfaces | grep -qxF "$QUERY_STRING" ) 2>/dev/null || badrequest

exec gluon-neighbour-info -s neighbour -i "$QUERY_STRING" -d ff02::2:1001 -p 1001 -r nodeinfo
