Browse Source

一键安装脚本

zjcqoo 6 years ago
parent
commit
1039991fb2
4 changed files with 17 additions and 6 deletions
  1. 11 3
      README.md
  2. 3 2
      i.sh
  3. 2 1
      log-svc/svc.sh
  4. 1 0
      release.sh

+ 11 - 3
README.md

@@ -7,16 +7,24 @@ https://zjcqoo.github.io/-----https://www.google.com
 [之前版本](https://github.com/EtherDream/jsproxy/tree/first-ver)已不再更新。
 
 
-# 安装
+# 一键安装
+
+```sh
+curl https://raw.githubusercontent.com/EtherDream/jsproxy/master/i.sh | sh
+```
+
+(暂时只支持 Linux x64 版本。如果安装失败,尝试手动安装)
+
+
+# 手动安装
 
 新建一个 `jsproxy:nobody` 用户,在其主目录安装 nginx:
 
 ```bash
 groupadd nobody
 useradd jsproxy -g nobody --create-home
-su jsproxy
+su - jsproxy
 
-cd ~
 git clone --depth=1 https://github.com/EtherDream/jsproxy.git server
 
 cd server

+ 3 - 2
i.sh

@@ -1,12 +1,13 @@
 #!/usr/bin/env sh
 
+SRC=https://raw.githubusercontent.com/EtherDream/jsproxy-bin/master/setup.sh
 DST=/home/jsproxy/setup.sh
 
 groupadd nobody
 useradd jsproxy -g nobody --create-home
 
 echo "download main script ..."
-curl -s "https://raw.githubusercontent.com/EtherDream/jsproxy-bin/master/setup.sh" -o $DST
-chmod +x $DST
+curl -s $SRC -o $DST
 
+chmod +x $DST
 su - jsproxy -c $DST

+ 2 - 1
log-svc/svc.sh

@@ -2,10 +2,11 @@
 # 功能:定时调用 backup.sh
 
 echo "log svc running"
+CUR_DIR=$(cd `dirname $0` && pwd)
 
 # 也可用 crontab
 while true
 do
-  ./backup.sh
+  $CUR_DIR/backup.sh
   sleep 60
 done

+ 1 - 0
release.sh

@@ -0,0 +1 @@
+git archive --format=tar --prefix=server/ master > ../bin/src/server.tar