Skip to content

Instantly share code, notes, and snippets.

@aa65535
Last active March 14, 2018 08:38
Show Gist options
  • Save aa65535/9a919ccc3504ce50286f to your computer and use it in GitHub Desktop.
Save aa65535/9a919ccc3504ce50286f to your computer and use it in GitHub Desktop.
#!/bin/sh
CD_VER="1.1.8"
CD_SHA="324844f"
CD_RLS="1"
SS_VER="1.5.3"
SS_SHA="5cc562f"
SS_RLS="1"
SV_VER="0.1.4"
SV_SHA="0d51fd3"
SV_RLS="1"
LuCI_VER="1.1.1-1"
BASE_URL="http://downloads.sourceforge.net/project/openwrt-dist"
opkg update
INSTALLED=$(opkg list-installed)
for a in $(opkg print-architecture | awk '{print $2}'); do
case $a in
ar71xx)
ARCH=ar71xx
;;
at91)
ARCH=at91
;;
bcm53xx)
ARCH=bcm53xx
;;
atheros)
ARCH=atheros
;;
ramips_24kec)
FOLDER=ramips
ARCH=ramips_24kec
;;
brcm63xx)
ARCH=brcm63xx
;;
brcm47xx)
ARCH=brcm47xx
;;
x86_64)
ARCH=x86_64
;;
x86)
ARCH=x86
;;
esac
done
if [ -z "$ARCH" ]; then
echo "Architectures not support"
exit 0
fi
echo -e "\nTarget Arch:\033[32m $ARCH \033[0m\n"
: ${FOLDER:=$ARCH}
if echo "$INSTALLED" | grep -q "luci"; then
INS_LUCI=1
fi
if !(echo "$INSTALLED" | grep -q "libopenssl"); then
POLAR=polarssl
fi
read -p "Install the ChinaDNS-C?" INS_CD
read -p "Install the shadowsocks-libev-spec?" INS_SS
read -p "Install the ShadowVPN?" INS_SV
if echo $INS_CD | grep -qi "^y"; then
opkg install "${BASE_URL}/chinadns-c/${CD_VER}-${CD_SHA}/ChinaDNS-C_${CD_VER}-${CD_RLS}_${ARCH}.ipk"
if [ "$INS_LUCI" = 1 ]; then
opkg install "${BASE_URL}/luci-app/chinadns-c/luci-app-chinadns-c_${LuCI_VER}_all.ipk"
fi
fi
if echo $INS_SS | grep -qi "^y"; then
if [ -n "$POLAR" ]; then
opkg install libpolarssl
fi
opkg install ipset
opkg install "${BASE_URL}/shadowsocks-libev/${SS_VER}-${SS_SHA}/${FOLDER}/shadowsocks-libev-spec${POLAR}_${SS_VER}-${SS_RLS}_${ARCH}.ipk"
if [ "$INS_LUCI" = 1 ]; then
opkg install "${BASE_URL}/luci-app/shadowvpn/luci-app-shadowvpn_${LuCI_VER}_all.ipk"
fi
fi
if echo $INS_SV | grep -qi "^y"; then
opkg install kmod-tun ip
opkg install "${BASE_URL}/shadowvpn/${SV_VER}-${SV_SHA}/ShadowVPN_${SV_VER}-${SV_RLS}_${ARCH}.ipk"
if [ "$INS_LUCI" = 1 ]; then
opkg install "${BASE_URL}/luci-app/shadowsocks-spec/luci-app-shadowsocks-spec_${LuCI_VER}_all.ipk"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment