Last active
August 29, 2015 14:17
-
-
Save sebastianwagner/2b1f02c689121427b5ba to your computer and use it in GitHub Desktop.
Network Manager disconnect script for docker devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## | |
# @see https://github.com/jpetazzo/pipework/issues/72#issuecomment-50045428 | |
## | |
which nmcli | |
if [ $? -eq 0 ]; then | |
LANG=C nmcli --terse --fields device,state device status \ | |
| egrep "^(docker|vboxnet).*\:connected" \ | |
| cut -d ':' -f 1 \ | |
| xargs --no-run-if-empty --max-args=1 nmcli device disconnect | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment