Subversion Repositories My Stuff

Compare Revisions

Ignore whitespace Rev 28 → Rev 29

/trunk/Bash/mail-stress-testing.sh
0,0 → 1,49
#!/bin/sh
 
#####################################################################
# Script to send disierd number of emails to one adress
# to stress test mail server
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# Author: Andrzej Kardaś
# License: GPLv3
# The full version of the licencse can be obtainted by visiting:
# http://www.gnu.org/licenses/gpl.html
#######################################################################
 
SERVERNAME=$(hostname)
DATE=$(date +"%d.%m.%Y")
EMAIL=test@test.pl
FILENAME="/var/tmp/attachment-${DATE}.txt"
HOWMANY=${1}
 
echo "Czas pracy wysylajacego komputera" > ${FILENAME}
/usr/bin/uptime >> ${FILENAME}
echo "Dane komputera wysylajacego:" >> ${FILENAME}
/usr/bin/uname -a >> ${FILENAME}
echo "Adres IP komputera:" >> ${FILENAME}
/sbin/ifconfig | grep Bcast | awk '{print $2 }'|awk -F":" '{print $2}' >> ${FILENAME}
echo "Publiczy adres wysylajacego komputera:" >> ${FILENAME}
/usr/bin/curl -s http://whatismyip.org >> ${FILENAME}
 
echo "To jest testowy email aby przetestować możliwość odebrania dużej ilości maili przez serwer" > /var/tmp/msgfile-${DATE}
echo "Czas pracy wysylajacego komputera" >> /var/tmp/msgfile-${DATE}
/usr/bin/uptime >> /var/tmp/msgfile-${DATE}
echo "Dane komputera wysylajacego:" >> /var/tmp/msgfile-${DATE}
/usr/bin/uname -a >> /var/tmp/msgfile-${DATE}
echo "Adres IP komputera:" >> /var/tmp/msgfile-${DATE}
/sbin/ifconfig | grep Bcast | awk '{print $2 }'|awk -F":" '{print $2}' >> /var/tmp/msgfile-${DATE}
echo "Publiczy adres wysylajacego komputera:" >> /var/tmp/msgfile-${DATE}
/usr/bin/curl -s http://whatismyip.org >> /var/tmp/msgfile-${DATE}
 
 
for ((i=1; i<=HOWMANY;i++))
do
echo "wsylam maila numer ${i}"
/usr/bin/mutt -s "${DATE} To jest mail testowy numer ${i}" ${EMAIL} -a ${FILENAME} < /var/tmp/msgfile-${DATE}
sleep 2
done
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property