#!/bin/bash/bin/mkdir -p /home/rsync/{log,pid,run}echo "linuxtest:linuxtest.org" >/home/rsync/rsync.passchmod 600 /home/rsync/rsync.passmkdir -p /data/webif [ -f /etc/rsyncd.conf ] then cp /etc/rsyncd.conf /etc/rsyncd.conf.back rm -rf /etc/rsyncd.conf rm -rf /home/rsync/pid/rsyncd.pid else exit 1 >/dev/null 2>&1ficat >> /etc/rsyncd.conf << EOFuid = rootgid = rootport=873use chroot = noread only = nolist = nomax connections = 0timeout = 600log file = /home/rsync/log/rsyncd.logpidfile = /home/rsync/pid/rsyncd.pidlock file = /home/rsync/run/rsync.lock[web]path = /data/webcomment = rsyncignore errorsauth users = linuxtestsecrets file = /home/rsync/rsync.passhosts allow = *EOFrsync --daemon Rsync_Process=`ps -ef | grep rsync | grep -v grep|wc -l`if [ $Rsync_Process -eq "1" ] then echo "The rsync is running..." else echo "This rsync is not running."fi