1
0

demo.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # BLOG: https://blog.linuxeye.com
  4. #
  5. # Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+
  6. #
  7. # Project home page:
  8. # https://oneinstack.com
  9. # https://github.com/lj2007331/oneinstack
  10. DEMO() {
  11. cd $oneinstack_dir/src
  12. [ "$IPADDR_COUNTRY"x == "CN"x ] && /bin/cp ../config/index_cn.html $wwwroot_dir/default/index.html || /bin/cp ../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,proberv.php}
  20. sed -i 's@https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js@http://lib.sinaapp.com/js/jquery/1.7/jquery.min.js@' $wwwroot_dir/default/proberv.php
  21. fi
  22. echo '<?php phpinfo() ?>' > $wwwroot_dir/default/phpinfo.php
  23. if [ "$PHP_cache" == '1' ];then
  24. src_url=http://mirrors.linuxeye.com/oneinstack/src/ocp.php && Download_src
  25. /bin/cp ocp.php $wwwroot_dir/default
  26. elif [ "$PHP_cache" == '2' ];then
  27. 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
  28. elif [ "$PHP_cache" == '3' ];then
  29. 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
  30. elif [ "$PHP_cache" == '4' ];then
  31. /bin/cp eaccelerator-*/control.php $wwwroot_dir/default
  32. 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
  33. else
  34. sed -i 's@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@@' $wwwroot_dir/default/index.html
  35. fi
  36. fi
  37. chown -R ${run_user}.$run_user $wwwroot_dir/default
  38. [ -e /usr/bin/systemctl ] && systemctl daemon-reload
  39. cd ..
  40. }