File import-suse-build-key of Package suse-build-key.32546

#!/bin/bash
#
triggerfile=/var/lib/suse-build-key/imported

# if zypp is running we will get into lock conflicts, and zypper might die
# unexpectedly.
if [ -s /run/zypp.pid ]; then
	exit 0
fi

# first remove trigger file
rm -f $triggerfile

# The import might fail if something has locked the RPM database. in that case we retry again on next boot or so.

# Upcoming SLES 15 4096 bit RSA key
if test -f /usr/lib/rpm/gnupg/keys/gpg-pubkey-3fa1d6ce-63c9481c.asc; then
	rpm -q gpg-pubkey-3fa1d6ce > /dev/null ||
		rpm --import /usr/lib/rpm/gnupg/keys/gpg-pubkey-3fa1d6ce-63c9481c.asc || touch $triggerfile
fi
if test -f /usr/lib/rpm/gnupg/keys/gpg-pubkey-d588dc46-63c939db.asc; then
	rpm -q gpg-pubkey-d588dc46 > /dev/null ||
		rpm --import /usr/lib/rpm/gnupg/keys/gpg-pubkey-d588dc46-63c939db.asc || touch $triggerfile
fi

# if we have finished import, disable and stop the timer.
if [ ! -f $triggerfile -a -x /usr/bin/systemctl ] ; then
	systemctl stop suse-build-key-import.timer
	systemctl disable suse-build-key-import.timer
fi
openSUSE Build Service is sponsored by