File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 2222BASE_DIR=$1
2323BIN_DIR=$2
2424
25- set -ex
26-
27- if ! command -v swctl & > /dev/null; then
25+ install_swctl () {
2826 mkdir -p $BASE_DIR /swctl && cd $BASE_DIR /swctl
2927 curl -kLo skywalking-cli.tar.gz https://github.com/apache/skywalking-cli/archive/${SW_CTL_COMMIT} .tar.gz
3028 tar -zxf skywalking-cli.tar.gz --strip=1
31- utype=$( uname | awk ' {print tolower($0)}' )
32- make $utype && mv bin/swctl-* -$utype -amd64 $BIN_DIR /swctl
33- fi
29+ VERSION=${SW_CTL_COMMIT} make install DESTDIR=$BIN_DIR
30+ }
31+
32+ if ! command -v swctl & > /dev/null; then
33+ echo " swctl is not installed"
34+ install_swctl
35+ elif ! swctl --version | grep -q " ${SW_CTL_COMMIT:: 7} " ; then
36+ # Check if the installed version is correct
37+ echo " swctl is already installed, but version is not ${SW_CTL_COMMIT} , will re-install it"
38+ install_swctl
39+ fi
You can’t perform that action at this time.
0 commit comments