1
0

test.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # Blog: http://blog.linuxeye.com
  4. TEST()
  5. {
  6. cd $oneinstack_dir/src
  7. . ../functions/download.sh
  8. . ../options.conf
  9. public_IP=`../functions/get_public_ip.py`
  10. if [ "`../functions/get_ip_area.py $public_IP`" == '\u4e2d\u56fd' ];then
  11. FLAG_IP=CN
  12. fi
  13. echo $public_IP $FLAG_IP
  14. if [ "$FLAG_IP"x == "CN"x ];then
  15. src_url=http://mirrors.linuxeye.com/lnmp/src/tz.zip && Download_src
  16. unzip -q tz.zip -d $wwwroot_dir/default
  17. /bin/cp $oneinstack_dir/conf/index_cn.html $wwwroot_dir/default/index.html
  18. else
  19. src_url=http://mirrors.linuxeye.com/lnmp/src/tz_e.zip && Download_src
  20. unzip -q tz_e.zip -d $wwwroot_dir/default;/bin/mv $wwwroot_dir/default/{tz_e.php,proberv.php}
  21. 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
  22. /bin/cp $oneinstack_dir/conf/index.html $wwwroot_dir/default
  23. fi
  24. src_url=https://gist.githubusercontent.com/ck-on/4959032/raw/0b871b345fd6cfcd6d2be030c1f33d1ad6a475cb/ocp.php && Download_src
  25. echo '<?php phpinfo() ?>' > $wwwroot_dir/default/phpinfo.php
  26. [ "$PHP_cache" == '1' ] && /bin/cp ocp.php $wwwroot_dir/default && sed -i 's@<a href="/xcache" target="_blank" class="links">xcache</a>@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@' $wwwroot_dir/default/index.html
  27. [ "$PHP_cache" == '3' ] && sed -i 's@<a href="/xcache" target="_blank" class="links">xcache</a>@<a href="/apc.php" target="_blank" class="links">APC</a>@' $wwwroot_dir/default/index.html
  28. [ "$PHP_cache" == '4' ] && /bin/cp eaccelerator-*/control.php $wwwroot_dir/default && sed -i 's@<a href="/xcache" target="_blank" class="links">xcache</a>@<a href="/control.php" target="_blank" class="links">eAccelerator</a>@' $wwwroot_dir/default/index.html
  29. chown -R ${run_user}.$run_user $wwwroot_dir/default
  30. cd ..
  31. }