<?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>EquinoxeFR &#187; nas</title>
	<atom:link href="http://www.equinoxefr.org/post/tag/nas/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.equinoxefr.org</link>
	<description>[Make &#38; Share]</description>
	<lastBuildDate>Sat, 10 Jul 2010 14:33:52 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Nas Buffalo et mise en veille</title>
		<link>http://www.equinoxefr.org/post/2009/06/26/nas-buffalo-et-mise-en-veille/</link>
		<comments>http://www.equinoxefr.org/post/2009/06/26/nas-buffalo-et-mise-en-veille/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 18:26:40 +0000</pubDate>
		<dc:creator>EquinoxeFR</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[buffalo]]></category>
		<category><![CDATA[linkstation]]></category>
		<category><![CDATA[nas]]></category>
		<category><![CDATA[Planet-Libre]]></category>

		<guid isPermaLink="false">http://www.equinoxefr.org/?p=665</guid>
		<description><![CDATA[J&#8217;ai un NAS Buffalo Linkstation Duo pro qui a la possibilité de passer en veille quand il n&#8217;est pas utilisé. Seulement voilà, comme bien souvent, cette fontionnalité n&#8217;est disponible que sous Windows ou MacOs pour lesquels des drivers  sont fournis. Heureusement pour nous, le réveil du NAS est une opération assez simple, elle consiste simplement <a href='http://www.equinoxefr.org/post/2009/06/26/nas-buffalo-et-mise-en-veille/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.equinoxefr.org/wp-content/uploads/2009/06/LS-WTGL-R1.png" rel="lightbox[665]"><img class="alignnone size-full wp-image-671" title="LS-WTGL-R1" src="http://www.equinoxefr.org/wp-content/uploads/2009/06/LS-WTGL-R1.png" alt="LS-WTGL-R1" width="254" height="300" /></a></p>
<p>J&#8217;ai un <strong>NAS Buffalo Linkstation Duo pro</strong> qui a la possibilité de passer en veille quand il n&#8217;est pas utilisé. Seulement voilà, comme bien souvent, cette fontionnalité n&#8217;est disponible que sous <em>Windows</em> ou <em>MacOs</em> pour lesquels des drivers  sont fournis.</p>
<p>Heureusement pour nous, le réveil du NAS est une opération assez simple, elle consiste simplement à envoyer au NAS des paquets &laquo;&nbsp;WakeOnLan&nbsp;&raquo; toutes les 20 secondes. Nous allons donc écrire un petit script qui une fois lancé maintiendra le NAS en éveil. Ce script nécessite l&#8217;installation du paquet &laquo;&nbsp;wakeonlan&nbsp;&raquo;.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> wakeonlan</pre></div></div>

<p>Ouvrez un nouveau script  à l&#8217;aide de gedit</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
gedit ~<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>wakenas.sh</pre></div></div>

<p>Insérez y le code suivant en remplaçant les variables IP et MAC par les vôtres.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">#! /bin/sh</span>
<span style="color: #666666; font-style: italic;"># Insert IP of your NAS</span>
<span style="color: #007800;">IP</span>=<span style="color: #ff0000;">&quot;192.168.1.25&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Insert ethernet address of your NAS</span>
<span style="color: #007800;">MAC</span>=<span style="color: #ff0000;">&quot;00:1D:73:XX:XX:XX&quot;</span>
&nbsp;
<span style="color: #007800;">PID</span>=<span style="color: #007800;">$$</span>
<span style="color: #7a0874; font-weight: bold;">&#40;</span>
zenity <span style="color: #660033;">--notification</span> <span style="color: #660033;">--window-icon</span>=<span style="color: #ff0000;">&quot;/usr/share/icons/gnome/scalable/devices/drive-harddisk.svg&quot;</span> <span style="color: #660033;">--text</span>=<span style="color: #ff0000;">&quot;Clic to quit&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-9</span> <span style="color: #007800;">$PID</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">do</span>
wakeonlan <span style="color: #660033;">-i</span> <span style="color: #007800;">$IP</span> <span style="color: #007800;">$MAC</span>
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">20</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>Puis rendez le éxécutable</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +x ~<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>wakenas.sh</pre></div></div>

<p>Lorsqu&#8217;il est lancé, une icone apparaît dans la barre des taches. Un clic sur l&#8217;icone termine le script et permet au nas de se remettre en veille. Voilà quelques watts d&#8217;économisés facilement.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.equinoxefr.org/post/2009/06/26/nas-buffalo-et-mise-en-veille/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
