Updates : Add GPG key

This commit is contained in:
MatMoul 2018-09-15 23:27:02 +02:00
parent 24bfe034b6
commit 0d7c6e5420

View file

@ -34,6 +34,7 @@ options+=("Edit mirrorlist" "")
options+=("" "") options+=("" "")
options+=("Update keyring" "pacman -S archlinux-keyring") options+=("Update keyring" "pacman -S archlinux-keyring")
options+=("Refresh pacman keys" "pacman-key --refresh-keys") options+=("Refresh pacman keys" "pacman-key --refresh-keys")
options+=("Add GPG key" "gpg --recv-keys")
options+=("" "") options+=("" "")
if [ -f /var/lib/pacman/db.lck ]; then if [ -f /var/lib/pacman/db.lck ]; then
options+=("Remove db.lck" "rm /var/lib/pacman/db.lck") options+=("Remove db.lck" "rm /var/lib/pacman/db.lck")
@ -136,6 +137,36 @@ case $sel in
'Edit mirrorlist') nano /etc/pacman.d/mirrorlist;; 'Edit mirrorlist') nano /etc/pacman.d/mirrorlist;;
'Update keyring') pacman -S archlinux-keyring;; 'Update keyring') pacman -S archlinux-keyring;;
'Refresh pacman keys') pacman-key --refresh-keys;; 'Refresh pacman keys') pacman-key --refresh-keys;;
'Add GPG key')
gpgservers=()
gpgservers+=("pool.sks-keyservers.net" "")
gpgservers+=("Other" "")
sel=$(whiptail --backtitle "$apptitle" --title "Add GPG key" --menu "GPG key server" 0 0 0 "${gpgservers[@]}" 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
case $sel in
"Other")
gpgserver=$(whiptail --backtitle "$apptitle" --title "Add GPG key" --inputbox "Enter the GPG key server :" 0 0 "" 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
gpgkey=$(whiptail --backtitle "$apptitle" --title "Add GPG key" --inputbox "Enter the GPG key :" 0 0 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
echo "sudo -u aurbuilder gpg --keyserver "$gpgserver" --recv-keys "$gpgkey
sudo -u aurbuilder gpg --keyserver $gpgserver --recv-keys $gpgkey
pressanykey
fi
fi
;;
*)
gpgserver=$sel
gpgkey=$(whiptail --backtitle "$apptitle" --title "Add GPG key" --inputbox "Enter the GPG key :" 0 0 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
echo "sudo -u aurbuilder gpg --keyserver "$gpgserver" --recv-keys "$gpgkey
sudo -u aurbuilder gpg --keyserver $gpgserver --recv-keys $gpgkey
pressanykey
fi
;;
esac
fi
;;
'Remove db.lck') rm /var/lib/pacman/db.lck;; 'Remove db.lck') rm /var/lib/pacman/db.lck;;
'Install downgrade') 'Install downgrade')
instpkg "" "downgrade" instpkg "" "downgrade"