diff --git a/cloud-init/create_ubuntu20_template.sh b/cloud-init/create_ubuntu20_template.sh index 2fc3f29..ff154b1 100644 --- a/cloud-init/create_ubuntu20_template.sh +++ b/cloud-init/create_ubuntu20_template.sh @@ -1,6 +1,15 @@ #!/bin/sh -_storage=${1} +_usage() { + echo " + Usage: $0 + : should be a valid (active, supporting VM image) PVE storage + " +} + +[ -z "$1" ] && _usage && return + +_storage=$1 pvesm status --enabled --target localhost --content images |awk {'print $1'} |tail +2 |grep "$_storage" > /dev/null 2>&1 if [ "$?" -ne "0" ]; then echo "Storage $_storage does not seems to exists. Use 'pvesm status' to find a usable storage"