add virsh.sh aliases; update README

This commit is contained in:
Dhya 2024-10-19 10:15:41 -07:00
parent 092b66f765
commit 17d0b270c7
2 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,27 @@
# Aliases for virsh
vlist() {
/usr/bin/virsh --connect qemu:///system list --all
}
vstart() {
/usr/bin/virsh --connect qemu:///system start $1
}
vsave() {
/usr/bin/virsh --connect qemu:///system managedsave $1 --running
}
vstop() {
/usr/bin/virsh --connect qemu:///system shutdown $1
}
vkill() {
/usr/bin/virsh --connect qemu:///system destroy $1
}
vconsole() {
/usr/bin/virsh --connect qemu:///system console $1
}
vrm() {
echo "This will completely remove $1 and its associated storage."
read -r -p "Are you sure? (y/N) " ans
echo
if [[ "$ans" =~ ^[Yy]$ ]]; then
/usr/bin/virsh --connect qemu:///system undefine --nvram --remove-all-storage $1
fi
}