Re: Disabling Rendezvous
Re: Disabling Rendezvous
- Subject: Re: Disabling Rendezvous
- From: Joshua See <email@hidden>
- Date: Sat, 22 May 2004 12:02:33 -0500
On May 20, 2004, at 5:26 PM, Gnarlodious wrote:
set XMLfile to
"/Library/Preferences/DirectoryService/DirectoryService.plist"
set keyName to "Rendezvous"
set theContent to do shell script "sudo cat " & XMLfile
-- read value
do shell script "echo " & the quoted form of theContent & " | sed -n
'/" & ,
keyName & "/{n;s/[^t]<string>\\(.*\\)<\\/string>/\\1/p;}'"
if the result is "Active" then
-- change value
do shell script "echo " & the quoted form of theContent & "sed" & ,
" -e '1N;/" & keyName &
"/{$!N;s/\\(.*\\)Active\\(.*\\)/\\1Inactive\\2/;};P;D' > " & XMLfile
end if
This script sets the .plist file to "Inactive".
Yeah but this would also do it, and not look like a cat walked on your
keyboard:
do shell script "defaults write
/Library/Preferences/DirectoryService/DirectoryService Rendezvous
Inactive"
However, one would need to tell the service to relaunch pretty much
what
the Directory Accesswindow does when you push the "Apply" button.
Any ideas? Apple Event? "Startup Services" shell command?
Kill the process, and relaunching it would be worth trying, but I'd
suspect doing so would likely cause other problems. You could do the
prefs change without AS, and there is probably a CLI command to restart
the service cleanly, but I'm inclined to agree with others on the lists
that this is a bad idea in general.
--
Sincerely,
Joshua See
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.