Hi all,
This is a task i thought would be pretty easy - a script to push updates out to the macs. We only have a few here, but its a pain manually updating them all.
I'm not sure if this is a good forum to post to but couldn't find one with alot of bash scripting support. Please suggest others that may be helpful.
I was surprised that i couldn't find much information on doing this - prehaps theres a applescript or automator way though?
Anyways, we have an authenticated proxy here. So when you run "softwareupdate -l" as root it recognises that and asks for usersname/password.
Thats great, however the problem comes when you try to automate it.
I've tried pushing the variables (and indeed just text) to the stdin of softwareupdate like so: echo [CACHE USERNAME]$'\n'$(sleep 2
[CACHE PASSWORD]$ | softwareupdate -l and this enters in the username, but then leaves me on the password field?
I've tested that I am in fact pushing the username, enter, wait 2s, password, enter by sending the same input to the following script:
echo Script running
echo Please put in username:
read username
echo Please enter in password:
read password
echo $username $password
As expected i get the following when i enter 'user' as the username and 'userpassword' when i enter that as the password.:
Script running
Please put in username:
Please enter in password:
user userpassword
Any ideas? i'm sure this has been done before!
This is a task i thought would be pretty easy - a script to push updates out to the macs. We only have a few here, but its a pain manually updating them all.
I'm not sure if this is a good forum to post to but couldn't find one with alot of bash scripting support. Please suggest others that may be helpful.
I was surprised that i couldn't find much information on doing this - prehaps theres a applescript or automator way though?
Anyways, we have an authenticated proxy here. So when you run "softwareupdate -l" as root it recognises that and asks for usersname/password.
Thats great, however the problem comes when you try to automate it.
I've tried pushing the variables (and indeed just text) to the stdin of softwareupdate like so: echo [CACHE USERNAME]$'\n'$(sleep 2
I've tested that I am in fact pushing the username, enter, wait 2s, password, enter by sending the same input to the following script:
echo Script running
echo Please put in username:
read username
echo Please enter in password:
read password
echo $username $password
As expected i get the following when i enter 'user' as the username and 'userpassword' when i enter that as the password.:
Script running
Please put in username:
Please enter in password:
user userpassword
Any ideas? i'm sure this has been done before!