1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 11:12:06 +00:00

iiab-update: Tighten up Calibre-Web upgrader (WIP: Ansible equiv soon)

This commit is contained in:
root 2024-07-20 11:52:53 -04:00
parent dbce29b24e
commit 06a36706eb

View file

@ -52,24 +52,25 @@
fi
if grep -q 'calibreweb_installed: True' /etc/iiab/iiab_state.yml; then
echo -e "\e[4mNow running: pipx uninstall xklb # THIS ALSO UNINSTALLS yt-dlp\e[0m\n"
pipx uninstall xklb
echo -e "\n\e[4mNow running: pipx install xklb # THIS ALSO INSTALLS yt-dlp\e[0m\n"
pipx install xklb
# IF YOU WANT THE "nightly" RELEASE OF yt-dlp, UNCOMMENT THE NEXT LINE:
# pipx inject --pip-args="--upgrade --pre" -f xklb yt-dlp[default]
echo -e "\n\e[4mNow running: yt-dlp --version\e[0m\n"
yt-dlp --version
cd /usr/local/calibre-web-py3
if [[ $(git branch --show-current) != "master" || $(git status --porcelain --untracked-files=no) != "" ]]; then # Permit venv detritus, e.g. untracked files like these 5: bin/ include/ lib/ lib64 pyvenv.cfg
echo -e "\n\n\e[41;1mIn /usr/local/calibre-web-py3, (1) 'git branch' MUST show current branch 'master' and (2) 'git status' must show NO MODIFIED FILES.\e[0m\n\n"
exit 1
fi
echo -e "\n\e[4mNow running: systemctl stop calibre-web\e[0m\n"
systemctl stop calibre-web
echo -e "\e[4mNow running: git pull https://github.com/iiab/calibre-web --no-rebase --no-edit\e[0m\n"
git pull https://github.com/iiab/calibre-web --no-rebase --no-edit
if [[ $1 == "-f" || $1 == "--fast" ]]; then
echo -e "\e[4mNow running: pipx uninstall xklb # THIS ALSO UNINSTALLS yt-dlp\e[0m\n"
pipx uninstall xklb
echo -e "\n\e[4mNow running: pipx install xklb # THIS ALSO INSTALLS yt-dlp\e[0m\n"
pipx install xklb
echo -e "\n\e[4mNow running: yt-dlp --version\e[0m\n"
yt-dlp --version
echo -e '\n\e[4mNeed better YouTube scraping? Run this for the latest yt-dlp "nightly" release:\e[0m\n\n\e[1mpipx inject --pip-args="--upgrade --pre" -f xklb yt-dlp[default]\e[0m\n'
# IF YOU WANT THE "nightly" RELEASE OF yt-dlp, UNCOMMENT THE NEXT LINE:
# pipx inject --pip-args="--upgrade --pre" -f xklb yt-dlp[default]
cd /usr/local/calibre-web-py3
if [[ $(git branch --show-current) != "master" || $(git status --porcelain --untracked-files=no) != "" ]]; then # Permit venv detritus, e.g. untracked files like these 5: bin/ include/ lib/ lib64 pyvenv.cfg
echo -e "\n\e[41;1mIn /usr/local/calibre-web-py3, (1) 'git branch' MUST show current branch 'master' and (2) 'git status' must show NO MODIFIED FILES.\e[0m\n\n"
exit 1
fi
echo -e "\e[4mNow running: systemctl stop calibre-web\e[0m\n"
systemctl stop calibre-web
echo -e "\e[4mNow running: git pull https://github.com/iiab/calibre-web --no-rebase --no-edit\e[0m\n"
git pull https://github.com/iiab/calibre-web --no-rebase --no-edit
echo -e "\n\e[4mNow running: bin/pip install -r requirements.txt --prefer-binary\e[0m\n"
bin/pip install -r requirements.txt --prefer-binary > /dev/null
echo -e "\e[4mNow running: systemctl restart calibre-web\e[0m\n"