🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #6462

Re: script sobre dmesg

#6462
From: sio2
Date: Thu, 26 Jun 2003 11:52
37 lines
2132 bytes
El jueves, 26 de junio de 2003, a las 09:39 GMT, Pacolinx escribi�:
> 
> Hola
> A mi disco duro hay veces q  me saca error de dma y cuando eso pasa tengo q
> desactivarlo. Para eso he hecho este script q si encuentra la cadena
> status=0x51 en dmesg me desactive el dma.  Pero siempre me desactiva el
> dma. Algien sabe donde esta el fallo?
> 
>#!/bin/bash
> f=/root/temp.txt
> dmesg > $f
> i=0
> awk '/status=0x51/ {i=i+1} '  $f
> if [ i> 0 ]; then
>                echo Error de dma 
>                hdparm -d0 /dev/hda
> fi
> 
> rm -f $f
> 
�No es m�s sencillo hacerlo con grep?:

#!/bin/sh

if [ -n "$(dmesg | grep 'status=0x51')" ]; then
   echo "Error de dma"
   hdaparm -d0 /dev/hda
fi

No lo he probado, pero supongo que funcionar� para lo que quieres.

-- 
Lee si puedes y enmienda si sabes
                  --- Lope de Vega ---
   Si     Di�xido de Silicio |        Debian GNU/Linux 
  /  \         (SiO2)        |    Jos� Miguel S�nchez Al�s
 O    O   Mineral de Cuarzo  |  sio2.arr@ba.online.fr | URL #257033
Technical Details
Message-ID: <slrnbflnjs.rv8.sio2.arr@cebolleta.net.dhis.org>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!feed.news.nacamar.de!fu-berlin.de!uni-berlin.de!22.red-80-37-129.pooles.rima-tde.NET!not-for-mail
References: <ejrqs-u63.ln1@paco.aldarias.org>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,f984cdfccfbdd20
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-06-26 05:20:04 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!feed.news.nacamar.de!fu-berlin.de!uni-berlin.de!22.red-80-37-129.pooles.rima-tde.NET!not-for-mail
From: sio2 <sio2.arr@ba.online.fr>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: script sobre dmesg
Date: Thu, 26 Jun 2003 13:52:28 +0200
Lines: 37
Message-ID: <slrnbflnjs.rv8.sio2.arr@cebolleta.net.dhis.org>
References: <ejrqs-u63.ln1@paco.aldarias.org>
Reply-To: sio2.arr@ba.online.fr
NNTP-Posting-Host: 22.red-80-37-129.pooles.rima-tde.net (80.37.129.22)
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 1056628823 28741452 80.37.129.22 (16 [113866])
X-Orig-Path: cebolleta.net.dhis.org!news
User-Agent: slrn/0.9.7.4 (Linux)