mirror of
https://github.com/YunoHost-Apps/domoticz_ynh.git
synced 2024-09-03 18:26:17 +02:00
Test group before applying
This commit is contained in:
parent
a1429a859d
commit
0aff4f160a
3 changed files with 27 additions and 10 deletions
|
@ -120,10 +120,15 @@ ynh_script_progression --message="Configuring system user..." --weight=1
|
||||||
# Create a system user
|
# Create a system user
|
||||||
ynh_system_user_create --username=$app
|
ynh_system_user_create --username=$app
|
||||||
#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) & i2c bus
|
#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) & i2c bus
|
||||||
usermod -a -G dialout $app
|
if grep dialout -q < /etc/group; then
|
||||||
usermod -a -G i2c $app
|
usermod -a -G dialout $app
|
||||||
usermod -a -G gpio $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
|
||||||
|
|
||||||
#allow app user to restart service on startup
|
#allow app user to restart service on startup
|
||||||
cp ../conf/sudoer ../conf/$app.conf
|
cp ../conf/sudoer ../conf/$app.conf
|
||||||
|
|
|
@ -92,9 +92,15 @@ ynh_restore_file --origin_path="/etc/sudoers.d/$app"
|
||||||
#Both folder and database file must be own by app user for domoticz to work and allow internal upgrade
|
#Both folder and database file must be own by app user for domoticz to work and allow internal upgrade
|
||||||
chown -R $app: $final_path
|
chown -R $app: $final_path
|
||||||
#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) & i2c bus
|
#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) & i2c bus
|
||||||
usermod -a -G dialout $app
|
if grep dialout -q < /etc/group; then
|
||||||
usermod -a -G i2c $app
|
usermod -a -G dialout $app
|
||||||
usermod -a -G gpio $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
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -175,9 +175,15 @@ ynh_script_progression --message="Making sure dedicated system user exists..."
|
||||||
# Create a dedicated user (if not existing)
|
# Create a dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app
|
ynh_system_user_create --username=$app
|
||||||
#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) & i2c bus
|
#allow user to access USB / serial port to communicate with tools (RFXtrx, Z-wave dongle, etc.) & i2c bus
|
||||||
usermod -a -G dialout $app
|
if grep dialout -q < /etc/group; then
|
||||||
usermod -a -G i2c $app
|
usermod -a -G dialout $app
|
||||||
usermod -a -G gpio $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
|
||||||
|
|
||||||
#allow app user to restart service on startup
|
#allow app user to restart service on startup
|
||||||
cp ../conf/sudoer ../conf/$app.conf
|
cp ../conf/sudoer ../conf/$app.conf
|
||||||
|
|
Loading…
Add table
Reference in a new issue