Skip to content

Commit

Permalink
PAS edits
Browse files Browse the repository at this point in the history
plex_docker_user added for support for LinuxServer.io/plex
update config for reading the file
edit plex.sh remove touch part
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Dec 10, 2019
1 parent 094d470 commit e9d153f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions menu/pgbox/endbanner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ EOF
fi
if [ "$program" == "plex" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 Manual Configuration Required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Expand Down
15 changes: 12 additions & 3 deletions menu/pgscan/pgscan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ tokenstatus() {
else pstatus="⚠️ NOT DEPLOYED"; fi
}

plexdockeruser() {
plexdocker=$(cat /var/plexguide/image/plex)
if [[ $plexdocker == "linuxserver/plex" ]];then
echo "abc" >/var/plexguide/pgscan/plex.docker
else echo "plex" >/var/plexguide/pgscan/plex.docker ; fi
}

plexcheck() {
pcheck=$(docker ps --format {{.Names}} | grep "plex")
if [ "$pcheck" == "" ]; then
Expand All @@ -48,7 +55,7 @@ plexcheck() {
EOF
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
exit
exit 0
fi
}

Expand All @@ -69,12 +76,13 @@ token() {
if [ "$ptoken" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! - Failed to Generate a Valid Plex Token! Exiting Deployment!
⛔️ WARNING! Failed to Generate a Valid Plex Token!
⛔️ WARNING! Exiting Deployment!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
exit
exit 0
fi
fi
}
Expand Down Expand Up @@ -222,6 +230,7 @@ EOF
}
# FUNCTIONS END ##############################################################
plexcheck
plexdockeruser
userstatus
tokenstatus
deploycheck
Expand Down
1 change: 0 additions & 1 deletion menu/plex/plex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ EOF
}

updateplex() {
touch /var/plexguide/plex.updaterole

tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Expand Down
4 changes: 4 additions & 0 deletions menu/roles/plex_autoscan/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
shell: 'cat /var/plexguide/pgscan/pgscan.serverpass'
register: plex_autoscan_server_pass

- name: Register Plex Docker User
shell: 'cat /var/plexguide/pgscan/plex.docker'
register: plex_docker_user

- name: Create mounted.bin for trash
shell: 'touch /mnt/unionfs/mounted.bin'

Expand Down
2 changes: 1 addition & 1 deletion menu/roles/plex_autoscan/templates/config.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"PLEX_LOCAL_URL": "http://localhost:32400",
"PLEX_SCANNER":"/usr/lib/plexmediaserver/Plex\\ Media\\ Scanner",
"PLEX_SUPPORT_DIR":"/var/lib/plexmediaserver/Library/Application\\ Support",
"PLEX_USER":"plex",
"PLEX_USER":"{{plex_docker_user.stdout}}",
"PLEX_TOKEN":"{{plex_auth_token.stdout}}",
"PLEX_CHECK_BEFORE_SCAN":true,
"PLEX_WAIT_FOR_EXTERNAL_SCANNERS":false,
Expand Down

0 comments on commit e9d153f

Please sign in to comment.