forked from 07031218/normal-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plex.sh
105 lines (94 loc) · 3.59 KB
/
plex.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
function rclone_install()
{
echo "检查Rclone......"
rclone --version
if [ $? -eq 0 ]; then
echo "检查到Rclone已安装!"
else
echo -e "\n| Rclone is installing ... "
curl https://rclone.org/install.sh | sudo bash
# 安装fuse 支持
sudo apt-get install -y fuse
fi
}
function gclone_install()
{
echo "检查Gclone......"
gclone --version
if [ $? -eq 0 ]; then
echo "检查到Gclone已安装!"
else
echo -e "\n| Gclone is installing ... "
bash <(wget -qO- https://raw.githubusercontent.com/07031218/normal-shell/main/gclone.sh)
fi
}
function docker_install()
{
echo "检查Docker......"
docker -v
if [ $? -eq 0 ]; then
echo "检查到Docker已安装!"
else
# 安装Docker
echo -e "\n| Docker is installing ... "
sudo apt-get update -y
curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh
rm -f get-docker.sh
fi
}
function download_res()
{
echo -e "\n| Resource File Downloading ... "
sudo mkdir /plex
cd /plex
sudo curl -L https://install.emengweb.com/plex.tar.gz -o /plex/plex.tar.gz
sudo tar zxvf plex.tar.gz
rm -f plex.tar.gz
}
clear
echo "+============================================================+"
echo "| Plex with Nginx&SSL Installer |"
echo "| |"
echo "| <[email protected]> |"
echo "|------------------------------------------------------------|"
echo "| https://emengweb.com |"
echo "+============================================================+"
echo -e "\n| 此Docker将自动帮您完成Nginx及SSL反带的配置,此后可直接通过https://域名进行访问Plex."
echo ""
# 安装基础组件
echo -e "\n| Basic components is installing ... "
sudo apt-get install -y curl
# 安装Rclone
rclone_install
# 安装Gclone
gclone_install
# 安装Docker
docker_install
# 下载配置资源文件
#download_res
# 启动Docker Compose
#echo -e "\n| Docker Compose Starting ... "
#sudo docker-compose up
# 配置完毕
clear
echo "+============================================================+"
echo "| |"
echo "| 目录配置 |"
echo "| /plex/conf.d - Nginx虚拟主机配置目录 |"
echo "| /plex/config:/config - Plex数据存储目录 |"
echo "| /plex/transcode:/transcode - 转码预留目录 |"
echo "| /plex/disk - Rclone请挂载在此目录下,例如gd目录 |"
echo "| |"
echo "+============================================================+"
echo ""
echo -e "\n| 配置完成."
echo -e "\n| 您还需要完成以下配置:"
echo -e "\n| 1、设置域名 DNS 解析到本机IP"
echo -e "\n| 2、修改 '/plex/docker-compose.yml' 文件,确保正确设置'FQDN'-域名及邮箱地址 'CERTBOT_EMAIL'"
echo -e "\n| 3、将Rclone磁盘映射至/plex/disk的子目录下,例如:/plex/disk/gd"
echo -e "\n| 以上准备工作完成后,进入/plex文件夹,输入 'docker-compose up -d' 启动 plex docker 容器,记得先映射至127.0.0.1:32400端口,打开浏览器完成plex的配置。"
echo -e "\n| 此Docker将自动帮您完成Nginx及SSL反带的配置,可直接通过https://域名进行访问Plex."
echo -e "\n| 祝好运."