Skip to content

Instantly share code, notes, and snippets.

@hr3lxphr6j
Last active April 15, 2022 02:30
Show Gist options
  • Save hr3lxphr6j/3c1085ddac9eb5a1c8b36fb610d9fa44 to your computer and use it in GitHub Desktop.
Save hr3lxphr6j/3c1085ddac9eb5a1c8b36fb610d9fa44 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -uex
readonly GEO_DATA_PATH=/usr/local/share/v2ray
if [ -z ${GITHUB_TOKEN:-} ]; then
echo "env: GITHUB_TOKEN is empty." >&2
exit 1
fi
if [ -z ${SERVER_NAME:-} ]; then
echo "env: SERVER_NAME is empty." >&2
exit 1
fi
curl -sSLfo $GEO_DATA_PATH/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
curl -sSLfo $GEO_DATA_PATH/geoip.data https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
curl -sSLfo /tmp/v2ray-cfg.json -H "Authorization: token ${GITHUB_TOKEN}" \
https://raw.githubusercontent.com/hr3lxphr6j/v2ray-config/master/${SERVER_NAME}.json
exec v2ray -c /tmp/v2ray-cfg.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment