Skip to content

Commit

Permalink
fix(脚本): 修改创建快捷方式时,可能出现的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mack-a committed Jul 2, 2021
1 parent 19c0bf6 commit 02d6c34
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3368,16 +3368,26 @@ 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
ln -s /etc/v2ray-agent/install.sh /usr/bin/vasma
chmod 700 /usr/bin/vasma
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
ln -s /etc/v2ray-agent/install.sh /usr/sbin/vasma
chmod 700 /usr/sbin/vasma
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
echoContent green "快捷方式创建成功,可执行[vasma]重新打开脚本"
if [[ "${vasmaType}" == "true" ]];then
echoContent green "快捷方式创建成功,可执行[vasma]重新打开脚本"
fi
fi
}

Expand Down

0 comments on commit 02d6c34

Please sign in to comment.