Browse Source

ss-server 运行库不匹配,自动编译/更新

hongwenjun 6 năm trước cách đây
mục cha
commit
a656899aa7
3 tập tin đã thay đổi với 15 bổ sung7 xóa
  1. 2 0
      openwrt-18.06.2/README.md
  2. 2 2
      shadowsocks/README.md
  3. 11 5
      shadowsocks/install_ss-server.sh

+ 2 - 0
openwrt-18.06.2/README.md

@@ -20,6 +20,8 @@ udp2raw -c -l127.0.0.1:21333 -r34.80.188.188:2999 --raw-mode faketcp -a -k passw
 # luci-udptools 工具默认: udpspeeder 不用密码,所以VPS服务端 udpspeeder 改成不用密码
 # vim /etc/init.d/udptools   # 或者编辑 luci-udptools 的脚本 第21行添加 -k $password
 # vim /etc/config/udptools   # UDP工具 参数配置
+
+# 还有一种方法下载修改版: OpenWRT luci KcpTun Udp2Raw 软件包  https://git.io/openwrt
 ```
 - UDP工具脚本: [/etc/init.d/udptools](https://github.com/atrandys/luci-udptools/blob/master/src/etc/init.d/udptools)
 - UDP参数配置: [/etc/config/udptools](https://github.com/atrandys/luci-udptools/blob/master/src/etc/config/udptools)

+ 2 - 2
shadowsocks/README.md

@@ -15,7 +15,7 @@ bash <(curl -L -s git.io/fhExJ) update
 ss-server -s 0.0.0.0 -p 40000 -k ${PASSWORD} -m aes-256-gcm -t 300 -s ::0 >> /var/log/ss-server.log &
 ```
 ### 基于alipine构建的shadowsocks-libev服务 -- Docker安装
-  https://hub.docker.com/r/taterli/shadowsocks-tiny
+    https://hub.docker.com/r/taterli/shadowsocks-tiny
 
 ### V2Ray和Shadowsocks配置显示二维码  短网址: https://git.io/v2ray.ss
 ![](https://raw.githubusercontent.com/hongwenjun/vps_setup/master/v2ray/v2ray.ss.png)
@@ -48,5 +48,5 @@ git submodule update --init --recursive
 make
 make install
 cd ..
-rm shadowsocks-libev -rf
+# rm shadowsocks-libev -rf
 ```

+ 11 - 5
shadowsocks/install_ss-server.sh

@@ -3,9 +3,8 @@
 # 定义文字颜色
 Green="\033[32m"  && Red="\033[31m" && GreenBG="\033[42;37m" && RedBG="\033[41;37m" && Font="\033[0m"
 
-echo -e "${Green}:: 快速安装 shadowsocks-libev 脚本 For Debian_9 Centos_7 Ubuntu_18 ${Font}"
-echo -e "${Red}:: 如果运行运行库不匹配,请编译安装/更新 ${RedBG} shadowsocks-libev ${Font}"
-echo -e "${Green}$  bash <(curl -L -s git.io/fhExJ) update  ${Font}"
+echo -e "${Green}:: Quick install Shadowsocks-libev  For Debian_9 Centos_7 Ubuntu_18 ${Font}"
+echo -e "${Green}:: Compile/Update: ${RedBG} bash <(curl -L -s git.io/fhExJ) update ${Font}"
 
 def_install(){
     if [[ ${release} == "centos" ]]; then
@@ -37,7 +36,7 @@ centos7_dev(){
 
 inst_ss-server(){
     # 下载shadowsocks代码
-    git clone https://github.com/shadowsocks/shadowsocks-libev.git
+    git clone --recursive https://github.com/shadowsocks/shadowsocks-libev --depth=1
     cd shadowsocks-libev
     git submodule update --init --recursive
 
@@ -47,7 +46,7 @@ inst_ss-server(){
     make
     make install
     cd ..
-    rm shadowsocks-libev -rf
+    # rm shadowsocks-libev -rf
 }
 
 # 检查系统
@@ -113,4 +112,11 @@ else
     if [ ! -f '/usr/local/bin/ss-server' ]; then
         def_install
     fi
+
+    # 如果运行库错误,编译/更新安装
+    /usr/local/bin/ss-server -v  >/dev/null 2>&1
+    if [ $? == 127 ]; then
+        update_ss-server
+    fi
+
 fi