#!/bin/bash #pacget script cachedir=/var/cache/pacman/pkg file=`echo $1|awk -F '/' '{ print $NF }'` echo Downloading: $file|sed 's,/,,' repo=`echo $1|awk -F '/' '{x=NF-3 } { print $x }'` echo repo: $repo mirrors=`sed -n 's/^Server = //; s,$,/'"$repo/os/i686/$file"', ; /^ftp/p; /^http/p' /etc/pacget.conf` if [[ $2 = *.db.tar.gz.part || $repo = "testing" ]]; then echo "(using one mirror)" mirrors=$1 cachedir=/var/lib/pacman fi aria2c -t60 -m5 -l /var/log/pacget.log $mirrors -o $file.pacget if [ -f $cachedir/$file.pacget.aria2 ]; then exit 130 fi mv $file.pacget $2