forked from lewangdev/ShadowsocksX-NG-GostPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgost-plugin-installer
executable file
·39 lines (30 loc) · 1.16 KB
/
gost-plugin-installer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
set -e
[ -n "$GOST_PLUGIN_DEBUG" ] && set -x
if [ -z "$GOST_PLUGIN_ROOT" ]; then
GOST_PLUGIN_ROOT="${HOME}/Library/Application Support/ShadowsocksX-NG/gost"
fi
colorize() {
if [ -t 1 ]; then printf "\e[%sm%s\e[m" "$1" "$2"
else echo -n "$2"
fi
}
# Checks for gost plugin root directory, and suggests to remove it for installing
if [ -d "${GOST_PLUGIN_ROOT}" ]; then
{ echo
colorize 1 "WARNING"
echo ": Can not proceed with installation. Kindly remove the '${GOST_PLUGIN_ROOT}' directory first."
echo
} >&2
exit 1
fi
mkdir "${GOST_PLUGIN_ROOT}"
GOST_VERSION=2.11.5
curl -L "https://github.com/ginuerzh/gost/releases/download/v${GOST_VERSION}/gost-darwin-amd64-${GOST_VERSION}.gz" --output "${GOST_PLUGIN_ROOT}/gost.gz"
gunzip "${GOST_PLUGIN_ROOT}/gost.gz"
chmod +x "${GOST_PLUGIN_ROOT}/gost"
SS_PLUGINS_ROOT="${HOME}/Library/Application Support/ShadowsocksX-NG/plugins"
curl -L "https://github.com/lewangdev/ShadowsocksX-NG-GostPlugin/releases/download/v0.0.2/gost-plugin.gz" --output "${SS_PLUGINS_ROOT}/gost-plugin.gz"
gunzip "${SS_PLUGINS_ROOT}/gost-plugin.gz"
chmod +x "${SS_PLUGINS_ROOT}/gost-plugin"
echo "Gost plugin installed."