# ==>> on AMI
# - run pre-bundle scripts, usually located in /etc/ami/bundle.d (as per EC2_REMOTE_SCRIPTS)
# - collect exclude directory information
# - bundle the volume
# - upload the bundle
# - remove the EC2 certificates and their containing directory
$SSH "if [ -d $EC2_REMOTE_SCRIPTS ]; then for script in $EC2_REMOTE_SCRIPTS/*; do if [ -x \$script ]; then \$script; fi; done; fi;" | $NOTIFY
$SSH \
'files="" ;' \
"for file in `grep -vP '^#|^\s*$' $EC2_REMOTE_EXCLUDE` ; " \
" do " \
' if [ -e $file ]; ' \
' then ' \
' if [ -z "$files" ] ; then files="\'$file\'" ; else files=$files",\'$file\'" ; fi; ' \
' fi; ' \
' done;' \
'if [ -n "$files" ] ; then exclude="-e $files" ; else exclude="" ; fi; \
"echo 'ec2-bundle-vol -d /mnt -k $PEM/pk-*.pem -c $PEM/cert-*.pem -u $AWS_ACCOUNT \$exclude -r $CPU -p $BUNDLE_PREFIX';"
<?PHP
$Variable = "YAY";
?>