aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/session.sh
diff options
context:
space:
mode:
authorGravatar Ben Boeckel <MathStuf@gmail.com>2010-08-21 12:07:34 -0400
committerGravatar Ben Boeckel <MathStuf@gmail.com>2010-10-02 11:56:30 -0400
commit90ebadae7fa7843ed4a43c03e344d0e8cdebc936 (patch)
treeb9ac5be499fadeac11b93b29d150509e537020f9 /examples/data/scripts/session.sh
parent01d32f99ff5b0fb3d195ad9816e992a8267ec7b9 (diff)
Prefer sockets to fifos
Diffstat (limited to 'examples/data/scripts/session.sh')
-rwxr-xr-xexamples/data/scripts/session.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/data/scripts/session.sh b/examples/data/scripts/session.sh
index 64d8c6b..89eeb7a 100755
--- a/examples/data/scripts/session.sh
+++ b/examples/data/scripts/session.sh
@@ -19,7 +19,7 @@ UZBL="uzbl-browser -c $UZBL_CONFIG_FILE" # add custom flags and whatever here.
act="$1"
# Test if we were run alone or from uzbl
-if [ -z "$UZBL_FIFO" ]; then
+if [ -z "$UZBL_SOCKET" ]; then
# Take the old config
act="$UZBL_CONFIG"
fi
@@ -39,24 +39,24 @@ case $act in
;;
"endinstance" )
- if [ -z "$UZBL_FIFO" ]; then
+ if [ -z "$UZBL_SOCKET" ]; then
echo "session manager: endinstance must be called from uzbl"
exit 1
fi
if [ ! "$UZBL_URL" = "(null)" ]; then
echo "$UZBL_URL" >> $UZBL_SESSION_FILE
fi
- echo "exit" > $UZBL_FIFO
+ echo "exit" | socat - unix-connect:$UZBL_SOCKET
;;
"endsession" )
mv "$UZBL_SESSION_FILE" "$UZBL_SESSION_FILE~"
- for fifo in $UZBL_FIFO_DIR/uzbl_fifo_*; do
- if [ "$fifo" != "$UZBL_FIFO" ]; then
- echo "spawn $scriptfile endinstance" > $fifo
+ for sock in $UZBL_SOCKET_DIR/uzbl_fifo_*; do
+ if [ "$sock" != "$UZBL_SOCKET" ]; then
+ echo "spawn $scriptfile endinstance" | socat - unix-connect:$socket
fi
done
- echo "spawn $scriptfile endinstance" > $UZBL_FIFO
+ echo "spawn $scriptfile endinstance" | socat - unix-connect:$UZBL_SOCKET
;;
* )