Skip to content

Commit

Permalink
check if keyfile already exists before removing
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfortner authored and theofficialgman committed Dec 28, 2023
1 parent b308528 commit 7bda6ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,9 @@ add_external_repo() { # add an external apt repo and its gpg key
[ -f /etc/apt/sources.list.d/${reponame}.list ] && error "add_external_repo: /etc/apt/sources.list.d/${reponame}.list already exists."

# download gpg key from specified url
sudo rm -f /usr/share/keyrings/${reponame}-keyring.gpg
if [ -f /usr/share/keyrings/${reponame-keyring.gpg} ]; then
sudo rm -f /usr/share/keyrings/${reponame}-keyring.gpg
fi
curl -fsSL "$pubkeyurl" | sudo gpg --dearmor -o /usr/share/keyrings/${reponame}-keyring.gpg

if [ $? != 0 ];then
Expand Down

0 comments on commit 7bda6ac

Please sign in to comment.