deploy.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. if [ `whoami` != 'root' ];then
  3. echo 'please run as root'
  4. exit 1
  5. fi
  6. if [[ ! -f "/etc/gsd/files.list_video_rtsp" ]]; then
  7. cp $PWD/../source/CNStream/config/files.list_video_rtsp /etc/gsd/
  8. fi
  9. if [[ ! -f "/etc/gsd/config.ini" ]]; then
  10. cp /opt/GSD/source/birdy/config/config.ini /etc/gsd/
  11. fi
  12. if [[ ! -f "/etc/profile.d/rtsp.sh" ]]; then
  13. echo "export rtspip=\"192.168.1.130\"" > /etc/profile.d/rtsp.sh
  14. fi
  15. if [[ ! -f "/etc/profile.d/gsdProfile.sh" ]]; then
  16. echo "export dockerio=\"10.8.0.113:8080\"" > /etc/profile.d/gsdProfile.sh
  17. fi
  18. read -p "是否为已部署的设备升级目录结构(yes/no, default is no):" FLASH_SELECT
  19. if [ -z "${FLASH_SELECT}" ];then
  20. FLASH_SELECT="no"
  21. fi
  22. if [ "${FLASH_SELECT}" == "yes" ];then
  23. echo "修改"
  24. if [[ ! -d "/opt/datas/" ]]; then
  25. mkdir -p /opt/datas/
  26. fi
  27. if [[ ! -d "/opt/datas/video" ]]; then
  28. mkdir -p /opt/datas/video
  29. fi
  30. if [[ ! -d "/opt/GSD/video" ]]; then
  31. if [[ ! -d "/home/sunwin/GSD/video" ]]; then
  32. echo ""
  33. else
  34. echo "转移视频数据"
  35. mv /home/sunwin/GSD/video/* /opt/datas/video/
  36. fi
  37. else
  38. echo "转移视频数据"
  39. mv /opt/GSD/video/* /opt/datas/video/
  40. fi
  41. fi
  42. echo "Complete!"