From 663bc386425fbe78895f43a5c3e00c1355ced4c4 Mon Sep 17 00:00:00 2001 From: Reshetnikov_AS Date: Thu, 7 Mar 2024 16:48:53 +0400 Subject: [PATCH] hwmonitor --- HWMonitor/create_install.bat | 4 ++++ HWMonitor/create_install.sh | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 HWMonitor/create_install.bat create mode 100755 HWMonitor/create_install.sh diff --git a/HWMonitor/create_install.bat b/HWMonitor/create_install.bat new file mode 100644 index 00000000..36b50a24 --- /dev/null +++ b/HWMonitor/create_install.bat @@ -0,0 +1,4 @@ +@echo off +"%~dp0..\.tools\busybox.exe" bash "%~dp0create_install.sh" + +exit /b %errorlevel% diff --git a/HWMonitor/create_install.sh b/HWMonitor/create_install.sh new file mode 100755 index 00000000..679dab4d --- /dev/null +++ b/HWMonitor/create_install.sh @@ -0,0 +1,21 @@ +#!/bin/bash +dp0="$(realpath "$(dirname "$0")")" +dp0_tools="$dp0/../.tools" && source "$dp0_tools/env_tools.sh" +set -e +cd "$dp0" + +latest_version=https://www.cpuid.com/softwares/hwmonitor.html +echo Get latest version: "$latest_version" ... +download_url=$($curl --silent --location "$latest_version" | "$grep" --only-matching '(?<=href=")[^\s]+hwmonitor/hwmonitor[^\s]+\.zip(?=")' | head -n1) +[[ -z "$download_url" ]] && { + echo "Cannot get release version" + exit 1 +} + +filename="$(basename -- "$download_url")" +download_url="https://download.cpuid.com/hwmonitor/$filename" +echo "Downloading: $download_url ..." +$curl --location "$download_url" --remote-name + +echo Extracting ... +"$p7z" e "$filename" "-o." *_x64.exe -aoa -r