Fix: GPG-Search
This commit is contained in:
parent
7bb30f09f5
commit
333d5c9e3c
15
start
15
start
@ -99,18 +99,21 @@ function gpgSearch() {
|
||||
echo "Searching for GPG key..."
|
||||
gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)"
|
||||
if [ $? -eq 0 ]; then
|
||||
export FFP=$(gpg -k "$(cat $TMP)" | head -n 2 | tail -n 1 | awk '{print $1}' | sed 's/.\{4\}/& /g;s/^\(.*\) $/\1/g')
|
||||
FFP=$(gpg -k "$(cat $TMP)" | head -n 2 | tail -n 1 | awk '{print $1}' | sed 's/.\{4\}/& /g;s/^\(.*\) $/\1/g')
|
||||
gpg --batch --delete-key "$FFP"
|
||||
if [ "$FFP" = "" ]; then
|
||||
gpgSearch
|
||||
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
else
|
||||
gpgSearch
|
||||
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
gpgSearch
|
||||
diaBox "GPG Search" "This is on vaild mail address."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
@ -137,8 +140,10 @@ function enterGPG() {
|
||||
gpgSearch
|
||||
if [ $? -eq 0 ]; then
|
||||
enterGPG "$FFP" "no-confirm"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
|
15
start_dialog
15
start_dialog
@ -133,18 +133,21 @@ function gpgSearch() {
|
||||
echo "Searching for GPG key..."
|
||||
gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)"
|
||||
if [ $? -eq 0 ]; then
|
||||
export FFP=$(gpg -k "$(cat $TMP)" | head -n 2 | tail -n 1 | awk '{print $1}' | sed 's/.\{4\}/& /g;s/^\(.*\) $/\1/g')
|
||||
FFP=$(gpg -k "$(cat $TMP)" | head -n 2 | tail -n 1 | awk '{print $1}' | sed 's/.\{4\}/& /g;s/^\(.*\) $/\1/g')
|
||||
gpg --batch --delete-key "$FFP"
|
||||
if [ "$FFP" = "" ]; then
|
||||
gpgSearch
|
||||
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
else
|
||||
gpgSearch
|
||||
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
gpgSearch
|
||||
diaBox "GPG Search" "This is on vaild mail address."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
@ -171,8 +174,10 @@ function enterGPG() {
|
||||
gpgSearch
|
||||
if [ $? -eq 0 ]; then
|
||||
enterGPG "$FFP" "no-confirm"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user