Use file descriptor instead of sleep to keep input pipe open
This commit is contained in:
parent
6a89682d5f
commit
69fac8189a
@ -11,24 +11,24 @@ setup() {
|
||||
|
||||
bridge-cli
|
||||
|
||||
echo "login" > $INPIPE
|
||||
echo "$BRIDGE_USER" > $INPIPE
|
||||
echo "$BRIDGE_PASS" > $INPIPE
|
||||
echo "exit" > $INPIPE
|
||||
echo "login" >&3
|
||||
echo "$BRIDGE_USER" >&3
|
||||
echo "$BRIDGE_PASS" >&3
|
||||
echo "exit" >&3
|
||||
wait $bridge_pid
|
||||
}
|
||||
|
||||
bridge-cli() {
|
||||
mkfifo $INPIPE
|
||||
sleep infinity > $INPIPE &
|
||||
$BRIDGE --cli < $INPIPE &
|
||||
exec 3> $INPIPE
|
||||
bridge_pid=$!
|
||||
}
|
||||
|
||||
start() {
|
||||
bridge-cli
|
||||
|
||||
echo "info" > $INPIPE
|
||||
echo "info" >&3
|
||||
wait $bridge_pid
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user