Menu style for setting trust level
This commit is contained in:
parent
f85e37e49e
commit
df1961e553
|
@ -283,25 +283,19 @@ function gpg_set_trust {
|
||||||
fpr=$(gpg --with-colons --fingerprint "$TRUST_ADDRESS" | grep fpr | head -n 1 | awk -F ':' '{print $10}')
|
fpr=$(gpg --with-colons --fingerprint "$TRUST_ADDRESS" | grep fpr | head -n 1 | awk -F ':' '{print $10}')
|
||||||
if [ ${#fpr} -gt 2 ]; then
|
if [ ${#fpr} -gt 2 ]; then
|
||||||
|
|
||||||
data=$(mktemp 2>/dev/null)
|
W=(1 $"I don't know or won't say"
|
||||||
dialog --backtitle $"Freedombone User Control Panel" \
|
2 $"I do NOT trust"
|
||||||
--title $"Trust a PGP/GPG key or website domain" \
|
3 $"I trust marginally"
|
||||||
--radiolist $"Set the trust level for $TRUST_ADDRESS:" 18 70 10 \
|
4 $"I trust fully"
|
||||||
1 $"I don't know or won't say" off \
|
5 $"I trust ultimately")
|
||||||
2 $"I do NOT trust" off \
|
|
||||||
3 $"I trust marginally" on \
|
# shellcheck disable=SC2068
|
||||||
4 $"I trust fully" off \
|
TRUST_LEVEL=$(dialog --backtitle $"Freedombone User Control Panel" --title $"Trust a PGP/GPG key or website domain" --menu $"Set the trust level for $TRUST_ADDRESS:" 18 70 10 "${W[@]}" 3>&2 2>&1 1>&3)
|
||||||
5 $"I trust ultimately" off 2> "$data"
|
|
||||||
sel=$?
|
if [ ! "$TRUST_LEVEL" ]; then
|
||||||
case $sel in
|
return;
|
||||||
1) rm -f "$data"
|
fi
|
||||||
return;;
|
|
||||||
255) rm -f "$data"
|
|
||||||
return;;
|
|
||||||
esac
|
|
||||||
TRUST_LEVEL=$(cat "$data")
|
|
||||||
if [ "${TRUST_LEVEL}" -ge 1 ] ; then
|
|
||||||
if [ "${TRUST_LEVEL}" -le 5 ] ; then
|
|
||||||
if echo -e "trust\\n${TRUST_LEVEL}\\ny\\nsave\\n" | gpg --command-fd 0 --edit-key "$fpr"; then
|
if echo -e "trust\\n${TRUST_LEVEL}\\ny\\nsave\\n" | gpg --command-fd 0 --edit-key "$fpr"; then
|
||||||
gpg --update-trustdb
|
gpg --update-trustdb
|
||||||
dialog --title $"Trust a PGP/GPG key or website domain" \
|
dialog --title $"Trust a PGP/GPG key or website domain" \
|
||||||
|
@ -309,9 +303,6 @@ function gpg_set_trust {
|
||||||
--msgbox $"$TRUST_ADDRESS was set to trust level ${TRUST_LEVEL}" 6 50
|
--msgbox $"$TRUST_ADDRESS was set to trust level ${TRUST_LEVEL}" 6 50
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
rm -f "$data"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function email_rule_subject {
|
function email_rule_subject {
|
||||||
|
|
Loading…
Reference in New Issue