Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Classes/FanControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,29 @@ +(void) initialize {
//avoid Zombies when starting external app
signal(SIGCHLD, SIG_IGN);

[FanControl copyMachinesIfNecessary];
//check owner and suid rights
[FanControl setRights];

//talk to smc
[smcWrapper init];

[FanControl terminateIfNoFans];

[FanControl copyMachinesIfNecessary];

//app in foreground for update notifications
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];

}

+(void) terminateIfNoFans {
int fan_num = [smcWrapper get_fan_num];
if (fan_num <= 0) {
NSLog(@"Exiting as %d fans were detected for Model Identifier: %@", fan_num, [MachineDefaults computerModel]);
[[NSApplication sharedApplication] terminate:self];
}
}

+(void)copyMachinesIfNecessary
{
NSString *path = [[[NSFileManager defaultManager] applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"];
Expand Down