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
|
bridge-cli
|
||||||
|
|
||||||
echo "login" > $INPIPE
|
echo "login" >&3
|
||||||
echo "$BRIDGE_USER" > $INPIPE
|
echo "$BRIDGE_USER" >&3
|
||||||
echo "$BRIDGE_PASS" > $INPIPE
|
echo "$BRIDGE_PASS" >&3
|
||||||
echo "exit" > $INPIPE
|
echo "exit" >&3
|
||||||
wait $bridge_pid
|
wait $bridge_pid
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge-cli() {
|
bridge-cli() {
|
||||||
mkfifo $INPIPE
|
mkfifo $INPIPE
|
||||||
sleep infinity > $INPIPE &
|
|
||||||
$BRIDGE --cli < $INPIPE &
|
$BRIDGE --cli < $INPIPE &
|
||||||
|
exec 3> $INPIPE
|
||||||
bridge_pid=$!
|
bridge_pid=$!
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
bridge-cli
|
bridge-cli
|
||||||
|
|
||||||
echo "info" > $INPIPE
|
echo "info" >&3
|
||||||
wait $bridge_pid
|
wait $bridge_pid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user