Created
April 29, 2018 16:54
-
-
Save dasilvacontin/879cbb924aad3b35847a2f8950ca1320 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env node | |
const { execSync } = require('child_process') | |
function denyApple () { | |
const ps = execSync('ps -ef | sed 1d').toString().split('\n') | |
const systemPrefsInfo = ps.find(p => p.indexOf('System Preferences') > 1) | |
if (systemPrefsInfo != null) { | |
const pid = systemPrefsInfo.trim().split(' ').filter(s => s.length)[1] | |
execSync(`kill -9 ${pid}`) | |
} else { | |
setTimeout(denyApple, 500) | |
} | |
} | |
denyApple() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment