|
@@ -100,19 +100,19 @@ function reconstruct_key {
|
100
|
100
|
cd /home/$MY_USERNAME/.gnupg_fragments
|
101
|
101
|
no_of_shares=$(ls -afq keyshare.asc.* | wc -l)
|
102
|
102
|
if (( no_of_shares < 4 )); then
|
103
|
|
- dialog --title "Encryption keys" --msgbox 'Not enough fragments to reconstruct the key' 6 70
|
|
103
|
+ dialog --title $"Encryption keys" --msgbox $'Not enough fragments to reconstruct the key' 6 70
|
104
|
104
|
exit 7348
|
105
|
105
|
fi
|
106
|
106
|
apt-get -y install libgfshare-bin gnupg
|
107
|
107
|
gfcombine /home/$MY_USERNAME/.gnupg_fragments/keyshare*
|
108
|
108
|
if [ ! "$?" = "0" ]; then
|
109
|
|
- dialog --title "Encryption keys" --msgbox 'Unable to reconstruct the key' 6 70
|
|
109
|
+ dialog --title $"Encryption keys" --msgbox $'Unable to reconstruct the key' 6 70
|
110
|
110
|
exit 7348
|
111
|
111
|
fi
|
112
|
112
|
|
113
|
113
|
KEYS_FILE=/home/$MY_USERNAME/.gnupg_fragments/keyshare.asc
|
114
|
114
|
if [ ! -f $KEYS_FILE ]; then
|
115
|
|
- dialog --title "Encryption keys" --msgbox 'Unable to reconstruct the key' 6 70
|
|
115
|
+ dialog --title $"Encryption keys" --msgbox $'Unable to reconstruct the key' 6 70
|
116
|
116
|
fi
|
117
|
117
|
|
118
|
118
|
su -c "gpg --allow-secret-key-import --import $KEYS_FILE" - $MY_USERNAME
|
|
@@ -124,12 +124,12 @@ function reconstruct_key {
|
124
|
124
|
fi
|
125
|
125
|
shred -zu $KEYS_FILE
|
126
|
126
|
|
127
|
|
- dialog --title "Encryption keys" --msgbox 'Key has been reconstructed' 6 70
|
|
127
|
+ dialog --title $"Encryption keys" --msgbox $'Key has been reconstructed' 6 70
|
128
|
128
|
}
|
129
|
129
|
|
130
|
130
|
function interactive_gpg_from_usb {
|
131
|
|
- dialog --title "Encryption keys" \
|
132
|
|
- --msgbox 'Plug in a USB drive containing a copy of your full key or key fragment' 6 70
|
|
131
|
+ dialog --title $"Encryption keys" \
|
|
132
|
+ --msgbox $'Plug in a USB drive containing a copy of your full key or key fragment' 6 70
|
133
|
133
|
|
134
|
134
|
HOME_DIR=/home/$MY_USERNAME
|
135
|
135
|
GPG_LOADING="yes"
|
|
@@ -146,7 +146,7 @@ function interactive_gpg_from_usb {
|
146
|
146
|
reconstruct_key
|
147
|
147
|
return 0
|
148
|
148
|
fi
|
149
|
|
- dialog --title "Encryption keys" --msgbox 'No USB drive found' 6 30
|
|
149
|
+ dialog --title $"Encryption keys" --msgbox $'No USB drive found' 6 30
|
150
|
150
|
exit 27852
|
151
|
151
|
fi
|
152
|
152
|
fi
|
|
@@ -173,8 +173,8 @@ function interactive_gpg_from_usb {
|
173
|
173
|
reconstruct_key
|
174
|
174
|
return 0
|
175
|
175
|
fi
|
176
|
|
- dialog --title "Encryption keys" \
|
177
|
|
- --msgbox "There was a problem mounting the USB drive to $GPG_USB_MOUNT" 6 70
|
|
176
|
+ dialog --title $"Encryption keys" \
|
|
177
|
+ --msgbox $"There was a problem mounting the USB drive to $GPG_USB_MOUNT" 6 70
|
178
|
178
|
rm -rf $GPG_USB_MOUNT
|
179
|
179
|
exit 74393
|
180
|
180
|
fi
|
|
@@ -187,8 +187,8 @@ function interactive_gpg_from_usb {
|
187
|
187
|
reconstruct_key
|
188
|
188
|
return 0
|
189
|
189
|
fi
|
190
|
|
- dialog --title "Encryption keys" \
|
191
|
|
- --msgbox "The directory $GPG_USB_MOUNT/.gnupg or $GPG_USB_MOUNT/.gnupg_fragments was not found" 6 70
|
|
190
|
+ dialog --title $"Encryption keys" \
|
|
191
|
+ --msgbox $"The directory $GPG_USB_MOUNT/.gnupg or $GPG_USB_MOUNT/.gnupg_fragments was not found" 6 70
|
192
|
192
|
umount -f $GPG_USB_MOUNT
|
193
|
193
|
rm -rf $GPG_USB_MOUNT
|
194
|
194
|
exit 723814
|
|
@@ -201,8 +201,8 @@ function interactive_gpg_from_usb {
|
201
|
201
|
fi
|
202
|
202
|
cp -r $GPG_USB_MOUNT/.gnupg/* $HOME_DIR/.gnupg
|
203
|
203
|
GPG_LOADING="no"
|
204
|
|
- dialog --title "Encryption keys" \
|
205
|
|
- --msgbox "GPG Keyring loaded to $HOME_DIR" 6 70
|
|
204
|
+ dialog --title $"Encryption keys" \
|
|
205
|
+ --msgbox $"GPG Keyring loaded to $HOME_DIR" 6 70
|
206
|
206
|
else
|
207
|
207
|
if [ ! -d $HOME_DIR/.gnupg_fragments ]; then
|
208
|
208
|
mkdir $HOME_DIR/.gnupg_fragments
|
|
@@ -216,8 +216,8 @@ function interactive_gpg_from_usb {
|
216
|
216
|
mkdir $HOME_DIR/.ssh
|
217
|
217
|
fi
|
218
|
218
|
cp $GPG_USB_MOUNT/.ssh/* $HOME_DIR/.ssh
|
219
|
|
- dialog --title "Encryption keys" \
|
220
|
|
- --msgbox "ssh keys imported" 6 70
|
|
219
|
+ dialog --title $"Encryption keys" \
|
|
220
|
+ --msgbox $"ssh keys imported" 6 70
|
221
|
221
|
SSH_IMPORTED="yes"
|
222
|
222
|
fi
|
223
|
223
|
fi
|
|
@@ -225,8 +225,8 @@ function interactive_gpg_from_usb {
|
225
|
225
|
umount -f $GPG_USB_MOUNT
|
226
|
226
|
rm -rf $GPG_USB_MOUNT
|
227
|
227
|
if [[ $GPG_LOADING == "yes" ]]; then
|
228
|
|
- dialog --title "Encryption keys" \
|
229
|
|
- --msgbox "Now remove the USB drive. Insert the next drive containing a key fragment, or select Ok to finish" 6 70
|
|
228
|
+ dialog --title $"Encryption keys" \
|
|
229
|
+ --msgbox $"Now remove the USB drive. Insert the next drive containing a key fragment, or select Ok to finish" 6 70
|
230
|
230
|
fi
|
231
|
231
|
GPG_CTR=$((GPG_CTR + 1))
|
232
|
232
|
done
|