summaryrefslogtreecommitdiff
path: root/others/vm3/vm.sh
diff options
context:
space:
mode:
authorYour Name <you@example.com>2024-12-21 15:11:19 +0800
committerYour Name <you@example.com>2024-12-21 15:11:19 +0800
commitbe3dde6ce14698c5818f21f65037a4beef1199cf (patch)
tree79dbd14ec4a07d6b41561931d15a4c03406d5836 /others/vm3/vm.sh
parent47303626554d42356dfd1b61ad3f9de97929cc87 (diff)
betavm3
Diffstat (limited to 'others/vm3/vm.sh')
-rw-r--r--others/vm3/vm.sh42
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
4case "$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 ;;
42esac