Merge pull request #5 from linuxserver/aptalca-patch-2

grep shouldn't be this confusing
This commit is contained in:
chbmb 2019-07-10 00:06:07 +01:00 committed by GitHub
commit 04a8319b15
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 [ ! $(grep -c 'abc' /etc/sudoers) ]; then if ! grep -q '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