v1.3.5-test
~全面适配Padavan及华硕/梅林固件! ~修复以上固件无法正确开机启动的bug ~修复以上固件定时任务无法保存的bug ~增加对部分小米设备使用redir-host模式无法观看Netflix的修复工具(8-4)
This commit is contained in:
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
clash_v=1.6.0
|
clash_v=1.6.0
|
||||||
clashpre_v=2021.05.08
|
clashpre_v=2021.05.08
|
||||||
GeoIP_v=20210514
|
GeoIP_v=20210514
|
||||||
versionsh=[A[B1.3.4
|
versionsh=1.3.5
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ gettar(){
|
|||||||
sed -i '/versionsh_l=*/'d $clashdir/mark
|
sed -i '/versionsh_l=*/'d $clashdir/mark
|
||||||
echo versionsh_l=$release_new >> $clashdir/mark
|
echo versionsh_l=$release_new >> $clashdir/mark
|
||||||
#设置环境变量
|
#设置环境变量
|
||||||
|
[ -w /opt/etc/profile ] && profile=/opt/etc/profile
|
||||||
|
[ -w /jffs/configs/profile.add ] && profile=/jffs/configs/profile.add
|
||||||
[ -w ~/.bashrc ] && profile=~/.bashrc
|
[ -w ~/.bashrc ] && profile=~/.bashrc
|
||||||
[ -w /etc/profile ] && profile=/etc/profile
|
[ -w /etc/profile ] && profile=/etc/profile
|
||||||
if [ -n "$profile" ];then
|
if [ -n "$profile" ];then
|
||||||
@@ -105,7 +107,7 @@ gettar(){
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
#华硕/Padavan额外设置
|
#华硕/Padavan额外设置
|
||||||
[ -n "$systype" ] && echo "$clashdir/start.sh init #运行ShellClash开机初始化脚本" >> $initdir
|
[ -n "$systype" ] && sed -i '/ShellClash初始化/'d $initdir && echo "$clashdir/start.sh init #ShellClash初始化脚本" >> $initdir
|
||||||
#删除临时文件
|
#删除临时文件
|
||||||
rm -rf /tmp/clashfm.tar.gz
|
rm -rf /tmp/clashfm.tar.gz
|
||||||
rm -rf $clashdir/clashservice
|
rm -rf $clashdir/clashservice
|
||||||
|
|||||||
@@ -985,6 +985,7 @@ tools(){
|
|||||||
[ -f "/etc/firewall.user" ] && echo -e " 2 \033[32m配置\033[0m外网访问SSH"
|
[ -f "/etc/firewall.user" ] && echo -e " 2 \033[32m配置\033[0m外网访问SSH"
|
||||||
#echo -e " 3 配置DDNS服务: \033[36m$ipv6_support\033[0m ————待施工"
|
#echo -e " 3 配置DDNS服务: \033[36m$ipv6_support\033[0m ————待施工"
|
||||||
[ -x /usr/sbin/otapredownload ] && echo -e " 3 \033[33m$mi_update\033[0m小米系统自动更新"
|
[ -x /usr/sbin/otapredownload ] && echo -e " 3 \033[33m$mi_update\033[0m小米系统自动更新"
|
||||||
|
[ -w "/etc/config/firewall" ] && echo -e " 4 \033[32修复\033[0mRedir_host模式Netflix访问"
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
echo -e " 0 返回上级菜单 \033[0m"
|
echo -e " 0 返回上级菜单 \033[0m"
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
@@ -1009,6 +1010,14 @@ tools(){
|
|||||||
sleep 1
|
sleep 1
|
||||||
tools
|
tools
|
||||||
|
|
||||||
|
elif [ "$num" = 4 ]; then
|
||||||
|
sed -i "s/drop_invalid\ \'1\'/drop_invalid\ \'0\'/g" /etc/config/firewall
|
||||||
|
echo -----------------------------------------------
|
||||||
|
read -P "已修复,是否立即重启设备使其生效?(1/0) > " res
|
||||||
|
[ "$res" = 1 ] && reboot
|
||||||
|
sleep 1
|
||||||
|
tools
|
||||||
|
|
||||||
else
|
else
|
||||||
errornum
|
errornum
|
||||||
fi
|
fi
|
||||||
@@ -1043,11 +1052,13 @@ clashcron(){
|
|||||||
read -p "是否确认添加定时任务?(1/0) > " res
|
read -p "是否确认添加定时任务?(1/0) > " res
|
||||||
if [ "$res" = '1' ]; then
|
if [ "$res" = '1' ]; then
|
||||||
cronwords="$min $hour * * $week $cronset >/dev/null 2>&1 #$week1的$hour点$min分$cronname"
|
cronwords="$min $hour * * $week $cronset >/dev/null 2>&1 #$week1的$hour点$min分$cronname"
|
||||||
crontab -l > /tmp/conf
|
crondir=/tmp/cron_$USER
|
||||||
sed -i "/$cronname/d" /tmp/conf
|
crontab -l > $crondir
|
||||||
sed -i '/^$/d' /tmp/conf
|
sed -i "/$cronname/d" $crondir
|
||||||
echo "$cronwords" >> /tmp/conf && crontab /tmp/conf
|
sed -i '/^$/d' $crondir
|
||||||
rm -f /tmp/conf
|
echo "$cronwords" >> $crondir && crontab $crondir
|
||||||
|
#华硕/Padavan固件存档在本地,其他则删除
|
||||||
|
[ "$clashdir" = "/jffs/clash" -o "$clashdir" = "/etc/storage/clash" ] && mv -f $crondir $clashdir/cron || rm -f $crondir
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
echo -e "\033[31m定时任务已添加!!!\033[0m"
|
echo -e "\033[31m定时任务已添加!!!\033[0m"
|
||||||
fi
|
fi
|
||||||
@@ -1071,6 +1082,7 @@ clashcron(){
|
|||||||
i=
|
i=
|
||||||
elif [ "$num" = 9 ]; then
|
elif [ "$num" = 9 ]; then
|
||||||
crontab -l > /tmp/conf && sed -i "/$cronname/d" /tmp/conf && crontab /tmp/conf
|
crontab -l > /tmp/conf && sed -i "/$cronname/d" /tmp/conf && crontab /tmp/conf
|
||||||
|
sed -i "/$cronname/d" $clashdir/cron
|
||||||
rm -f /tmp/conf
|
rm -f /tmp/conf
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
echo -e "\033[31m定时任务:$cronname已删除!\033[0m"
|
echo -e "\033[31m定时任务:$cronname已删除!\033[0m"
|
||||||
|
|||||||
@@ -355,7 +355,6 @@ gettar(){
|
|||||||
mv $clashdir/clash.service $sysdir/clash.service
|
mv $clashdir/clash.service $sysdir/clash.service
|
||||||
sed -i "s%/etc/clash%$clashdir%g" $sysdir/clash.service
|
sed -i "s%/etc/clash%$clashdir%g" $sysdir/clash.service
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
#useradd shellclash
|
|
||||||
else
|
else
|
||||||
#设为保守模式启动
|
#设为保守模式启动
|
||||||
sed -i '/start_old=*/'d $clashdir/mark
|
sed -i '/start_old=*/'d $clashdir/mark
|
||||||
@@ -369,6 +368,8 @@ gettar(){
|
|||||||
sed -i '/versionsh_l=*/'d $clashdir/mark
|
sed -i '/versionsh_l=*/'d $clashdir/mark
|
||||||
echo versionsh_l=$release_new >> $clashdir/mark
|
echo versionsh_l=$release_new >> $clashdir/mark
|
||||||
#设置环境变量
|
#设置环境变量
|
||||||
|
[ -w /opt/etc/profile ] && profile=/opt/etc/profile
|
||||||
|
[ -w /jffs/configs/profile.add ] && profile=/jffs/configs/profile.add
|
||||||
[ -w ~/.bashrc ] && profile=~/.bashrc
|
[ -w ~/.bashrc ] && profile=~/.bashrc
|
||||||
[ -w /etc/profile ] && profile=/etc/profile
|
[ -w /etc/profile ] && profile=/etc/profile
|
||||||
if [ -n "$profile" ];then
|
if [ -n "$profile" ];then
|
||||||
@@ -380,6 +381,8 @@ gettar(){
|
|||||||
echo 无法写入环境变量!请检查安装权限!
|
echo 无法写入环境变量!请检查安装权限!
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
#华硕/Padavan额外设置
|
||||||
|
[ -n "$systype" ] && sed -i '/ShellClash初始化/'d $initdir && echo "$clashdir/start.sh init #ShellClash初始化脚本" >> $initdir
|
||||||
#删除临时文件
|
#删除临时文件
|
||||||
rm -rf /tmp/clashfm.tar.gz
|
rm -rf /tmp/clashfm.tar.gz
|
||||||
rm -rf $clashdir/clashservice
|
rm -rf $clashdir/clashservice
|
||||||
@@ -845,6 +848,8 @@ update(){
|
|||||||
sed -i '/all_proxy/'d $profile
|
sed -i '/all_proxy/'d $profile
|
||||||
sed -i '/ALL_PROXY/'d $profile
|
sed -i '/ALL_PROXY/'d $profile
|
||||||
sed -i "/启用外网访问SSH服务/d" /etc/firewall.user
|
sed -i "/启用外网访问SSH服务/d" /etc/firewall.user
|
||||||
|
sed -i '/ShellClash初始化/'d /etc/storage/started_script.sh 2>/dev/null
|
||||||
|
sed -i '/ShellClash初始化/'d /jffs/.asusrouter 2>/dev/null
|
||||||
rm -rf $clashdir
|
rm -rf $clashdir
|
||||||
rm -rf /etc/init.d/clash
|
rm -rf /etc/init.d/clash
|
||||||
rm -rf /etc/systemd/system/clash.service
|
rm -rf /etc/systemd/system/clash.service
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
#脚本内部工具
|
#脚本内部工具
|
||||||
getconfig(){
|
getconfig(){
|
||||||
#加载配置文件
|
#加载配置文件
|
||||||
[ -n "/etc/storage/clash" ] && clashdir=/etc/storage/clash
|
[ -d "/etc/storage/clash" ] && clashdir=/etc/storage/clash
|
||||||
[ -n "/jffs/clash" ] && clashdir=/etc/storage/clash
|
[ -d "/jffs/clash" ] && clashdir=/jffs/clash
|
||||||
[ -z "$clashdir" ] && clashdir=$(cat /etc/profile | grep clashdir | awk -F "\"" '{print $2}')
|
[ -z "$clashdir" ] && clashdir=$(cat /etc/profile | grep clashdir | awk -F "\"" '{print $2}')
|
||||||
[ -z "$clashdir" ] && clashdir=$(cat ~/.bashrc | grep clashdir | awk -F "\"" '{print $2}')
|
[ -z "$clashdir" ] && clashdir=$(cat ~/.bashrc | grep clashdir | awk -F "\"" '{print $2}')
|
||||||
ccfg=$clashdir/mark
|
ccfg=$clashdir/mark
|
||||||
@@ -643,7 +643,7 @@ afstart(){
|
|||||||
#设置本机代理
|
#设置本机代理
|
||||||
[ "$local_proxy" = "已开启" ] && $0 set_proxy $mix_port $db_port
|
[ "$local_proxy" = "已开启" ] && $0 set_proxy $mix_port $db_port
|
||||||
#启用面板配置自动保存
|
#启用面板配置自动保存
|
||||||
cronset '#每10分钟保存节点配置' "*/10 * * * * test -n \"$(pidof clash)\" && $clashdir/start.sh web_save #每10分钟保存节点配置"
|
cronset '#每10分钟保存节点配置' "*/10 * * * * test -n \"\$(pidof clash)\" && $clashdir/start.sh web_save #每10分钟保存节点配置"
|
||||||
[ -f $clashdir/web_save ] && web_restore & #后台还原面板配置
|
[ -f $clashdir/web_save ] && web_restore & #后台还原面板配置
|
||||||
else
|
else
|
||||||
logger "clash服务启动失败!请查看报错信息!" 31
|
logger "clash服务启动失败!请查看报错信息!" 31
|
||||||
@@ -708,11 +708,12 @@ restart)
|
|||||||
$0 start
|
$0 start
|
||||||
;;
|
;;
|
||||||
init)
|
init)
|
||||||
[ -n "/etc/storage/clash" ] && clashdir=/etc/storage/clash
|
[ -d "/etc/storage/clash" ] && clashdir=/etc/storage/clash && profile=/opt/etc/profile
|
||||||
[ -n "/jffs/clash" ] && clashdir=/etc/storage/clash
|
[ -d "/jffs/clash" ] && clashdir=/jffs/clash && profile=/jffs/configs/profile.add
|
||||||
echo "alias clash=\"$clashdir/clash.sh\"" >> /opt/etc/profile
|
echo "alias clash=\"$clashdir/clash.sh\"" >> $profile
|
||||||
echo "export clashdir=\"$clashdir\"" >> /opt/etc/profile
|
echo "export clashdir=\"$clashdir\"" >> $profile
|
||||||
$0 start
|
$0 start
|
||||||
|
crontab $clashdir/cron
|
||||||
;;
|
;;
|
||||||
getyaml)
|
getyaml)
|
||||||
getconfig
|
getconfig
|
||||||
@@ -735,7 +736,7 @@ web_restore)
|
|||||||
;;
|
;;
|
||||||
daemon)
|
daemon)
|
||||||
getconfig
|
getconfig
|
||||||
cronset '#clash保守模式守护进程' "*/1 * * * * test -z \"$(pidof clash)\" && $clashdir/start.sh restart #clash保守模式守护进程"
|
cronset '#clash保守模式守护进程' "*/1 * * * * test -z \"\$(pidof clash)\" && $clashdir/start.sh restart #clash保守模式守护进程"
|
||||||
;;
|
;;
|
||||||
cronset)
|
cronset)
|
||||||
cronset $2 $3
|
cronset $2 $3
|
||||||
|
|||||||
Reference in New Issue
Block a user