[pve-devel] [RFC installer] add button for renewing dhcp lease

Oguz Bektas o.bektas at proxmox.com
Wed Jan 30 15:39:14 CET 2019


per request on #2066, this is more of a proof-of-concept and not
thoroughly tested.
(i'm aware the button doesn't look very nice at the current position,
planning to change it according to comments)

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 proxinstall | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/proxinstall b/proxinstall
index f2414db..0422caa 100755
--- a/proxinstall
+++ b/proxinstall
@@ -2013,6 +2013,13 @@ sub create_ipconf_view {
     $device_cb->set_active(0);
     $device_cb->set_visible(1);
 
+    my $dhcp_button = Gtk3::Button->new("Renew DHCP");
+    $dhcp_button->signal_connect(clicked => sub {
+	run_command("dhclient -r");
+	run_command("dhclient -v");
+	create_ipconf_view();
+    });
+
     my $get_device_desc = sub {
 	my $iface = shift;
 	return "$iface->{name} - $iface->{mac} ($iface->{driver})";
@@ -2071,6 +2078,8 @@ sub create_ipconf_view {
 
     $vbox2->pack_start($maskbox, 0, 0, 2);
 
+    $vbox2->pack_end($dhcp_button, 0, 0, 2);
+
     $gateway = $config->{gateway} // $ipconf->{gateway} || '192.168.100.1';
 
     my $gwbox;
-- 
2.11.0





More information about the pve-devel mailing list