diff options
| author | Your Name <you@example.com> | 2024-12-21 15:11:19 +0800 |
|---|---|---|
| committer | Your Name <you@example.com> | 2024-12-21 15:11:19 +0800 |
| commit | be3dde6ce14698c5818f21f65037a4beef1199cf (patch) | |
| tree | 79dbd14ec4a07d6b41561931d15a4c03406d5836 /others/vm3/vm.sh | |
| parent | 47303626554d42356dfd1b61ad3f9de97929cc87 (diff) | |
betavm3
Diffstat (limited to 'others/vm3/vm.sh')
| -rw-r--r-- | others/vm3/vm.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/others/vm3/vm.sh b/others/vm3/vm.sh new file mode 100644 index 0000000..1072569 --- /dev/null +++ b/others/vm3/vm.sh @@ -0,0 +1,42 @@ +#!/bin/bash + + +case "$1" in + "compute") + shift + case "$1" in + "create") + VM_NAME=$2 + shift 2 + while [[ $# -gt 0 ]]; do + case "$1" in + -vcpu) + VCPU=$2 + shift 2 + ;; + -ram) + RAM_GB=$(($2*1000)) + shift 2 + ;; + -disk) + DISK_GB=$2 + shift 2 + ;; + *) + echo "Unknown argument: $1" + exit 1 + ;; + esac + done + ;; + *) + echo "Unknown compute command: $1" + exit 1 + ;; + esac + ;; + *) + echo "Unknown command: $1" + exit 1 + ;; +esac |
