fix if grep

This commit is contained in:
aptalca 2019-07-09 18:32:57 -04:00 committed by GitHub
parent 97181b11c9
commit 88d09c973d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ mkdir -p /config/{extensions,data,workspace,.ssh}
if [ -n "${SUDO_PASSWORD}" ]; then if [ -n "${SUDO_PASSWORD}" ]; then
echo "setting up sudo access" echo "setting up sudo access"
if [ ! $(cat /etc/sudoers | grep abc) ]; then if [ ! $(grep -c 'abc' /etc/sudoers) ]; then
echo "adding abc to sudoers" echo "adding abc to sudoers"
echo "abc ALL=(ALL:ALL) ALL" >> /etc/sudoers echo "abc ALL=(ALL:ALL) ALL" >> /etc/sudoers
fi fi