From 8f9b55d79cc8bd7f339ed4cae1510f5a132dd314 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Tue, 1 Mar 2016 15:40:01 +0100 Subject: [PATCH] fix for sudo usage in autotests --- cmake_targets/autotests/run_exec_autotests.bash | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash index 4608c58e9b..a98a071bae 100755 --- a/cmake_targets/autotests/run_exec_autotests.bash +++ b/cmake_targets/autotests/run_exec_autotests.bash @@ -404,14 +404,12 @@ until [ -z "$1" ] esac done -if [ "$SET_PASSWORD" == "1" ]; then - mypassword=$passwd -else - read -s -p "Enter Password: " mypassword +if [ "$SET_PASSWORD" != "1" ]; then + read -s -p "Enter Password: " passwd fi tmpfile=`mktemp` -echo \'$passwd\' | $SUDO echo $HOME >& $tmpfile +echo $passwd | $SUDO echo $HOME > $tmpfile tstsudo=`cat $tmpfile` if [ "$tstsudo" != "$HOME" ]; then echo "$USER might not have sudo privileges. Exiting" -- GitLab