Add interface support

This commit is contained in:
Pascal Vizeli
2017-05-24 00:37:29 +02:00
parent 40be067f8a
commit c5ffc73263
2 changed files with 7 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "DHCP server",
"version": "0.2",
"version": "0.3",
"slug": "dhcp_server",
"description": "A simple dhcp server",
"url": "https://home-assistant.io/addons/dhcp_server/",
@@ -17,7 +17,8 @@
"range_start": "192.168.1.100",
"range_end": "192.168.1.200",
"broadcast": "192.168.1.255",
"gateway": "192.168.1.1"
"gateway": "192.168.1.1",
"interface": "eth0"
}
],
"hosts": []
@@ -32,7 +33,8 @@
"range_start": "str",
"range_end": "str",
"broadcast": "str",
"gateway": "str"
"gateway": "str",
"interface": "str"
}
],
"hosts": [

View File

@@ -19,10 +19,12 @@ for (( i=0; i < "$NETWORKS"; i++ )); do
RANGE_END=$(jq --raw-output ".networks[$i].range_end" $CONFIG_PATH)
BROADCAST=$(jq --raw-output ".networks[$i].broadcast" $CONFIG_PATH)
GATEWAY=$(jq --raw-output ".networks[$i].gateway" $CONFIG_PATH)
INTERFACE=$(jq --raw-output ".networks[$i].interface" $CONFIG_PATH)
{
echo "subnet $SUBNET netmask $NETMASK {"
echo " range $RANGE_START $RANGE_END;"
echo " interface $INTERFACE;"
echo " option routers $GATEWAY;"
echo " option broadcast-address $BROADCAST;"
echo "}"