[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/usr/share/se3/scripts/ -> mk_rsyncconf.sh (source)

   1  #!/bin/bash
   2  
   3  # $Id: mk_rsyncconf.sh 7061 2012-04-02 09:22:45Z dbo $ #
   4  
   5  ##### Configure rsync pour une sauvegarde via Backuppc depuis un autre serveur #####
   6  
   7  if [ "$1" = "pass" ]
   8  then
   9      PASS=`cat /etc/rsyncd.secret | cut -d':' -f2`
  10      echo "$PASS"
  11      exit 0
  12  fi    
  13  
  14  
  15  if [ -e "/tmp/rsyncd.conf" -a "$1" != "" ]
  16  then
  17      mv /tmp/rsyncd.conf /etc/rsyncd.conf 2>/dev/null
  18      echo "$2:$3" > /etc/rsyncd.secret
  19      chmod 400 /etc/rsyncd.secret
  20      rm -f /tmp/rsyncd.conf 2>/dev/null
  21  fi
  22      
  23  if [ "$1" = "start" ]
  24  then
  25  echo "
  26  RSYNC_ENABLE=true
  27  RSYNC_CONFIG_FILE=/etc/rsyncd.conf
  28  RSYNC_OPTS='' " > /etc/default/rsync
  29  
  30  /etc/init.d/rsync start 2>/dev/null
  31  
  32  fi
  33  
  34  if [ "$1" = "stop" ]
  35  then
  36  echo "
  37  RSYNC_ENABLE=false
  38  RSYNC_CONFIG_FILE=/etc/rsyncd.conf
  39  RSYNC_OPTS='' " > /etc/default/rsync
  40  
  41  /etc/init.d/rsync stop 2>/dev/null
  42  fi
  43  
  44  if [ "$1" = "restart" ]
  45  then
  46  echo "
  47  RSYNC_ENABLE=true
  48  RSYNC_CONFIG_FILE=/etc/rsyncd.conf
  49  RSYNC_OPTS='' " > /etc/default/rsync
  50  
  51  /etc/init.d/rsync restart 2>/dev/null
  52  fi
  53  


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1