From 91e99a66b53fa9eb8231be18c2d15f299931c631 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 20 Apr 2023 12:12:42 +0200 Subject: [PATCH] Add install-evcc.ps1 --- Scripts/install-evcc.ps1 | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 Scripts/install-evcc.ps1 diff --git a/Scripts/install-evcc.ps1 b/Scripts/install-evcc.ps1 new file mode 100755 index 00000000..5a42819e --- /dev/null +++ b/Scripts/install-evcc.ps1 @@ -0,0 +1,41 @@ +<# +.SYNOPSIS + Installs evcc +.DESCRIPTION + This PowerShell script installs evcc. +.EXAMPLE + PS> ./install-evcc +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + $StopWatch = [system.diagnostics.stopwatch]::startNew() + + "⏳ (1/6) Installing necessary packets..." + & sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl + + "⏳ (2/6) Installing keyring for evcc..." + & curl -1sLf 'https://dl.cloudsmith.io/public/evcc/stable/setup.deb.sh' | sudo -E bash + + "⏳ (3/6) Updating packet list...." + & sudo apt update + + "⏳ (4/6) Installing evcc packet..." + & sudo apt install -y evcc + + "⏳ (5/6) Configuring evcc..." + & evcc configure + + "⏳ (6/6) Starting evcc Web server on :7070 as system service..." + & sudo systemctl start evcc + + [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds + "✔️ evcc installed successfully in $Elapsed sec" + exit 0 # success +} catch { + "Sorry: $($Error[0])" + exit 1 +}