File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -xeu
4+
5+
6+ export LC_ALL=C
7+
8+ # Lower bound version
9+ min_version=" 24.9.19"
10+
11+ # Get the current version of pio
12+ current_version=$( sudo -u pioreactor pio version)
13+
14+ # Use sorting to determine if the current version is less than the minimum version
15+ is_valid=$( printf " %s\n%s" " $current_version " " $min_version " | sort -V | head -n1)
16+
17+ # If the smallest version isn't the minimum version, then current version is too low
18+ if [ " $is_valid " != " $min_version " ]; then
19+ sudo -u pioreactor pio log -l ERROR -m " Version error: installed version $current_version is lower than the minimum required version $min_version ."
20+ exit 1
21+ fi
22+
23+ echo " Version check passed: $current_version "
You can’t perform that action at this time.
0 commit comments