Added check for state of VM/CT to avoid errors
This commit is contained in:
@@ -35,6 +35,9 @@ if ! $IdExists; then echo "This ID does not exist"; exit; fi
|
||||
if [[ $VMS =~ $ID ]]; then TYPE=VM; fi
|
||||
if [[ $CTS =~ $ID ]]; then TYPE=CT; fi
|
||||
|
||||
check#Check if VM/CT is running
|
||||
if ! $($TYPE-State $ID); then echo "This ID is not runnig"; exit; fi
|
||||
|
||||
#Ask what should be updated
|
||||
while true; do
|
||||
read -p "Wich software should be updated (P)ackages, (A)pplications or (B)oth? " sofq
|
||||
@@ -52,6 +55,6 @@ while true; do
|
||||
$TYPE-UpdatePackages $ID
|
||||
$TYPE-UpdateApplicatons $ID
|
||||
break;;
|
||||
* ) echo "Please answer with (A)ll, (C)T`s or (V)M`s.";;
|
||||
* ) echo "Please answer with (P)ackages, (A)pplications or (B)oth.";;
|
||||
esac
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user