From b4f99c8910c539f3776451e7198f630b501817ff Mon Sep 17 00:00:00 2001 From: Shibby Date: Thu, 12 Mar 2015 21:42:56 +0100 Subject: [PATCH] Bittorrent: Add "Custom Log File Path" to GUI --- release/src/router/httpd/tomato.c | 3 +++ release/src/router/nvram/defaults.c | 2 ++ release/src/router/rc/transmission.c | 6 +++++- release/src/router/www/nas-bittorrent.asp | 13 +++++++++++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/release/src/router/httpd/tomato.c b/release/src/router/httpd/tomato.c index 04c5c04fb3..722f0f1583 100644 --- a/release/src/router/httpd/tomato.c +++ b/release/src/router/httpd/tomato.c @@ -1277,6 +1277,9 @@ static const nvset_t nvset_list[] = { { "bt_ul_queue_enable", V_01 }, { "bt_ul_queue_size", V_RANGE(1, 30) }, { "bt_message", V_RANGE(0, 3) }, + { "bt_log", V_01 }, + { "bt_log_path", V_LENGTH(0, 50) }, + #endif #ifdef TCONFIG_NFS diff --git a/release/src/router/nvram/defaults.c b/release/src/router/nvram/defaults.c index 69297bb4c8..036b85523a 100644 --- a/release/src/router/nvram/defaults.c +++ b/release/src/router/nvram/defaults.c @@ -1048,6 +1048,8 @@ const defaults_t defaults[] = { { "bt_ul_queue_enable", "0" }, { "bt_ul_queue_size", "5" }, { "bt_message", "2" }, + { "bt_log", "0" }, + { "bt_log_path", "/var/log" }, #endif #if 0 diff --git a/release/src/router/rc/transmission.c b/release/src/router/rc/transmission.c index 4ec5c23691..e08a8794f4 100644 --- a/release/src/router/rc/transmission.c +++ b/release/src/router/rc/transmission.c @@ -141,8 +141,12 @@ void start_bittorrent(void) //crash fix? fprintf( fp, "EVENT_NOEPOLL=1; export EVENT_NOEPOLL\n" ); // - + if ( nvram_match( "bt_log", "1") ) + { + fprintf( fp, "%s/transmission-daemon -g %s/.settings -e %s/transmission.log\n", pn, pk, nvram_safe_get( "bt_log_path" ) ); + } else { fprintf( fp, "%s/transmission-daemon -g %s/.settings\n", pn, pk ); + } fprintf( fp, "logger \"Transmission daemon successfully started\" \n"); fprintf( fp, "sleep 2\n" ); diff --git a/release/src/router/www/nas-bittorrent.asp b/release/src/router/www/nas-bittorrent.asp index 9cc4268433..6bced37abd 100644 --- a/release/src/router/www/nas-bittorrent.asp +++ b/release/src/router/www/nas-bittorrent.asp @@ -21,7 +21,7 @@ textarea { }