Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save iamralch/e6b72065616c45bf7bf23d2022146b9a to your computer and use it in GitHub Desktop.

Select an option

Save iamralch/e6b72065616c45bf7bf23d2022146b9a to your computer and use it in GitHub Desktop.

Revisions

  1. @stafot stafot revised this gist Jun 19, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion reset_virtualbox_dhcp_leases.sh
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ case $OSTYPE in
    esac

    # # Reset Virtualbox DHCP Lease Info
    common_message_print "Resetting Virtualbox DHCP Lease Info..."
    echo "Resetting Virtualbox DHCP Lease Info..."
    kill -9 $(ps aux |grep -i "vboxsvc\|vboxnetdhcp" | awk '{print $2}') 2>/dev/null

    if [[ -f ~/$VBOX_CONFIG_DIR/VirtualBox/HostInterfaceNetworking-vboxnet0-Dhcpd.leases ]] ; then
  2. @stafot stafot created this gist Jun 19, 2019.
    24 changes: 24 additions & 0 deletions reset_virtualbox_dhcp_leases.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    #!/usr/bin/env bash

    function minikube_reset_vbox_dhcp_leases() {

    # Check OS version
    case $OSTYPE in
    darwin*)
    VBOX_CONFIG_DIR=Library
    ;;
    linux*)
    VBOX_CONFIG_DIR=.config
    ;;
    esac

    # # Reset Virtualbox DHCP Lease Info
    common_message_print "Resetting Virtualbox DHCP Lease Info..."
    kill -9 $(ps aux |grep -i "vboxsvc\|vboxnetdhcp" | awk '{print $2}') 2>/dev/null

    if [[ -f ~/$VBOX_CONFIG_DIR/VirtualBox/HostInterfaceNetworking-vboxnet0-Dhcpd.leases ]] ; then
    rm ~/$VBOX_CONFIG_DIR/VirtualBox/HostInterfaceNetworking-vboxnet0-Dhcpd.leases
    fi
    }

    minikube_reset_vbox_dhcp_leases