fix: repeated add clash alias and $clashdir

This commit is contained in:
wuxs 2022-09-16 17:45:17 +08:00 committed by GitHub
parent 392b8f6877
commit 651f21c7b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,9 +5,12 @@ clashdir=/data/clash
profile=/etc/profile
#h初始化环境变量
echo "alias clash=\"$clashdir/clash.sh\"" >> $profile
echo "export clashdir=\"$clashdir\"" >> $profile
if [ `type -t clash` != "alias" ];then
echo "alias clash=\"$clashdir/clash.sh\"" >> $profile
fi
if [ -z $clashdir ];then
echo "export clashdir=\"$clashdir\"" >> $profile
fi
#设置init.d服务并启动clash服务
ln -sf $clashdir/clashservice /etc/init.d/clash
chmod 755 /etc/init.d/clash