From b7500369d7c7b0ad13f02b95a6e9c9b9b4106bfa Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 25 Nov 2016 20:14:54 +0800 Subject: [PATCH] update quick-install scripts for debian/raspbian --- README-zh.md | 19 ++++++++++--------- README.md | 26 ++++++++++++++++++-------- aria2.service | 2 +- quick-install.sh | 26 +++++++++++++++----------- 4 files changed, 44 insertions(+), 29 deletions(-) diff --git a/README-zh.md b/README-zh.md index 5534d73..46c6d4a 100644 --- a/README-zh.md +++ b/README-zh.md @@ -20,12 +20,20 @@ - 播放在线视频(mpv) - 更多 +## Quick Install (Debian/Raspbian) + +(将会安装配置 `aria2`, `diana`, `youtube-dl`, 如你已安装 `aria2` 请对照下面的 `安装`部分安装本脚本) + +```bash +/bin/bash -c "$(curl -sL https://git.io/vXy3m)" +``` + ## 安装 安装 `subprocess32` 模块 ```bash -sudo apt-get install python-dev +sudo apt-get install python-dev python-pillow ``` ```bash @@ -35,14 +43,7 @@ sudo pip install subprocess32 下载 `itchat` 框架 ```bash -git clone https://github.com/littlecodersh/ItChat -``` - -然后 `cd` 到目录内, 并下载脚本 - -```bash -cd ItChat -``` +sudo pip install itchat``` ```bash wget https://raw.githubusercontent.com/yangxuan8282/wechat-remote/master/wechat_remote.py diff --git a/README.md b/README.md index 130b89f..6c32ce1 100644 --- a/README.md +++ b/README.md @@ -17,26 +17,28 @@ This [page](https://github.com/herrbischoff/awesome-command-line-apps) can give - cast online video - & more -## How to install +## Quick install (Debian/Raspbian) -You should get itchat first: +(This will install and configure `aria2`, `youtube-dl`, `diana`, if you have installed the `aria2` package, please check `How to install` section.) ```bash -git clone https://github.com/littlecodersh/ItChat +/bin/bash -c "$(curl -sL https://git.io/vXy3m)" ``` -then `cd` into the folder, and download the scripts +## How to install + +You should get itchat first: ```bash -cd ItChat +sudo apt-get install python-dev python-pillow ``` -install `subprocess32`: - ```bash -sudo apt-get install python-dev +sudo pip install itchat ``` +install `subprocess32`: + ```bash sudo pip install subprocess32 ``` @@ -87,6 +89,14 @@ cd ~ git clone https://github.com/baskerville/diana ``` +```bash +cd diana +``` + +```bash +sudo cp dad diana /usr/bin +``` + start: ```bash diff --git a/aria2.service b/aria2.service index 9e3363c..87b91de 100644 --- a/aria2.service +++ b/aria2.service @@ -3,7 +3,7 @@ Description=Aria2 Service After=network.target [Service] -ExecStart=/usr/bin/aria2c --enable-rpc --rpc-listen-all --rpc-allow-origin-all --save-session %h/.config/aria2/session.lock --input-file %h/.config/aria2/session.lock --conf-path=%h/.config/aria2/aria2.conf +ExecStart=/usr/bin/aria2c --enable-rpc --rpc-listen-all --rpc-allow-origin-all --conf-path=/etc/aria2.conf [Install] WantedBy=default.target diff --git a/quick-install.sh b/quick-install.sh index d8f358d..728993b 100644 --- a/quick-install.sh +++ b/quick-install.sh @@ -5,16 +5,20 @@ if ! [[ -f /usr/bin/wechat-remote ]]; then git clone https://github.com/baskerville/diana /tmp/diana sudo pip install itchat sudo pip install subprocess32 - sudo cp /tmp/diana/diana /usr/bin - sudo cp /tmp/diana/dad /usr/bin - sudo chmod 755 /usr/bin/dad /usr/bin/diana - mkdir -p $HOME/.config/aria2 - cp aria2.conf $HOME/.config/aria2/aria2.conf - touch $HOME/.config/aria2/session.lock - sudo cp aria2.service /etc/systemd/user - systemctl --user start aria2 - systemctl --user enable aria2 + sudo install -Dm 755 /tmp/diana/dad /tmp/diana/diana /usr/bin + sudo cp /tmp/wechat-remote/aria2.conf /etc/aria2.conf + echo "Enter the aria2 download directory (full path) and press [ENTER]: " + read dir + sudo sed -i -e "s|dir=\$HOME|dir=$dir|g" /etc/aria2.conf + sudo sed -i -e "s|input-file=.*|input-file=/var/aria2/session.lock|g" /etc/aria2.conf + sudo sed -i -e "s|save-session=.*|input-file=/var/aria2/session.lock|g" /etc/aria2.conf + sudo mkdir -p /var/aria2 + sudo touch /var/aria2/session.lock + sudo cp /tmp/wechat-remote/aria2.service /etc/systemd/system + sudo systemctl daemon-reload + sudo systemctl enable aria2 + sudo systemctl start aria2 + sudo systemctl status aria2 dad start - sudo cp /tmp/wechat-remote/wechat_remote.py /usr/bin/wechat-remote - sudo chmod 755 /usr/bin/wechat-remote + sudo install -Dm 755 /tmp/wechat-remote/wechat_remote.py /usr/bin/wechat-remote fi