Skip to content

Instantly share code, notes, and snippets.

@brahimmachkouri
Created December 2, 2014 17:22
Show Gist options
  • Save brahimmachkouri/9d857cb676e959ffbb8e to your computer and use it in GitHub Desktop.
Save brahimmachkouri/9d857cb676e959ffbb8e to your computer and use it in GitHub Desktop.
Adjust keyservers settings in puphpet file configurations
#!/bin/bash
server1="keyserver.ubuntu.com"
server2="keyserver.debian.com"
server3="keys.gnupg.net"
function replacehkp {
sedserver=`echo $1 | awk -F '.' '{ print $1 "\\\." $2 "\\\." $3 }'`
grep -ri "'$server" * | awk -F ':' '{ print $1 }' | xargs sed -i "s/'$sedserver/'hkp:\/\/$sedserver:80/g"
}
replacehkp $server1
replacehkp $server2
replacehkp $server3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment