Mailinglist Archive: opensuse (3442 mails)
| < Previous | Next > |
Re: [SLE] Auto starting programs in X
- From: Geoff <capsthorne@xxxxxxxxxxx>
- Date: Sun, 9 Dec 2001 17:35:25 +0000
- Message-id: <20011209173525.5cd37e1e.capsthorne@xxxxxxxxxxx>
Hi David,
Apropos the autostart, I played around somewhat and came up with the following
(which I will also send also by private email). There are bound to be better
ways of doing it, but it might at least serve a proof of concept. You might be
able to substitute it for the line that presently autostarts Netscape in YAST2.
Regards,
Geoff
#!/bin/bash
###########################################################################
# This script checks if Netscape or Firestarter is running. If either is not
# running, then it is started. If it is running, then do nothing vis a vis
# that program.
# The assumption is that the script is run by root. The Firestarter part
# would need tweaking if it is not.
###########################################################################
# grep the process tree for running instances of the programs.
# Redirect the output to files, which will be of zero
# length if the no running instance is found. There is probably a nicer
# way to do this, but it appears to work.
ps auxc | grep netscape > netscape_running
ps auxc | grep firestarter > firestarter_running
# If the netscape file is of zero length then start netscape as a background job
if ! test -s netscape_running; then netscape &
fi
# Ditto for firestarter
if ! test -s firestarter_running; then firestarter &
fi
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Apropos the autostart, I played around somewhat and came up with the following
(which I will also send also by private email). There are bound to be better
ways of doing it, but it might at least serve a proof of concept. You might be
able to substitute it for the line that presently autostarts Netscape in YAST2.
Regards,
Geoff
#!/bin/bash
###########################################################################
# This script checks if Netscape or Firestarter is running. If either is not
# running, then it is started. If it is running, then do nothing vis a vis
# that program.
# The assumption is that the script is run by root. The Firestarter part
# would need tweaking if it is not.
###########################################################################
# grep the process tree for running instances of the programs.
# Redirect the output to files, which will be of zero
# length if the no running instance is found. There is probably a nicer
# way to do this, but it appears to work.
ps auxc | grep netscape > netscape_running
ps auxc | grep firestarter > firestarter_running
# If the netscape file is of zero length then start netscape as a background job
if ! test -s netscape_running; then netscape &
fi
# Ditto for firestarter
if ! test -s firestarter_running; then firestarter &
fi
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
| < Previous | Next > |