TDengine/packaging/tools/get_os.sh
Shuduo Sang 59981d40c3
chore(tools): taos tools mac for3.0 (#13752)
* chore(release): make get_os.sh works on mac

* chore(tools): update taos-tools
2022-06-13 11:57:49 +08:00

19 lines
495 B
Bash
Executable file

#!/bin/bash
#
# This file is used to install TAOS time-series database on linux systems. The operating system
# is required to use systemd to manage services at boot
set -e
#set -x
# -----------------------Variables definition---------------------
if [[ "$OSTYPE" == "darwin"* ]]; then
echo -e "Darwin"
else
OS=$(cat /etc/*-release | grep "^NAME=" | cut -d= -f2)
len=$(echo ${#OS})
len=$((len-2))
retval=$(echo -ne ${OS:1:${len}} | cut -d" " -f1)
echo -ne $retval
fi