Created
November 16, 2020 09:33
-
-
Save Halo-Michael/cb91988a17cd5766d4c90545231a1e0f to your computer and use it in GitHub Desktop.
run /etc/rc.d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <Foundation/NSTask.h> | |
int main(){ | |
for (NSString *file in [[NSFileManager defaultManager] subpathsAtPath:@"/etc/rc.d"]) { | |
NSString *path = [@"/etc/rc.d/" stringByAppendingString:file]; | |
if ([[NSFileManager defaultManager] isExecutableFileAtPath:path]) { | |
[[NSTask launchedTaskWithLaunchPath:path arguments:@[]] waitUntilExit]; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment