From d9c4c6d2f243f6cd2c2eae145abd71c6a50cd0ca Mon Sep 17 00:00:00 2001 From: Piotr Machowski Date: Mon, 14 Jun 2021 04:12:05 +0200 Subject: [PATCH] Adjust to run a released version --- README.md | 35 +++++++++++++---------------------- run.sh | 9 +++++++++ run_docker.sh | 10 ++++++++++ 3 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 run.sh create mode 100644 run_docker.sh diff --git a/README.md b/README.md index 489c4a6..eb81a9c 100644 --- a/README.md +++ b/README.md @@ -12,43 +12,34 @@ You will need to provide Xiaomi Home credentials (_not ones from Roborock app_): In return all of your devices connected to account will be listed, together with their name and IP address. ## Windows -Download and run [token_extractor.exe](https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/raw/master/token_extractor.exe). +Download and run [token_extractor.exe](https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/releases/latest/download/token_extractor.exe). -## Home Assistant - [SSH & Web Terminal](https://github.com/hassio-addons/addon-ssh) +## Linux & Home Assistant (in [SSH & Web Terminal](https://github.com/hassio-addons/addon-ssh)) -Download and run script: +Execute following command: ```bash -wget https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/raw/master/token_extractor.py -python3 token_extractor.py +bash <(curl -L https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/raw/master/run.sh) ``` ## Docker -Clone this repository: -```bash -git clone https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor.git -``` - -Go to cloned directory: -```bash -cd Xiaomi-cloud-tokens-extractor -``` - -Build and run script using docker: +Execute following command: ```bash -docker run --rm -it $(docker build -q .) +bash <(curl -L https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/raw/master/run_docker.sh) ``` -## Other platforms +## Manual run in python -Install dependencies: +Download and unpack archive: ```bash -pip3 install requests +wget https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/releases/latest/download/token_extractor.zip +unzip token_extractor.zip +cd token_extractor ``` -Download and run script: +Install dependencies and run script: ```bash -wget https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/raw/master/token_extractor.py +pip3 install -r requirements.txt python3 token_extractor.py ``` diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..495954f --- /dev/null +++ b/run.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +wget https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/releases/latest/download/token_extractor.zip +unzip token_extractor.zip +cd token_extractor +pip3 install -r requirements.txt +python3 token_extractor.py +cd .. +rm -rf token_extractor diff --git a/run_docker.sh b/run_docker.sh new file mode 100644 index 0000000..88a2add --- /dev/null +++ b/run_docker.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +wget https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/releases/latest/download/token_extractor_docker.zip +unzip token_extractor_docker.zip +cd token_extractor_docker +docker_image=$(docker build -q .) +docker run --rm -rf $docker_image +docker rmi $docker_image +cd .. +rm -rf token_extractor_docker