Permalink
Browse files

Fix tail gtail confusion

  • Loading branch information...
1 parent ab41e4c commit ad19c8b2d32781a94dedf90cb5e58c79ad5a7071 @partoneoftwo committed Oct 28, 2013
Showing with 21 additions and 7 deletions.
  1. +14 −0 LUKSUS.checks
  2. +6 −6 LUKSUS.functions
  3. +1 −1 LUKSUS.variables
View
@@ -89,6 +89,20 @@ fi
# just use whichever was found
# This is only cool for the dev himself # "$dialogapp" --msgbox "Message displayed with $dialogapp" 0 0
+### HEAD OR GHEAD TEST
+read HEADAPP <<< "$(which head ghead 2> /dev/null)"
+[[ "$HEADAPP" ]] || {
+ echo 'neither head nor ghead found. Please install gnutools or coretools package' >&2
+ exit 1
+}
+
+### TAIL OR GTAIL TEST
+read TAILAPP <<< "$(which tail gtail 2> /dev/null)"
+[[ "$TAILAPP" ]] || {
+ echo 'neither tail nor gtail found. Please install gnutools or coretools package' >&2
+ exit 1
+}
+
# user wants to force LUKS
if [[ "$3" = "luks" ]] || [[ "$4" = "luks" ]] || [[ "$5" = "luks" ]] || [[ "$6" = "luks" ]] || [[ "$7" = "luks" ]] || [[ "$8" = "luks" ]]
View
@@ -281,12 +281,12 @@ DEVICEEXISTS ()
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.$$
+ $TAILAPP -n 12 LUKSUS.logo 2> /dev/null || tail -n 12 LUKSUS.logo;
+ $TAILAPP -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.$$
+ $HEADAPP -n 6 LUKSUS.logo 2> /dev/null || head -n 6 LUKSUS.logo;
+ $HEADAPP -n 6 LUKSUS.logo 1>welcomelogo.$$ 2> /dev/null || head -n 6 LUKSUS.logo >welcomelogo.$$
dialogsize="12 60"
fi
}
@@ -461,14 +461,14 @@ LOOPBACKMETHOD ()
if [[ $LOOPBACKDEVICE == true ]] && [[ $UNAME == DragonFly ]]; then
echo DragonFlyBSD - Nice...;
echo Beginning loopbackmethod on $device;
- ghead -c $luksfilesize /dev/zero > $luksfile;
+ $HEADAPP -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;
+ $HEADAPP /dev/zero -c $luksfilesize > $luksfile;
mdconfig -a -t vnode -f $luksfile -u $freebsdloopnumber;
loopbackhelp="mdconfig -a -t vnode -f $luksfile -u $freebsdloopnumber";
else
View
@@ -1,6 +1,6 @@
# This file contains variables and command substitutions (no more backticks) in variables
programname=LUKSUS
-version=v1.2.40
+version=v1.2.45
date="27.10.2013"
author="Thomas J. Frivold"
time1="$(date +%s.%N)"

0 comments on commit ad19c8b

Please sign in to comment.