mirror of
https://github.com/tteck/Proxmox.git
synced 2024-12-02 02:53:58 +01:00
Update and rename stirlingpdf.sh to stirling-pdf.sh
- Rename sh file - Switch update from git to relaese
This commit is contained in:
parent
e1247b6d0b
commit
95a9467ff1
@ -18,7 +18,7 @@ EOF
|
|||||||
}
|
}
|
||||||
header_info
|
header_info
|
||||||
echo -e "Loading..."
|
echo -e "Loading..."
|
||||||
APP="StirlingPDF"
|
APP="Stirling-PDF"
|
||||||
var_disk="8"
|
var_disk="8"
|
||||||
var_cpu="2"
|
var_cpu="2"
|
||||||
var_ram="2048"
|
var_ram="2048"
|
||||||
@ -55,19 +55,20 @@ header_info
|
|||||||
if [[ ! -d /opt/Stirling-PDF ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
if [[ ! -d /opt/Stirling-PDF ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||||
msg_info "Updating ${APP}"
|
msg_info "Updating ${APP}"
|
||||||
systemctl stop stirlingpdf
|
systemctl stop stirlingpdf
|
||||||
git clone https://github.com/Stirling-Tools/Stirling-PDF.git
|
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) }')
|
||||||
cd Stirling-PDF
|
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
|
chmod +x ./gradlew
|
||||||
./gradlew build
|
./gradlew build &>/dev/null
|
||||||
cp -r ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/
|
cp -r ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/
|
||||||
cp -r scripts /opt/Stirling-PDF/
|
cp -r scripts /opt/Stirling-PDF/
|
||||||
cd ~
|
cd ~
|
||||||
rm -rf Stirling-PDF
|
rm -rf Stirling-PDF-$RELEASE v$RELEASE.tar.gz
|
||||||
latest_version=$(ls -1 /opt/Stirling-PDF/Stirling-PDF-*.jar | sort -V | tail -n 1)
|
latest_version=$(ls -1 /opt/Stirling-PDF/Stirling-PDF-*.jar | sort -V | tail -n 1)
|
||||||
ln -sf "$latest_version" /opt/Stirling-PDF/Stirling-PDF.jar
|
ln -sf "$latest_version" /opt/Stirling-PDF/Stirling-PDF.jar
|
||||||
new_version=$(echo "$latest_version" | grep -oP '(?<=Stirling-PDF-)\d+(\.\d+)+(?=\.jar)')
|
|
||||||
systemctl start stirlingpdf
|
systemctl start stirlingpdf
|
||||||
msg_ok "Updated ${APP} to v$new_version"
|
msg_ok "Updated ${APP} to v$RELEASE"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user