mldonkey-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-users] rc-script


From: Christian Loitsch
Subject: [Mldonkey-users] rc-script
Date: Sun, 11 May 2003 15:37:02 +0200
User-agent: Mutt/1.4.1i

I found an rc-script, which does quite a lot of things.

Are these all necessairy/useful?:

start(){
    ebegin $"Starting MLdonkey"
    cd ${ddir}
    # Remove old servers
    rm -Rf servers.ini*
    
    # Remove tmp files
    rm -Rf *.tmp

    #  you should not change this lines...
    ${sudo} -u ${user} ${bin} > /dev/null 2>&1 &

    ${sleep} 5
    ${renice} ${nice_level} -u ${user} > /dev/null

    # Overnet Support
    #OVER_IP1=resolveip overnet.dyndns.org | $awk '{print $6}'
    #OVER_PR1=4665
    #OVER_IP2=Resolveip fudge.punkcookies.com | $awk '{print $6}'
    #OVER_PR2=12000
    #boot $OVER_IP1 $OVER_PR1
    #boot $OVER_IP2 $OVER_PR2
                
    # you can change or add commands above the first STOPHERE and q
    # open Connection to telnet interface
      sh -c "${nc} localhost 4000 > /dev/null <<STOPHERE
        clh
        n 209.126.214.34[4661]
        n 195.112.128.222[6667]
        n 193.111.198.137[4242]
        n 193.111.198.138[4242]
        n 193.111.198.139[4242]
        n 194.97.40.162[4242]
        ovweb
        q
      STOPHERE"

}
stop(){
  sh -c "$nc localhost 4000 > /dev/null  <<STOPHERE
    commit
    close_fds
    kill
  STOPHERE"
  # better sleep a while, before killing
  $sleep 10

  # kill mldonkey if it is still running
  ps ax |$grep $ddir/$bin |$grep -v $grep |$awk '{print "kill" $1}'| sh
  ebegin $"Stopping $prog"
}

I would have just done this:

start() {
        ebegin "Starting mldonkey"
        cd ${WORKDIR}
        start-stop-daemon --start --exec /usr/bin/mlnet\
        -- -daemon -log_file ${LOGFILE} -run_as_user ${USER}
        eend $?
}

stop() {
        ebegin "Stopping mldonkey"
        start-stop-daemon --quiet --stop --exec /usr/bin/mlnet
        eend $?
}


I admit mldonkey is not niced with this script.

christian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]