From 9e82c96713989a7565eadac505b36e3dbe91cd5a Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 11 Jun 2023 07:56:17 -0400 Subject: Added, removed, renamed scripts --- .local/bin/stop-vm | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100755 .local/bin/stop-vm (limited to '.local/bin/stop-vm') diff --git a/.local/bin/stop-vm b/.local/bin/stop-vm deleted file mode 100755 index 6c92250..0000000 --- a/.local/bin/stop-vm +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Stops domains given as arguments - -opts=$(getopt -o 'as' -l 'all,save' -- "$@") -eval set -- "$opts" -all=0 -save=0 -while true -do - case $1 in - '-a'|'--all') all=1; shift; continue ;; - '-s'|'--save') save=1; shift; continue ;; - '--') shift; break;; - esac -done - -[ $all -eq 1 ] && domains="$(virsh list | grep running | awk '{print $2}')" || domains="$@" -for domain in $domains -do - [ $save -eq 1 ] && virsh managedsave $domain || virsh shutdown $domain -done -- cgit v1.2.3