Skip to content

Commit

Permalink
Cpuid: cpu-z, hwmonitor (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
hemnstill authored Mar 7, 2024
1 parent c66f985 commit 7eea93a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
4 changes: 4 additions & 0 deletions HWMonitor/create_install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
"%~dp0..\.tools\busybox.exe" bash "%~dp0create_install.sh"

exit /b %errorlevel%
21 changes: 21 additions & 0 deletions HWMonitor/create_install.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions cpu-z/create_install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
"%~dp0..\.tools\busybox.exe" bash "%~dp0create_install.sh"

exit /b %errorlevel%
21 changes: 21 additions & 0 deletions cpu-z/create_install.sh
Original file line number Diff line number Diff line change
@@ -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/cpu-z.html
echo Get latest version: "$latest_version" ...
download_url=$($curl --silent --location "$latest_version" | "$grep" --only-matching '(?<=href=")[^\s]+cpu-z/cpu-z[^\s]+-en\.zip(?=")' | head -n1)
[[ -z "$download_url" ]] && {
echo "Cannot get release version"
exit 1
}

filename="$(basename -- "$download_url")"
download_url="https://download.cpuid.com/cpu-z/$filename"
echo "Downloading: $download_url ..."
$curl --location "$download_url" --remote-name

echo Extracting ...
"$p7z" e "$filename" "-o." *_x64.exe -aoa -r

0 comments on commit 7eea93a

Please sign in to comment.