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 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | |||
| 4 | case "$1" in | ||
| 5 | "compute") | ||
| 6 | shift | ||
| 7 | case "$1" in | ||
| 8 | "create") | ||
| 9 | VM_NAME=$2 | ||
| 10 | shift 2 | ||
| 11 | while [[ $# -gt 0 ]]; do | ||
| 12 | case "$1" in | ||
| 13 | -vcpu) | ||
| 14 | VCPU=$2 | ||
| 15 | shift 2 | ||
| 16 | ;; | ||
| 17 | -ram) | ||
| 18 | RAM_GB=$(($2*1000)) | ||
| 19 | shift 2 | ||
| 20 | ;; | ||
| 21 | -disk) | ||
| 22 | DISK_GB=$2 | ||
| 23 | shift 2 | ||
| 24 | ;; | ||
| 25 | *) | ||
| 26 | echo "Unknown argument: $1" | ||
| 27 | exit 1 | ||
| 28 | ;; | ||
| 29 | esac | ||
| 30 | done | ||
| 31 | ;; | ||
| 32 | *) | ||
| 33 | echo "Unknown compute command: $1" | ||
| 34 | exit 1 | ||
| 35 | ;; | ||
| 36 | esac | ||
| 37 | ;; | ||
| 38 | *) | ||
| 39 | echo "Unknown command: $1" | ||
| 40 | exit 1 | ||
| 41 | ;; | ||
| 42 | esac | ||
