diff options
author | Jacob Salmela <jacobsalmela@users.noreply.github.com> | 2016-01-03 02:20:33 +0300 |
---|---|---|
committer | Jacob Salmela <jacobsalmela@users.noreply.github.com> | 2016-01-03 02:20:33 +0300 |
commit | 6f9d2d0567dfdf0286b6369d6fa26382a8fd0ba1 (patch) | |
tree | ffff2c2786ff3bc24a7d09cba4e08b6017e06ffe | |
parent | d2b694788653834bec3789c3f28a37aa2d5ebc7e (diff) |
fixes #145v2.2
A much more elegant way to get the screen size.
-rwxr-xr-x | automated install/basic-install.sh | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index ea7c882e..b80180cb 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -20,12 +20,9 @@ tmpLog=/tmp/pihole-install.log instalLogLoc=/etc/pihole/install.log -# Get the screen size in case we need a full-screen message and so we can display a dialog that is sized nicely -screenSize=$(stty -a | tr \; \\012 | egrep 'rows|columns' | cut '-d ' -f3) - # Find the rows and columns -rows=$(stty -a | tr \; \\012 | egrep 'rows' | cut -d' ' -f3) -columns=$(stty -a | tr \; \\012 | egrep 'columns' | cut -d' ' -f3) +rows=$(tput lines) +columns=$(tput cols) # Divide by two so the dialogs take up half of the screen, which looks nice. r=$(( rows / 2 )) |