#!/bin/bash


. /ips/setup/.config

if [ "$1" = "--force" ]; then
   RSY_DAILY=
fi

if [ "$RSY_DAILY" = "2" ]; then
   # off
   exit
fi 



   DAT=`date +"%Y.%m.%d"`

if [ "$RSY_DAILY" = "1" ]; then

   RSY=`cat /ips/tmp/RSY 2> /dev/null`
   if [  "$RSY" = "$DAT"   ];  then
      echo $DAT already checked
      exit 0
   fi

   #echo $DAT > /ips/tmp/RSY
  
fi

   echo $DAT checking

  /ips/extra/ipsqos.rsync
  res=$?
  
  if [ $res = 0 ]; then
      echo $DAT > /ips/tmp/RSY
      echo $DAT checked
  else
      echo $DAT failed
  fi

  exit $res
  