Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Further cleanup - version bumped to v0.8.5

  • Loading branch information...
commit d2b41db612ffcc447c6b637ebabaae0042513521 1 parent 0531cf2
Thomas Frivold authored
View
35 LUKSUS
@@ -27,38 +27,40 @@ fi
###############################
-###### INITIAL WELCOME ########
+##### FUNCTIONS ######
###############################
-if [ -r LUKSUS.welcome ]; then
- source LUKSUS.welcome
+
+if [ -r LUKSUS.functions ]; then
+ source LUKSUS.functions
else
exit 0
fi
###############################
-##### CONDITIONAL CHECKS ######
+###### INITIAL WELCOME ########
###############################
-
-if [ -r LUKSUS.checks ]; then
- source LUKSUS.checks
+if [ -r LUKSUS.welcome ]; then
+ source LUKSUS.welcome
else
exit 0
fi
+
###############################
-##### FUNCTIONS ######
+##### CONDITIONAL CHECKS ######
###############################
-if [ -r LUKSUS.functions ]; then
- source LUKSUS.functions
+if [ -r LUKSUS.checks ]; then
+ source LUKSUS.checks
else
exit 0
fi
+
#########################################################
#########################################################
#########################################################
@@ -69,18 +71,12 @@ fi
#########################################################
#########################################################
-# loopback specific functions
-# WELCOME - had to botch this one, does functions not allow conditions?
-# Call functions
-
+# Calling functions
ASKUSERVERIFY
LOOPBACKMETHOD
DONTSHREDIFLOOPBACK
-### From here / something more elegant needs to be written
-# use the blkid script
-
# mkdir
# create mountpoint & keydirectory
# i should create an if routine here
@@ -113,7 +109,8 @@ then
echo "Checking to see if the device contains a LUKS volume"
echo "The device positively contains a LUKS volume."
echo "Great!"
-echo "Continuing LUKSUS"
+echo "Continuing"
+DISPLAYLOGO
else echo "The device does not contain a LUKS volume"
echo "Something went wrong and the LUKS device has not been created"
echo "Exiting"
@@ -158,7 +155,7 @@ if [ $? -ne 0 ] ; then
echo ################################################
echo Thanks for using
-cat LUKSUS.logo
+DISPLAYLOGO
echo Results:
echo DRIVE: $device
echo NAME: $name
View
26 LUKSUS.functions
@@ -1,5 +1,16 @@
#### FUNCTIONS ######
+# SHOW LOGO, BUT DO IT OPTIMALLY BY DETERMINING TERMINAL SIZE
+DISPLAYLOGO()
+{
+if [ $width -gt 119 ]
+then
+ tail --lines 12 LUKSUS.logo
+ else
+ head --lines 6 LUKSUS.logo
+fi
+}
+
LOOPBACKMETHOD()
{
if [[ $device = *loop* ]]
@@ -33,10 +44,7 @@ else # Don't want to mix up the two instances.
ASKUSERVERIFY()
{
-
-# OUTPUTING SCRIPT VERSION AND DATE
-
-dialog --title "WELCOME TO $PROGRAMNAME" \
+dialog --title "WELCOME TO $programname" \
--msgbox "\n
\n
VERSION: $version\n
@@ -72,21 +80,21 @@ echo THE DEVICE YOU HAVE SPECIFIED
echo ################################################
dialog --title "DRIVE ENCRYPTION SCRIPT" \
---msgbox "\n DETAILS AS SUBMITTED IN THE VARIABLES
+--msgbox "\n DETAILS AS SUBMITTED BY THE USER
\n \n \n
NAME: $name \n
DRIVE: $device \n
MOUNTPOINT: $mountpoint \n
KEYFILE: $keyfile \n
HEADER BACKUP: $headerfile\n
-$luksfile
-$luksfilesize
+FILECONTAINER LOCATION: $luksfile
+FILECONTAINER SIZE: $luksfilesize
" 50 50
echo ################################################
-echo DETAILS AS SUBMITTED IN THE VARIABLES
-echo WHICH WILL BE USED FOR THE DRIVE ENCRYPTION
+echo DETAILS AS SUBMITTED BY THE USER
+echo PLEASE VERIFY THAT THESE ARE CORRECT
echo DRIVE: $device
echo NAME: $name
echo KEYFILE: $keyfile
View
7 LUKSUS.variables
@@ -1,6 +1,6 @@
programname=LUKSUS
-version=v0.8.3
-date=25.02.2013
+version=v0.8.5
+date=26.02.2013
author="Thomas J. Frivold"
time1="$(date +%s.%N)"
@@ -15,4 +15,7 @@ headerfile=/keys/$name.luks.header
mountpoint=/mnt/$name
FILE="/tmp/out.$$"
GREP=`which grep`
+screensize=`echo -e "lines\ncols"|tput -S`
+height=$(echo $screensize | cut -d " " -f 1)
+width=$(echo $screensize | cut -d " " -f 2)
View
18 LUKSUS.welcome
@@ -4,19 +4,5 @@
# before everything else, so it must be here.
# at least for now
-# Easter egg!
-# determining screensize
-# and show different logos depending on screensize
-screensize=`echo -e "lines\ncols"|tput -S`
-height=$(echo $screensize | cut -d " " -f 1)
-width=$(echo $screensize | cut -d " " -f 2)
-
-
-if [ $width -gt 119 ]
-then
- tail --lines 12 LUKSUS.logo
- else
- head --lines 6 LUKSUS.logo
-fi
-echo "$programname $version ($date)"
-echo "by $author"
+DISPLAYLOGO
+echo " $version ($date) by $author"
View
21 README
@@ -90,8 +90,10 @@
# Luksus is released under GNU GPLv2 License
# located here: http://www.gnu.org/licenses/gpl-2.0.html
-# I would love to hear from you regarding suggestions
-# tips and so on. My email is: thomas .at. aftenstorm.com
+#
+# I would love to hear from you regarding feedback, ways you use it,
+# suggestions, tips and so on.
+# My email is: thomas.frivold.at.gmail.com
########################################################
#################### TODO ##############################
@@ -104,15 +106,24 @@
# + better support command line options in a pro-manner
# + add the commandline option to use with or without dialog
# + rewrite the script using python
-# + incorporate suggestions from my reddit friends (ongoing)
-# + implement functions in the script, and then call these functions,
-as seen here: http://www.tldp.org/LDP/abs/html/functions.html (ongoing)
########################################################
#################### CHANGELOG #########################
########################################################
+# v0.8.5 26.02.2013 12:00
+# Cleanup before public release on Freecode.com!
+# Hello World
+
+# v0.8.4 26.02.2013 10:00
+# Added a routine to check the screensize, and display
+# a logo according to which screensize the user has.
+# Cleaned up a little bit here and there
+
+# v0.8.3 25.02.2013 20:00
+# Tweaks
+
# v0.8.2 25.02.2013 15:00
# Added a welcome sequence
# Added a logo! (yay)
Please sign in to comment.
Something went wrong with that request. Please try again.