v3.0.0.sh 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/usr/bin/env bash
  2. git config core.ignorecase false
  3. chmod 777 /app/data/tmp -R
  4. service crond restart
  5. hostname=`hostname`
  6. domain=`php /app/bin/tools.php getDomain`
  7. port=`php /app/bin/tools.php getPort`
  8. #收款明细表名称改成票据收款统计表
  9. #curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=receiptsDetailedRename
  10. #初始化数据
  11. curl -s http://${domain}:${port}/v2/tools/init
  12. #初始化量身定制
  13. curl -s http://${domain}:${port}/v2/tools/init?key=customized
  14. #初始化机台数据
  15. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=machine
  16. #转移报表密码
  17. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=transfer_report_password
  18. #初始化财务数据
  19. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=statement
  20. #初始化权限
  21. curl -s http://${domain}:${port}/v2/tools/init?key=rule
  22. #初始化机台暂停权限
  23. curl -s http://${domain}:${port}/v2/tools/init?key=machinePause
  24. #初始化机台报表数据
  25. curl -s http://${domain}:${port}/v2/tools/init?key=machine
  26. #开票收票报表数据
  27. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=ticket
  28. #初始化票据销售时间
  29. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=billOrderTime
  30. #设置内置事务
  31. curl -s http://${domain}:${port}/v2/tools/init?key=setAffairBuildin
  32. #初始化仓库同步
  33. curl -s http://${domain}:${port}/v2/tools/init?key=initWarehouseSyn
  34. #修正产品退货单票据金额
  35. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=CPTHDBillAmount
  36. #初始化票据开票人
  37. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=BillUserID
  38. #调整mongodb数据结构
  39. curl -s http://${domain}:${port}/v2/tools/v3-to-v32
  40. #调整索引
  41. curl -s http://${domain}:${port}/v2/tools/init?key=createIndex
  42. #安装wkhtmltopdf
  43. #if [ ! -x "$(command -v wkhtmltopdf)" ]; then
  44. # yum install -y urw-fonts libXext openssl-devel libXrender
  45. # wget -O /usr/share/fonts/simsun.ttc http://mi.lacecdn.com/docker/simsun.ttc
  46. # wget -O /usr/share/fonts/simfang.ttf http://mi.lacecdn.com/docker/simfang.ttf
  47. # wget -O /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz http://mi.lacecdn.com/docker/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  48. # cd /tmp
  49. # tar xvfJ wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  50. # rm -rf /usr/local/wkhtmltox
  51. # mv wkhtmltox /usr/local/
  52. # chmod +x /usr/local/wkhtmltox/bin/wkhtmltopdf
  53. # chmod +x /usr/local/wkhtmltox/bin/wkhtmltoimage
  54. # ln -sf /usr/local/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
  55. # ln -sf /usr/local/wkhtmltox/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
  56. # rm -rf /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  57. #fi
  58. #sed -i 's/^max_allowed_packet = 1M/max_allowed_packet = 16M/' /etc/my.cnf
  59. #if [ ! -f /etc/init.d/redis ];then
  60. # wget -O /etc/init.d/redis http://mi.lacecdn.com/docker/init.d.redis
  61. # chmod +x /etc/init.d/redis
  62. # service redis start
  63. # chkconfig redis on
  64. #fi
  65. #if [ -z `php -m | grep imagick` ];then
  66. # echo | pecl install imagick
  67. #fi
  68. sed -i -e '/^# wiredTiger:/a\ engineConfig:\n\ cacheSizeGB: 0.25' -e 's/^# wiredTiger:/ wiredTiger:/' /etc/mongod.conf
  69. sync; echo 3 > /proc/sys/vm/drop_caches
  70. systemctl restart mongod