From c7ded41b40d0e5606c71a7a05b793382fdcf5dac Mon Sep 17 00:00:00 2001 From: Krakinou Date: Tue, 2 Feb 2021 21:04:57 +0100 Subject: [PATCH] Add i2c bus access --- scripts/install | 4 ++-- scripts/restore | 6 ++++-- scripts/upgrade | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 2217b28..ceccbbb 100755 --- a/scripts/install +++ b/scripts/install @@ -119,8 +119,8 @@ ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user ynh_system_user_create --username=$app -#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) -usermod -a -G dialout $app +#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) & i2c bus +usermod -a -G dialout i2c $app #allow app user to restart service on startup cp ../conf/sudoer ../conf/$app.conf diff --git a/scripts/restore b/scripts/restore index 165a767..7869b0a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -76,8 +76,7 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$app -#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) -usermod -a -G dialout $app + #Restore user authorization to restart server @@ -92,6 +91,9 @@ ynh_restore_file --origin_path="/etc/sudoers.d/$app" #chown -R root: $final_path #Both folder and database file must be own by app user for domoticz to work and allow internal upgrade chown -R $app: $final_path +#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) & i2c bus +usermod -a -G dialout i2c $app + #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index cc4a906..557d845 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -174,6 +174,8 @@ ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username=$app +#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) & i2c bus +usermod -a -G dialout i2c $app #allow app user to restart service on startup cp ../conf/sudoer ../conf/$app.conf