Skip to content

Instantly share code, notes, and snippets.

@wheresjames
Created October 13, 2016 13:11
Show Gist options
  • Save wheresjames/16f38cc1330a1ff389d5890a06b505ad to your computer and use it in GitHub Desktop.
Save wheresjames/16f38cc1330a1ff389d5890a06b505ad to your computer and use it in GitHub Desktop.
Scripts to sign and update a debian repository
export KEYNAME=$1
for arch in `find $2 -maxdepth 1 -mindepth 1 -type d`; do
for deb in `find $arch -type f -name "*.deb"`; do
dpkg-sig -k $KEYNAME -s builder $deb
done
done
# Create key
# gpg --gen-key
# List keys
# gpg --list-keys
# To export key
# gpg -a --export-secret-key 47FBF6FA > private.gpg
# gpg -a --export 47FBF6FA > public.gpg
# To import key
# gpg --import -v -v private.gpg
# gpg --import -v -v public.gpg
# Add key to apt
# apt-key add public.gpg
export KEYNAME=$1
for arch in `find $2 -maxdepth 1 -mindepth 1 -type d`; do
dpkg-scanpackages $arch > $arch/Packages
apt-ftparchive release $arch > $arch/Release
gpg --digest-algo SHA256 --yes -abs -u $KEYNAME -o $arch/Release.gpg $arch/Release
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment