mysync.sh 585 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. ############### 一键安装RslSync脚本 ###############
  3. #Author:xiaoz.me
  4. #Update:2017-03-27
  5. #Help:https://www.xiaoz.me/archives/8219
  6. ####################### END #######################
  7. #获取rslsync pid
  8. chksync=$(pgrep 'rslsync')
  9. if [ "$1" == "start" ]
  10. then
  11. ./rslsync --config sync.conf
  12. echo "启动成功,请访问http://IP:8888/"
  13. elif [ "$1" == "status" ]
  14. then
  15. if [ "$chksync" == "" ]
  16. then
  17. echo "Not running!"
  18. else
  19. echo "Is running,pid is ${chksync}"
  20. fi
  21. elif [ "$1" == "stop" ]
  22. then
  23. kill -9 ${chksync}
  24. else
  25. echo "参数错误!"
  26. fi