1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jeedom_ynh.git synced 2024-09-03 19:26:26 +02:00

Merge pull request #24 from YunoHost-Apps/sudo

usermod to $app
This commit is contained in:
yalh76 2022-07-22 22:22:18 +02:00 committed by GitHub
commit 7ffe39618d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View file

@ -123,18 +123,18 @@ chown $app:www-data -R /tmp/jeedom
# For nginx user to be able to communicate with home automation devices
if [ $(getent group dialout) ]; then
usermod -a -G dialout www-data
usermod -a -G dialout $app
fi
if [ $(getent group gpio) ]; then
usermod -a -G gpio www-data
usermod -a -G gpio $app
fi
if [ $(getent group tty) ]; then
usermod -a -G tty www-data
usermod -a -G tty $app
fi
# Sudo permissions to the user if agreed to
if [ ${sudo} ]; then
usermod -a -G "sudo" www-data
usermod -a -G "sudo" $app
if [ $(grep "www-data ALL=(ALL) NOPASSWD: ALL" /etc/sudoers | wc -l) -eq 0 ];then
bash -c 'echo "www-data ALL=(ALL) NOPASSWD: ALL" | (EDITOR="tee -a" visudo)'
fi

View file

@ -101,18 +101,18 @@ chown $app:www-data -R /tmp/jeedom
# For nginx user to be able to communicate with home automation devices
if [ $(getent group dialout) ]; then
usermod -a -G dialout www-data
usermod -a -G dialout $app
fi
if [ $(getent group gpio) ]; then
usermod -a -G gpio www-data
usermod -a -G gpio $app
fi
if [ $(getent group tty) ]; then
usermod -a -G tty www-data
usermod -a -G tty $app
fi
# Sudo permissions to the user if agreed to
if [ ${sudo} ]; then
usermod -a -G "sudo" www-data
usermod -a -G "sudo" $app
if [ $(grep "www-data ALL=(ALL) NOPASSWD: ALL" /etc/sudoers | wc -l) -eq 0 ];then
bash -c 'echo "www-data ALL=(ALL) NOPASSWD: ALL" | (EDITOR="tee -a" visudo)'
fi

View file

@ -128,18 +128,18 @@ chown $app:www-data -R /tmp/jeedom
# For nginx user to be able to communicate with home automation devices
if [ $(getent group dialout) ]; then
usermod -a -G dialout www-data
usermod -a -G dialout $app
fi
if [ $(getent group gpio) ]; then
usermod -a -G gpio www-data
usermod -a -G gpio $app
fi
if [ $(getent group tty) ]; then
usermod -a -G tty www-data
usermod -a -G tty $app
fi
# Sudo permissions to the user if agreed to
if [ ${sudo} ]; then
usermod -a -G "sudo" www-data
usermod -a -G "sudo" $app
if [ $(grep "www-data ALL=(ALL) NOPASSWD: ALL" /etc/sudoers | wc -l) -eq 0 ];then
bash -c 'echo "www-data ALL=(ALL) NOPASSWD: ALL" | (EDITOR="tee -a" visudo)'
fi