Advertisement
Guest User

Untitled

a guest
Aug 26th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <?php
  2. $str = <<< EOT
  3. #cloud-config
  4. bootcmd:
  5. - echo "test" > /root/test_user_data
  6. EOT;
  7.  
  8. echo base64_encode($str);
  9. ?>
  10.  
  11.  
  12. and then
  13.  
  14.  
  15. update instances set user_data="I2Nsb3VkLWNvbmZpZwpib290Y21kOgogLSBlY2hvICJ0ZXN0IiA+IC9yb290L3Rlc3RfdXNlcl9kYXRh" where uuid='bc7f3eae-2da5-4b6f-bfc2-21cdceb21b2e';
  16.  
  17.  
  18. on REBOOT, the vm grabs the user_data and runs it again
  19.  
  20. I can see a file in /root/test_user_data.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement