install 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/usr/bin/env sh
  2. set -e
  3. check()
  4. {
  5. yes=`which $1 | wc -l`
  6. echo $yes
  7. }
  8. chmod -R +x src/*.py
  9. chmod -R +x src/shell
  10. chmod -R 777 container/share/
  11. basepath=$(cd `dirname $0`; pwd)
  12. # docker
  13. status=`check docker`
  14. if [ "$status" = 0 ]; then
  15. #curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
  16. $basepath/src/shell/docker/setup --mirror Aliyun
  17. fi
  18. mkdir -p /etc/docker
  19. tee /etc/docker/daemon.json <<-'EOF'
  20. {
  21. "registry-mirrors": [
  22. "https://docker.mirrors.ustc.edu.cn",
  23. "https://registry.docker-cn.com",
  24. "http://hub-mirror.c.163.com",
  25. "https://mirror.ccs.tencentyun.com"
  26. ]
  27. ,"insecure-registries" : ["docker.dever.cc"]
  28. }
  29. EOF
  30. #service docker restart
  31. ln -sf $basepath/src/dm.py /usr/bin/dm && chmod +x /usr/bin/dm
  32. ln -sf $basepath/src/ds.py /usr/bin/ds && chmod +x /usr/bin/ds
  33. ln -sf $basepath/src/dp.py /usr/bin/dp && chmod +x /usr/bin/dp
  34. ln -sf $basepath/src/dpc.py /usr/bin/dpc && chmod +x /usr/bin/dpc
  35. ln -sf $basepath/src/dever.py /usr/bin/dever && chmod +x /usr/bin/dever
  36. ln -sf $basepath/src/dever2.py /usr/bin/dever2 && chmod +x /usr/bin/dever2
  37. ln -sf $basepath/src/dgit.py /usr/bin/dgit && chmod +x /usr/bin/dgit
  38. # python-pip
  39. #pipstatus=`check pip`
  40. #if [ "$pipstatus" = 0 ]; then
  41. #wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -rf get-pip.py
  42. #fi
  43. # python-daemon 用不到了
  44. #pip install python-daemon
  45. #pip install redis
  46. #yumstatus=`check yum`
  47. #if [ "$yumstatus" = 0 ]; then
  48. #apt install python-gevent
  49. #else
  50. #yum install python-gevent
  51. #fi
  52. #dm run server-redis
  53. #python $basepath/src/daemon.py &
  54. docker version
  55. echo 'install success!'