File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ NOBUTTON="no"
1212BRIGHTNESS=255
1313PYTHON=" python3"
1414PIP=" pip3"
15+ PSUTIL_MIN_VERSION=" 5.6.7"
1516
1617ON_THRESHOLD_SET=false
1718OFF_THRESHOLD_SET=false
@@ -201,7 +202,7 @@ Restart=on-failure
201202WantedBy=multi-user.target
202203EOF
203204
204- printf " Checking for rpi.gpio>= 0.7.0 (for Pi 4 support)\n"
205+ printf " Checking for rpi.gpio >= 0.7.0 (for Pi 4 support)\n"
205206$PYTHON - << EOF
206207import RPi.GPIO as GPIO
207208from pkg_resources import parse_version
@@ -229,16 +230,19 @@ else
229230 printf " Fan SHIM already installed\n"
230231fi
231232
232- printf " Checking for psutil\n"
233+ printf " Checking for psutil >= $PSUTIL_MIN_VERSION \n"
233234$PYTHON - > /dev/null 2>&1 << EOF
235+ import sys
234236import psutil
237+ from pkg_resources import parse_version
238+ sys.exit(not parse_version(psutil.__version__) >= parse_version('$PSUTIL_MIN_VERSION '))
235239EOF
236240
237241if [ $? -ne 0 ]; then
238242 printf " Installing psutil\n"
239- $PIP install psutil fanshim
243+ $PIP install --ignore-installed psutil
240244else
241- printf " psutil already installed\n"
245+ printf " psutil >= $PSUTIL_MIN_VERSION already installed\n"
242246fi
243247
244248printf " \nInstalling service to: $SERVICE_PATH \n"
You can’t perform that action at this time.
0 commit comments