Hi all,
I will like the help some help in getting Extension Attributes up to grep SSHD.
/bin/launchctl print-disabled system | grep sshd
com.openssh.sshd => true
Sorry that scripting is new to me.
So the <result>True<result/> or False. Please help.
Hi all,
I will like the help some help in getting Extension Attributes up to grep SSHD.
/bin/launchctl print-disabled system | grep sshd
com.openssh.sshd => true
Sorry that scripting is new to me.
So the <result>True<result/> or False. Please help.
Best answer by sdagley
@yuenhongtang If you want True when sshd is enabled, and False when not this will do it:
#!/bin/sh
# EA to check status for com.openssh.sshd
# Returns True if enabled
# False if disabled
sshdStatus=$(/bin/launchctl print-disabled system | /usr/bin/grep sshd | /usr/bin/grep enabled)
if [ -n "$sshdStatus" ]; then
result="True"
else
result="False"
fi
echo "<result>$result</false>"
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.