深圳市罗湖网站建设,百度自助建站官网,东莞寮步搬家公司,wordpress如何转换为中文Mac命令关闭代理设置 背景#xff1a;在日常公司处理过程中#xff0c;因公司代理软件存在一些bug#xff0c;在非正常退出时候未关闭系统代理功能#xff0c;导致浏览器无法访问网页。在这种情况#xff0c;只需要在网络设置中关闭代理功能即可解决#xff0c;但因有些人…Mac命令关闭代理设置 背景在日常公司处理过程中因公司代理软件存在一些bug在非正常退出时候未关闭系统代理功能导致浏览器无法访问网页。在这种情况只需要在网络设置中关闭代理功能即可解决但因有些人不熟悉系统找不到相关设置所特写了相关脚本交由员工运行即可关闭。暂只写了Mac版本的Windows后续有时间补上。 Mac
#- - - - - - - - -- --Script comment information - - - - - - - - - -
#Author 拉基
#Email helpdesk81outlook.com
#Creation time 2023-09-21
#FileName proxy.sh
#Blog address https://www.cnblogs.com/98record/
#Copyright (C) 2023All rights reserved
#- - - - - - - - - - - - - end - - - - - - - - - - - - - - - - - -
IFS$\n # 设置分隔符为换行符
interfaces($(networksetup -listallnetworkservices | tail -n 2))
for interface in ${interfaces[]}; do# 去除末尾可能的空格interface$(echo ${interface} | xargs)# 关闭自动发现代理sudo networksetup -setproxyautodiscovery ${interface} off# 关闭自动配置代理sudo networksetup -setautoproxystate ${interface} off# 关闭网页代理HTTPsudo networksetup -setwebproxystate ${interface} off# 关闭安全网页代理HTTPSsudo networksetup -setsecurewebproxystate ${interface} off# 关闭SOCKS代理sudo networksetup -setsocksfirewallproxystate ${interface} off
done