-
Notifications
You must be signed in to change notification settings - Fork 6
executable file
·23 lines (19 loc) · 1.09 KB
/
magnet-response.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# This workflow should download the latest magnet-response exe, and compare the previous hash
# with the current hash.
name: check-magnet-response-hash
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
magnet_response_hash:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Check Magnet Response Hash
run: |
MAGNET_VERSION=$(cat /home/runner/work/winfor-salt/winfor-salt/winfor/standalones/magnet-response.sls | grep "set version" | awk -F\' '{print tolower($2)}')
wget https://storage.googleapis.com/mfi-files/free_tools/MagnetRESPONSE/MagnetRESPONSEv${MAGNET_VERSION}_Self_Extracting_Archive.exe
PREVIOUS_HASH=$(cat /home/runner/work/winfor-salt/winfor-salt/winfor/standalones/magnet-response.sls | grep "set hash" | awk -F\' '{print tolower($2)}')
CURRENT_HASH=$(sha256sum MagnetRESPONSEv${MAGNET_VERSION}_Self_Extracting_Archive.exe | awk '{print $1}')
if [[ "$PREVIOUS_HASH" != "$CURRENT_HASH" ]]; then echo "HASH UPDATED - $CURRENT_HASH" && exit 1; else echo "No hash changes" && exit 0; fi