diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-07-04 10:03:53 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-07-04 10:03:53 +0300 |
commit | 46c2487829973e7aa89ed4b462dd6af01a60ce1b (patch) | |
tree | 3a824c9a815f4bbc4f6a13e6d785401b1d53bf72 /etc/library.sh | |
parent | a82d2d150063a49950e05a7efc9e98382bf1f44b (diff) |
create torrent in library and batch
Diffstat (limited to 'etc/library.sh')
-rwxr-xr-x | etc/library.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/library.sh b/etc/library.sh index 8efeab64..1823cddc 100755 --- a/etc/library.sh +++ b/etc/library.sh @@ -288,6 +288,15 @@ function pack_image() echo -e "$TARNAME packed successfully" } +function create_torrent() +{ + [[ "$1" == "" ]] && { echo "No directory specified"; exit 1; } + test -d $1 || { echo "$1 not found or is not a directory" ; exit 1; } + + md5sum $1/*.bz2 > $1/md5sum + + createtorrent -a udp://tracker.opentrackr.org -p 1337 -c "NextCloudPi. Nextcloud for Raspberry Pi image" $1 $1.torrent +} # License # # This script is free software; you can redistribute it and/or modify it |