Graceful exit on non-linux platforms.

pull/68/head
Karol Pucynski 2020-04-28 12:29:00 +02:00 committed by aristocratos
parent 36e5c8e7f1
commit 4fd84d0510
1 changed files with 16 additions and 0 deletions

16
bashtop
View File

@ -189,8 +189,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