scripting

Tech198

macrumors G5
Original poster
Mar 21, 2011
13,963
1,639
Australia, Perth
I have Mac Mini that I control remotely at all times as its main use is a media server with no keyboard and mouse attached..

The problem comes specially after applying security updates which need restarting, u must login with attached keyboard & mouse (locally).. I found out that even
Code:
fdesetup authrestart
using sudo will also work not just with FileVault but also with security updates (although Apple's site only mentions specially remote access Filevault on restart) I found that bit on OS X daily.

The problem is i must run it from Terminal... I have doe a quick bash scrip to try an automate the process, but i still must have Terminal open by userin order to execute..

Is is possible to maybe active this all automatically by a call from Applescript? I know password must be entered manually, which i don't have a problem with.... I just need the script to automatically launch Terminal first. and do script...
 

superscape

macrumors 6502a
Feb 12, 2008
920
214
East Riding of Yorkshire, UK
Hi,

Maybe you should look at "do shell script"? For example...

Code:
set theResult to do shell script "date"
Have a look in StandardAdditions.osax's scripting dictionary, and there are options for supplying username/password and running commands with admin privileges.

Hope that helps
 

Tech198

macrumors G5
Original poster
Mar 21, 2011
13,963
1,639
Australia, Perth
Thanks... However do shell script requires me to still have "bash script"" since "fdesetup" is used at Terminal prompt.... Is there a way do just do this vi APpleScript only?

I prefer to type in password myself for security reasons, but automated (i'll have a look at that). yet i do not wish to have two files .sh and Apple script just do accomplish this ether if possible.... just one or the other. I prefer using Apple script if i can but not sure if u can do bash directly in Applescript or weather u must call .sh which i really do not wish to do. As this requires having both files.

I can leave out the "date" because its not set to automatically restart at any given date... I just execute the script before a security update is applied so on next boot i can login remotely. The whole idea is for doing this... since i do not have Keyboard and mouse attached to Mac mini,, therefore having the script ready to run on the remote system is a good idea..