Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- [ -z "$1" ] && echo "iface" && exit 0
- echo ""
- echo "$1: Disconnecting..."
- echo ""
- echo "" > /etc/resolve.conf
- ip -4 addr flush dev $1
- if [[ -z `cat /etc/network/interfaces | grep $1` ]]; then
- dhclient $1 -r
- ip route del default dev $1 2>&1 1>/dev/null || true
- #dhclient -x -v
- ifconfig $1 down
- exit 0
- else
- ifdown $1
- fi
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement