mirror of
https://dev.iopsys.eu/iopsys/owsd.git
synced 2026-01-14 20:24:51 +00:00
25 lines
502 B
Bash
Executable File
25 lines
502 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# This script will publish the ubus object router.network and its method 'hosts', providing clients hostnames, MACs, IPs and connection status. Reads from /tmp/hosts.json.
|
|
# This is script is used to simulate router.network hosts functionality required by uproxyd
|
|
|
|
HOSTFILE="/tmp/hosts.json"
|
|
|
|
case "$1" in
|
|
list)
|
|
echo '{ "hosts" : {} }'
|
|
;;
|
|
call)
|
|
case "$2" in
|
|
hosts)
|
|
if [ -s $HOSTFILE ]; then
|
|
cat $HOSTFILE
|
|
else
|
|
echo '{ "hosts": [] }'
|
|
fi
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
|