From ae4c2d59e8ddd07a683e60ee969c017987e0295b Mon Sep 17 00:00:00 2001 From: cmrxnn Date: Mon, 22 Jan 2024 16:31:37 +0000 Subject: [PATCH] update install/update scripts --- scripts/install_linux | 4 ++-- scripts/update_linux | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 scripts/update_linux diff --git a/scripts/install_linux b/scripts/install_linux index f82254e..0f45d42 100644 --- a/scripts/install_linux +++ b/scripts/install_linux @@ -4,7 +4,7 @@ echo "WARNING: Influx operates on port 3000 by default. If you need to change th echo "Influx: Running installer in 3s"; sleep 3; -sudo apt -y install curl; +apt -y install curl; mkdir -p /etc/influx; curl -L -o /etc/influx/config.yml "https://raw.githubusercontent.com/cmrxnn/influx-agent/develop/config.yml.example" @@ -13,7 +13,7 @@ curl -L -o /usr/local/bin/influx "https://github.com/cmrxnn/influx-agent/release chmod u+x /usr/local/bin/influx; -sudo echo "[Unit] +echo "[Unit] Description=InfluxAgent After=network.target diff --git a/scripts/update_linux b/scripts/update_linux new file mode 100644 index 0000000..d3db5a7 --- /dev/null +++ b/scripts/update_linux @@ -0,0 +1,15 @@ +#!/bin/bash + +echo "Influx: Running updater in 3s"; +sleep 3; + +systemctl stop influx; +curl -L -o /usr/local/bin/influx "https://github.com/cmrxnn/influx-agent/releases/latest/download/influx_linux_$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")"; + +chmod u+x /usr/local/bin/influx; + +systemctl restart --now influx; + +echo "Influx: Update completed, checking systemctl process..."; + +systemctl status influx; \ No newline at end of file