diff options
author | makefu <github@syntax-fehler.de> | 2014-03-24 16:17:16 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2014-03-24 16:17:16 +0100 |
commit | 14ee58ef4e9dfda2bbb41044025e7d51910a1173 (patch) | |
tree | 0126664a317c4813ab4dd490fbc30cf4f4be86cb /filehooker/root-image/krebs | |
parent | 655c0f585c9cfd103d71db0a48856ac5f806f6c3 (diff) |
make filehooker lib try to use tmux channel if ncdc is already running
Diffstat (limited to 'filehooker/root-image/krebs')
-rw-r--r-- | filehooker/root-image/krebs/lib/filehooker | 5 |
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(){ |