post-receive 700 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
  3. export PATH
  4. #syncip=123.206.177.125 #img
  5. syncip=123.206.116.149 #web
  6. port=21332
  7. syncname=hookssync
  8. token=924f6c2e-e13e-11e7-8cc9-e84e062b86ac
  9. #echo color_text
  10. Color_Text()
  11. {
  12. echo -e " \e[0;$2m$1\e[0m"
  13. }
  14. Echo_Red()
  15. {
  16. echo $(Color_Text "$1" "31")
  17. }
  18. Echo_Green()
  19. {
  20. echo $(Color_Text "$1" "32")
  21. }
  22. Echo_Green 'the code is sync... please wait...'
  23. Echo_Green '---------------------------sync------------------------------'
  24. echo ''
  25. echo ''
  26. echo ''
  27. echo ''
  28. curl -s http://$syncip:$port/$syncname/$token
  29. echo ''
  30. Echo_Green '---------------------------sync------------------------------'
  31. Echo_Green 'Finsh.....'