diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2018-08-14 21:03:35 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2019-02-26 00:54:09 -0500 |
commit | 391ffe388cdee37383152051fdecec5cb4ce4044 (patch) | |
tree | 13ce619c4f63f062718c343a5a4d97c9b79c5844 /bin/refresh-keyring | |
parent | c4ed17775119898c552f94424a1fc5bae33a58e4 (diff) |
update refresh-keyring scriptv0.13
Diffstat (limited to 'bin/refresh-keyring')
-rwxr-xr-x | bin/refresh-keyring | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/bin/refresh-keyring b/bin/refresh-keyring index 880364b..b807bf9 100755 --- a/bin/refresh-keyring +++ b/bin/refresh-keyring @@ -1,13 +1,26 @@ #!/bin/bash +readonly PACMAN_GNUPG_BACKUP_DIR=/etc/pacman.d.gnupg-backup-$(date '+%s') -pacman -Sy --noconfirm archlinux-keyring \ - archlinux32-keyring \ - archlinuxarm-keyring \ - parabola-keyring && \ -pacman-key --init && \ -pacman-key --populate archlinux \ - archlinux32 \ - archlinuxarm \ - parabola && \ -pacman-key --refresh-keys + +mv /etc/pacman.d/gnupg $PACMAN_GNUPG_BACKUP_DIR 2> /dev/null +if sudo pacman -Scc && + sudo pacman -Syy --noconfirm archlinux-keyring \ + archlinux32-keyring \ + archlinuxarm-keyring \ + parabola-keyring && + sudo pacman-key --init && + sudo pacman-key --populate archlinux \ + archlinux32 \ + archlinuxarm \ + parabola && + sudo pacman-key --refresh-keys +then echo "the parabola keyring has been refreshed" + rm -rf $PACMAN_GNUPG_BACKUP_DIR +else echo "there was a problem refreshing the parabola keyring" + if [ -d "$PACMAN_GNUPG_BACKUP_DIR" ] + then rm -rf /etc/pacman.d/gnupg 2> /dev/null + mv $PACMAN_GNUPG_BACKUP_DIR /etc/pacman.d/gnupg + else echo "/etc/pacman.d/gnupg is locked" + fi +fi |