You are not logged in.

#1 2008-06-09 02:38:56

Statix
Member
From: Hangzhou, China
Registered: 2008-02-16
Posts: 240

Linking Processes

I'm looking to make a little bash script to start and "link" two processes together.

Basically, when one starts the other starts, and when one ends the other ends.

To be specific I'm trying to link Ventrilo on wine with ventriloctrl.


Madly in love with Arch64, Openbox, DotA, and of course... penguins!
Happy to help if you're not a Help Vampire. Use your wonderful resources like ArchWiki, Google, and our wonderful search page.

Offline

#2 2008-06-09 16:48:13

Eradest
Member
From: Germany
Registered: 2007-07-18
Posts: 56

Re: Linking Processes

Not sure whether this works, seems rather hack-ish.

#!/bin/bash
process1
process2

while true
do
  sleep 1
  pidof process1 > /dev/null || break && killall process2
  pidof process2 > /dev/null || break && killall process1
done

Offline

Board footer

Powered by FluxBB