init.sh 745 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. # usage: ./init.sh /usr/bin/php http://localhost
  3. phpcli=$1
  4. pmsRoot=$2
  5. basePath=$(cd "$(dirname "$0")"; pwd)
  6. if [ ! -n "$1" ]; then
  7. while :; do
  8. echo "Please input your php path:(example: /usr/bin/php)"
  9. read phpcli
  10. if [ ! -f $phpcli ]; then
  11. echo "php path is error";
  12. elif [ "$phpcli"x != ""x ]; then
  13. break;
  14. fi
  15. done
  16. fi
  17. if [ ! -n "$2" ]; then
  18. while :; do
  19. echo "Please input zentao url:(example: http://localhost:88/zentao or http://localhost)"
  20. read pmsRoot
  21. if [ -z "$pmsRoot" ]; then
  22. echo "zentao url is error";
  23. else
  24. break;
  25. fi
  26. done
  27. fi
  28. pmsRoot=`echo "$pmsRoot" | sed 's/[/]$//g'`
  29. $phpcli "$basePath/php/init.php" $phpcli $pmsRoot;
  30. chmod 755 $basePath/*.sh
  31. exit 0