From 89bba2cd66b630759fdc702876338b9460f8587b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 15 Jun 2013 18:18:49 +0900 Subject: [PATCH] bashrc: update reflector function --- bashrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index 0e62117..3b5ff0a 100755 --- a/bashrc +++ b/bashrc @@ -238,11 +238,12 @@ null type pacmatic && { _pacman_update_mirrorlist_with_reflector(){ ml=/etc/pacman.d/mirrorlist - cmd="$(expr "$(grep reflector $ml)" : '# With: *\(.*\)')" + cmd="$(expr "$(grep -m 1 reflector $ml)" : '# With: *\(.*\)')" if test -z "$cmd" then - cmd="reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist" + cmd="reflector --verbose -l 5 --sort rate --save $ml" fi + echo "Running $cmd ..." 1>&2 sudo $cmd } null type reflector && test -f /etc/pacman.d/mirrorlist && \