Skip to content

Commit

Permalink
remove deprecated syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
  • Loading branch information
travisghansen committed Jan 30, 2023
1 parent bd1f93e commit 5fb51d9
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.5.16

Released 2023-01-30

- update deprecated syntax

# v0.5.15

Released 2023-01-29
Expand Down
40 changes: 40 additions & 0 deletions EXEC_EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,46 @@ $toreturn = [
];
```

## release / renew dhcp address on an interface

```
require_once '/etc/inc/interfaces.inc';
$if = "igb0";
$interface = "wan";
$ifdescr = "WAN";
$ipv = 4;
$sleep = 1;
// Copied from: /usr/local/www/status_interfaces.php
// Relinquish the DHCP lease from the server.
// $if is physical interface: ie: igb0
// $ifdescr is WAN, LAN, etc
// $ipv is '4' or '6'
function dhcp_relinquish_lease($if, $ifdescr, $ipv) {
$leases_db = '/var/db/dhclient.leases.' . $if;
$conf_file = '/var/etc/dhclient_'.$ifdescr.'.conf';
$script_file = '/usr/local/sbin/pfSense-dhclient-script';
$ipv = ((int) $ipv == 6) ? '-6' : '-4';
if (file_exists($leases_db) && file_exists($script_file)) {
mwexec('/usr/local/sbin/dhclient {$ipv} -d -r' .
' -lf ' . escapeshellarg($leases_db) .
' -cf ' . escapeshellarg($conf_file) .
' -sf ' . escapeshellarg($script_file));
}
}
dhcp_relinquish_lease($if, $ifdescr, $ipv);
interface_bring_down($interface);
sleep($sleep);
interface_configure($interface);
$toreturn = [
"data" => true,
];
```

# command

## flush state table
Expand Down
2 changes: 1 addition & 1 deletion custom_components/pfsense/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async def async_update_device_tracker_data():
# Fetch initial data so we have data when entities subscribe
await device_tracker_coordinator.async_config_entry_first_refresh()

hass.config_entries.async_setup_platforms(entry, platforms)
await hass.config_entries.async_forward_entry_setups(entry, platforms)

service_registar = ServiceRegistrar(hass)
service_registar.async_register()
Expand Down

0 comments on commit 5fb51d9

Please sign in to comment.