add 'weave reset'

Closes #20.
This commit is contained in:
Matthias Radestock committed 2014-09-15 12:43:58 +01:00
1 parent 8297fef53d
commit d2bd78435e
2 files changed
+32

No files matched your search

+14
View File
@@ -9,6 +9,7 @@ usage() {
echo "weave hide <ipaddr>/<subnet>"
echo "weave status"
echo "weave stop"
echo "weave reset"
exit 1
}
@@ -60,6 +61,12 @@ create_bridge() {
ip link set dev $BRIDGE up
}
destroy_bridge() {
if [ -d /sys/class/net/$BRIDGE ] ; then
ip link del dev $BRIDGE
fi
}
run_iptables() {
# -w is recent addition to iptables
if [ -z "$CHECKED_IPTABLES_W" ] ; then
@@ -215,6 +222,13 @@ case "$COMMAND" in
check_command_and_run conntrack conntrack -D -p udp --dport 6783 >/dev/null 2>&1 || true
stop_masquerading
;;
reset)
docker kill weave >/dev/null 2>&1 || true
docker rm -f weave >/dev/null 2>&1 || true
check_command_and_run conntrack conntrack -D -p udp --dport 6783 >/dev/null 2>&1 || true
stop_masquerading
destroy_bridge
;;
*)
echo "Unknown weave command '$COMMAND'"
usage