Skip to content

Instantly share code, notes, and snippets.

@zhanglianxin
Last active December 7, 2023 08:57
Show Gist options
  • Save zhanglianxin/a7b57ce15ef36211b3700498462c1314 to your computer and use it in GitHub Desktop.
Save zhanglianxin/a7b57ce15ef36211b3700498462c1314 to your computer and use it in GitHub Desktop.
Update V2Ray core files for V2rayU(v3.2.0) on macOS.
#!/bin/bash
# for [V2rayU](https://github.com/yanue/V2rayU).
V2RAY_HOME=~/v2ray-core
INAPP_DIR=/Applications/V2rayU.app/Contents/Resources/v2ray-core
INUSER_DIR=~/.V2rayU/v2ray-core
# brew install --cask v2rayu
# brew install v2ray xray
if [ ! -d "$V2RAY_HOME" ]; then
echo "$V2RAY_HOME does not exist, make it."
mkdir $V2RAY_HOME
fi
ln -f /usr/local/opt/xray/libexec/xray \
/usr/local/opt/v2ray/libexec/v2ray \
/usr/local/opt/v2ray/share/v2ray/{geoip.dat,geosite.dat} \
$V2RAY_HOME
mv $INAPP_DIR ${INAPP_DIR}.bak
mv $INUSER_DIR ${INUSER_DIR}.bak
ln -sf $V2RAY_HOME $INAPP_DIR
ln -sf $V2RAY_HOME $INUSER_DIR
echo 'Done.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment