From 3044c9d7708a91e34ea8c05dd5921bbd64fced70 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 31 Dec 2014 11:37:15 -0500 Subject: [PATCH] osx.sh fixups. --- dotfiles/lib/shellrc/osx.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/dotfiles/lib/shellrc/osx.sh b/dotfiles/lib/shellrc/osx.sh index 617cd31b..ade0539e 100644 --- a/dotfiles/lib/shellrc/osx.sh +++ b/dotfiles/lib/shellrc/osx.sh @@ -40,7 +40,7 @@ function reload_user_agent { as_current_user /bin/launchctl unload "$1" as_current_user /bin/launchctl load "$1" } - + function reload_root_agent { as_user 'root' "/bin/launchctl unload '$1'" @@ -112,7 +112,7 @@ function set_application_for_file_extension() { VALUE="${1-public.plain-text}" # the new handler for all roles - HANDLER="${1}" + HANDLER="${2}" $_BUDDY -c 'Print "LSHandlers"' $_PLIST >/dev/null 2>&1 if [[ $? -ne 0 ]] ; then @@ -147,18 +147,13 @@ function reload_preferences { killall -u $(whoami) cfprefsd } -disable_proxy(){ +function disable_proxy(){ sudo networksetup -setsocksfirewallproxystate Wi-Fi off sudo networksetup -setsocksfirewallproxystate Ethernet off echo "SOCKS proxy disabled." } function socks_proxy { - disable_proxy(){ - sudo networksetup -setsocksfirewallproxystate Wi-Fi off - sudo networksetup -setsocksfirewallproxystate Ethernet off - echo "SOCKS proxy disabled." - } trap disable_proxy EXIT sudo networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 9999 sudo networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 9999