How do I check if remote login is enabled in Applescript?
I have a script that checks if its sunday or monday, then requests to turn on remote login. Could I easily change it so that it checks if remote login is on, then if it is not, request to turn it on?
This is my script:
on remoteLogin(value)
do shell script "launchctl " & value & " -w /System/Library/LaunchDaemons/ssh.plist" with administrator privileges
end remoteLogin
if weekday of (current date) is in {Sunday, Monday} then
remoteLogin("load")
else
return "not Sunday or Monday"
end if