Skip to content

Instantly share code, notes, and snippets.

@Drewster727
Drewster727 / plexupdate.sh
Created January 31, 2021 18:54
Obtain & Install Latest Public Plex Media Server (Debian)
#!/bin/bash
VERSIONS_URL=https://plex.tv/api/downloads/5.json
LATEST_VERSION=$(curl -s $VERSIONS_URL | jq -r '.computer.Linux.version')
OS_LABEL="Ubuntu (16.04+) / Debian (8+) - Intel/AMD 64-bit"
DOWNLOAD_URL=$(curl -s $VERSIONS_URL | jq -r --arg OS_LABEL "$OS_LABEL" '.computer.Linux.releases[] | select(.label==$OS_LABEL).url')
FILE_NAME=$(echo ${DOWNLOAD_URL##*/})
echo "[DOWNLOAD] $DOWNLOAD_URL"
wget $DOWNLOAD_URL
// show disk usage
du -h * | sort -h
du -h --max-depth=1 . | sort -h -r
tree -L 3 --du -h -D
// show deleted files
lsof | grep deleted
// show drive info
lsblk
#!/usr/bin/env python
from plexapi.server import PlexServer
from plexapi.server import CONFIG
import requests
import argparse
import time
import os
# Using CONFIG file
PLEX_URL = ''