<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; email оповешения при подлючении клиента к OpenVPN серверу]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=25427&amp;type=atom" />
	<updated>2012-12-15T13:16:11Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=25427</id>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=314787#p314787" />
			<content type="html"><![CDATA[<p>ЕМНИП в centos 6 по дефолту rsyslog, который имеет модуль ommail, с помощью которого можно отсылать на почту нужные сообщения в зависимости от событий, типа событийи т.д. От скриптов можно послностью отказаться.</p>]]></content>
			<author>
				<name><![CDATA[Macumazan]]></name>
				<uri>https://linuxforum.ru/profile.php?id=952</uri>
			</author>
			<updated>2012-12-15T13:16:11Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=314787#p314787</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=314707#p314707" />
			<content type="html"><![CDATA[<p>Добрового времени суток. Помогите дописать скрипт пожалуйста.</p><p>1шаг: Проверяю еррор логи на наличие ошибки, на выходе из команды получаю название домена<br /></p><div class="codebox"><pre><code>grep &quot;$min_1&quot; $log_er | grep limiting | awk &#039;{print $16}&#039; | sed &#039;s/,/ /g&#039; </code></pre></div><p>2шаг: Потом сравниваю с именами домена. Если какои-то домен подходит, то проверяю другие логи, чтобы узнать количество соединений<br /></p><div class="codebox"><pre><code>     if [[ $line =~ ^domain1.com ]] ;then
                                full_line=`grep &quot;$min_2&quot; $log_2 | awk &#039;{print $3}&#039; | sort | uniq -c | sort -n `
                                full_line_s=`echo &quot;$full_line&quot; |  awk &#039;{print $1}&#039;`
                                for line in $full_line_s
                        fi
                        do
                                check=`echo &quot;$line&quot;`
                #check limits
                        if (( $check &gt; $thr ))
                then
                        echo &quot;Some text: $data&quot;|mail -s &quot;Some text on $host&quot; $mailbox
                        fi
#-----------------------------------------------------------------------------------------------------
                        elif [[ $line =~ ^domain2.com ]] ;then
                                full_line=`grep &quot;$min_2&quot; $log_2 | awk &#039;{print $3}&#039; | sort | uniq -c | sort -n `
                                full_line_s=`echo &quot;$full_line&quot; |  awk &#039;{print $1}&#039;`
                                for line in $full_line_s
                        do
                                check=`echo &quot;$line&quot;`
                #check limits
                        if (( $check &gt; $thr ))
                then
                        echo &quot;Some text: $data&quot;|mail -s &quot;Some text on $host&quot; $mailbox
                        fi
#-----------------------------------------------------------------------------------------------------
                         elif [[ $line =~ ^domain3.com ]] ;then
                                full_line=`grep &quot;$min_2&quot; $log_3 | awk &#039;{print $3}&#039; | sort | uniq -c | sort -n `
                                full_line_s=`echo &quot;$full_line&quot; |  awk &#039;{print $1}&#039;`
                                for line in $full_line_s
                        do
                                check=`echo &quot;$line&quot;`
                #check limits
                        if (( $check &gt; $thr ))
                then
                        echo &quot;Some text: $data&quot;|mail -s &quot;Some text on $host&quot; $mailbox
                        fi
#-----------------------------------------------------------------------------------------------------
                        elif [[ $line =~ ^domain4.com ]] ;then
                                full_line=`grep &quot;$min_2&quot; $log_4 | awk &#039;{print $3}&#039; | sort | uniq -c | sort -n `
                                full_line_s=`echo &quot;$full_line&quot; |  awk &#039;{print $1}&#039;`
                                for line in $full_line_s
                        do
                                check=`echo &quot;$line&quot;`
                #check limits
                        if (( $check &gt; $thr ))
                then
                        echo &quot;Some text: $data&quot;|mail -s &quot;Some text on $host&quot; $mailbox
                        fi
#-----------------------------------------------------------------------------------------------------
                else
                        break;
        fi
                done</code></pre></div><p>3шаг: Если лимит превышен, то отправляю емаил<br /></p><div class="codebox"><pre><code>do
                                check=`echo &quot;$line&quot;`
                #check limits
                        if (( $check &gt; $thr ))
                then
                        echo &quot;Some text: $data&quot;|mail -s &quot;Some text on $host&quot; $mailbox
                        fi</code></pre></div><p>Весь скрипт:<br /></p><div class="codebox"><pre><code>#!/bin/bash

#Setup limit
thr=900
#-----------------------------------------------------------------------------------------------------
#Time
min_1=`date &#039;+%G/%m/%d %H:%M&#039;`
min_2=`date +%d/%b/%Y:%H:%M`
#-----------------------------------------------------------------------------------------------------
#nginx error log file
log_er=&quot;/var/log/nginx/error.log&quot;
#-----------------------------------------------------------------------------------------------------
#log files
log_1=&quot;/etc/nginx/logs/domain1.com.ssl.log&quot;
log_2=&quot;/etc/nginx/logs/domain2.com.ssl.log&quot;
log_3=&quot;/etc/nginx/logs/domain3.com.ssl.log&quot;
log_4=&quot;/etc/nginx/logs/domain4.com.ssl.log&quot;
#-----------------------------------------------------------------------------------------------------
#Information for email
#From hostname
host=`hostname`
#-----------------------------------------------------------------------------------------------------
#To
mailbox=&quot;myemail@whatever.com&quot;
#-----------------------------------------------------------------------------------------------------
#Body
data=`test message`
#-----------------------------------------------------------------------------------------------------
                grep &quot;$min_1&quot; $log_er | grep limiting | awk &#039;{print $16}&#039; | sed &#039;s/,/ /g&#039; | while read line; do
                        if [[ $line =~ ^domain1.com ]] ;then
                                full_line=`grep &quot;$min_2&quot; $log_2 | awk &#039;{print $3}&#039; | sort | uniq -c | sort -n `
                                full_line_s=`echo &quot;$full_line&quot; |  awk &#039;{print $1}&#039;`
                                for line in $full_line_s
                        fi
                        do
                                check=`echo &quot;$line&quot;`
                #check limits
                        if (( $check &gt; $thr ))
                then
                        echo &quot;Some text: $data&quot;|mail -s &quot;Some text on $host&quot; $mailbox
                        fi
#-----------------------------------------------------------------------------------------------------
                        elif [[ $line =~ ^domain2.com ]] ;then
                                full_line=`grep &quot;$min_2&quot; $log_2 | awk &#039;{print $3}&#039; | sort | uniq -c | sort -n `
                                full_line_s=`echo &quot;$full_line&quot; |  awk &#039;{print $1}&#039;`
                                for line in $full_line_s
                        do
                                check=`echo &quot;$line&quot;`
                #check limits
                        if (( $check &gt; $thr ))
                then
                        echo &quot;Some text: $data&quot;|mail -s &quot;Some text on $host&quot; $mailbox
                        fi
#-----------------------------------------------------------------------------------------------------
                         elif [[ $line =~ ^domain3.com ]] ;then
                                full_line=`grep &quot;$min_2&quot; $log_3 | awk &#039;{print $3}&#039; | sort | uniq -c | sort -n `
                                full_line_s=`echo &quot;$full_line&quot; |  awk &#039;{print $1}&#039;`
                                for line in $full_line_s
                        do
                                check=`echo &quot;$line&quot;`
                #check limits
                        if (( $check &gt; $thr ))
                then
                        echo &quot;Some text: $data&quot;|mail -s &quot;Some text on $host&quot; $mailbox
                        fi
#-----------------------------------------------------------------------------------------------------
                        elif [[ $line =~ ^domain4.com ]] ;then
                                full_line=`grep &quot;$min_2&quot; $log_4 | awk &#039;{print $3}&#039; | sort | uniq -c | sort -n `
                                full_line_s=`echo &quot;$full_line&quot; |  awk &#039;{print $1}&#039;`
                                for line in $full_line_s
                        do
                                check=`echo &quot;$line&quot;`
                #check limits
                        if (( $check &gt; $thr ))
                then
                        echo &quot;Some text: $data&quot;|mail -s &quot;Some text on $host&quot; $mailbox
                        fi
#-----------------------------------------------------------------------------------------------------
                else
                        break;
        fi
                done</code></pre></div><p>По частям скрипт работает, но связать все в один не получатся, особенно if fi не могу понять как работает, если там не один цикл, а четыре. Плюс еше if fi из шага 3 там мешаются. Короче завис я( Помогите пожалуйста, буду очень благодарен.<br />Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[NewbieUNIX]]></name>
				<uri>https://linuxforum.ru/profile.php?id=21109</uri>
			</author>
			<updated>2012-12-14T19:09:48Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=314707#p314707</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=314060#p314060" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Lupo Alberto пишет:</cite><blockquote><div class="codebox"><pre><code>date +%d/%b/%Y:%H:%M</code></pre></div></blockquote></div><p>Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[NewbieUNIX]]></name>
				<uri>https://linuxforum.ru/profile.php?id=21109</uri>
			</author>
			<updated>2012-12-11T18:59:59Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=314060#p314060</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=314059#p314059" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>date +%d/%b/%Y:%H:%M</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Lupo Alberto]]></name>
				<uri>https://linuxforum.ru/profile.php?id=9018</uri>
			</author>
			<updated>2012-12-11T18:46:15Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=314059#p314059</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=314056#p314056" />
			<content type="html"><![CDATA[<p>Помогите пожалуйста оптимизировать:<br /></p><div class="codebox"><pre><code>date | awk &#039;{print $3,$2,$6,$4}&#039; | sed &#039;s/ /\//&#039; | sed &#039;s/ /\//&#039; | sed &#039;s/ /\:/&#039; | cut -d: -f1,2,3</code></pre></div><p>Пытаюсь вывод команды &quot;date&quot; трансформировать, вместо <br /></p><div class="codebox"><pre><code>Tue Dec 11 13:35:32 EST 2012</code></pre></div><p>получить следующее:<br /></p><div class="codebox"><pre><code>11/Dec/2012:13:35</code></pre></div><p>Мой вариант работает, но я понимаю что можно сделать проще, только не знаю как. Буду очень благодарен за подсказку.<br />Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[NewbieUNIX]]></name>
				<uri>https://linuxforum.ru/profile.php?id=21109</uri>
			</author>
			<updated>2012-12-11T18:37:22Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=314056#p314056</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=313125#p313125" />
			<content type="html"><![CDATA[<p>Вот что получилось. Vascom и Lupo Alberto огромное спасибо.<br /></p><div class="codebox"><pre><code>#!/bin/bash

thr=30

full_line=`netstat -ntu | awk &#039;{print $5}&#039; | awk &#039;!/[A-Za-z]/&#039; | cut -d: -f1 | sort | uniq -c | sort -n`

full_line_s=`echo &quot;$full_line&quot; |  awk &#039;{print $1}&#039;`

for line in $full_line_s
do

    check=`echo &quot;$line&quot; | awk &#039;{print $1}&#039;`
###############################################################
host=`hostname`
mailbox=&quot;myemail@whatever.com&quot;
data=`netstat -ntu | awk &#039;$5 ~ /[0-9]/ {print $5}&#039; | cut -d: -f1 | sort | uniq -c | sort -n | awk &#039;$1 &gt; 30 {print $2}&#039;`
###############################################################
    #check limits
    if (( $check &gt; $thr ))
    then
        echo &quot;Some text here: $data&quot;|mail -s &quot;Some text here $host&quot; $mailbox
    fi
done</code></pre></div>]]></content>
			<author>
				<name><![CDATA[NewbieUNIX]]></name>
				<uri>https://linuxforum.ru/profile.php?id=21109</uri>
			</author>
			<updated>2012-12-06T20:39:19Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=313125#p313125</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=313045#p313045" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Vascom пишет:</cite><blockquote><p>Да, это я коряво с пробелами разобрался <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /><br />Конечно надо было через awk, как-то забываю про него.</p><p>Ну разберись в скрипте, если хочешь, там все команды элементарные.<br />Надо отредактировать строку<br />check=`echo &quot;$line&quot; | cut -d &quot;,&quot; -f7`<br />подобрать нужное поле, то есть не -f7, а -f6 или -f5 или ещё меньше.</p></blockquote></div><p>Да конечно <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" />&nbsp; Ещё раз огромное спасибо&nbsp; <img src="https://linuxforum.ru/img/smilies/ay.gif" alt="ay" /> <br />Просто хотел убедиться, что понимаю о чём речь.<br />Позже виложу конечный вариант.</p>]]></content>
			<author>
				<name><![CDATA[NewbieUNIX]]></name>
				<uri>https://linuxforum.ru/profile.php?id=21109</uri>
			</author>
			<updated>2012-12-06T15:18:09Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=313045#p313045</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=312983#p312983" />
			<content type="html"><![CDATA[<p>Да, это я коряво с пробелами разобрался <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /><br />Конечно надо было через awk, как-то забываю про него.</p><p>Ну разберись в скрипте, если хочешь, там все команды элементарные.<br />Надо отредактировать строку<br />check=`echo &quot;$line&quot; | cut -d &quot;,&quot; -f7`<br />подобрать нужное поле, то есть не -f7, а -f6 или -f5 или ещё меньше.</p>]]></content>
			<author>
				<name><![CDATA[Vascom]]></name>
				<uri>https://linuxforum.ru/profile.php?id=5339</uri>
			</author>
			<updated>2012-12-06T06:30:19Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=312983#p312983</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=312896#p312896" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Vascom пишет:</cite><blockquote><p>На коленке можно так сделать, правда пришлось избавляться от пробелов, но их точно так же можно и вернуть, если надо:<br /></p><div class="codebox"><pre><code>#!/bin/bash

#Удаляем старый файл
rm flame_file.log
#Задаём порог срабатывания
thr=1

full_line=`netstat -ntu | awk &#039;{print $5}&#039; | awk &#039;!/[A-Z]/&#039; | cut -d: -f1 | sort | uniq -c | sort -n`

#Заменяем пробелы на &quot;,&quot;, чтобы проще было обрабатывать в цикле for
full_line_s=`echo &quot;$full_line&quot; | sed &#039;s/ /,/g&#039;`

for line in $full_line_s
do
    #Вычленяем нужные числа
    check=`echo &quot;$line&quot; | cut -d &quot;,&quot; -f7`

    #Проверяем превышение порога
    if (( $check &gt; $thr ))
    then
        echo &quot;$line&quot; &gt;&gt; flame_file.log
    fi
done</code></pre></div><p>Как отправить письмо ты уже знаешь, файл очищается rm (в моём примере), либо через <strong>echo &quot;&quot; &gt; flame_file.log</strong>.</p><p>Этот вариант написан за пару минут, можно доработать и вылизать его.</p></blockquote></div><p>Скрипт интересный, спасибо большое.<br />На линии 19 он сравнивает IP с лимитом количества подключений, хотя должен сравнивать лимит подлючений и кол-во подключений с одного IP.<br /></p><div class="codebox"><pre><code> line 19: ((: 209.40.97.5 &gt; 1 : syntax error: invalid arithmetic operator (error token is &quot;.40.97.5 &gt; 1 &quot;)</code></pre></div><p> Или я чего-то не понимаю?<br />Спасибо</p>]]></content>
			<author>
				<name><![CDATA[NewbieUNIX]]></name>
				<uri>https://linuxforum.ru/profile.php?id=21109</uri>
			</author>
			<updated>2012-12-05T17:56:35Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=312896#p312896</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=312710#p312710" />
			<content type="html"><![CDATA[<p>Кстати, <em>iptables</em> может логировать (и при желании блокировать) превышение запросов за определённый промежуток времени.</p>]]></content>
			<author>
				<name><![CDATA[Lupo Alberto]]></name>
				<uri>https://linuxforum.ru/profile.php?id=9018</uri>
			</author>
			<updated>2012-12-05T07:41:12Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=312710#p312710</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=312705#p312705" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>NewbieUNIX пишет:</cite><blockquote><p>Как лучше проверить есть ли в первом столбике число, например, больше 30. И если такая линия имеется, то переместить её в отдельный фаил вместе с IP адресом.</p></blockquote></div><p>Команда<br /></p><div class="codebox"><pre><code>netstat -ntu | awk &#039;$5 ~ /[0-9]/ {print $5}&#039; | cut -d: -f1 | sort | uniq -c | sort -n | awk &#039;$1 &gt; 30 {print $2}&#039;</code></pre></div><p>покажет только адреса, встречающиеся больше 30 раз. Ну и, разумеется, весь вывод можно перенаправить в файл.</p>]]></content>
			<author>
				<name><![CDATA[Lupo Alberto]]></name>
				<uri>https://linuxforum.ru/profile.php?id=9018</uri>
			</author>
			<updated>2012-12-05T06:46:39Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=312705#p312705</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=312695#p312695" />
			<content type="html"><![CDATA[<p>На коленке можно так сделать, правда пришлось избавляться от пробелов, но их точно так же можно и вернуть, если надо:<br /></p><div class="codebox"><pre><code>#!/bin/bash

#Удаляем старый файл
rm flame_file.log
#Задаём порог срабатывания
thr=1

full_line=`netstat -ntu | awk &#039;{print $5}&#039; | awk &#039;!/[A-Z]/&#039; | cut -d: -f1 | sort | uniq -c | sort -n`

#Заменяем пробелы на &quot;,&quot;, чтобы проще было обрабатывать в цикле for
full_line_s=`echo &quot;$full_line&quot; | sed &#039;s/ /,/g&#039;`

for line in $full_line_s
do
    #Вычленяем нужные числа
    check=`echo &quot;$line&quot; | cut -d &quot;,&quot; -f7`

    #Проверяем превышение порога
    if (( $check &gt; $thr ))
    then
        echo &quot;$line&quot; &gt;&gt; flame_file.log
    fi
done</code></pre></div><p>Как отправить письмо ты уже знаешь, файл очищается rm (в моём примере), либо через <strong>echo &quot;&quot; &gt; flame_file.log</strong>.</p><p>Этот вариант написан за пару минут, можно доработать и вылизать его.</p>]]></content>
			<author>
				<name><![CDATA[Vascom]]></name>
				<uri>https://linuxforum.ru/profile.php?id=5339</uri>
			</author>
			<updated>2012-12-05T05:28:42Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=312695#p312695</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=312684#p312684" />
			<content type="html"><![CDATA[<p>С вашего разрешения, друзья, посветим эту тему скриптам =)<br />Я пытаюсь написать скрипт, который будет отсылать email если количество соединений превысит установленный предел.<br />Т.е. один пользователь пытается закидать сервак запросами. Вот что у меня получилось:<br /></p><div class="codebox"><pre><code>#!/bin/bash
while [ : ]
do
        netstat -ntu | awk &#039;{print $5}&#039; | awk &#039;!/[A-Z]/&#039; | cut -d: -f1 | sort | uniq -c | sort -n 
                if [[ $line &gt; 30 ]] ;then
                        break;
                else
                        echo $line &gt;&gt; result2;
                fi
done
#-------------------------------------------------------------------------------------------
                        cat result2 | mail -s &quot;Some gay hit API limit&quot; myemail@whatever.com
:&gt; result2
done</code></pre></div><p>Строго не судите, только учусь<br />Я использую команду netstat, для того чтобы получить список IP адресов и сколько соединений установленно с каждым IP:<br /></p><div class="codebox"><pre><code> netstat -ntu | awk &#039;{print $5}&#039; | awk &#039;!/[A-Z]/&#039; | cut -d: -f1 | sort | uniq -c | sort -n </code></pre></div><p>Получается вот что:<br /></p><div class="codebox"><pre><code>      1 149.152.191.3
      1 164.50.244.203
      2 173.164.45.221
      4 173.64.11.26</code></pre></div><p>Затем(вот тут вопрос):<br /></p><div class="codebox"><pre><code>if [[ $line &gt; 1 ]] ;then
                        break;
                else
                        echo $line &gt;&gt; result2;
                fi
done</code></pre></div><p>Как лучше проверить есть ли в первом столбике число, например, больше 30. И если такая линия имеется, то переместить её в отдельный фаил вместе с IP адресом. Естественно я понимаю, что if [[ $line &gt; 1 ]] ;then .... совершенно не правильно, просто пытался кое-что изобразить, но вообше не получилось, пардоньте.</p><p>Ну и финальная стадия, отправить содержимое фаила на определеный email и очистить фаил.<br />Подскажите пожалуиста как дописать скрипт, либо может эту задачу можно решить иным способом.<br />Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[NewbieUNIX]]></name>
				<uri>https://linuxforum.ru/profile.php?id=21109</uri>
			</author>
			<updated>2012-12-04T22:59:18Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=312684#p312684</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=312626#p312626" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Vascom пишет:</cite><blockquote><p>Так в чём была проблема?</p></blockquote></div><p>кавычки =)</p>]]></content>
			<author>
				<name><![CDATA[NewbieUNIX]]></name>
				<uri>https://linuxforum.ru/profile.php?id=21109</uri>
			</author>
			<updated>2012-12-04T16:26:36Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=312626#p312626</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: email оповешения при подлючении клиента к OpenVPN серверу]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=312625#p312625" />
			<content type="html"><![CDATA[<p>Так в чём была проблема?</p>]]></content>
			<author>
				<name><![CDATA[Vascom]]></name>
				<uri>https://linuxforum.ru/profile.php?id=5339</uri>
			</author>
			<updated>2012-12-04T16:14:52Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=312625#p312625</id>
		</entry>
</feed>
