Advertisement
Guest User

Untitled

a guest
May 19th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #!/bin/sh
  2. # This assumes that it is being run by root.
  3. ALLOW=${ALLOW:-127.* ::1}
  4. USERNAME=racktop
  5. PASSWORD=racktop
  6.  
  7. echo "$USERNAME:$PASSWORD" > /tmp/rsyncd.secrets
  8. chmod 0400 /tmp/rsyncd.secrets && chown 0:0 /tmp/rsyncd.secrets
  9.  
  10. cat <<EOF > /tmp/rsyncd.conf
  11. pid file = /tmp/rsyncd.pid
  12. log file = /dev/stdout
  13. lock file = /tmp/rsyncd.lck
  14. timeout = 300
  15. max connections = 2
  16. port = 9008
  17.  
  18. [data]
  19. uid = root
  20. gid = everyone
  21. hosts deny = *
  22. hosts allow = ${ALLOW}
  23. read only = false
  24. path = /tmp/files
  25. comment = data directory
  26. auth users = $USERNAME
  27. secrets file = /tmp/rsyncd.secrets
  28. EOF
  29.  
  30. exec /usr/bin/rsync --no-detach --daemon --config /tmp/rsyncd.conf "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement