File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1414
1515
1616NAME=$( basename " ${URL} " )
17- NAME=${NAME% .* } -$( date +%Y-%m-%d_%H:%M)
17+ SNAPSHOT_NAME=${NAME% .* } -$( date +%Y-%m-%d_%H:%M)
18+ IMAGE_NAME=${IMAGE_NAME:- $SNAPSHOT_NAME }
19+ IMAGE_BOOTSCRIPT=${IMAGE_BOOTSCRIPT: stable}
1820VOLUME_SIZE=${VOLUME_SIZE:- 50GB}
1921KEY=$( cat ~ /.ssh/id_rsa.pub | awk ' { print $1" "$2 }' | tr ' ' ' _' )
2022
@@ -50,12 +52,12 @@ echo "[+] Server stopped"
5052
5153
5254echo " [+] Creating a snapshot of nbd1"
53- SNAPSHOT=$( scw commit --volume=1 " ${SERVER} " " ${NAME } " )
55+ SNAPSHOT=$( scw commit --volume=1 " ${SERVER} " " ${SNAPSHOT_NAME } " )
5456echo " [+] Snapshot ${SNAPSHOT} created"
5557
5658
5759echo " [+] Creating an image based of the snapshot"
58- IMAGE=$( scw tag " ${SNAPSHOT} " " ${NAME } " )
60+ IMAGE=$( scw tag --bootscript= " ${IMAGE_BOOTSCRIPT} " " ${ SNAPSHOT}" " ${IMAGE_NAME } " )
5961echo " [+] Image created: ${IMAGE} "
6062
6163
You can’t perform that action at this time.
0 commit comments