I'm looking to configure gsutil with a service account from an unattended init script running on a vanilla ubuntu 14 EC2 instance. I've tried several methods for interacting with gsutil unattendedly without success as yet. Would appreciate your advice as to how this can be approached.
This is a bash script i tried running:
#!/bin/bash
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
gsutil config -e <<'EOF'
XXX.gserviceaccount.com
/XXX/service_account_private_key.p12
PASSWORD
N
APP_NAME
EOF
I Also tried running a command in the following structure, still without success:
{ echo "XXX.gserviceaccount.com"; echo "/XXX/service_account_private_key.p12"; echo "PASSWORD"; echo "N"; echo "APP_NAME"; } | gsutil config -e
Thanks in advance for your help!