On Tue, 1 Feb 2005 elmars.ositis@xxxxxx wrote:

Before I go spending my time inventing the wheel, I would like to ask
whether anyone has built an init script around lp5250d to autostart some
as/400 printer connections. What I would like to do is configure a number
of printers and have the init manager monitor their status and restart them
if for some reason they fail. I have some ideas on how to do this, but if
anyone has done this before, I would rather not re-invent the wheel...

This probably isn't exactly what you want but here is the script I use. This can be run from cron.

#!/bin/bash # # This checks to see if lp5250d era1-print is running and if so kills # and restarts it. Otherwise it just starts it.

PID=`ps ax | grep "lp5250d era1-print" | egrep -v grep | awk '{print $1}'`

if [ "$PID" ]; then
#    echo "Killing lp5250d era1-print (PID ${PID})..."
    kill ${PID}
    lp5250d era1-print
#    echo "No PID!!"
#    echo "Starting lp5250d era1-print..."
    lp5250d era1-print

James Rich

It's not the software that's free; it's you.
        - billyskank on Groklaw

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.