Skip to content

Instantly share code, notes, and snippets.

@mevansam
Last active August 29, 2015 14:11
Show Gist options
  • Save mevansam/7bd8298e3e5316008108 to your computer and use it in GitHub Desktop.
Save mevansam/7bd8298e3e5316008108 to your computer and use it in GitHub Desktop.
Re-enabling VBox networks if disabled by VPN tools
#!/bin/bash
for device in $(VBoxManage list hostonlyifs | awk '/^Name:/ { print $2 }'); do \
ipaddress=$(VBoxManage list hostonlyifs | grep -A 3 "$device" | awk '/IPAddress:/ { print $2 }'); \
VBoxManage hostonlyif ipconfig $device --ip $ipaddress; \
sudo ifconfig $device down; \
sudo ifconfig $device up; \
echo "Restarted $device with ip $ipaddress."; \
done
@mevansam
Copy link
Author

To run this copy and paste the following to a shell:

curl -ks -L https://gist.github.com/mevansam/7bd8298e3e5316008108/raw/9bb7848b35b505cb2b2d385f77175e1d38fd9d8d/gistfile1.sh | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment