Upgrade Plex Jail with script help

Status
Not open for further replies.

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I have plex installed in a jail (not the plugin) and I want the script to upgrade the pkg without asking a "y" input. Not sure what is wrong with my code.
Code:
#!/bin/sh

service plexmediaserver stop
pkg update && pkg upgrade multimedia/plexmediaserver -y
service plexmediaserver start
 
D

dlavigne

Guest
Paste (using code tags) the specific error you get when you run the script.
 

rorik

Cadet
Joined
Jul 20, 2015
Messages
5
I have plex installed in a jail (not the plugin) and I want the script to upgrade the pkg without asking a "y" input. Not sure what is wrong with my code.
Code:
#!/bin/sh

service plexmediaserver stop
pkg update && pkg upgrade multimedia/plexmediaserver -y
service plexmediaserver start

Perhaps adding another '-y' flag for the initial 'pkg update' portion will suffice?

Code:
#!/bin/sh

service plexmediaserver stop
pkg update -y && pkg upgrade multimedia/plexmediaserver -y
service plexmediaserver start
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
@dlavigne
Code:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: -y is not installed, therefore upgrade is impossible
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
	plexmediaserver: 1.8.4.4249 -> 1.9.2.4285

Number of packages to be upgraded: 1

65 MiB to be downloaded.

Proceed with this action? [y/N]: 



@rorik if I add the -y per your code I get
Code:
pkg: illegal option -- y
Usage: pkg update [-fq] [-r reponame]

For more information, see 'pkg help update'.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Code:
#!/bin/sh

service plexmediaserver stop
pkg update && pkg upgrade -y multimedia/plexmediaserver
service plexmediaserver start


Works. The -y needs to be after the pkg upgrade part of the command. Thanks.
 
Status
Not open for further replies.
Top