install.sh 678 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. set -e -x -u
  3. if [ -z "$1" ]
  4. then
  5. echo "version is empty."
  6. exit 5
  7. fi
  8. url="https://www.taosdata.com/download/download-all.php?pkgType=tdengine_linux&pkgName=TDengine-client-$1-Linux-x64.tar.gz"
  9. zip="TDengine-client.tar.gz"
  10. wget -T 280 -O "$zip" "$url"
  11. if ! [ -e $zip ]
  12. then
  13. echo "Not downloaded to the installation package."
  14. exit 2
  15. fi
  16. dir="TDengine-client"
  17. tar -zxvf "$zip"
  18. rm "$zip"
  19. if ! [ -e $dir ]
  20. then
  21. echo "Failed to decompress Taos client."
  22. exit 3
  23. fi
  24. cd "$dir"
  25. ret=""
  26. for file in ./*
  27. do
  28. if [ -x $file -a ! -d $file ]
  29. then
  30. ./"$file"
  31. ret="successful"
  32. fi
  33. done
  34. cd ../
  35. rm -rf "$dir"
  36. if [ -z "$ret" ]
  37. then
  38. echo "not found script."
  39. exit 4
  40. fi