|
1 | 1 | #!/usr/bin/env bash |
2 | 2 | set -e |
3 | 3 | echo "How do you want to install Smartwatts ?"; |
4 | | -echo "1) pip 2) docker 3) deb"; |
| 4 | +echo "1) pip 2) docker"; |
5 | 5 | read; |
6 | 6 | VAR=${REPLY:-2} |
7 | 7 | echo "Installing Smartwatts..." |
8 | 8 | case $VAR in |
9 | 9 | 1) pip install smartwatts;; |
10 | 10 | 2) docker pull powerapi/smartwatts-formula;; |
11 | | - 3) echo "Getting Smartwatts..."; |
12 | | - curl -s https://api.github.com/repos/powerapi-ng/smartwatts-formula/releases/latest | grep "browser_download_url.*deb" | cut -d : -f 2,3 | tr -d \" | wget -qi -; |
13 | | - echo "Smartwatts downloaded"; |
14 | | - echo "Building..."; |
15 | | - sudo apt install ./python3-smartwatts_*-1_all.deb || rm python3-smartwatts_*-1_all.deb ;; |
16 | 11 | *) echo "Not a valid choice. Installation aborted"; exit 0;; |
17 | 12 | esac |
18 | 13 | echo "Smartwatts Installed" |
19 | 14 | echo "Installing the sensor..." |
20 | 15 | echo "How do you want to install the sensor (HWPC)" |
21 | | -echo "1) docker 2) deb 3) binary"; |
| 16 | +echo "1) docker"; |
22 | 17 | read; |
23 | 18 | VAR=${REPLY:-1} |
24 | 19 | echo "Installing Sensor..." |
25 | 20 | case $VAR in |
26 | 21 | 1) docker pull powerapi/hwpc-sensor;; |
27 | | - 2) echo "Getting HWPC Sensor..."; |
28 | | - curl -s https://api.github.com/repos/powerapi-ng/hwpc-sensor/releases/latest | grep "browser_download_url.*deb" | cut -d : -f 2,3 | tr -d \" | wget -qi -; |
29 | | - echo "HWPC Sensor downloaded"; |
30 | | - echo "Building..."; |
31 | | - sudo apt install ./hwpc-sensor-*.deb || rm hwpc-sensor-*.deb;; |
32 | | - 3)curl -s https://api.github.com/repos/powerapi-ng/hwpc-sensor/releases/latest | grep "browser_download_url*" | grep --invert-match ".deb" | cut -d : -f 2,3 | tr -d \" | wget -qi -;; |
33 | 22 | *) echo "Not a valid choice. Installation aborted"; exit 0;; |
34 | 23 | esac |
35 | 24 | echo "Sensor Installed" |
0 commit comments