forked from colonelpanic/dotfiles
[macOS] Fixups to shell functions
This commit is contained in:
parent
10b38aec5b
commit
efa0f61aaf
@ -13,14 +13,14 @@ function enable_access_for_assistive_devices {
|
||||
local where_clause="where service='kTCCServiceAccessibility' and client='$bundle_identifier'"
|
||||
local search_string="SELECT * from access ${where_clause};"
|
||||
local values_string="VALUES('kTCCServiceAccessibility','$bundle_identifier',0,1,1,NULL)"
|
||||
if test -z $(sudo sqlite3 '/Library/Application Support/com.apple.TCC/TCC.db' $search_string);
|
||||
if test -z $(sudo sqlite3 '/Library/Application Support/com.apple.TCC/TCC.db' "$search_string");
|
||||
then
|
||||
local sql_string="INSERT INTO access $values_string;"
|
||||
else
|
||||
local sql_string="UPDATE access set allowed = 1 ${where_clause};"
|
||||
fi
|
||||
echo $sql_string
|
||||
sudo sqlite3 '/Library/Application Support/com.apple.TCC/TCC.db' $sql_string
|
||||
echo "$sql_string"
|
||||
sudo sqlite3 '/Library/Application Support/com.apple.TCC/TCC.db' "$sql_string"
|
||||
}
|
||||
|
||||
function as_user {
|
||||
|
Loading…
Reference in New Issue
Block a user