I created a script to add to OD, but when I manually run, I get a message "Certificates are available for this server. Would you like to add them to the system keychain automatically (y/n)?"
The script will wait for a response. How can I automatically respond to this question in the script so it does not wait for a response?
Solved
Created a script to add computer to OD, but....
Best answer by ryan_ball
You might be able to use expect.
#!/bin/bash
# Some code here
/usr/bin/expect >/dev/null 2>&1 <<EOF
set timeout -1
spawn 'command that adds computer to OD without quotes'
expect "automatically (y/n)?"
send -- "y
"
expect eof
EOF
# Rest of code here
exit 0
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.