-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpgscan.sh
503 lines (426 loc) · 22.6 KB
/
pgscan.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
#!/bin/bash
# FUNCTIONS START ##############################################################
# mkdir -p /var/plexguide/pgscan
# echo "en" >/var/plexguide/pgscan/fixmatch.lang
# echo "false" >/var/plexguide/pgscan/fixmatch.status
# echo "NOT-SET" >/var/plexguide/pgscan/plex.docker
folder="/var/plexguide/pgscan"
if [[ ! -d "$folder" ]]; then
sudo mkdir -p /var/plexguide/pgscan
sudo echo "en" >/var/plexguide/pgscan/fixmatch.lang
sudo echo "false" >/var/plexguide/pgscan/fixmatch.status
sudo echo "NOT-SET" >/var/plexguide/pgscan/plex.docker
sudo echo "NOT-SET" >/var/plexguide/pgscan/plex.path
sudo echo "NOT-SET" >/var/plexguide/pgscan/gdrive.id
fi
###removeoldpart
serviveplex="/etc/systemd/system/plex_autoscan.service"
if [ -f "$serviveplex" ]; then
sudo systemctl disable plex_autoscan.service
sudo systemctl stop plex_autoscan.service
sudo rm -f "$serviveplex"
fi
variable() {
file="$1"
if [[ ! -e "$file" ]]; then echo "$2" >$1; fi
}
deploycheck() {
dcheck=$(docker ps --format '{{.Names}}' | grep "plexautoscan")
if [[ "$dcheck" == "plexautoscan" ]]; then
dstatus="✅ DOCKER DEPLOYED"
else dstatus="⚠️ DOCKER NOT DEPLOYED"; fi
}
tokenstatus() {
ptokendep=$(cat /var/plexguide/pgscan/plex.token)
if [[ "$ptokendep" != "" ]]; then
if [[ ! -f "/opt/appdata/plexautoscan/config/config.json" ]]; then
pstatus="✅ TOKEN DEPLOYED || ⚠️ PAS NOT DEPLOYED";
else
PGSELFTEST=$(curl -LI "http://$(hostname -I | awk '{print $1}'):32400/system?X-Plex-Token=$(cat /opt/appdata/plexautoscan/config/config.json | jq .PLEX_TOKEN | sed 's/"//g')" -o /dev/null -w '%{http_code}\n' -s)
if [[ $PGSELFTEST -ge 200 && $PGSELFTEST -le 299 ]]; then pstatus="✅ TOKEN DEPLOYED"
else pstatus="⚠️ DOCKER DEPLOYED || ❌ PAS TOKEN FAILED"; fi
fi
else pstatus="⚠️ NOT DEPLOYED"; fi
}
plexcheck() {
pcheck=$(docker ps --format '{{.Names}}' | grep "plex")
if [[ "$pcheck" == "" ]]; then
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! - Plex is Not Installed or Running! Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
dontwork
fi
}
token() {
touch /var/plexguide/pgscan/plex.token
ptoken=$(cat /var/plexguide/pgscan/plex.token)
if [[ ! -f "$ptoken" ]]; then
tokencreate
sleep 2
X_PLEX_TOKEN=$(sudo cat "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Preferences.xml" | sed -e 's;^.* PlexOnlineToken=";;' | sed -e 's;".*$;;' | tail -1)
ptoken=$(cat /var/plexguide/pgscan/plex.token)
if [[ "$ptoken" != "$X_PLEX_TOKEN" ]]; then
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! Failed to Generate a Valid Plex Token!
⛔️ WARNING! Exiting Deployment!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
dontwork
fi
fi
}
tokencreate() {
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 START Plex_AutoScan Token Create
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
templatebackup=/opt/plexguide/menu/pgscan/templates/config.backup
template=/opt/plexguide/menu/pgscan/templates/config.json.j2
X_PLEX_TOKEN=$(sudo cat "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Preferences.xml" | sed -e 's;^.* PlexOnlineToken=";;' | sed -e 's;".*$;;' | tail -1)
cp -r $template $templatebackup
echo $X_PLEX_TOKEN >/var/plexguide/pgscan/plex.token
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ FINISHED Plex_AutoScan Token 🚀 START SERVERPASS Create
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
RAN=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo $RAN >/var/plexguide/pgscan/pgscan.serverpass
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ FINISHED Plex_AutoScan Token || SERVERPASS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
timerremove
question1
}
badinput() {
echo
read -p '⛔️ ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
clear && question1
}
dontwork() {
echo
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
clear && exit 0
}
works() {
echo
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
clear && question1
}
credits() {
clear
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Plex_AutoScan Credits
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#########################################################################
# Author: l3uddz #
# URL: https://github.com/l3uddz/plex_autoscan #
# Coder of plex_autoscan #
# -- #
# Author(s): l3uddz, desimaniac #
# URL: https://github.com/cloudbox/cloudbox #
# Coder of plex_autoscan role #
# -- #
# Part of the Cloudbox project: https://cloudbox.works #
#########################################################################
# GNU General Public License v3.0 #
#########################################################################
'
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
clear && question1
}
doneenter() {
echo
read -p 'All done | PRESS [ENTER] ' typed </dev/tty
clear && question1
}
####REMOVEPART start
# KEY VARIABLE RECALL & EXECUTION
timerremove() {
seconds=10; date1=$((`date +%s` + $seconds));
while [ "$date1" -ge `date +%s` ]; do
echo -ne "$(date -u --date @$(($date1 - `date +%s` )) +%H:%M:%S)\r";
done
}
remove() {
dcheck=$(docker ps --format '{{.Names}}' | grep "plexautoscan")
if [[ "$dcheck" == "plexautoscan" ]]; then
removepas
else
notinstalled
fi
}
removepas() {
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 STARTING Remove Plex AutoScan Docker || l3uddz/plex_autoscan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
docker stop plexautoscan
docker rm plexautoscan
rm -rf /opt/appdata/plexautoscan
rm -rf /var/plexguide/pgscan
mkidr -p /var/plexguide/pgscan
echo "en" >/var/plexguide/pgscan/fixmatch.lang
echo "false" >/var/plexguide/pgscan/fixmatch.status
echo "NOT-SET" >/var/plexguide/pgscan/plex.docker
echo "/var/lib/plexmediaserver/Library/Application\\\ Support" >/var/plexguide/pgscan/plex.path
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 FINISHED REMOVE Plex AutoScan Docker
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
timerremove
question1
}
notinstalled() {
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! - PAS is Not Installed or Running! Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
timerremove
question1
}
##### REMOVE END
logger() {
dcheck=$(docker ps --format '{{.Names}}' | grep "plexautoscan")
if [[ "$dcheck" == "plexautoscan" ]]; then
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 ACTIVE LOGS Plex AutoScan Docker || l3uddz/plex_autoscan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
tail -n 50 /opt/appdata/plexautoscan/config/plex_autoscan.log
doneenter
else
notinstalled
fi
}
fxmatch() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Plex_AutoScan FixMatching
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE :
Plex Autoscan will compare the TVDBID/TMDBID/IMDBID sent
by Sonarr/Radarr with what Plex has matched with, and if
this match is incorrect, it will autocorrect the match on the
item (movie file or TV episode). If the incorrect match is
a duplicate entry in Plex, it will auto split the original
entry before correcting the match on the new item.
[1] Fixmatch Lang [ $(cat /var/plexguide/pgscan/fixmatch.lang) ]
[2] Fixmatch on / off [ $(cat /var/plexguide/pgscan/fixmatch.status) ]
[Z] - Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1) lang && clear && fxmatch ;;
2) runs && clear && fxmatch ;;
z) question1 ;;
Z) question1 ;;
*) fxmatch ;;
esac
}
lang() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Plex_AutoScan FixMatching Lang
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE : Sample :
this will work :
en
de
jp
ch
Default is "en"
[Z] - Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Lang | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
fxmatch
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ SYSTEM MESSAGE:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Language Set Is: $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo $typed >/var/plexguide/pgscan/fixmatch.lang
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fxmatch
fi
}
runs() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Plex_AutoScan Fix Missmatch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] True
[2] False
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Z] - Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1) echo "true" >/var/plexguide/pgscan/fixmatch.status && fxmatch ;;
2) echo "false" >/var/plexguide/pgscan/fixmatch.status && fxmatch ;;
z) fxmatch ;;
Z) fxmatch ;;
*) fxmatch ;;
esac
}
pversion() {
plexcontainertest=$(docker ps --format '{{.Image}}' | grep "plex:")
if [[ "$plexcontainertest" == "linuxserver/plex:latest" ]]; then
echo "abc" >/var/plexguide/pgscan/plex.dockeruserset
echo "/config/Library/Application\\\ Support" >/var/plexguide/pgscan/plex.path
else
echo "plex" >/var/plexguide/pgscan/plex.dockeruserset
echo "/var/lib/plexmediaserver/Library/Application\\\ Support" >/var/plexguide/pgscan/plex.path
fi
plexcontainer=$(docker ps --format '{{.Image}}' | grep "plex")
pasuserdocker=$(cat /var/plexguide/pgscan/plex.dockeruserset)
plexsupportdir=$(cat /var/plexguide/pgscan/plex.path)
cat /opt/appdata/plexguide/.gdrive | grep "client_id" | awk '{print $3}' >/var/plexguide/pgscan/gdrive.id
cat /opt/appdata/plexguide/.gdrive | grep "client_secret" | awk '{print $3}' >/var/plexguide/pgscan/gdrive.secret
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Plex Docker
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Linuxserver Docker used "abc"
Plex Docker used "plex"
Plex Docker Image: [ $plexcontainer ]
Plex Docker user: [ $pasuserdocker ]
Plex Support Dir: [ $plexsupportdir ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sudo cp -r /var/plexguide/pgscan/plex.dockeruserset /var/plexguide/pgscan/plex.docker 1>/dev/null 2>&1
doneenter
}
showuppage() {
dpas=$(docker ps --format '{{.Names}}' | grep "plexautoscan")
dtra=$(docker ps --format '{{.Names}}' | grep "traefik")
if [[ "$dpas" == "plexautoscan" && "$dtra" == "traefik" ]]; then
showpaspage="http://plexautoscan:3468/$(cat /var/plexguide/pgscan/pgscan.serverpass)"
showpagedomain="https://plexautoscan.$(cat /var/plexguide/server.domain)/$(cat /var/plexguide/pgscan/pgscan.serverpass)"
else
showpaspage="http://$(cat /var/plexguide/server.ip):3468/$(cat /var/plexguide/pgscan/pgscan.serverpass)"
fi
}
question1() {
dcheck=$(docker ps --format '{{.Names}}' | grep "plexautoscan")
if [[ "$dcheck" == "plexautoscan" ]]; then
deplyoed
else undeployed; fi
}
pasdeploy() {
ansible-playbook /opt/plexguide/menu/pgscan/yml/plexautoscan.yml
}
undeployed() {
langfa=$(cat /var/plexguide/pgscan/fixmatch.status)
lang=$(cat /var/plexguide/pgscan/fixmatch.lang)
dplexset=$(cat /var/plexguide/pgscan/plex.docker)
tokenstatus
deploycheck
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Plex_AutoScan Interface || l3uddz/plex_autoscan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] Deploy Plex Token [ $pstatus ]
[2] Fixmatch Lang [ $lang | $langfa ]
[3] Plex Docker Version [ $dplexset ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[A] Deploy Plex-Auto-Scan Docker [ $dstatus ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Z] - Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1) tokencreate && clear && question1 ;;
2) fxmatch && clear && question1 ;;
3) pversion && clear && question1 ;;
A) pasdeploy && question1 ;;
a) pasdeploy && question1 ;;
C) credits && clear && question1 ;;
c) credits && clear && question1 ;;
z) exit 0 ;;
Z) exit 0 ;;
*) question1 ;;
esac
}
deplyoed() {
langfa=$(cat /var/plexguide/pgscan/fixmatch.status)
lang=$(cat /var/plexguide/pgscan/fixmatch.lang)
dplexset=$(cat /var/plexguide/pgscan/plex.docker)
showuppage
tokenstatus
deploycheck
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Plex_AutoScan Interface || l3uddz/plex_autoscan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] Deploy Plex Token [ $pstatus ]
[2] Fixmatch Lang [ $lang | $langfa ]
[3] Plex Docker Version [ $dplexset ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
if [[ $(cat /var/plexguide/server.domain) != "NOT-SET" ]]; then
tee <<-EOF
PAS Webhook ARRs : [ $showpaspage ]
PAS Domain : [ $showpagedomain ]
EOF
else
tee <<-EOF
PAS Webhook ARRs : [ $showpaspage ]
EOF
fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[A] Redeploy Plex-Auto-Scan Docker [ $dstatus ]
[S] Show last 50 lines of Plex_AutoScan log
[R] Remove Plex_AutoScan
[C] Credits
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Z] - Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1) tokencreate && clear && question1 ;;
2) fxmatch && clear && question1 ;;
3) pversion && clear && question1 ;;
A) pasdeploy && question1 ;;
a) pasdeploy && question1 ;;
S) logger ;;
s) logger ;;
r) removepas ;;
R) removepas ;;
C) credits && clear && question1 ;;
c) credits && clear && question1 ;;
z) exit 0 ;;
Z) exit 0 ;;
*) question1 ;;
esac
}
# FUNCTIONS END ##############################################################
plexcheck
tokenstatus
variable /var/plexguide/pgscan/fixmatch.lang "en"
variable /var/plexguide/pgscan/fixmatch.status "false"
variable /var/plexguide/pgscan/plex.docker "NOT-SET"
variable /var/plexguide/pgscan/plex.path "/var/lib/plexmediaserver/Library/Application\\\ Support"
deploycheck
question1