mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 02:24:09 +00:00
rework reflector mirrorlist update script
This commit is contained in:
parent
f24883623d
commit
58febce4bb
4 changed files with 25 additions and 4 deletions
|
|
@ -7,4 +7,4 @@ Target = pacman-mirrorlist
|
|||
Description = Updating mirror list...
|
||||
When = PostTransaction
|
||||
Depends = reflector
|
||||
Exec = /usr/bin/bash -c "/usr/bin/reflector --latest 15 --sort rate --save /etc/pacman.d/mirrorlist && if [[ -f /etc/pacman.d/mirrorlist.pacnew ]] ; then rm /etc/pacman.d/mirrorlist.pacnew ; fi"
|
||||
Exec = /usr/local/bin/reflector-update
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
[options]
|
||||
HoldPkg = pacman glibc
|
||||
Architecture = auto
|
||||
CheckSpace
|
||||
SigLevel = Required DatabaseOptional
|
||||
HoldPkg = pacman glibc
|
||||
HookDir = /etc/pacman.d/hooks/
|
||||
LocalFileSigLevel = Optional
|
||||
SigLevel = Required DatabaseOptional
|
||||
|
||||
CheckSpace
|
||||
VerbosePkgLists
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
|
|
|||
10
roles/base/files/reflector-update.sh
Normal file
10
roles/base/files/reflector-update.sh
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
/usr/bin/reflector --latest 20 \
|
||||
--sort rate \
|
||||
--protocol https \
|
||||
--save /etc/pacman.d/mirrorlist
|
||||
|
||||
if [[ -f /etc/pacman.d/mirrorlist.pacnew ]]; then
|
||||
rm /etc/pacman.d/mirrorlist.pacnew
|
||||
fi
|
||||
|
|
@ -5,6 +5,14 @@
|
|||
tags:
|
||||
- packages
|
||||
|
||||
- name: Push reflector update script
|
||||
copy:
|
||||
src: reflector-update.sh
|
||||
dest: /usr/local/bin/reflector-update
|
||||
mode: 0755
|
||||
tags:
|
||||
- packages
|
||||
|
||||
- name: Create pacman hook directory
|
||||
file: path=/etc/pacman.d/hooks
|
||||
state=directory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue