🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: script mldonkey

#7867
From: Rafa
Date: Fri, 17 Jan 2003 19:00
87 lines
3441 bytes
Hola,

Aqu� tienes mi script, antes de ejecutar el mldonkey haces un cd al
directorio donde lo tengas:

#!/bin/sh
#
# mldonkey      This shell script takes care of starting and stopping
#               mldonkey.
 
PATH=/usr/sbin:/root/bin:/usr/local/sbin:${PATH}
COLUMNS=9999
export PATH COLUMNS
 
program=mldonkey
# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting mldonkey: "
        cd /opt/mldonkey/
        nohup ./mldonkey > /dev/null&
        #exec setuidgid rgarcia ./mldonkey /dev/null
        echo done
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down mldonkey: "
        kill `ps -aef | awk '/.\/mldonkey$/ { print $2}'`
        echo done
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  status)
        pids=`ps -aef | awk '/.\/mldonkey$/ { print $2}'`
        if test "$pids"
        then
                for p in $pids
                do
                        echo "$program (pid $p) is running"
                done
        else
                echo "$program is stopped"
        fi
        ;;
  *)
        echo "Usage: mldonkey {start|stop|restart|status}"
        exit 1
esac
 
exit 0


On Mon, 13 Jan 2003 03:18:26 +0100, iglesia wrote:

> Buenas a todos, a ver si me podeis echar un cable
> 
> Quiero hacer un script para arrancar el mldonkey cada vez que se encienda el 
> ordenador.
> El script lo cree en /etc/init.d/mldonkey
> 
> El problema es que no se muy bien como arracanrlo,
> porque si lo arranco sin mas:
> 
> #fichero mldonkey dentro de /etc/init.d
> /opt/mldonkey/mldonkey & > /dev/null
> 
> Lo que hace este script es tomar el directorio desde donde lo arranca como / 
> y el mldonkey se crea en la raiz todos los ficheros y directorios que 
> necesita para funcionar.
> 
> Eso no me interesa, quiero hacer un escript para que me ejecute el programa 
> dentro de su propio directorio:
> 
> Algo asi como
> # script
> cd /opt/mldonkey
> ./mldonkey & > /dev/null
> 
> Como se puede hacer, puesto que el escript anterior no funciona.
> 
> 
> Por si os puede ser util, uso Debian Woody.
> 
> Gracias por adelantado.
Technical Details
Message-ID: <pan.2003.01.17.19.00.17.257503@supercable.es>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!snoopy.risq.qc.ca!news-out.spamkiller.net!propagator2-maxim!news-in.spamkiller.net!news.telia-iberia.com!news.rediris.es!newsfeed.bt.es!news.bt.es!not-for-mail
References: <avt7lj$j3m2p$1@ID-162718.news.dfncis.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f86c8,a85e0067192ed13b
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-01-17 11:02:17 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!snoopy.risq.qc.ca!news-out.spamkiller.net!propagator2-maxim!news-in.spamkiller.net!news.telia-iberia.com!news.rediris.es!newsfeed.bt.es!news.bt.es!not-for-mail
From: "Rafa" <ragamo@supercable.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: script mldonkey
Date: Fri, 17 Jan 2003 20:00:17 +0100
Organization: Supercable Andalucia, S.A.
Lines: 88
Message-ID: <pan.2003.01.17.19.00.17.257503@supercable.es>
References: <avt7lj$j3m2p$1@ID-162718.news.dfncis.de>
NNTP-Posting-Host: 212.79.128.146
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
X-Trace: titan.bt.es 1042828926 19517 212.79.128.146 (17 Jan 2003 18:42:06 GMT)
X-Complaints-To: abuse@bt.es
NNTP-Posting-Date: 17 Jan 2003 18:42:06 GMT
User-Agent: Pan/0.13.3 (That cat's something I can't explain)
Cache-Post-Path: seux119!unknown@cliente-217217021254.ubrgrb01.supercable.es
X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)