Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # This assumes that it is being run by root.
- ALLOW=${ALLOW:-127.* ::1}
- USERNAME=racktop
- PASSWORD=racktop
- echo "$USERNAME:$PASSWORD" > /tmp/rsyncd.secrets
- chmod 0400 /tmp/rsyncd.secrets && chown 0:0 /tmp/rsyncd.secrets
- cat <<EOF > /tmp/rsyncd.conf
- pid file = /tmp/rsyncd.pid
- log file = /dev/stdout
- lock file = /tmp/rsyncd.lck
- timeout = 300
- max connections = 2
- port = 9008
- [data]
- uid = root
- gid = everyone
- hosts deny = *
- hosts allow = ${ALLOW}
- read only = false
- path = /tmp/files
- comment = data directory
- auth users = $USERNAME
- secrets file = /tmp/rsyncd.secrets
- EOF
- exec /usr/bin/rsync --no-detach --daemon --config /tmp/rsyncd.conf "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement