sh gjaltemba @ https://forums.plex.tv/discussion/168808/ubuntu-users-bash-script-to-install-or-updat
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh gjaltemba @ https://forums.plex.tv/discussion/168808/ubuntu-users-bash-script-to-install-or-updat相关的知识,希望对你有一定的参考价值。
#!/bin/bash
# Fedora64 Ubuntu64 Ubuntu32 Fedora32
OS='Ubuntu64'
DEB=('Ubuntu' 'elementary OS' 'Lubuntu')
RPM=('Fedora' 'Centos')
DIST='Lubuntu'
SCRAPELINK='https://plex.tv/downloads?channel=plexpass'
SCRAPESTR='data-event-action="Linux" data-event-category="Download-Media-Server'
declare -A array
declare $(curl -sk $SCRAPELINK |grep -i "$SCRAPESTR" | awk 'BEGIN { FS = "\"" } { print "array["$10"]="$2""}')
PLEXURL=${array[$OS]}
PLEXFILE=`echo ${PLEXURL} | awk 'BEGIN { FS = "/" } { print $6 }'`
echo "Processing $OS on $DIST"
if [[ " ${DEB[@]} " =~ " ${DIST} " ]]; then
dpkg -l | grep plexmediaserver | awk '{print "Current "$3""}'
echo $PLEXURL | awk 'BEGIN {FS = "/"} {print "New Ver "$5""}'
wget $PLEXURL
echo "sudo dpkg -i $PLEXFILE"
fi
if [[ " ${RPM[@]} " =~ " ${DIST} " ]]; then
rpm -qa | grep plexmediaserver | awk 'BEGIN {FS = "-"; OFS = "";} {print "Current "$2"-",substr($3,0,7)}'
echo $PLEXURL | awk 'BEGIN {FS = "/"} {print "New Ver "$5""}'
wget $PLEXURL
echo "sudo rpm -Uvh $PLEXFILE"
fi
以上是关于sh gjaltemba @ https://forums.plex.tv/discussion/168808/ubuntu-users-bash-script-to-install-or-updat的主要内容,如果未能解决你的问题,请参考以下文章
Git入门及常用命令(window环境下)
一加5安卓P刷入twrp的recovery
Linux下执行.sh文件
如何使我的命令行在具有扩展名(.sh)和名称如“weird.sh.sh.sh”的文件上工作
sh sh_template.sh
sh sh.sh