Configure a valid DHT cache directory.
This commit is contained in:
parent
57ec856f49
commit
350f4c2646
3 changed files with 16 additions and 3 deletions
|
@ -37,7 +37,9 @@ get_torrent() {
|
|||
sudo vm-aria2 stop "${VM_NAME}"
|
||||
cd "${VM_SYSDIR}"
|
||||
# get image
|
||||
aria2c --seed-time=0 --dht-entry-point="${SEEDBOX_HOST}:${SEEDBOX_PORT}" "${VM_SYSDIR}/${VM_NAME}.qcow2.torrent"
|
||||
aria2c --seed-time=0 --dht-file-path=$DHTDAT \
|
||||
--dht-entry-point="${SEEDBOX_HOST}:${SEEDBOX_PORT}" \
|
||||
"${VM_SYSDIR}/${VM_NAME}.qcow2.torrent"
|
||||
# and seed
|
||||
sudo vm-aria2 start "${VM_NAME}"
|
||||
if ! flock -u 200; then
|
||||
|
@ -51,7 +53,8 @@ get_torrent() {
|
|||
|
||||
get_image_size() {
|
||||
torrentfile=$1
|
||||
length=$(aria2c -S "${torrentfile}" | grep "Total Length" | grep "Total Length" | sed -E 's/.*\(([0-9,]*)\)/\1/' | sed s/,//g)
|
||||
length=$(aria2c -S "${torrentfile}" | grep "Total Length" | \
|
||||
sed -E -e 's/.*\(([0-9,]*)\)/\1/' -e 's/,//g')
|
||||
echo "$length"
|
||||
}
|
||||
|
||||
|
@ -75,6 +78,8 @@ push_file() {
|
|||
--pwdfile "${SEEDBOX_PWFILE}" --no-cert "${FILENAME}"
|
||||
}
|
||||
|
||||
########################
|
||||
|
||||
if [[ "$(id -nu)" != "lmnsynci" ]]; then
|
||||
echo "$(basename "$0") must be run as lmnsynci user"
|
||||
show_help
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue