pacrank: Now testing if pacnew file exists (thanks pacman 5.0 *sarcasm*)

This commit is contained in:
madmaurice 2016-02-18 11:49:56 +01:00
parent 4095d48c20
commit 639a93f95b

View file

@ -10,5 +10,10 @@ country=$1
INPUT=/etc/pacman.d/mirrorlist.pacnew
OUTPUT=/etc/pacman.d/mirrorlist
if [ ! -f "$INPUT" ]; then
echo "$INPUT is missing."
exit 1
fi
cat $INPUT | awk -v "COUNTRY=$country" 'BEGIN { c="" } /^##/ { c=substr($0,4); } /^#Server/ { if(c==COUNTRY) { print substr($0,2); } }' | rankmirrors - | sudo tee $OUTPUT