aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkvm-creator3
1 files changed, 2 insertions, 1 deletions
diff --git a/kvm-creator b/kvm-creator
index 6a1300a..59eb7eb 100755
--- a/kvm-creator
+++ b/kvm-creator
@@ -15,7 +15,8 @@ RAM="${4:-512}"
[ ! -d /etc/sv/kvm ] && mkdir /etc/sv/kvm
-if [ ls /etc/sv/kvm/* &> /dev/null ]; then
+ls /etc/sv/kvm/* &> /dev/null
+if [ "$?" -eq 0 ]; then
TAP="${5:-tap$(( $( cat /etc/sv/kvm/*/env/TAP | sed 's/^tap//' | sort -n | tail -n 1 ) + 1 ))}"
MAC="${6:-$(cat /etc/sv/kvm/*/env/MAC | head -n1 | cut -f 1-5 -d: ):$(( $( cat /etc/sv/kvm/*/env/MAC | cut -f 6 -d: | sort -n | tail -n 1 ) + 1 ))}"
else