summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2014-03-24 16:17:16 +0100
committermakefu <github@syntax-fehler.de>2014-03-24 16:17:16 +0100
commit14ee58ef4e9dfda2bbb41044025e7d51910a1173 (patch)
tree0126664a317c4813ab4dd490fbc30cf4f4be86cb
parent655c0f585c9cfd103d71db0a48856ac5f806f6c3 (diff)
make filehooker lib try to use tmux channel if ncdc is already running
-rw-r--r--filehooker/root-image/krebs/lib/filehooker5
1 files changed, 4 insertions, 1 deletions
diff --git a/filehooker/root-image/krebs/lib/filehooker b/filehooker/root-image/krebs/lib/filehooker
index f6f4c0a7..d30fb519 100644
--- a/filehooker/root-image/krebs/lib/filehooker
+++ b/filehooker/root-image/krebs/lib/filehooker
@@ -5,9 +5,12 @@
ncdc_user=${ncdc_user:-hooker}
ncdc_bin=${ncdc_bin:-/usr/bin/ncdc}
+
ncdc_config(){
# maybe we want to use the running ncdc process and communicate via tmux send-keys ?
- (sleep 1;cat;printf "/quit\n") | sudo -u $ncdc_user "$ncdc_bin"
+ txt="$(cat)"
+ (sleep 1;printf "%s" "$txt";printf "/quit\n") | sudo -u $ncdc_user "$ncdc_bin" 2>/dev/null || \
+ sudo -u $ncdc_user /usr/bin/tmux send-keys -t dcpp:ncdc "$txt" C-m
}
ncdc_configure_netshare(){