From 1314a73a516118f64efa7b0096b382303240cb66 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Wed, 8 Nov 2023 22:59:08 +0800 Subject: [PATCH] refactor: update tianji reporter install script --- scripts/install.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 9128867..5ee6bf5 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -54,12 +54,14 @@ function install_dependencies() { function input_dsn() { defaultServer="{{DEFAULT_SERVER}}" - read -p "${Info} Please input server url(default: $defaultWorkspace)" serverUrl - serverUrl=${serverUrl:$defaultWorkspace} + echo -e "${Info} Please input server url, press enter use default value(default: $defaultServer)" + read -re serverUrl + serverUrl=${serverUrl:-$defaultServer} defaultWorkspace="{{DEFAULT_WORKSPACE}}" - read -p "${Info} Please input workspaceId(default: $defaultWorkspace)" workspace - workspace=${workspace:$defaultWorkspace} + echo -e "${Info} Please input workspaceId, press enter use default value(default: $defaultWorkspace)" + read -re workspace + workspace=${workspace:-$defaultWorkspace} } service_conf=/usr/lib/systemd/system/tianji-reporter.service @@ -68,7 +70,7 @@ function write_service() { echo -e "${Info} Write to systemd configuration" cat >${service_conf} <<-EOF [Unit] -Description=Tianji-Report +Description=Tianji-Reporter Documentation=https://github.com/msgbyte/tianji After=network.target @@ -134,7 +136,8 @@ function install_client() { esac echo -e "${Info} Downloading ${arch} binary file..." mkdir -p /usr/local/tianji/reporter/ - cd /tmp && wget "https://github.com/msgbyte/tianji/releases/latest/download/tianji-reporter-linux-${arch}" + cd /tmp + wget --no-check-certificate "https://github.com/msgbyte/tianji/releases/latest/download/tianji-reporter-linux-${arch}" mv tianji-reporter-linux-${arch} /usr/local/tianji/reporter/tianji-reporter chmod +x /usr/local/tianji/reporter/tianji-reporter enable_service