diff --git a/scripts/install b/scripts/install index 0f83ce6..42149da 100755 --- a/scripts/install +++ b/scripts/install @@ -85,6 +85,16 @@ ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user ynh_system_user_create --username=$app --home_dir="$final_path" +if grep dialout -q < /etc/group; then + usermod -a -G dialout "$app" +fi +if grep i2c -q < /etc/group; then + usermod -a -G i2c "$app" +fi +if grep gpio -q < /etc/group; then + usermod -a -G gpio "$app" +fi + #================================================= # INSTALL EXTRA DEPENDENCIES diff --git a/scripts/restore b/scripts/restore index 21e2d1e..aa0db7b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -50,6 +50,16 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" +if grep dialout -q < /etc/group; then + usermod -a -G dialout "$app" +fi +if grep i2c -q < /etc/group; then + usermod -a -G i2c "$app" +fi +if grep gpio -q < /etc/group; then + usermod -a -G gpio "$app" +fi + #================================================= # INSTALL EXTRA DEPENDENCIES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 67f6baf..14977b2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -80,6 +80,16 @@ ynh_script_progression --message="Making sure dedicated system user exists..." - # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" +if grep dialout -q < /etc/group; then + usermod -a -G dialout "$app" +fi +if grep i2c -q < /etc/group; then + usermod -a -G i2c "$app" +fi +if grep gpio -q < /etc/group; then + usermod -a -G gpio "$app" +fi + #================================================= # UPGRADE DEPENDENCIES #=================================================