From 33b8017181730138ed922ac626b1ebd985770011 Mon Sep 17 00:00:00 2001 From: billz Date: Thu, 10 Oct 2019 08:34:40 +0100 Subject: [PATCH] Update sudo_add() with $raspap_user. Resolves #409 --- installers/common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 46f7c67d..b11286c5 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -259,7 +259,7 @@ function enable_raspap_daemon() { # Add a single entry to the sudoers file function sudo_add() { - sudo bash -c "echo \"www-data ALL=(ALL) NOPASSWD:$1\" | (EDITOR=\"tee -a\" visudo)" \ + sudo bash -c "echo \"$raspap_user ALL=(ALL) NOPASSWD:$1\" | (EDITOR=\"tee -a\" visudo)" \ || install_error "Unable to patch /etc/sudoers" } @@ -299,11 +299,11 @@ function patch_system_files() { ) # Check if sudoers needs patching - if [ $(sudo grep -c www-data /etc/sudoers) -ne 28 ] + if [ $(sudo grep -c $raspap_user /etc/sudoers) -ne 28 ] then # Sudoers file has incorrect number of commands. Wiping them out. install_log "Cleaning sudoers file" - sudo sed -i '/www-data/d' /etc/sudoers + sudo sed -i "/$raspap_user/d" /etc/sudoers install_log "Patching system sudoers file" # patch /etc/sudoers file for cmd in "${cmds[@]}"