I am trying to edit hosts
file. But it gives error:
sudo: no tty present and no askpass program specified.
I have tried but its not working. Please help if anyone know. Thank You.
NSMutableString* pfConf = [NSMutableString stringWithContentsOfFile: @"/private/etc/pf.conf" encoding: NSUTF8StringEncoding error: nil];
if ([pfConf rangeOfString: @"/private/etc/pf.anchors/org.eyebeam"].location == NSNotFound) {
[pfConf appendString: @"\n"
"anchor \"org.eyebeam\"\n"
"load anchor \"org.eyebeam\" from \"/private/etc/pf.anchors/org.eyebeam\"\n"];
}
[pfConf writeToFile: @"/private/etc/pf.conf" atomically: true encoding: NSUTF8StringEncoding error: nil];