Code:
root@truenas[~]# iocage pkg PlexMediaServer lock plexmediaserver
pkg: warning: database version 36 is newer than libpkg(3) version 35, but stillcompatible
plexmediaserver-1.32.4.7195: already locked
plexmediaserver-1.32.4.7195: already locked
root@truenas[~]# iocage exec PlexMediaServer "fetch -o /usr/local/etc/ https://github.com/mstinaff/PMS_Updater/blob/master/PMS_Updater.sh"
/usr/local/etc//PMS_Updater.sh 42 kB 1212 kBps 00s
root@truenas[~]# iocage exec PlexMediaServer "chmod +x /usr/local/etc/PMS_Updater.sh"
root@truenas[~]# iocage exec PlexMediaServer "/usr/local/etc/PMS_Updater.sh -a -v"
sed: "": No such file or directory
usage: basename string [suffix]
basename [-a] [-s suffix] string [...]
/usr/local/etc/PMS_Updater.sh: verNum: not found
/usr/local/etc/PMS_Updater.sh: verNum: not found
/usr/local/etc/PMS_Updater.sh: //Plex\: not found
usage: fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [--bind-address=host]
[--ca-cert=file] [--ca-path=dir] [--cert=file] [--crl=file]
[-i file] [--key=file] [-N file] [--no-passive] [--no-proxy=list]
[--no-sslv3] [--no-tlsv1] [--no-verify-hostname] [--no-verify-peer]
[-o file] [--referer=URL] [-S bytes] [-T seconds]
[--user-agent=agent-string] [-w seconds] URL ...
fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [--bind-address=host]
[--ca-cert=file] [--ca-path=dir] [--cert=file] [--crl=file]
[-i file] [--key=file] [-N file] [--no-passive] [--no-proxy=list]
[--no-sslv3] [--no-tlsv1] [--no-verify-hostname] [--no-verify-peer]
[-o file] [--referer=URL] [-S bytes] [-T seconds]
[--user-agent=agent-string] [-w seconds] -h host -f file [-c dir]
/usr/local/etc/PMS_Updater.sh: //Plex Media Server: not found
usage: basename string [suffix]
basename [-a] [-s suffix] string [...]
/usr/local/etc/PMS_Updater.sh: verNum: not found
/usr/local/etc/PMS_Updater.sh: verNum: not found
usage: basename string [suffix]
basename [-a] [-s suffix] string [...]
usage: basename string [suffix]
basename [-a] [-s suffix] string [...]
/usr/local/etc/PMS_Updater.sh: verNum: not found
/usr/local/etc/PMS_Updater.sh: verNum: not found
/usr/local/etc/PMS_Updater.sh: {payload:{allShortcutsEnabled:false,fileTree:{:{items:[{name:LICENSE,path:LICENSE,contentType:file},{name:PMS_Updater.sh,path:PMS_Updater.sh,contentType:file},{name:README.md,path:README.md,contentType:file}],totalCount:3}},fileTreeProcessingTime:2.2733060000000003,foldersToFetch:[],reducedMotionEnabled:null,repo:{id:18883421,defaultBranch:master,name:PMS_Updater,ownerLogin:mstinaff,currentUserCanPush:false,isFork:false,isEmpty:false,createdAt:2014-04-17T15:31:38.000Z,ownerAvatar:https://avatars.githubusercontent.com/u/4060893?v=4,public:true,private:false,isOrgOwned:false},symbolsExpanded:false,treeExpanded:true,refInfo:{name:master,listCacheKey:v0:1613516581.695437,canEdit:false,refType:branch,currentOid:b59272d6a6c282e33db80d15a2ecdce65599b1e0},path:PMS_Updater.sh,currentUser:null,blob:{rawLines:[#!/bin/sh,,AUTOUPDATE=1,FORCEUPDATE=0,VERBOSE=1,REMOVE=1,LOGGING=1,,# Try to find the Preferences.xml in all possiblefolders to fetch the token for downloads of PlexPass versions.,,if [ -f /Plex\ Media\ Server/Preferences.xml ]; then, PREFS="/Plex Media Server/Preferences.xml",elif, [ -f /usr/local/plex/Plex\ Media\ Server/Preferences.xml ]; then, PREFS="/usr/local/plex/Plex Media Server/Preferences.xml",elif, [ -f /usr/local/plexdata/Plex\ Media\ Server/Preferences.xml ]; then, PREFS="/usr/local/plexdata/Plex Media Server/Preferences.xml",elif, [ -f /usr/local/plexdata-plexpass/Plex\ Media\ Server/Preferences.xml ]; then, PREFS="/usr/local/plexdata-plexpass/Plex Media Server/Preferences.xml",else, echo "Preferences.xml not found. This will likely prevent the script from downloading the latest version of Plex. You can still manually download Plex and run PMS_Updater.sh with the -l flag.",fi,,PLEXTOKEN="",BASEURL="https://plex.tv/api/downloads/5.json",TOKENURL="?channel=plexpass&X-Plex-Token=",DOWNLOADPATH="/tmp",LOGPATH="/tmp",LOGFILE="PMS_Updater.log",PMSPARENTPATH="/usr/local/share",PMSPATTERN="PlexMediaServer-[0-9]*.[0-9]*.[0-9]*.[0-9]*-[0-9,a-f]*-FreeBSD-amd64.tar.bz2",,# Initialize CURRENTVER to the script max so if reading the current version fails,# for some reason we don't blindly clobber things,CURRENTVER=9999.9999.9999.9999.9999,,,usage(),{,cat << EOF,usage: /usr/local/etc/PMS_Updater.sh options,,This script will search the plex.tv download site for a download link,and if it is newer than the currently installed version the script will,download and optionaly install the new version.,,OPTIONS:, -l Local file to install instead of latest from Plex.tv, -d download folder (default /tmp) Ignored if -l is used, -a Auto Update to newer version, -f Force Update even if version is not newer, -r Remove update packages older than current version, Done before any update actions are taken., -v Verbose, -n Use normal version (not PlexPass) version,EOF,},,## LogMsg(),## READS: STDIN (Piped input) -a (passed in string) ,## MODIFIES: NONE,##,## Writes log entries to /,LogMsg(),{, if [ "-a" = "-n" ]; then SWITCH="-n"; fi, while read IN; do, tdStamp=2023-08-16 09:37.51, if [ = 1 ]; then echo " " >> /; fi, if [ = 1 ] || [ "-a" = "-f" ]; then echo ; fi, done,},,,,,## verNum(),## READS: -a (passed in string),## MODIFIES: NONE,##,## Converts the Plex version string to a mathmatically comparable,## numberby removing non numericals and padding each section with zeros,## so v0.9.9.10.485 becomes 00000009000900100485,## NOTE: Plex version numbers appear to have changed from something like,## v0.9.14.4.1556-a10e3c2,## to,## v1.0.0.2261-a17e99e,## Unfortunately this makes the new 1.X versions appear to be an older,## version than the 0.9.X versions. This sed hack will append a .0 version,## to the 1.X version so that it will now behave correctly. The new 1.X will,## now looks omething like:,## 1.0.0.2261.0-a17e99e,## And will convert it to the proper long form such as:,## 00010000000022610000,verNum(),{, echo "-a: Argument list too long
Command: /bin/sh -c /usr/local/etc/PMS_Updater.sh -a -v failed!