mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-25 19:38:17 +02:00
Add install-signal-cli.ps1
This commit is contained in:
parent
f036207cc9
commit
708d3c3998
@ -74,6 +74,7 @@ generate-qrcode.ps1, generates a QR code
|
|||||||
hibernate.ps1, enables hibernate mode for the local computer (needs admin rights)
|
hibernate.ps1, enables hibernate mode for the local computer (needs admin rights)
|
||||||
inspect-exe.ps1, prints basic information of the given executable file
|
inspect-exe.ps1, prints basic information of the given executable file
|
||||||
install-google-chrome.ps1, installs the Google Chrome browser
|
install-google-chrome.ps1, installs the Google Chrome browser
|
||||||
|
install-signal-cli.ps1, installs signal-cli from github.com/AsamK/signal-cli
|
||||||
introduce-powershell.ps1, introduces PowerShell to new users
|
introduce-powershell.ps1, introduces PowerShell to new users
|
||||||
list-aliases.ps1, lists all PowerShell aliases
|
list-aliases.ps1, lists all PowerShell aliases
|
||||||
list-anagrams.ps1, lists all anagrams of the given word
|
list-anagrams.ps1, lists all anagrams of the given word
|
||||||
|
|
@ -48,6 +48,7 @@ Mega Collection of PowerShell Scripts
|
|||||||
* [enable-ssh-server.ps1](Scripts/enable-ssh-server.ps1) - enables the SSH server (needs admin rights)
|
* [enable-ssh-server.ps1](Scripts/enable-ssh-server.ps1) - enables the SSH server (needs admin rights)
|
||||||
* [hibernate.ps1](Scripts/hibernate.ps1) - enables hibernate mode for the local computer (needs admin rights)
|
* [hibernate.ps1](Scripts/hibernate.ps1) - enables hibernate mode for the local computer (needs admin rights)
|
||||||
* [install-google-chrome.ps1](Scripts/install-google-chrome.ps1) - installs the Google Chrome browser
|
* [install-google-chrome.ps1](Scripts/install-google-chrome.ps1) - installs the Google Chrome browser
|
||||||
|
* [install-signal-cli.ps1](Scripts/install-signal-cli.ps1) - installs signal-cli from github.com/AsamK/signal-cli
|
||||||
* [list-drives.ps1](Scripts/list-drives.ps1) - lists all drives
|
* [list-drives.ps1](Scripts/list-drives.ps1) - lists all drives
|
||||||
* [list-network-shares.ps1](Scripts/list-network-shares.ps1) - lists the network shares of the local computer
|
* [list-network-shares.ps1](Scripts/list-network-shares.ps1) - lists the network shares of the local computer
|
||||||
* [list-installed-apps.ps1](Scripts/list-installed-apps.ps1) - lists the installed Windows Store apps
|
* [list-installed-apps.ps1](Scripts/list-installed-apps.ps1) - lists the installed Windows Store apps
|
||||||
|
34
Scripts/install-signal-cli.ps1
Executable file
34
Scripts/install-signal-cli.ps1
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
<#
|
||||||
|
.SYNTAX install-signal-cli.ps1 [<version>]
|
||||||
|
.DESCRIPTION installs signal-cli from github.com/AsamK/signal-cli
|
||||||
|
.LINK https://github.com/fleschutz/PowerShell
|
||||||
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
|
#>
|
||||||
|
|
||||||
|
param($Version = "")
|
||||||
|
if ($Version -eq "") { $Version = read-host "Enter version to install (see https://github.com/AsamK/signal-cli)" }
|
||||||
|
|
||||||
|
try {
|
||||||
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
|
set-location /tmp
|
||||||
|
|
||||||
|
& wget --version
|
||||||
|
if ($lastExitCode -ne "0") { throw "Can't execute 'wget' - make sure wget is installed and available" }
|
||||||
|
|
||||||
|
& wget "https://github.com/AsamK/signal-cli/releases/download/v$Version/signal-cli-$($Version).tar.gz"
|
||||||
|
if ($lastExitCode -ne "0") { throw "'wget' failed" }
|
||||||
|
|
||||||
|
sudo tar xf "signal-cli-$Version.tar.gz" -C /opt
|
||||||
|
if ($lastExitCode -ne "0") { throw "'sudo tar xf' failed" }
|
||||||
|
|
||||||
|
sudo ln -sf "/opt/signal-cli-$Version)/bin/signal-cli" /usr/local/bin/
|
||||||
|
if ($lastExitCode -ne "0") { throw "'sudo ln -sf' failed" }
|
||||||
|
|
||||||
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
|
"✔️ installed signal-cli $Version to /opt and /usr/local/bin in $Elapsed sec"
|
||||||
|
exit 0
|
||||||
|
} catch {
|
||||||
|
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user