forked from colonelpanic/dotfiles
osx.sh fixups.
This commit is contained in:
parent
b5ec409974
commit
3044c9d770
@ -112,7 +112,7 @@ function set_application_for_file_extension() {
|
|||||||
VALUE="${1-public.plain-text}"
|
VALUE="${1-public.plain-text}"
|
||||||
|
|
||||||
# the new handler for all roles
|
# the new handler for all roles
|
||||||
HANDLER="${1}"
|
HANDLER="${2}"
|
||||||
|
|
||||||
$_BUDDY -c 'Print "LSHandlers"' $_PLIST >/dev/null 2>&1
|
$_BUDDY -c 'Print "LSHandlers"' $_PLIST >/dev/null 2>&1
|
||||||
if [[ $? -ne 0 ]] ; then
|
if [[ $? -ne 0 ]] ; then
|
||||||
@ -147,18 +147,13 @@ function reload_preferences {
|
|||||||
killall -u $(whoami) cfprefsd
|
killall -u $(whoami) cfprefsd
|
||||||
}
|
}
|
||||||
|
|
||||||
disable_proxy(){
|
function disable_proxy(){
|
||||||
sudo networksetup -setsocksfirewallproxystate Wi-Fi off
|
sudo networksetup -setsocksfirewallproxystate Wi-Fi off
|
||||||
sudo networksetup -setsocksfirewallproxystate Ethernet off
|
sudo networksetup -setsocksfirewallproxystate Ethernet off
|
||||||
echo "SOCKS proxy disabled."
|
echo "SOCKS proxy disabled."
|
||||||
}
|
}
|
||||||
|
|
||||||
function socks_proxy {
|
function socks_proxy {
|
||||||
disable_proxy(){
|
|
||||||
sudo networksetup -setsocksfirewallproxystate Wi-Fi off
|
|
||||||
sudo networksetup -setsocksfirewallproxystate Ethernet off
|
|
||||||
echo "SOCKS proxy disabled."
|
|
||||||
}
|
|
||||||
trap disable_proxy EXIT
|
trap disable_proxy EXIT
|
||||||
sudo networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 9999
|
sudo networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 9999
|
||||||
sudo networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 9999
|
sudo networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 9999
|
||||||
|
Loading…
Reference in New Issue
Block a user