diff --git a/scripts/install b/scripts/install index 5fed213..0def6b5 100644 --- a/scripts/install +++ b/scripts/install @@ -75,6 +75,17 @@ if getent group dialout && ! id -Gn "${app}" | grep -qw "\bdialout\b" >/dev/null adduser "${app}" dialout fi +# On Raspberry, vcgencmd is used to get info about the board +# Octoprint use it check for throttling (power lose) +vcgencmd > /dev/null +if [ $? -eq 0 ]; then + ynh_script_progression "vcgencmd found : add user to group" + if getent group video && ! id -Gn "${app}" | grep -qw "\bvideo\b" >/dev/null; then + # Add user to video group so it can access vcgencmd. + adduser "${app}" video + fi +fi + #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b3c57b5..01acd99 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,6 +73,17 @@ if getent group dialout && ! id -Gn "${app}" | grep -qw "\bdialout\b" >/dev/null adduser "${app}" dialout fi +# On Raspberry, vcgencmd is used to get info about the board +# Octoprint use it check for throttling (power lose) +vcgencmd > /dev/null +if [ $? -eq 0 ]; then + ynh_script_progression "vcgencmd found : add user to group" + if getent group video && ! id -Gn "${app}" | grep -qw "\bvideo\b" >/dev/null; then + # Add user to video group so it can access vcgencmd. + adduser "${app}" video + fi +fi + #================================================= # START SYSTEMD SERVICE #=================================================