A normal user doesn't have a right to read /etc/sudoers, so current
script won't work if executed by non-root users.
This patch replacing the check by geeting config from 'sudo -l'
command.
Change-Id: I608edabb73761cea0f6199045f1cde2217a34bf3
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
fi
if [[ $(whoami) != "root" ]]; then
fi
if [[ $(whoami) != "root" ]]; then
- if grep "^Defaults requiretty" /etc/sudoers
- then echo "please comment out Defaults requiretty from /etc/sudoers"
+ if sudo -l | grep "requiretty"; then
+ echo "please comment out Defaults requiretty from /etc/sudoers"