From 35d945b9b6222c690a30e70da96daae227d3099b Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 24 Mar 2014 18:17:43 +0100 Subject: do not pipe shit into ncurses, just use tmux --- filehooker/root-image/krebs/bin/start-ncdc.ship | 4 +++- filehooker/root-image/krebs/lib/filehooker | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'filehooker') diff --git a/filehooker/root-image/krebs/bin/start-ncdc.ship b/filehooker/root-image/krebs/bin/start-ncdc.ship index e190ec06..3251ef53 100755 --- a/filehooker/root-image/krebs/bin/start-ncdc.ship +++ b/filehooker/root-image/krebs/bin/start-ncdc.ship @@ -6,6 +6,9 @@ set -euf ncdc_user="hooker" useradd -m $ncdc_user ||: +sudo -u $ncdc_user /usr/bin/tmux new-session -s dcpp -n ncdc -d ncdc 2>/dev/null || echo "ncdc is already running" + + dc_hub="adcs://elch.nsupdate.info:2781" ncdc_configure_hub "$dc_hub" "elch" @@ -14,5 +17,4 @@ ncdc_configure_nick "$nick" share_all_partitions -sudo -u $ncdc_user /usr/bin/tmux new-session -s dcpp -n ncdc -d ncdc exit 0 diff --git a/filehooker/root-image/krebs/lib/filehooker b/filehooker/root-image/krebs/lib/filehooker index c72d4d51..c51be701 100644 --- a/filehooker/root-image/krebs/lib/filehooker +++ b/filehooker/root-image/krebs/lib/filehooker @@ -9,7 +9,8 @@ ncdc_bin=${ncdc_bin:-/usr/bin/ncdc} ncdc_config(){ # maybe we want to use the running ncdc process and communicate via tmux send-keys ? txt="$(cat)" - (sleep 1;printf "%s" "$txt";printf "/quit\n") | sudo -u $ncdc_user "$ncdc_bin" 2>/dev/null || \ +# printf "%s" "$txt" + ! sudo -u $ncdc_user /usr/bin/tmux has-session -t dcpp && echo "ncdc session must be running" && exit 1 sudo -u $ncdc_user /usr/bin/tmux send-keys -t dcpp:ncdc "$txt" C-m } -- cgit v1.2.3