Az alábbi szkript automatikusan letölti és a rendszerhez adja a source.list -ben szereplő launcpad ppa tárolók kulcsait.
#! /bin/sh
if [ "`whoami`" != "root" ];
then
echo "Please run with SUDO"
exit 1
fi
case "$1" in
hardy) RELEASE="hardy";;
intrepid) RELEASE="intrepid" ;;
jaunty) RELEASE="jaunty";;
*)
echo "Please select one of the following:"
echo "--"
echo "- hardy"
echo "- intrepid"
echo "- jaunty"
echo "--"
echo "Example: sudo ./launchpad-update intrepid"
exit 1
;;
esac
echo Release: $RELEASE
echo Please Wait...
for q in `find /etc/apt/ -name *.list`; do
cat $q >> fullsourceslist
done
for i in `cat fullsourceslist | grep "deb http" | grep ppa.launchpad | grep $RELEASE | cut -d/ -f4`; do
wget -q --no-check-certificate `wget -q --no-check-certificate https://launchpad.net/~$i/+archive -O- | grep "http://keyserver.ubuntu.com:11371/pks/" | cut -d'"' -f2 ` -O- | grep "pub " | cut -d'"' -f2 >> keyss
done
for j in `cat keyss` ; do
wget -q --no-check-certificate "http://keyserver.ubuntu.com:11371$j" -O- | grep -B 999999 END |grep -A 999999 BEGIN > keyss2
sudo apt-key add keyss2
rm keyss2
done
rm keyss
rm fullsourceslist