1. Copy 2 file 2_trans_auto.sh và S88transmission vào thư mục /mnt/disk1
Download
2. Chmod +x cho 2 file trên để có quyền excute
3. Chạy file ./2_trans_auto.sh
Để cài đặt bản 2.94 cần cài đặt bản ipkg mới nhất. Xem hướng dẫn cài đặt ở đây
Cài đặt rtorrent cho NAS LS-XHL
4. Sửa các cấu hình trong file /root/.config/transmission-daemon/settings.json
192.168.1.123 –> Là địa chỉ IP trong mạng LAN
{
"alt-speed-down": 0,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 0,
"bind-address-ipv4": "192.168.1.123",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 4,
"dht-enabled": true,
"download-dir": "/mnt/disk1/Torrents",
"download-queue-enabled": true,
"download-queue-size": 0,
"encryption": 1,
"idle-seeding-limit": 30,
"idle-seeding-limit-enabled": false,
"incomplete-dir": "/mnt/disk1/Torrents",
"incomplete-dir-enabled": false,
"lpd-enabled": false,
"message-level": 2,
"peer-congestion-algorithm": "",
"peer-id-ttl-hours": 6,
"peer-limit-global": 200,
"peer-limit-per-torrent": 200,
"peer-port": 8889,
"peer-port-random-high": 8889,
"peer-port-random-low": 8889,
"peer-port-random-on-start": false,
"peer-socket-tos": "default",
"pex-enabled": true,
"port-forwarding-enabled": true,
"preallocation": 1,
"prefetch-enabled": true,
"queue-stalled-enabled": true,
"queue-stalled-minutes": 30,
"ratio-limit": 2,
"ratio-limit-enabled": false,
"rename-partial-files": true,
"rpc-authentication-required": false,
"rpc-bind-address": "192.168.1.123",
"rpc-enabled": true,
"rpc-host-whitelist": "",
"rpc-host-whitelist-enabled": true,
"rpc-password": "password",
"rpc-port": 8888,
"rpc-url": "/transmission/",
"rpc-username": "username",
"rpc-whitelist": "*.*.*.*",
"rpc-whitelist-enabled": true,
"scrape-paused-torrents-enabled": true,
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 0,
"speed-limit-down": 0,
"speed-limit-down-enabled": false,
"speed-limit-up": 0,
"speed-limit-up-enabled": false,
"start-added-torrents": true,
"trash-original-torrent-files": false,
"umask": 0,
"upload-slots-per-torrent": 200,
"utp-enabled": true
}
5. Nếu transmission không tự start sau khi reboot thì tạo crontab để check sống chết.
Tạo file check_transmission
#!/bin/bash
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin
logfile="/var/log/rtorrentInit.log"
echo `date` `ps |grep "transmission-daemon" |grep -v grep` >> $logfile
RESULT=$(ps |grep "transmission-daemon" |grep -v "grep"|wc -l)
echo "`date` count ${RESULT}" >> $logfile
if [ "${RESULT}" -eq "0" ]; then
echo "`date` transmission is not running--> start" >> $logfile
`/mnt/disk1/script/S88transmission`
else
echo "`date` transmission is running" >> $logfile
fi
Add quyền thực thi
chmod +x check_transmission
Thêm vào crontab
*/5 * * * * /mnt/disk1/script/check_transmission
Xong.