Statistics
| Branch: | Tag: | Revision:

mininet / cleanup @ 55dd9368

History | View | Annotate | Download (940 Bytes)

1
#!/bin/bash
2

    
3
# Unfortunately, Mininet and OpenFlow don't always clean up
4
# properly after themselves. Until they do (or until cleanup
5
# functionality is integrated into the python code), this
6
# script may be used to get rid of unwanted garbage. It may
7
# also get rid of "false positives", but hopefully nothing
8
# irreplaceable!
9

    
10
echo "Removing all links of the pattern foo-ethX"
11

    
12
for f in `ip link show | egrep -o '(\w+-eth\w+)' ` ; do  
13
  cmd="ip link del $f"
14
  echo $smd
15
  $cmd
16
done
17

    
18
echo "Removing excess controllers/ofprotocols/ofdatapaths/pings"
19
killall -9 controller ofprotocol ofdatapath ping 2> /dev/null
20

    
21
echo "Removing excess kernel datapath processes"
22
ps ax | egrep -o 'dp[0-9]+' | sed 's/dp/nl:/' | xargs -l1 echo dpctl deldp 
23

    
24
echo "Removing junk in /tmp"
25
rm -f /tmp/vconn* /tmp/vlogs* /tmp/*.out /tmp/*.log
26

    
27
echo "Removing old screen sessions"
28
screen -ls | egrep -o '[0-9]+\.[hsc][0-9]+' | sed 's/\.[hsc][0-9]*//g' | kill -9
29