Add qemu ifup/ifdown scripts

This commit is contained in:
Sonny 2018-05-11 16:06:20 +02:00
parent c4f7ca2241
commit ab4841031d
4 changed files with 73 additions and 0 deletions

24
scripts/generate-tap Executable file
View 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