daily pastebin goal
5%
SHARE
TWEET

antiflood.sh

a guest Aug 19th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fun_span () {
  2. local USUARIO="$1"
  3. local GRUPO="$2"
  4. local CAMINHO="/etc/ShellBot/Usuarios/$GRUPO/"
  5. unset USRARRAY
  6. declare -A USRARRAY
  7. [[ ! -e $CAMINHO/timearray.sh ]] && touch $CAMINHO/timearray.sh
  8. source $CAMINHO/timearray.sh || rm $CAMINHO/timearray.sh
  9. [[ ${USRARRAY[$USUARIO]} -gt "3" ]] && funcao_span "$USUARIO" "$GRUPO" && return 0 # DEFINE VALOR MAXIMO DE MSG
  10. local VALUE=$(cat $CAMINHO/timearray.sh|grep -v "$USUARIO") && rm $CAMINHO/timearray.sh
  11. while read line; do
  12. echo $line >> $CAMINHO/timearray.sh
  13. done <<< "$VALUE"
  14. let USRARRAY[$USUARIO]++
  15. echo "USRARRAY[$USUARIO]='${USRARRAY[$USUARIO]}'" >> $CAMINHO/timearray.sh
  16. [[ ${USRARRAY[$USUARIO]} -gt "1" ]] && return 0
  17. (
  18. sleep 5s # TEMPO DE SPAN
  19. VALUE=$(cat $CAMINHO/timearray.sh|grep -v "$USUARIO") && rm $CAMINHO/timearray.sh
  20. while read line; do
  21. echo $line >> $CAMINHO/timearray.sh
  22. done <<< "$VALUE"
  23. ) &
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top