You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

54 lines
1.6 KiB

  1. #!/bin/bash
  2. # This script is under public domain do with it whatever you want (yes, that includes eating it).
  3. if [ $# -lt 1 ]; then
  4. echo "Usage: $(basename $0) [animal domain or directory]"
  5. exit 1
  6. fi
  7. ANIMAL=${PWD}/${1}
  8. ANIMAL_TITLE=$1
  9. if [ -d $ANIMAL ]; then
  10. echo "ERROR: $ANIMAL exists already!"
  11. exit 1
  12. fi
  13. echo ">> adding animal $1"
  14. echo ">> creating directory structure ..."
  15. mkdir -p ${ANIMAL}/{data/{attic,cache,index,locks,media,media_attic,media_meta,meta,pages,tmp},conf}
  16. find ${ANIMAL}/ -type d -exec chmod 777 {} \;
  17. touch ${ANIMAL}/conf/{local.php,local.protected.php,acl.auth.php,users.auth.php,plugins.local.php}
  18. chmod 666 ${ANIMAL}/conf/{local.php,acl.auth.php,users.auth.php,plugins.local.php}
  19. echo ">> creating basic configuration ..."
  20. echo "<?php
  21. \$conf['title'] = '${ANIMAL_TITLE}';
  22. \$conf['lang'] = 'en';
  23. \$conf['useacl'] = 1;
  24. \$conf['animal'] = '${ANIMAL_TITLE}';
  25. \$conf['animal_inc'] = '${ANIMAL}/';
  26. \$conf['superuser'] = '@admin';" > ${ANIMAL}/conf/local.php
  27. echo ">> setting fixed configuration ..."
  28. echo "<?php
  29. \$conf['savedir'] = DOKU_CONF.'../data';
  30. \$conf['updatecheck'] = 0;" > ${ANIMAL}/conf/local.protected.php
  31. echo ">> setting basic permissions ..."
  32. echo "# <?php exit()?>
  33. * @admin 255
  34. * @ALL 1" > ${ANIMAL}/conf/acl.auth.php
  35. echo ">> adding admin user ..."
  36. echo '# <?php exit()?>
  37. admin:$1$cce258b2$U9o5nK0z4MhTfB5QlKF23/:admin:admin@mail.org:admin,user' > ${ANIMAL}/conf/users.auth.php
  38. echo ">> IMPORTANT: Don't forget to change your admin username + password!"
  39. echo ">> finished!"
  40. echo ">> bye!"
  41. exit 0
  42. # vim:ts=4:sw=4:noet:enc=utf-8: