2013-11-23 10:54:23 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-08-23 12:55:59 +02:00
|
|
|
if test "$1" = "--socket" ; then
|
|
|
|
shift
|
|
|
|
ADDRESS="$1"
|
|
|
|
shift
|
|
|
|
else
|
|
|
|
ADDRESS="powerline-ipc-${UID:-`id -u`}"
|
|
|
|
fi
|
2013-11-23 10:54:23 +01:00
|
|
|
|
|
|
|
# Warning: env -0 does not work in busybox. Consider switching to parsing
|
|
|
|
# `set` output in this case
|
|
|
|
(
|
2014-08-04 00:59:02 +02:00
|
|
|
printf '%x\0' "$#"
|
2013-11-23 10:54:23 +01:00
|
|
|
for argv in "$@" ; do
|
|
|
|
printf '%s\0' "$argv"
|
|
|
|
done
|
2014-08-04 00:59:02 +02:00
|
|
|
printf '%s\0' "$PWD"
|
|
|
|
env -0
|
2014-08-02 19:10:15 +02:00
|
|
|
) | socat -lf/dev/null -t 10 - abstract-client:"$ADDRESS"
|
|
|
|
|
|
|
|
if test $? -ne 0 ; then
|
|
|
|
powerline-render "$@"
|
|
|
|
fi
|