Add qemu ifup/ifdown scripts
This commit is contained in:
parent
c4f7ca2241
commit
ab4841031d
4 changed files with 73 additions and 0 deletions
24
scripts/generate-tap
Executable file
24
scripts/generate-tap
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
# Generate a numbered tap device name
|
||||
|
||||
TAP="tap0"
|
||||
COUNT=0
|
||||
|
||||
while [[ true ]]; do
|
||||
FOUND=false
|
||||
|
||||
for INT in $(ls /sys/class/net); do
|
||||
if [[ $INT == $TAP ]]; then
|
||||
((COUNT++))
|
||||
|
||||
TAP="tap$COUNT"
|
||||
FOUND=true
|
||||
continue
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ !$FOUND ]]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue