From aad569dc0d652223412a66623378548af7d681e4 Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 8 Jan 2024 08:02:34 -0500 Subject: [PATCH] Update and rename stirlingpdf-install.sh to stirling-pdf-install.sh - Rename stirlingpdf-install.sh to stirling-pdf-install.sh - Switch from git to release for install --- ...stirlingpdf-install.sh => stirling-pdf-install.sh} | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename install/{stirlingpdf-install.sh => stirling-pdf-install.sh} (86%) diff --git a/install/stirlingpdf-install.sh b/install/stirling-pdf-install.sh similarity index 86% rename from install/stirlingpdf-install.sh rename to install/stirling-pdf-install.sh index a99bf679..353d8269 100644 --- a/install/stirlingpdf-install.sh +++ b/install/stirling-pdf-install.sh @@ -72,8 +72,10 @@ $STD apt-get install -y 'tesseract-ocr-*' msg_ok "Installed Language Packs" msg_info "Installing Stirling-PDF (Additional Patience)" -$STD git clone https://github.com/Stirling-Tools/Stirling-PDF.git -cd Stirling-PDF +RELEASE=$(curl -s https://api.github.com/repos/Stirling-Tools/Stirling-PDF/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +wget -q https://github.com/Stirling-Tools/Stirling-PDF/archive/refs/tags/v$RELEASE.tar.gz +tar -xzf v$RELEASE.tar.gz +cd Stirling-PDF-$RELEASE chmod +x ./gradlew $STD ./gradlew build mkdir -p /opt/Stirling-PDF @@ -82,8 +84,7 @@ mv ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/ mv scripts /opt/Stirling-PDF/ latest_version=$(ls -1 /opt/Stirling-PDF/Stirling-PDF-*.jar | sort -V | tail -n 1) ln -s "$latest_version" /opt/Stirling-PDF/Stirling-PDF.jar -current_version=$(echo "$latest_version" | grep -oP '(?<=Stirling-PDF-)\d+(\.\d+)+(?=\.jar)') -msg_ok "Installed Stirling-PDF v$current_version" +msg_ok "Installed Stirling-PDF v$RELEASE" msg_info "Creating Service" cat </etc/systemd/system/stirlingpdf.service @@ -113,7 +114,7 @@ motd_ssh customize msg_info "Cleaning up" -rm -rf /zulu-repo_1.0.0-3_all.deb +rm -rf v$RELEASE.tar.gz /zulu-repo_1.0.0-3_all.deb $STD apt-get autoremove $STD apt-get autoclean msg_ok "Cleaned"