mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-19 00:46:30 +02:00
Updated the Markdown manuals
This commit is contained in:
@@ -88,37 +88,35 @@ Script Content
|
||||
param([int]$port = 8099, [string]$mediaFolder = "$HOME/Calibre Library", [string]$userDB = "$HOME/CalibreUsers.sqlite", [string]$logfile = "$HOME/CalibreServer.log")
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
if (-not $IsLinux) { throw "Sorry, currently only supported on Linux" }
|
||||
|
||||
"⏳ (1/5) Updating package infos..."
|
||||
& sudo apt update -y
|
||||
if ($lastExitCode -ne "0") { throw "'apt update' failed" }
|
||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
"⏳ (2/5) Installing Calibre..."
|
||||
& sudo apt install calibre -y
|
||||
if ($lastExitCode -ne "0") { throw "'apt install calibre' failed" }
|
||||
"⏳ (1/5) Updating package infos..."
|
||||
& sudo apt update -y
|
||||
if ($lastExitCode -ne "0") { throw "'apt update' failed" }
|
||||
|
||||
"⏳ (3/5) Searching for Calibre server executable..."
|
||||
& calibre-server --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'calibre-server' - make sure Calibre server is installed and available" }
|
||||
"⏳ (2/5) Installing Calibre package..."
|
||||
& sudo apt install calibre -y
|
||||
if ($lastExitCode -ne "0") { throw "'apt install calibre' failed" }
|
||||
|
||||
"⏳ (4/5) Creating media folder at: $mediaFolder ... (if non-existent)"
|
||||
mkdir $mediaFolder
|
||||
Write-Host "⏳ (3/5) Searching for Calibre server executable... " -noNewline
|
||||
& calibre-server --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'calibre-server' - make sure Calibre server is installed and available" }
|
||||
|
||||
"⏳ (5/5) Starting Calibre server as background process..."
|
||||
& calibre-server --port $port --num-per-page 100 --userdb $userDB --log $logfile --daemonize $HOME/'Calibre Library'
|
||||
"⏳ (4/5) Creating media folder at: $mediaFolder ... (if non-existent)"
|
||||
mkdir $mediaFolder
|
||||
|
||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||
"✔️ Installed Calibre server on Web port $port in $elapsed sec (media folder: $mediaFolder, user database: $userDB, log file: $logfile)"
|
||||
exit 0 # success
|
||||
} else {
|
||||
throw "Currently only supported on Linux"
|
||||
}
|
||||
"⏳ (5/5) Starting Calibre server as background process..."
|
||||
& calibre-server --port $port --num-per-page 100 --userdb $userDB --log $logfile --daemonize $HOME/'Calibre Library'
|
||||
|
||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||
"✔️ Installed Calibre server on port $port in $($elapsed)s (media at: $mediaFolder, user DB: $userDB, log to: $logfile)"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of install-calibre-server.ps1 as of 03/27/2024 17:36:26)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of install-calibre-server.ps1 as of 05/19/2024 10:25:20)*
|
||||
|
Reference in New Issue
Block a user