summaryrefslogtreecommitdiffstats
path: root/distribution/virt/import/getconsolefile
blob: 6a783e5a0f6baf6d59ebf5b0daa53f36499aca1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

if [[ $# != 1 ]]; then 
	echo "Usage: $0 [guestname]"
	exit 1
fi

if ! virsh list --all | grep -q $1; then 
	echo "guest $1 doesn't seem to exist"
	exit 1
fi

if ! virsh dumpxml $1 | grep -A 3 "<serial type='file'>" | grep "source path=" | awk -F"'" '{print $2}'; then
	exit 1
else
	exit 0
fi