v0.9.9fix
~bug修复
This commit is contained in:
Binary file not shown.
@@ -1,2 +1,2 @@
|
|||||||
GeoIP_v=20200817
|
GeoIP_v=20200817
|
||||||
versionsh=0.9.9
|
versionsh=0.9.9fix
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ if [ -z "$redir_mod" ];then
|
|||||||
redir_mod=Redir模式
|
redir_mod=Redir模式
|
||||||
fi
|
fi
|
||||||
#获取运行状态
|
#获取运行状态
|
||||||
status=`ps |grep -w 'clash -d'|grep -v grep|wc -l`
|
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh|wc -l`
|
||||||
if [[ $status -gt 0 ]];then
|
if [[ $status -gt 0 ]];then
|
||||||
run="\033[32m正在运行($redir_mod)\033[0m"
|
run="\033[32m正在运行($redir_mod)\033[0m"
|
||||||
uid=`ps |grep -w 'clash -d'|grep -v grep|awk '{print $1}'`
|
uid=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh|awk '{print $1}'`
|
||||||
VmRSS=`cat /proc/$uid/status|grep -w VmRSS|awk '{print $2,$3}'`
|
VmRSS=`cat /proc/$uid/status|grep -w VmRSS|awk '{print $2,$3}'`
|
||||||
#获取运行时长
|
#获取运行时长
|
||||||
if [ -n "$start_time" ]; then
|
if [ -n "$start_time" ]; then
|
||||||
@@ -86,11 +86,8 @@ if [ ! -f $clashdir/Country.mmdb ];then
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
clashstop(){
|
clashstop(){
|
||||||
if [ "$start_old" = "已开启" ];then
|
|
||||||
source $clashdir/start.sh && stop_old
|
source $clashdir/start.sh && stop_old
|
||||||
else
|
|
||||||
/etc/init.d/clash stop > /dev/null 2>&1
|
/etc/init.d/clash stop > /dev/null 2>&1
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
clashstart(){
|
clashstart(){
|
||||||
if [ ! -f "$yaml" ];then
|
if [ ! -f "$yaml" ];then
|
||||||
@@ -107,7 +104,7 @@ clashstart(){
|
|||||||
if [ "$start_old" = "已开启" ];then
|
if [ "$start_old" = "已开启" ];then
|
||||||
source $clashdir/start.sh && start_old
|
source $clashdir/start.sh && start_old
|
||||||
sleep 1
|
sleep 1
|
||||||
status=`ps |grep -w 'clash -d'|grep -v grep`
|
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh`
|
||||||
if [ -z "$status" ];then
|
if [ -z "$status" ];then
|
||||||
echo -e "\033[31mclash启动失败!\033[0m"
|
echo -e "\033[31mclash启动失败!\033[0m"
|
||||||
sed -i /start_old=*/d $ccfg
|
sed -i /start_old=*/d $ccfg
|
||||||
@@ -116,12 +113,12 @@ clashstart(){
|
|||||||
else
|
else
|
||||||
/etc/init.d/clash start
|
/etc/init.d/clash start
|
||||||
sleep 1
|
sleep 1
|
||||||
status=`ps |grep -w 'clash -d'|grep -v grep`
|
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh`
|
||||||
if [ -z "$status" ];then
|
if [ -z "$status" ];then
|
||||||
echo -e "\033[31mclash启动失败!尝试使用保守方式启动!\033[0m"
|
echo -e "\033[31mclash启动失败!尝试使用保守方式启动!\033[0m"
|
||||||
source $clashdir/start.sh && start_old
|
source $clashdir/start.sh && start_old
|
||||||
sleep 1
|
sleep 1
|
||||||
status=`ps |grep -w 'clash -d'|grep -v grep`
|
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh`
|
||||||
if [ -z "$status" ];then
|
if [ -z "$status" ];then
|
||||||
echo -e "\033[31mclash启动失败!\033[0m"
|
echo -e "\033[31mclash启动失败!\033[0m"
|
||||||
sed -i /start_old=*/d $ccfg
|
sed -i /start_old=*/d $ccfg
|
||||||
|
|||||||
@@ -94,26 +94,8 @@ else
|
|||||||
mv $yamlnew $yaml
|
mv $yamlnew $yaml
|
||||||
echo 配置文件已生成!正在启动clash使其生效!
|
echo 配置文件已生成!正在启动clash使其生效!
|
||||||
#重启clash服务
|
#重启clash服务
|
||||||
if [ $status -gt 0 ];then
|
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
killall -9 clash &> /dev/null
|
killall -9 clash &> /dev/null
|
||||||
echo -e "\033[31mClash服务已停止!\033[0m"
|
start_over(){
|
||||||
fi
|
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
if [ "$start_old" = "已开启" ];then
|
|
||||||
source $clashdir/start.sh && start_old
|
|
||||||
else
|
|
||||||
/etc/init.d/clash start
|
|
||||||
sleep 1
|
|
||||||
status=`ps |grep -w 'clash -d'|grep -v grep`
|
|
||||||
if [ -z "$status" ];then
|
|
||||||
echo -e "\033[31mclash启动失败!尝试使用保守方式启动!\033[0m"
|
|
||||||
source $clashdir/start.sh && start_old
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
status=`ps |grep -w 'clash -d'|grep -v grep|wc -l`
|
|
||||||
if [[ $status -gt 0 ]];then
|
|
||||||
host=$(ubus call network.interface.lan status | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';)
|
host=$(ubus call network.interface.lan status | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';)
|
||||||
echo -e "\033[32mclash服务已启动!\033[0m"
|
echo -e "\033[32mclash服务已启动!\033[0m"
|
||||||
echo -e "可以使用\033[30;47m http://clash.razord.top \033[0m管理内置规则"
|
echo -e "可以使用\033[30;47m http://clash.razord.top \033[0m管理内置规则"
|
||||||
@@ -121,7 +103,29 @@ else
|
|||||||
echo -e "也可前往更新菜单安装本地Dashboard面板,连接更稳定!\033[0m"
|
echo -e "也可前往更新菜单安装本地Dashboard面板,连接更稳定!\033[0m"
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
clashsh
|
clashsh
|
||||||
|
}
|
||||||
|
if [ "$start_old" = "已开启" ];then
|
||||||
|
source $clashdir/start.sh && start_old
|
||||||
|
sleep 1
|
||||||
|
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh|wc -l`
|
||||||
|
if [[ $status -gt 0 ]];then
|
||||||
|
start_over
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
|
/etc/init.d/clash start
|
||||||
|
sleep 1
|
||||||
|
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh|wc -l`
|
||||||
|
if [[ $status -gt 0 ]];then
|
||||||
|
start_over
|
||||||
|
else
|
||||||
|
echo -e "\033[31mclash服务启动失败!尝试使用保守方式启动!\033[0m"
|
||||||
|
source $clashdir/start.sh && start_old
|
||||||
|
sleep 1
|
||||||
|
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh|wc -l`
|
||||||
|
if [[ $status -gt 0 ]];then
|
||||||
|
start_over
|
||||||
|
fi
|
||||||
|
fi
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
if [ -f $yaml.bak ];then
|
if [ -f $yaml.bak ];then
|
||||||
echo -e "\033[31mclash服务启动失败!已还原配置文件并重启clash!\033[0m"
|
echo -e "\033[31mclash服务启动失败!已还原配置文件并重启clash!\033[0m"
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ start_dns(){
|
|||||||
}
|
}
|
||||||
daemon_old(){
|
daemon_old(){
|
||||||
#守护进程状态
|
#守护进程状态
|
||||||
status=$(ps |grep -w 'clash -d'|grep -v grep)
|
status=$(ps |grep -w 'clash'|grep -v grep|grep -v clash.sh)
|
||||||
[ -z $status ] && $clashdir/clash -d $clashdir && mark_time
|
[ -z $status ] && $clashdir/clash -d $clashdir && mark_time
|
||||||
}
|
}
|
||||||
checkcron(){
|
checkcron(){
|
||||||
|
|||||||
Reference in New Issue
Block a user