-
Notifications
You must be signed in to change notification settings - Fork 4
/
LUKSUS.functions
executable file
·638 lines (592 loc) · 19.5 KB
/
LUKSUS.functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
#### FUNCTIONS ######
DEVICESET()
{
device=$($dialogapp $DIALOGAPPOPTIONS --inputbox "Enter the device to
create encrypted volume on.\nExample:\n/dev/sdd1\n\nTo create an encrypted filecontainer
use a LOOPBACKDEVICE.\nExample:\n/dev/loop0 (Linux)\n/dev/vn0
(DragonFlyBSD)\n
/dev/md0 (FreeBSD)\n
/dev/vnd0 (NetBSD)\n" 0 0 3>&1 1>&2 2>&3)
}
ENCRYPTIONENGINE()
{
DIALOGAPP=${DIALOG=dialog}
$DIALOGAPP --clear --title "Set your preferred encryption engine" \
--menu "Please choose encryption engine" 20 51 4 \
"LUKS" "LUKS (Linux and DragonFlyBSD)" \
"TRUECRYPT" "Truecrypt (TCPLAY) (Linux and DragonFlyBSD)" \
"GELI" "GELI (FreeBSD)" \
"CGD" "CGD (NetBSD)" \
"BIOCTL" "BIOCTL (OpenBSD)" \
"OPENPGP" "GNU GPG OPENPGP (GENERIC)" 2> $tempfile.enginemode
retval=$?
choice=$(cat $tempfile.enginemode)
ENCRYPTION=$(cat $tempfile.enginemode)
case $retval in
0)
$dialogapp --msgbox "Encryption engine chosen: $choice" 0 0;;
1)
echo "Cancel pressed.";;
255)
echo "ESC pressed.";;
esac
}
SECURITYMODE()
{
DIALOGAPP=${DIALOG=dialog}
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile.securitymode" 0 1 2 5 15
$DIALOGAPP --clear --title "Please choose security mode" \
--menu "Do you wish to use a passphrase or a keyfile" 20 51 4 \
"PASSPHRASE" "PASSPHRASE" \
"KEYFILE" "KEYFILE (WILL BE GENERATED FOR YOU)" 2> $tempfile.securitymode
retval=$?
choice=$(cat $tempfile.securitymode)
SECURITYMODE=$(cat $tempfile.securitymode)
case $retval in
0)
$dialogapp --msgbox "You chose the following security for your volume: $choice" 0 0;;
1)
echo "Cancel pressed.";;
255)
echo "ESC pressed.";;
esac
}
TRAPERR()
{
echo "ERROR: ${BASH_SOURCE[1]} "" \
""at about line ${BASH_LINENO[0]}"
}
EXITHOUSEKEEPING()
{
rm *.$$
#rm menuchoices.*
rm welcomelogo.*
}
NAMESET()
{
name=$($dialogapp $DIALOGAPPOPTIONS --inputbox "Enter the volume name (nickname of the volume).\nExample: Mystuff\nNote no special characters or spaces" 0 0 3>&1 1>&2 2>&3)
}
LUKSFILESET()
{
if [[ $LOOPBACKDEVICE == false ]]
then
echo Okay. Using a physical device.
else
$dialogapp $DIALOGAPPOPTIONS --title $programname --msgbox "Loopbackdevice has been detected!\nYou have specified a loopbackdevice and want to create a filecontainer." 0 0
luksfile=$($dialogapp $DIALOGAPPOPTIONS --title $programname --inputbox "LUKSUS has detected that you are creating an encrypted file container.\n\nPlease specify the full path where the encrypted volume should be created. No spaces or special characters. \n\nExample: /home/mystuff.archive" $dialogsize 3>&1 1>&2 2>&3)
fi
}
LUKSFILESIZESET()
{
if [[ $LOOPBACKDEVICE == false ]]
then
echo ..
else
luksfilesize=$($dialogapp $DIALOGAPPOPTIONS --inputbox "What is the
desired size of the encrypted file container. \n\nExample: 100M or 25G" $dialogsize 3>&1 1>&2 2>&3)
fi
}
NEXT()
{
NEXT=true
echo CONTINUING
}
WELCOMEINFORMATION()
{
"$dialogapp" --title $programname --msgbox "Welcome to $programname $version \n\n
This program lets you create an encrypted volume on a physical media such
as a hardrive or usb stick, or it can be in the form of a file
container. The program will now ask you to specify which device you
wish to create the volume on. If you are creating a file container
then you must choose a loopback device as device. You can also choose
between using a password or a keyfile if the encryption mechanism
supports it. The default is to use a password.\n\n
When you click OK the wizard will start and ask you which device you
wish to proceed with. You can re-run the wizard and you can exit the
program before $programname does any heavywork and makes any changes." 0 0
}
WIZARD()
{
# RUN THROUGH THE LUKSUS-WIZARD
ENCRYPTIONENGINE
SECURITYMODE
DEVICESET
LOOPBACKTEST
LUKSFILESET
LUKSFILESIZESET
NAMESET
}
MENUSYSTEM()
{
while [ $NEXT == false ] ;
do
# Dialog utility to display options list
$dialogapp --cancel-label "EXIT LUKSUS" --clear --backtitle "$programname $version" --title "" \
--menu "Choose next to proceed or run the wizard again" $dialogsize 10 \
"NEXT" "CONTINUE LUKSUS, REVIEW AND BEGIN VOLUME CREATION" \
"WIZARD" "RUN THE WIZARD AGAIN TO SET UP LUKSUS" \
"REVIEW" "REVIEW THE USERSPECIFIED OPTIONS" \
"-" "" \
"-" "" \
"DEVICE" "ENTER DEVICE TO USE (PHYSICAL OR LOOPBACK)" \
"NAME" "NICK NAME FOR ENCRYPTED CONTAINER" \
"LOCATION" "SPECIFY WHERE TO STORE ENCRYPTED VOLUME (FIXED SIZE)" \
"SIZE" "SPECIFY HOW LARGE THE CONTAINER SHOULD BE" \
"ENCRYPTIONENGINE" "CHOOSE ENCRYPTION ENGINE" \
"SECURITYMODE" "CHOOSE TO USE PASSPHRASE OR KEYFILE" 2> menuchoices.$$
retopt=$?
choice=`cat menuchoices.$$`
case $retopt in
0) case $choice in
WIZARD) WIZARD ;;
DEVICE) DEVICESET ;;
NAME) NAMESET ;;
LOCATION) LUKSFILESET ;;
SIZE) LUKSFILESIZESET;;
SECURITYMODE) SECURITYMODE ;;
ENCRYPTIONENGINE) ENCRYPTIONENGINE ;;
SUMMARY) SUMMARY ;;
NEXT) NEXT ;;
REVIEW) GRAPHICALVERIFYCHOICES ;;
esac ;;
*)clear ; exit ;;
esac
done
keyfile=/keys/$name.key
headerbackup=/keys/$name.header
mountpoint=/mnt/$name
}
ASKUSERVERIFYCONSOLE ()
{
echo;
echo THE FOLLOWING DETAILS HAS BEEN SET BY THE USER;
echo PLEASE VERIFY THAT THESE ARE CORRECT;
echo ENCRYPTION USED: $ENCRYPTION;
echo DRIVE: $device;
echo NAME: $name;
echo MOUNTPOINT: $mountpoint;
echo HEADER BACKUP: $headerbackup;
echo SECURITY MODE: $SECURITYMODE;
echo KEYFILE: $keyfile;
echo LOOPBACK: $LOOPBACKDEVICE;
echo OS: $UNAME;
echo;
echo JUST TO MAKE DOUBLY SURE THAT YOU ARE FORMATTING THE CORRECT DRIVE;
echo LUKSUS ASKS AGAIN. IS THIS THE CORRECT DEVICE TO FORMAT AND ENCRYPT?;
echo YOU WILL NUKE THE FOLLOWING DEVICE: $device;
echo HIT CTRL+C NOW TO QUIT, OR HIT ANY KEY TO CONTINUE;
echo "";
echo SERIOUSLY - LAST CHANCE;
read || exit
}
CGD ()
{
if [[ $ENCRYPTION == CGD ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo Initializing $device with $ENCRYPTION;
cgdconfig -g -V $name -o $keydir/$name aes-cbc 256;
cgdconfig -g -o $keydir/$name aes-cbc 256;
cgdconfig $name $device;
cgdconfig -V re-enter $name $device;
else
echo "";
fi
}
CREATEANDMOUNTFS ()
{
mkdir -p $mountpoint;
mkdir -p $keydir;
if [[ $UNAME == DragonFly ]]; then
echo DragonFlyBSD mode;
newfs /dev/mapper/$name;
mount /dev/mapper/$name /mnt/$name;
mounthelp="mount /dev/mapper/$name /mnt/$name";
else
if [[ $UNAME == FreeBSD ]]; then
newfs $device.eli;
mount $device.eli /mnt/$name;
mounthelp="mount $device.eli /mnt/$name";
else
if [[ $UNAME == NetBSD ]]; then
newfs -O 2 $device;
mount $device /mnt/$name;
mounthelp="mount $device /mnt/$name";
else
if [[ $UNAME == Linux ]]; then
mkfs.ext4 /dev/mapper/$name;
e2label /dev/mapper/$name $name;
mount -t ext4 /dev/mapper/$name $mountpoint > /dev/null 2>&1;
mounthelp="mount -t ext4 /dev/mapper/$name $mountpoint";
else
echo No Idea What To Do;
fi;
fi;
fi;
fi
}
CREATEKEYFILE ()
{
if [[ $SECURITYMODE == KEYFILE ]]; then
echo Creating key;
dd if=/dev/urandom of=$keyfile bs=512 count=256;
else
echo ...;
fi
}
DEVICEEXISTS ()
{
if [ -e "$device" ]; then
echo "OK, $device exists";
else
echo "$device was not found. $programname is now exiting";
exit 1;
fi
}
DISPLAYLOGO ()
{
if [ $width -gt 119 ]; then
gtail -n 12 LUKSUS.logo 2> /dev/null || tail -n 12 LUKSUS.logo;
gtail -n 12 LUKSUS.logo 1>welcomelogo.$$ 2> /dev/null || tail -n 12 LUKSUS.logo >welcomelogo.$$
dialogsize="17 123"
else
ghead -n 6 LUKSUS.logo 2> /dev/null || head -n 6 LUKSUS.logo;
ghead -n 6 LUKSUS.logo 1>welcomelogo.$$ 2> /dev/null || head -n 6 LUKSUS.logo >welcomelogo.$$
dialogsize="12 60"
fi
}
DISPLAYSUMMARY ()
{
echo "All the following information can be found in $keydir/$name.information";
date;
echo Results of LUKSUS:;
echo DRIVE: $device;
echo NAME: $name;
echo SECURITYMODE: $SECURITYMODE;
echo KEYFILE: $keyfile;
echo MOUNTPOINT: $mountpoint;
echo HEADER BACKUP: $headerbackup;
echo ENCRYPTION USED: $ENCRYPTION;
echo CONTAINER $luksfile $luksfilesize;
echo MOUNTPOINT: `mount | grep $name`;
echo `df -h | head -n 1`;
echo `df -h | grep $name`;
echo "";
echo Volumestatus:;
echo $VOLUMESTATUS >> $keydir/$name.information 2>> $keydir/$name.information;
echo "################################################";
time2="$(date +%s.%N)";
ls -l $device
}
DISPLAYSUMMARYGRAPHICAL ()
{
$dialogapp --msgbox "All the following information can be found
in\n$keydir/$name.information" 0 0;
$dialogapp --textbox $keydir/$name.information 0 0;
}
DONTSHREDIFLOOPBACK ()
{
if [[ $LOOPBACKDEVICE == false ]] && [[ $UNAME == Linux ]]; then
echo "Okay we are using a physical device $device ...";
echo Shredding ...;
shred -f -v -n1 $device || gshred -f -v -n1 $device;
else
if [[ $LOOPBACKDEVICE == false ]] && [[ UNAME == DragonFly ]]; then
echo On DragonFlyBSD. Okay cool.;
echo in the middle of the shredding.place;
gshred -f -v -n1 $device;
else
if [[ $LOOPBACKDEVICE == false ]] && [[ $UNAME == FreeBSD ]]; then
echo On FreeBSD. Okay cool.;
echo in the middle of the shredding.place;
gshred -f -v -n1 $device;
else
echo "$device is a loopback device.";
fi;
fi;
fi
}
DRAGONFLYHOUSEKEEPING ()
{
if [[ $UNAME == DragonFly ]]; then
echo We are on DragonFlyBSD here.;
alias ghead=head;
alias gshred=shred;
kldload dm;
vnconfig > /dev/null 2> /dev/null;
else
echo "";
fi
}
FREEBSDHOUSEKEEPING ()
{
if [ $UNAME == FreeBSD ]; then
echo We are on FreeBSD here. Cool.;
alias ghead=head;
alias gshred=shred;
kldload geom_eli;
else
echo "";
fi
}
GELI ()
{
if [[ $ENCRYPTION == GELI ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo Initializing $device with $ENCRYPTION;
geli init -B $headerbackup -s 4096 $device;
else
echo "";
fi
}
GELIKEYFILE ()
{
if [[ ENCRYPTION == GELI ]] && [[ $SECURITYMODE == KEYFILE ]]; then
echo Initializing $device with $ENCRYPTION with a keyfile;
geli init -B $headerbackup -p -s 4096 -K $keyfile $device;
else
echo "";
fi
}
GELIOPEN ()
{
if [[ $ENCRYPTION == GELI ]] && [[ $SECURITYMODE == KEYFILE ]]; then
echo Attempting to open the newly created $ENCRYPTION volume $name with $keyfile;
geli attach -k $keyfile $device;
cryptoinithelp="geli attach -k $keyfile $device";
VOLUMESTATUS=$(geli dump $name);
else
if [[ $ENCRYPTION == GELI ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo Attempting to open the newly created $ENCRYPTION volume $name;
geli attach $device;
cryptoinithelp="geli attach $device";
VOLUMESTATUS=$(geli dump $device);
else
echo "";
fi;
fi
}
GRAPHICALVERIFYCHOICES ()
{
if [[ $GOGRAPHICAL = 1 ]]; then
$dialogapp --title "$programname $version" --yesno "\nDETAILS AS SUBMITTED BY THE USER
\n \n \n
ENCRYPTION USED: $ENCRYPTION
\n
NAME: $name \n
DRIVE: $device \n
MOUNTPOINT: $mountpoint \n
KEYFILE: $keyfile \n
HEADER BACKUP: $headerbackup\n
FILECONTAINER LOCATION: $luksfile\n
FILECONTAINER SIZE: $luksfilesize\n
SECURITYMODE: $SECURITYMODE\n
LOOPBACKDEVICE: $LOOPBACKDEVICE\n
OS: $UNAME\n\n
ARE THESE VALUES CORRECT? \n\nIF UNSURE SAY NO.
" 0 0;
case $? in
0)
;;
1)
echo "You have pressed NO. Exit LUKSUS.";
exit 1
;;
255)
echo "Box closed"
;;
esac;
else
echo "";
fi
}
GRAPHICALWELCOME ()
{
if [[ $dialog == true ]]; then
$dialogapp --backtitle "$programname $version" \
--title "WELCOME" \
--exit-label "BEGIN" --textbox welcomelogo.$$ $dialogsize;
fi
}
LOOPBACKMETHOD ()
{
if [[ $LOOPBACKDEVICE == true ]] && [[ $UNAME == Linux ]]; then
echo Beginning loopbackmethod on $device;
head -c $luksfilesize /dev/zero > $luksfile;
losetup -f 1>/dev/null 2> /dev/null;
losetup $device $luksfile;
loopbackhelp="losetup $device $luksfile";
else
if [[ $LOOPBACKDEVICE == true ]] && [[ $UNAME == DragonFly ]]; then
echo DragonFlyBSD - Nice...;
echo Beginning loopbackmethod on $device;
ghead -c $luksfilesize /dev/zero > $luksfile;
vnconfig > /dev/null 2> /dev/null;
vnconfig $device $luksfile;
loopbackhelp="vnconfig $device $luksfile";
else
if [[ $LOOPBACKDEVICE == true ]] && [[ $UNAME == FreeBSD ]]; then
echo FreeBSD - Nice...;
ghead /dev/zero -c $luksfilesize > $luksfile;
mdconfig -a -t vnode -f $luksfile -u $freebsdloopnumber;
loopbackhelp="mdconfig -a -t vnode -f $luksfile -u $freebsdloopnumber";
else
echo "Okay, not using a loopback device, proceeding in normal mode";
fi;
fi;
fi
}
LOOPBACKTEST ()
{
if [[ $device == *loop* ]]; then
LOOPBACKDEVICE=true;
else
if [[ $device == *vn* ]]; then
LOOPBACKDEVICE=true;
else
if [[ $device == *md* ]]; then
LOOPBACKDEVICE=true;
else
if [[ $device == *vnd* ]]; then
LOOPBACKDEVICE=true;
else
LOOPBACKDEVICE=false;
fi;
fi;
fi;
fi
}
LUKS ()
{
if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo LUKS with passphrase;
echo You will only be prompted for a password once. Type carefully.;
cryptsetup --batch-mode --verbose --cipher=aes-xts-plain64 luksFormat $device;
else
echo "";
fi
}
LUKSKEYFILE ()
{
if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE = KEYFILE ]]; then
echo LUKS mode;
cryptsetup --batch-mode --verbose --key-size=512 --cipher=aes-xts-plain64 luksFormat $device $keyfile;
else
echo "";
fi
}
LUKSOPEN ()
{
if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE == KEYFILE ]]; then
echo Attempting to open the newly created $ENCRYPTION volume $name with $keyfile;
cryptsetup luksOpen $device $name --key-file=$keyfile;
cryptoinithelp="cryptsetup luksOpen $device $name --key-file=$keyfile";
VOLUMESTATUS=$(cryptsetup status $name);
else
if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo Attempting to open the newly created $ENCRYPTION volume $name;
cryptsetup luksOpen $device $name;
cryptoinithelp="cryptsetup luksOpen $device $name";
VOLUMESTATUS=$(cryptsetup status $name);
else
echo "";
fi;
fi
}
LUKSVERIFY ()
{
if [[ $ENCRYPTION = LUKS ]]; then
echo "Verifying LUKS volume";
cryptsetup isLuks $device || "echo "The device does not contain a LUKS volume. This is a problem since it should have a LUKS volume by now. Please check commandline arguments and try again" && exit 1";
echo "The device positively contains a LUKS volume.";
echo "Great!";
echo "Taking a backup of the LUKS container header";
cryptsetup luksHeaderBackup --header-backup-file=$headerbackup $device --verbose || "echo Something went wrong and LUKSUS failed to backup the LUKS header. Please check commandline arguments and try again. && exit 1";
echo "The LUKS container header has been backed up successfully";
echo "Great!";
else
echo "";
fi
}
NETBSDHOUSEKEEPING ()
{
if [ $UNAME == NetBSD ]; then
echo We are on NetBSD here. Cool.;
alias ghead=head;
alias gshred=shred;
else
echo "";
fi
}
OSTEST ()
{
if [[ $UNAME = Linux ]]; then
ENCRYPTION=LUKS;
echo On $UNAME, defaulting to $ENCRYPTION;
else
if [[ $UNAME = DragonFly ]]; then
ENCRYPTION=LUKS;
echo On $UNAME, defaulting to $ENCRYPTION;
else
if [[ $UNAME = FreeBSD ]]; then
ENCRYPTION=GELI;
echo On $UNAME, Encryption set to $ENCRYPTION;
else
if [[ $UNAME = NetBSD ]]; then
ENCRYPTION=CGD;
else
ENCRYPTION=LUKSUS;
echo No idea what I am running on $UNAME, defaulting to $ENCRYPTION;
fi;
fi;
fi;
fi
}
TRUECRYPT ()
{
if [[ $ENCRYPTION == TRUECRYPT ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo TrueCrypt mode;
tcplay --create --device=$device --cipher=AES-256-XTS;
else
echo "";
fi
}
TRUECRYPTKEYFILE ()
{
if [[ $ENCRYPTION == TRUECRYPT ]] && [[ $SECURITYMODE == KEYFILE ]]; then
echo TrueCrypt mode and adding a keyfile. Truecrypt asks for a password in any case. The container will also have a keyfile;
tcplay --create --device=$device --cipher=AES-256-XTS --keyfile=$keyfile;
else
echo "";
fi
}
TRUECRYPTOPEN ()
{
if [[ $ENCRYPTION == TRUECRYPT ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo Attempting to open and mount the newly created Truecrypt encrypted volume;
tcplay -m $name -d $device;
cryptoinithelp="tcplay -m $name -d $device";
VOLUMESTATUS=$(cryptsetup status $name);
else
if [[ $ENCRYPTION == TRUECRYPT ]] && [[ $SECURITYMODE == KEYFILE ]]; then
echo Attempting to open newly created Truecrypt volume $name;
tcplay -m $name -d $device -k $keyfile;
cryptoinithelp="tcplay -m $name -d $device -k $keyfile";
VOLUMESTATUS=$(cryptsetup status $name);
else
echo "";
fi;
fi
}
WRITEINFORMATIONFILE ()
{
DISPLAYLOGO > $keydir/$name.information 2> $keydir/$name.information;
DISPLAYSUMMARY >> $keydir/$name.information 2>> $keydir/$name.information;
ls -l $keydir/$name* >> $keydir/$name.information 2>> $keydir/$name.information;
echo "" >> $keydir/$name.information 2>> $keydir/$name.information;
echo "In order to mount your newly encrypted volume, run the following:" >> $keydir/$name.information 2>> $keydir/$name.information;
echo "###" >> $keydir/$name.information 2>> $keydir/$name.information;
echo $loopbackhelp >> $keydir/$name.information 2>> $keydir/$name.information;
echo $cryptoinithelp >> $keydir/$name.information 2>> $keydir/$name.information;
echo $mounthelp >> $keydir/$name.information 2>> $keydir/$name.information;
echo "###" >> $keydir/$name.information 2>> $keydir/$name.information;
cp $keydir/$name.information $mountpoint
}