Hi,
I have a class which is a subclass of NSOperation, that runs a shell
script with AuthorizationExecuteWithPrivileges. Something like this:
// Alloc my auth class and authenticate
Authentication *auth = [[Authentication alloc] init];
[auth authenticate];
// Set permissions on script and run script with
AuthorizationExecuteWithPrivileges
[auth executeShellCommand:@"chmod 755 /script.sh; chown $USER:admin /
script.sh; sh /script.sh"];
// Then call selector on main thread to notify that its finished
[[AppDelegate shared] performSelectorOnMainThread:@selector(scriptDone)
withObject:nil
waitUntilDone:YES];
( "shared" is just a method in my main delegat class that returns
[[AppDelegate alloc] init]). The issue is that the selector is being
called a few seconds after the script starts, not when its finished.
Thanks
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]