Advertisement
Guest User

Untitled

a guest
May 24th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Install drupal site from command line without doing any http calls.
  4. # Please execute this script under drupal install directory.
  5. # This script assummes that :
  6. # - database details have been already defined in site/default/settings.php
  7. # - you'll be fine with:
  8. # - default instalation profile
  9. # - "en" locale
  10. # - clean url enabled
  11. # - status updated enabled
  12. #
  13. # @author: Catalin Balan <catalin.balan@gmail.com>
  14.  
  15. site_name='Drupal brand new site'
  16. site_mail='drupal@email.com'
  17. account_name='admin'
  18. account_email='admin@email.com'
  19. account_password='password'
  20.  
  21. function cookies() {
  22. if [ -n "$1" ]; then
  23. echo "\$_COOKIE=unserialize('$1');"
  24. else
  25. echo 'function _cli_cookie_print(){print(serialize(array(session_name()=>session_id())));}
  26. register_shutdown_function("_cli_cookie_print");'
  27. fi
  28.  
  29. echo '$_GET=array("profile"=>"default", "locale"=>"en", "id"=>"1"); $_REQUEST=$_GET;'
  30. }
  31.  
  32. phpcode="$(cookies) include('install.php');"
  33. cli_cookie=$(php -r "$phpcode"|tail -n1)
  34.  
  35. phpcode=$(cookies $cli_cookie)' $_GET["op"]="start"; $_REQUEST=$_GET; include("install.php");'
  36. php -r "$phpcode"
  37.  
  38. phpcode=$(cookies $cli_cookie)' $_GET["op"]="do_nojs"; $_REQUEST=$_GET; include("install.php");'
  39. php -r "$phpcode"
  40.  
  41. phpcode=$(cookies $cli_cookie)' $_GET["op"]="finished"; $_REQUEST=$_GET; include("install.php");'
  42. php -r "$phpcode"
  43.  
  44. phpcode=$(cookies $cli_cookie)' $_POST=array("site_name"=>"'$site_name'",
  45. "site_mail"=>"'$site_mail'",
  46. "account"=>array("name"=>"'$account_name'", "mail"=>"'$account_email'", "pass"=>array("pass1"=>"'$account_password'", "pass2"=>"'$account_password'")),
  47. "date_default_timezone"=>"0",
  48. "clean_url"=>"1",
  49. "form_id"=>"install_configure_form",
  50. "update_status_module" => array("1"=>"1")); include("install.php");'
  51. php -r "$phpcode"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement