SaveText.Ru

Untitled
  1. #!/bin/bash
  2. #
  3. # # Usage: ./command "option"
  4. # # where is "option" == 1 or 2
  5. #
  6.  
  7. WORKDIR=$(pwd)
  8. LOGFILE="log.txt"
  9.  
  10. # if [ $1 -eq "" ]; then
  11. #     echo 'Usage: ./command "option"'
  12. #     echo 'where is "option" == 1 or 2'
  13. #     exit 1
  14.  
  15. # elif [ $1 -eq "1" ]; then
  16. #     lala
  17. # elif [ $1 -eq "2"]; then
  18. #     lala
  19. # fi
  20.  
  21. echo "----- Sending test requests at $(date +%D_%H:%M) -----" >> $WORKDIR/$LOGFILE
  22. for ((i=1; i <= 10; i++))
  23. do
  24.     echo $i
  25.  
  26.     echo "curl -GIL https://test$i.onef.pro" >> $WORKDIR/$LOGFILE
  27.     curl -GIL https://https-test$i.onef.pro >> $WORKDIR/$LOGFILE 2>&1
  28.     echo $?
  29.     echo "" >> $WORKDIR/$LOGFILE
  30.  
  31.     echo "curl -GIL http://test$i.onef.pro" >> $WORKDIR/$LOGFILE
  32.     curl -GIL http://http-test$i.onef.pro >> $WORKDIR/$LOGFILE 2>&1
  33.     echo $?
  34.     echo "" >> $WORKDIR/$LOGFILE
  35.  
  36.     echo ""
  37. done
  38. echo "----- Stop sending test requests -----" >> $WORKDIR/$LOGFILE
  39.  
  40.  

Share with your friends:

Print