Skip to content

Commit ee3cff5

Browse files
committed
refactor: Clean smartwatts_install sh file
1 parent d394edb commit ee3cff5

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

docs/script/smartwatts_install.sh

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
11
#!/usr/bin/env bash
22
set -e
33
echo "How do you want to install Smartwatts ?";
4-
echo "1) pip 2) docker 3) deb";
4+
echo "1) pip 2) docker";
55
read;
66
VAR=${REPLY:-2}
77
echo "Installing Smartwatts..."
88
case $VAR in
99
1) pip install smartwatts;;
1010
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 ;;
1611
*) echo "Not a valid choice. Installation aborted"; exit 0;;
1712
esac
1813
echo "Smartwatts Installed"
1914
echo "Installing the sensor..."
2015
echo "How do you want to install the sensor (HWPC)"
21-
echo "1) docker 2) deb 3) binary";
16+
echo "1) docker";
2217
read;
2318
VAR=${REPLY:-1}
2419
echo "Installing Sensor..."
2520
case $VAR in
2621
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 -;;
3322
*) echo "Not a valid choice. Installation aborted"; exit 0;;
3423
esac
3524
echo "Sensor Installed"

0 commit comments

Comments
 (0)