v1.0.0beta15.3

~优化脚本语句和结构
~完美适配支持wget!!!
~优化非root用户体验
~增加Gitee下载源
~增加脚本日志以及查看日志功能
~修复部分情况下开机自启显示错误的bug
This commit is contained in:
juewuy
2020-10-24 21:13:06 +08:00
parent 4743965c58
commit 7091319fcb
6 changed files with 104 additions and 177 deletions

View File

@@ -3,7 +3,8 @@
getconfig(){
#加载配置文件
[ -z "$clashdir" ] && source /etc/profile > /dev/null 2>&1
[ -z "$clashdir" ] && source /etc/profile > /dev/null
[ -z "$clashdir" ] && source ~/.bashrc > /dev/null
ccfg=$clashdir/mark
[ -f $ccfg ] && source $ccfg
#默认设置
@@ -432,8 +433,10 @@ set_proxy)
kwriteconfig5 --file kioslaverc --group "Proxy Settings" --key "Proxy Config Script" "http://127.0.0.1${3}/pac"
#环境变量方式
else
echo 'export all_proxy=http://127.0.0.1:'"$2" >> /etc/profile
echo 'export ALL_PROXY=$all_proxy' >> /etc/profile
[ -w ~/.bashrc ] && profile=~/.bashrc
[ -w /etc/profile ] && profile=/etc/profile
echo 'export all_proxy=http://127.0.0.1:'"$2" >> $profile
echo 'export ALL_PROXY=$all_proxy' >> $profile
fi
;;
unset_proxy)
@@ -445,8 +448,10 @@ unset_proxy)
kwriteconfig5 --file kioslaverc --group "Proxy Settings" --key "ProxyType" 0
#环境变量方式
else
sed -i '/all_proxy/'d /etc/profile
sed -i '/ALL_PROXY/'d /etc/profile
[ -w ~/.bashrc ] && profile=~/.bashrc
[ -w /etc/profile ] && profile=/etc/profile
sed -i '/all_proxy/'d $profile
sed -i '/ALL_PROXY/'d $profile
fi
;;
esac