mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-25 18:40:06 -04:00
Creating script which updates yt-dlp in the wrolpi venv to the latest available.
This commit is contained in:
parent
f7bcf29cce
commit
036b12382e
1 changed files with 20 additions and 0 deletions
20
scripts/upgrade_yt-dlp.sh
Executable file
20
scripts/upgrade_yt-dlp.sh
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# Re-execute this script if it wasn't called with sudo.
|
||||
if [ "$(whoami)" != "wrolpi" ]; then
|
||||
sudo -u wrolpi "$0" "$@"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
. /opt/wrolpi/venv/bin/activate
|
||||
if pip install --upgrade yt-dlp | grep -q "Successfully installed"; then
|
||||
echo "yt-dlp was upgraded."
|
||||
echo "You must restart the API:"
|
||||
echo " sudo systemctl restart wrolpi-api"
|
||||
exit 0
|
||||
else
|
||||
echo "yt-dlp is already up to date"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue