mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 13:14:21 +01:00
Add interface support
This commit is contained in:
@@ -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": [
|
||||
|
||||
@@ -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 "}"
|
||||
|
||||
Reference in New Issue
Block a user