2023-05-04 19:35:15 +02:00
|
|
|
# [ nix-shell:/media/music ]# transmission-create -o ~/first.torrent "Zardonic - Antihero (2015)" -t http://robi.private:6969/announce
|
|
|
|
# Creating
|
|
|
|
# torrent "/root/first.torrent" .... done!
|
|
|
|
#
|
|
|
|
# [nix-shell:/media/music]# transmission-remote sync.chungus.private:80 -a ~/first.torrent --download-dir /media/music
|
|
|
|
# sync.chungus.private:80/transmission/rpc/ responded: "success"
|
|
|
|
#
|
|
|
|
# [nix-shell:/media/music]# transmission-remote sync.robi.private:80 -a ~/first.torrent --download-dir /media/music
|
|
|
|
# sync.robi.private:80/transmission/rpc/ responded: "success"
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2023-05-04 20:59:26 +02:00
|
|
|
{ pkgs, ... }:
|
2023-05-04 19:35:15 +02:00
|
|
|
{
|
2023-05-04 20:59:26 +02:00
|
|
|
environment.systemPackages = [
|
2023-05-04 19:35:15 +02:00
|
|
|
(pkgs.writers.writeBashBin "torrent-sync" ''
|
2023-05-04 20:59:26 +02:00
|
|
|
set -e
|
|
|
|
set -x
|
2023-05-04 19:35:15 +02:00
|
|
|
|
2023-05-04 20:59:26 +02:00
|
|
|
file_folder=$( realpath "$1" )
|
|
|
|
folder=$( dirname "$file_folder" )
|
|
|
|
file=$( basename "$file_folder" )
|
2023-05-04 19:35:15 +02:00
|
|
|
|
2023-05-04 20:59:26 +02:00
|
|
|
pushd "$folder"
|
|
|
|
${pkgs.transmission}/bin/transmission-create \
|
|
|
|
-t udp://robi.private:6969/announce \
|
|
|
|
-o ~/last.torrent \
|
|
|
|
"$file"
|
|
|
|
popd
|
2023-05-04 19:35:15 +02:00
|
|
|
|
2023-05-04 20:59:26 +02:00
|
|
|
${pkgs.transmission}/bin/transmission-remote \
|
|
|
|
sync.chungus.private:80 \
|
|
|
|
-a ~/last.torrent \
|
|
|
|
--download-dir "$folder"
|
2023-05-04 19:35:15 +02:00
|
|
|
|
2023-05-04 20:59:26 +02:00
|
|
|
${pkgs.transmission}/bin/transmission-remote \
|
|
|
|
sync.robi.private:80 \
|
|
|
|
-a ~/last.torrent \
|
|
|
|
--download-dir "$folder"
|
2023-05-04 19:35:15 +02:00
|
|
|
|
|
|
|
'')
|
2023-05-04 20:59:26 +02:00
|
|
|
];
|
|
|
|
}
|