diff options
author | root <root@shack.(none)> | 2010-05-07 02:24:01 +0200 |
---|---|---|
committer | root <root@shack.(none)> | 2010-05-07 02:24:01 +0200 |
commit | b9a22654b96cf5a32f227ef6991ea81176cacb50 (patch) | |
tree | 0cfe03bd2ab9e5238e500a8c7422a86555156470 /noise | |
parent | 81344217c8a54e46d7cfc38466303d046e08e77f (diff) |
noise: use folders for connected clients
Additionally export $NOISE_pid to modules.
Diffstat (limited to 'noise')
-rwxr-xr-x | noise | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -50,8 +50,10 @@ fail() { } cleanup() { - rm -f $linefeed $env kill $jobs + rm -f $linefeed $env + rmdir /tmp/noise/$$ 2>/dev/null + rmdir /tmp/noise 2>/dev/null } @@ -62,8 +64,9 @@ if test -d "$dirname/modules" ; then export NOISE_PATH="${NOISE_PATH+$NOISE_PATH:}$dirname/modules" export NOISE_PATH="${NOISE_PATH+$NOISE_PATH:}$HOME/noise/modules" fi -linefeed="/tmp/noise-client-$$" -env="/tmp/noise-client-$$-env" +mkdir -vp /tmp/noise/$$ +linefeed="/tmp/noise/$$/linefeed" +env="/tmp/noise/$$/environment" trap cleanup EXIT mkfifo $linefeed touch $env @@ -89,7 +92,7 @@ while echo -n "$noise_prompt" && eval "`readline`" ; do module="$dir/$command" if test -x "$module" ; then shift - eval 'NOISE="$0" NOISE_linefeed="$linefeed" "$module"' "$args" + eval 'NOISE="$0" NOISE_pid="$$" NOISE_linefeed="$linefeed" "$module"' "$args" continue 2 fi done |