Hello all! I am pretty new to scripting, and I'm having an issue creating an extension attribute I need. Usually I'm able to get these, but I'm having problems here.
We have edited /etc/pam.d/sudo to include the string "pam_smartcard.so" in it for some work we are doing. I'm trying to create an EA that will let me know if that string has been added to sudo, or not. The following:
grep "pam_smarcard.so" /etc/pam.d/sudo | awk '{print NR}'
...works to return a 1 if that addition has been made, or no return if that addition wasn't added to sudo.
Any idea how to script that and have the result either be Enabled if 1, or Disabled if no return?
Thanks for any help, I feel like this is super easy and I'm just missing some little thing with the numerous attempts I've tried. This is my first attempt as a grep command EA, usually I just do a readout of a plist file using read.