-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlexinstaller.sh
More file actions
34 lines (31 loc) · 1.18 KB
/
Plexinstaller.sh
File metadata and controls
34 lines (31 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
if [ "$(id -u)" -eq 0 ]; then echo "Running as sudo"; fi
if $(which apt) == "/usr/bin/apt" then
echo "You are using a linux distro with apt package manager."
apt update
apt upgrade -y
apt install curl -y
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
apt install plexmediaserver -y
elif $(which dnf) == "/usr/bin/dnf"
echo "You are using a linux distro with dnf package manager."
tee /etc/yum.repos.d/plex.repo<<EOF
[Plexrepo]
name=plexrepo
baseurl=https://downloads.plex.tv/repo/rpm/\$basearch/
enabled=1
gpgkey=https://downloads.plex.tv/plex-keys/PlexSign.key
gpgcheck=1
EOF
dnf update -y
dnf install plexmediaserver -y
else
echo "Unknown package manager. Please visit https://www.plex.tv/media-server-downloads/?cat=computer&plat=linux for download and install"
fi
if $(which systemctl) == "/usr/bin/systemctl" then
systemctl enable plexmediaserver --now
elif $(which update-rc.d) == "/usr/bin/update-rc.d"
update-rc.d plexmediaserver defaults
else
echo "Unknown service manager, please configure the media server's service file for your distro on your own."
fi