fix(脚本): 修改创建快捷方式时,可能出现的bug

pull/534/merge
mack-a 2021-07-02 21:57:39 +08:00
parent 4b0426d3f6
commit 4f0d5a33a1
1 changed files with 17 additions and 7 deletions

View File

@ -3368,17 +3368,27 @@ aliasInstall() {
if [[ -f "$HOME/install.sh" ]] && [[ -d "/etc/v2ray-agent" ]] && grep <$HOME/install.sh -q "作者mack-a"; then
mv "$HOME/install.sh" /etc/v2ray-agent/install.sh
if [[ -d "/usr/bin/" ]] && [[ ! -f "/usr/bin/vasma" ]]; then
local vasmaType=
if [[ -d "/usr/bin/" ]] ; then
if [[ ! -f "/usr/bin/vasma" ]];then
ln -s /etc/v2ray-agent/install.sh /usr/bin/vasma
chmod 700 /usr/bin/vasma
vasmaType=true
fi
rm -rf "$HOME/install.sh"
elif [[ -d "/usr/sbin" ]] && [[ ! -f "/usr/sbin/vasma" ]]; then
elif [[ -d "/usr/sbin" ]] ; then
if [[ ! -f "/usr/sbin/vasma" ]];then
ln -s /etc/v2ray-agent/install.sh /usr/sbin/vasma
chmod 700 /usr/sbin/vasma
vasmaType=true
fi
rm -rf "$HOME/install.sh"
fi
if [[ "${vasmaType}" == "true" ]];then
echoContent green "快捷方式创建成功,可执行[vasma]重新打开脚本"
fi
fi
}
# 检查ipv6、ipv4