Graceful exit on non-linux platforms.

pull/64/head
Karol Pucynski 2020-04-28 12:29:00 +02:00
parent 30aeef8f65
commit f48ab51c8d
1 changed files with 16 additions and 0 deletions

16
bashtop
View File

@ -173,8 +173,24 @@ else
}
fi
system_check_() {
local system
case "$(uname -s)" in
Linux*) system=Linux;;
Darwin*) system=MacOS;;
CYGWIN*) system=Cygwin;;
MINGW*) system=MinGw;;
*) system="Other"
esac
if [[ "$system" != "Linux" ]]; then
echo "This tool does not support $system platform."
exit 1
fi
}
init_() { #? Collect needed information and set options before startig main loop
system_check_
local i
#* Set terminal options, save and clear screen
tput smcup