demo.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # BLOG: https://blog.linuxeye.cn
  4. #
  5. # Notes: OneinStack for CentOS/RedHat 6+ Debian 7+ and Ubuntu 12+
  6. #
  7. # Project home page:
  8. # https://oneinstack.com
  9. # https://github.com/oneinstack/oneinstack
  10. DEMO() {
  11. pushd ${oneinstack_dir}/src > /dev/null
  12. [ "${IPADDR_COUNTRY}"x == "CN"x ] && /bin/cp ${oneinstack_dir}/config/index_cn.html ${wwwroot_dir}/default/index.html || /bin/cp ${oneinstack_dir}/config/index.html ${wwwroot_dir}/default
  13. if [ -e "${php_install_dir}/bin/php" ]; then
  14. src_url=http://mirrors.linuxeye.com/oneinstack/src/xprober.php && Download_src
  15. /bin/cp xprober.php ${wwwroot_dir}/default
  16. echo "<?php phpinfo() ?>" > ${wwwroot_dir}/default/phpinfo.php
  17. case "${phpcache_option}" in
  18. 1)
  19. src_url=http://mirrors.linuxeye.com/oneinstack/src/ocp.php && Download_src
  20. /bin/cp ocp.php ${wwwroot_dir}/default
  21. ;;
  22. 2)
  23. sed -i 's@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@<a href="/xcache" target="_blank" class="links">xcache</a>@' ${wwwroot_dir}/default/index.html
  24. ;;
  25. 3)
  26. sed -i 's@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@<a href="/apc.php" target="_blank" class="links">APC</a>@' ${wwwroot_dir}/default/index.html
  27. ;;
  28. 4)
  29. /bin/cp eaccelerator-*/control.php ${wwwroot_dir}/default
  30. sed -i 's@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@<a href="/control.php" target="_blank" class="links">eAccelerator</a>@' ${wwwroot_dir}/default/index.html
  31. ;;
  32. *)
  33. sed -i 's@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@@' ${wwwroot_dir}/default/index.html
  34. ;;
  35. esac
  36. fi
  37. chown -R ${run_user}.${run_user} ${wwwroot_dir}/default
  38. [ -e /bin/systemctl ] && systemctl daemon-reload
  39. popd > /dev/null
  40. }