diff --git a/vmcreate.sh b/vmcreate.sh index 02bfcdd..e7c2136 100644 --- a/vmcreate.sh +++ b/vmcreate.sh @@ -227,6 +227,10 @@ if [ $pubkey ]; then else read -p "Public key not specified. Use default? Enter to continue or Ctrl+C to abort" fi +if [[ (head -c 7 "$pubkey") -ne "ssh-rsa" ]]; then + echo "$pubkey is not a valid public key. Make sure you specified PUBLIC key." + exit 6 +fi # Проверяем, что нет ВМ в списке и нет сниппетов for line in $(cat hosts.tmp)