diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index 715a230..0f9ca20 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/version b/bin/version index 496d00b..caf48c9 100644 --- a/bin/version +++ b/bin/version @@ -1,4 +1,4 @@ clash_v=1.4.2 clashpre_v=2021.03.10 GeoIP_v=20210312 -versionsh=1.1.6 +versionsh=1.1.7 diff --git a/install.sh b/install.sh index 5ecce3a..8890cf5 100644 --- a/install.sh +++ b/install.sh @@ -86,7 +86,7 @@ gettar(){ fi #修饰文件及版本号 shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash - sed -i "s%#!/bin/sh%#!/bin/$shtype%g" $clashdir/start.sh + sed -i "s|/bin/sh|/bin/$shtype|" $clashdir/start.sh chmod 777 $clashdir/start.sh sed -i '/versionsh_l=*/'d $clashdir/mark echo versionsh_l=$release_new >> $clashdir/mark diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 3eb6ae8..98c2fed 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -363,17 +363,22 @@ gettar(){ fi #修饰文件及版本号 shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash - sed -i "s%#!/bin/sh%#!/bin/$shtype%g" $clashdir/start.sh + sed -i "s|/bin/sh|/bin/$shtype|" $clashdir/start.sh chmod 777 $clashdir/start.sh sed -i '/versionsh_l=*/'d $clashdir/mark echo versionsh_l=$release_new >> $clashdir/mark #设置环境变量 [ -w ~/.bashrc ] && profile=~/.bashrc [ -w /etc/profile ] && profile=/etc/profile - sed -i '/alias clash=*/'d $profile - echo "alias clash=\"$shtype $clashdir/clash.sh\"" >> $profile #设置快捷命令环境变量 - sed -i '/export clashdir=*/'d $profile - echo "export clashdir=\"$clashdir\"" >> $profile #设置clash路径环境变量 + if [ -n "$profile" ];then + sed -i '/alias clash=*/'d $profile + echo "alias clash=\"$shtype $clashdir/clash.sh\"" >> $profile #设置快捷命令环境变量 + sed -i '/export clashdir=*/'d $profile + echo "export clashdir=\"$clashdir\"" >> $profile #设置clash路径环境变量 + else + echo 无法写入环境变量!请检查安装权限! + exit 1 + fi #删除临时文件 rm -rf /tmp/clashfm.tar.gz rm -rf $clashdir/clashservice