为了避免这种事情再次发生
- function run(){
- oci compute instance launch
- –availability-domain CvdW:AP-SINGAPORE-1-AD-1
- –image-id ocid1.image.oc1.ap-singapore-1.aaaaaaaa3vsfhyvqje5yyn2vrr52tfnm5j2xovxyl2uojexvead5mesrh7ba
- –subnet-id ocid1.subnet.oc1.ap-singapore-1.aaaaaaaagrqldyaws457ncv77lbeoychmjzych7q6kethyfinfpjx6nwlqda
- –shape VM.Standard.A1.Flex
- –assign-public-ip true
- –metadata ‘{"ssh_authorized_keys": "ssh-XXXXXXXXXXXXXXXXXXXXXXXXXXXX"}’
- –compartment-id ocid1.tenancy.oc1..aaaaaaaaea6qoimvuytkec25r4omjk4fl72pzcampzf3cbynil4w6b3ldb4q
- –shape-config ‘{"ocpus":2,"memory_in_gbs":12}’
- –display-name arm
- }
-
- file="~/oci.ok"
- if [[ ! -f $file ]] || [[ `cat $file` != "ok" ]];then
- echo "开刷"
- run
- if [[ $? -eq 0 ]];then
- echo "ok" > $file
- fi
- else
- echo "已经刷到了"
- fi
复制代码
|