From b920bb2a6adebb5c8ee101fe5e369c50888035eb Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 10 Feb 2015 15:05:20 +0100 Subject: Linux: modify installer script to make it run when the "less" command doesn't support the -X argument (Busybox case) --- src/Setup/Linux/veracrypt_install_template.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/Setup/Linux') diff --git a/src/Setup/Linux/veracrypt_install_template.sh b/src/Setup/Linux/veracrypt_install_template.sh index 427f9320..22d080f6 100644 --- a/src/Setup/Linux/veracrypt_install_template.sh +++ b/src/Setup/Linux/veracrypt_install_template.sh @@ -774,16 +774,36 @@ printf 'terms of the VeraCrypt License.\n\nPress Enter to display the license te read A MORE=more -which less >/dev/null 2>/dev/null && MORE='less -E -X' - +HASLESS=0 +which less >/dev/null 2>/dev/null && HASLESS=1 +if [ $HASLESS -eq 1 ] +then + MORE='less -E -X' +fi cat <<_END | cat - $LICENSE | $MORE Press Enter or space bar to see the rest of the license. _END + if [ $? -ne 0 ] + then + if [ $HASLESS -eq 1 ] + then +# use less without -X as it is not supported by some versions (busybox case) + MORE='less -E' + cat <<_END | cat - $LICENSE | $MORE + +Press Enter or space bar to see the rest of the license. + + +_END + [ $? -ne 0 ] && exit 1 + else + exit 1 + fi + fi - [ $? -ne 0 ] && exit 1 rm -f $LICENSE ACCEPTED=0 -- cgit v1.2.3