aboutsummaryrefslogtreecommitdiff
path: root/server_create.sh
diff options
context:
space:
mode:
Diffstat (limited to 'server_create.sh')
-rwxr-xr-xserver_create.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/server_create.sh b/server_create.sh
new file mode 100755
index 0000000..19ed7a1
--- /dev/null
+++ b/server_create.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+ID=$(echo $(scw create --commercial-type=VC1S 5fc9990a-d274-49b8-afac-42af22b42a71) | cut -d'-' -f1)
+
+echo $ID
+scw start $ID
+scw attach $ID
+while [[ $(scw ps -a | awk "/$ID.*(running).*/") == "" ]]; do
+ sleep 30
+done
+echo "Runnig ! => $(scw ps -a | awk "/$ID.*(running).*/") "
+
+cat > ip <<EOF
+$(scw inspect $ID | jq '.[0].public_ip.address' | cut -d'"' -f2)
+EOF
+