Skip to content

Instantly share code, notes, and snippets.

@kobus-v-schoor
Last active December 10, 2020 18:18
Show Gist options
  • Save kobus-v-schoor/5a155c5fa65312ba60b1b2d378e7cb97 to your computer and use it in GitHub Desktop.
Save kobus-v-schoor/5a155c5fa65312ba60b1b2d378e7cb97 to your computer and use it in GitHub Desktop.
#! /bin/bash
# get icc cpu usage
cpu=$(ps -C ICC -o %cpu | tail -n 1 | sed 's/\..*//g')
# compare with threshold
THRESHOLD=50
if [[ $cpu -gt $THRESHOLD ]]; then
# kill ICC
pkill -9 ICC
# restart ICC as fork
setsid /home/pi/ICC/ICC
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment