-
Notifications
You must be signed in to change notification settings - Fork 0
/
genGpgKey.sh
executable file
·37 lines (35 loc) · 1.12 KB
/
genGpgKey.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
#------------------------------------------------------------------------------
#
# MyRPM - Rpm Utilities
# Copyright (c) Jean-Marie RENOUARD 2014 - LightPath
# Contact : Jean-Marie Renouard <jmrenouard at gmail.com>
#
# This program is open source, licensed under the Artistic Licence v2.0.
#
# Artistic Licence 2.0
# Everyone is permitted to copy and distribute verbatim copies of
# this license document, but changing it is not allowed.
#
#------------------------------------------------------------------------------
umask 0277
cat << EOF > /tmp/gpg-genkey.conf
%echo Generating a package signing key
Key-Type: DSA
Key-Length: 1024
Subkey-Type: ELG-E
Subkey-Length: 2048
Name-Real: Jean-Marie RENOUARD
Name-Email: [email protected]
Expire-Date: 0
Passphrase: xxxxxxx
%commit
%echo Done
EOF
umask 0022
(find / -xdev -type f -exec sha256sum {} >/dev/null \; 2>&1) &
export ENTROPY=$!
gpg --batch --gen-key /tmp/gpg-genkey.conf > gpg-keygen.log 2> gpg-keygen_error.log
ps -ef | grep find | awk '{ print $2 }' | grep ${ENTROPY} && kill ${ENTROPY}
kill `ps -ef|grep sha256sum|awk '{if($3==1){print $2}}'`
rm /tmp/gpg-genkey.conf