<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Case &#187; rtorrent</title>
	<atom:link href="http://case.net.ru/tag/rtorrent/feed/" rel="self" type="application/rss+xml" />
	<link>http://case.net.ru</link>
	<description>Just another technical weblog</description>
	<lastBuildDate>Sat, 19 Jun 2010 14:06:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>rtorrent and stream</title>
		<link>http://case.net.ru/2009/01/12/rtorrent-and-stream/</link>
		<comments>http://case.net.ru/2009/01/12/rtorrent-and-stream/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 08:03:14 +0000</pubDate>
		<dc:creator>Case</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[rtorrent]]></category>
		<category><![CDATA[stream]]></category>

		<guid isPermaLink="false">http://case.net.ru/?p=77</guid>
		<description><![CDATA[Раз в сутки стрим делает реконнект, выдавая при этом новый внешний ип. Небольшой watchdog для rtorrent&#8217;а на этот случай. rtorrent.sh: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #!/bin/sh while true do if &#91; &#34;`ifconfig &#124; grep ng0`&#34; &#93;; then if &#91; &#34;`ifconfig ng0&#124;grep inet`&#34; &#93;; then ip_s=`ifconfig [...]]]></description>
			<content:encoded><![CDATA[<p>Раз в сутки стрим делает реконнект, выдавая при этом новый внешний ип. Небольшой watchdog для rtorrent&#8217;а на этот случай.</p>
<p>rtorrent.sh:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">true</span>
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">`ifconfig | grep ng0`</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">`ifconfig ng0|grep inet`</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
        <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #007800;">ip_s</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ifconfig</span> ng0<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> inet<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span><span style="color: #000000; font-weight: bold;">`</span>
            <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>case<span style="color: #000000; font-weight: bold;">/</span>.rtorrent.rc.stream <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/bind=.*/bind=<span style="color: #007800;">$ip_s</span>/&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/ip=.*/ip=<span style="color: #007800;">$ip_s</span>/&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span>
            <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>case<span style="color: #000000; font-weight: bold;">/</span>.rtorrent.rc.stream
            rtorrent <span style="color: #660033;">-n</span> <span style="color: #660033;">-o</span> <span style="color: #007800;">import</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>case<span style="color: #000000; font-weight: bold;">/</span>.rtorrent.rc.stream
        <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">5</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p>mpd-down-stream.sh</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">killall</span> <span style="color: #660033;">-2</span> rtorrent</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://case.net.ru/2009/01/12/rtorrent-and-stream/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
