From f86537e4e9dc5ce215f075ef06a03313c0abedbc Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 5 Jul 2015 15:23:16 +0100 Subject: [PATCH] Include social key management as an option in the interactive installer --- src/freedombone-config | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/freedombone-config b/src/freedombone-config index 99aa29a0..3825ec94 100755 --- a/src/freedombone-config +++ b/src/freedombone-config @@ -548,6 +548,26 @@ function interactive_configuration { interactive_gpg + data=$(tempfile 2>/dev/null) + trap "rm -f $data" 0 1 2 5 15 + SOCIAL_KEY_STR="\nDo you wish to enable social key management, otherwise known as \"the unforgettable key\"?\n\nThis means that fragments of your GPG key will be included with any remote backups so that if you later lose your key then it can be reconstructed from your friends servers. If you select \"no\" then you can still do social key management, but offline using physical USB thumb drives, which is more secure but less convenient." + if [[ $(grep "ENABLE_SOCIAL_KEY_MANAGEMENT" temp.cfg | awk -F '=' '{print $2}') == "yes" ]]; then + dialog --title "Social Key Management" \ + --backtitle "Freedombone Configuration" \ + --yesno "$SOCIAL_KEY_STR" 15 60 + else + dialog --title "Social Key Management" \ + --backtitle "Freedombone Configuration" \ + --defaultno \ + --yesno "$SOCIAL_KEY_STR" 15 60 + fi + sel=$? + case $sel in + 0) ENABLE_SOCIAL_KEY_MANAGEMENT="yes";; + 255) exit 1;; + esac + save_configuration_file + data=$(tempfile 2>/dev/null) trap "rm -f $data" 0 1 2 5 15 if [[ $INSTALLING_ON_BBB == "no" ]]; then @@ -1293,6 +1313,9 @@ function read_configuration { fi if [ -f $CONFIGURATION_FILE ]; then + if grep -q "ENABLE_SOCIAL_KEY_MANAGEMENT" $CONFIGURATION_FILE; then + ENABLE_SOCIAL_KEY_MANAGEMENT=$(grep "ENABLE_SOCIAL_KEY_MANAGEMENT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi if grep -q "GIT_DOMAIN_NAME" $CONFIGURATION_FILE; then GIT_DOMAIN_NAME=$(grep "GIT_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') fi