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..."
|
echo "Searching for GPG key..."
|
||||||
gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)"
|
gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)"
|
||||||
if [ $? -eq 0 ]; then
|
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"
|
gpg --batch --delete-key "$FFP"
|
||||||
if [ "$FFP" = "" ]; then
|
if [ "$FFP" = "" ]; then
|
||||||
gpgSearch
|
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||||
|
return 1
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
gpgSearch
|
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
gpgSearch
|
diaBox "GPG Search" "This is on vaild mail address."
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
@ -137,8 +140,10 @@ function enterGPG() {
|
|||||||
gpgSearch
|
gpgSearch
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
enterGPG "$FFP" "no-confirm"
|
enterGPG "$FFP" "no-confirm"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
return
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
15
start_dialog
15
start_dialog
@ -133,18 +133,21 @@ function gpgSearch() {
|
|||||||
echo "Searching for GPG key..."
|
echo "Searching for GPG key..."
|
||||||
gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)"
|
gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)"
|
||||||
if [ $? -eq 0 ]; then
|
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"
|
gpg --batch --delete-key "$FFP"
|
||||||
if [ "$FFP" = "" ]; then
|
if [ "$FFP" = "" ]; then
|
||||||
gpgSearch
|
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||||
|
return 1
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
gpgSearch
|
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
gpgSearch
|
diaBox "GPG Search" "This is on vaild mail address."
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
@ -171,8 +174,10 @@ function enterGPG() {
|
|||||||
gpgSearch
|
gpgSearch
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
enterGPG "$FFP" "no-confirm"
|
enterGPG "$FFP" "no-confirm"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
return
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user