demo.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # BLOG: https://blog.linuxeye.cn
  4. #
  5. # Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
  6. #
  7. # Project home page:
  8. # https://oneinstack.com
  9. # https://github.com/lj2007331/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. if [ "${IPADDR_COUNTRY}"x == "CN"x ]; then
  15. src_url=http://mirrors.linuxeye.com/oneinstack/src/tz.zip && Download_src
  16. unzip -q tz.zip -d ${wwwroot_dir}/default
  17. else
  18. src_url=http://mirrors.linuxeye.com/oneinstack/src/tz_e.zip && Download_src
  19. unzip -q tz_e.zip -d ${wwwroot_dir}/default;/bin/mv ${wwwroot_dir}/default/{tz_e.php,prober.php}
  20. fi
  21. echo "<?php phpinfo() ?>" > ${wwwroot_dir}/default/phpinfo.php
  22. case "${phpcache_option}" in
  23. 1)
  24. src_url=http://mirrors.linuxeye.com/oneinstack/src/ocp.php && Download_src
  25. /bin/cp ocp.php ${wwwroot_dir}/default
  26. ;;
  27. 2)
  28. 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
  29. ;;
  30. 3)
  31. 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
  32. ;;
  33. 4)
  34. /bin/cp eaccelerator-*/control.php ${wwwroot_dir}/default
  35. 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
  36. ;;
  37. *)
  38. sed -i 's@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@@' ${wwwroot_dir}/default/index.html
  39. ;;
  40. esac
  41. fi
  42. chown -R ${run_user}.${run_user} ${wwwroot_dir}/default
  43. [ -e /usr/bin/systemctl ] && systemctl daemon-reload
  44. popd
  45. }