install 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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": ["https://b2qcb7w2.mirror.aliyuncs.com"]
  22. ,"insecure-registries" : ["docker.dever.cc"]
  23. }
  24. EOF
  25. service docker restart
  26. ln -sf $basepath/src/dm.py /usr/bin/dm && chmod +x /usr/bin/dm
  27. ln -sf $basepath/src/ds.py /usr/bin/ds && chmod +x /usr/bin/ds
  28. ln -sf $basepath/src/dp.py /usr/bin/dp && chmod +x /usr/bin/dp
  29. ln -sf $basepath/src/dpc.py /usr/bin/dpc && chmod +x /usr/bin/dpc
  30. ln -sf $basepath/src/dever.py /usr/bin/dever && chmod +x /usr/bin/dever
  31. ln -sf $basepath/src/dgit.py /usr/bin/dgit && chmod +x /usr/bin/dgit
  32. # python-pip
  33. #pipstatus=`check pip`
  34. #if [ "$pipstatus" = 0 ]; then
  35. #wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -rf get-pip.py
  36. #fi
  37. # python-daemon 用不到了
  38. #pip install python-daemon
  39. #pip install redis
  40. #yumstatus=`check yum`
  41. #if [ "$yumstatus" = 0 ]; then
  42. #apt install python-gevent
  43. #else
  44. #yum install python-gevent
  45. #fi
  46. #dm run server-redis
  47. #python $basepath/src/daemon.py &
  48. docker version
  49. echo 'install success!'