Revert "Merge pull request #31 from Pandaura/dev"

This reverts commit 619678b60b, reversing
changes made to 9ec20a91e5.
This commit is contained in:
thesammykins
2021-11-03 08:42:27 +11:00
parent 619678b60b
commit b85d46105c
95 changed files with 5730 additions and 6574 deletions

1
.gitignore vendored
View File

@@ -3,4 +3,3 @@ menu/start.sh
menu/hcloud/LICENSE
menu/gce/functions/oldfile.sh
.vscode/sftp.json

File diff suppressed because it is too large Load Diff

106
README.md
View File

@@ -1,28 +1,12 @@
![](https://github.com/Pandaura/PTS-Team/blob/master/pandaura.gif)
**PTS is currently in maintenance mode and is considered feature complete.** From time-to-time developers will take it upon themselves to add new containers to Community-Apps as requested and update the Core-Apps whenever required.
THIS KINDA EXPLODED SOMEWHAT SO EXPECT TO SEE SOME CHANGES SOON! BARE WITH ME!
We consider PTS to be a remarkable collaborative achievement and take pride in the fact we have built a solid foundation for any person to setup and learn basic Linux and also run a media server with minimal effort.
This is a fork of PTS/MHA called Pandaura. Thank you to all who contributed to the previous projects. No features are really added to MHA anymore as it is in maintenance mode so I will be making some ammendments here. Pandaura utilizes Ansible and Docker to streamline your media server while deploying multiple tools for your server operations.
We encourage anyone wanting to contribute to the project in the future to join our community, this is also where we provide support: https://discord.gg/cKsMwMZ
My personal opinion. PTS/MHA did well and still are providing excellend support. Whilst PG was more of a rename and grab project with an awesome community in which we can't deny the time and effort that was put into the project. The remnants meant things were, for lack of a better word, bashed together which left untidy and unfinished menu systems with grammar and spelling that will make your eyes bleed. I'm here to tidy this up, improve on the messy (only in some places) code and just make this the tool that it should have been. Previous projects had the potential to just be burned but you have nothing to worry about here. This is a safer/faster/more reliable project but we all have different tastes....enjoy.
Thanks to our valued contributors over the past couple of years, you have helped create something to be proud of and that will serve the community well into the future.
I'll be listing a few of the annoyances below...
The menu doesn't even go back when you're in a sub menu half the time...you are either left hanging or you go straight back to the beginning either way this is really frustrating
Most menu sub systems again wouldn't even 'clear' leaving your terminal messy
Current section being worked on -
Traefik V2
Authelia
Cloud Companion
Python Plex Library - own version with scraping
Spelling/typos/general script tidy up
Refresh
Ouroboros -- It's no longer in development so why use it https://github.com/pyouroboros/ouroboros
Core Apps - Update the list of Core apps
Community Apps - Update the list of Community apps
**You know who you are.** PTS is forever, others will come and go.
_**Table of Contents**_
@@ -36,9 +20,9 @@ _**Table of Contents**_
# 1. Install
## (i) Backup your current server using PTS Vault before installing Pandaura.
## (i) Backup your current server using PTS Vault before installing PTS-Team.
Your PTS backup can be used to restore your applications in Pandaura fork after install (see later)
Your PTS backup can be used to restore your applications in PTS fork after install (see later)
**NOTE** Tested and working for PG v8.5-8.7
Type the following to access your current build's menu: `sudo pgblitz`
@@ -59,65 +43,95 @@ sudo wget -N https://raw.githubusercontent.com/MHA-Team/PTS-Clone/final/function
```
## (ii) Installing Pandaura
## (ii) Installing PTS
**NOTE**
The ideal method of installing the Pandaura is to delete your current build and install Pandaura on a clean system.
Pandaura works best on **ubuntu 18.XX** and this tutorial will assume you are using ubuntu 18.XX.
The ideal method of installing the PTS fork is to delete your current build and install PTS fork on a clean system.
PTS fork works best on **ubuntu 18.XX** and this tutorial will assume you are using ubuntu 18.XX.
If you are unsure on how to do this, please refer to the documentation provided by your server provider.
Once your server has an OS installed, login to your server using SSH.
Type or paste the following to install Pandaura fork:
Type or paste the following to install PTS fork:
```
sudo apt-get update -yqq
sudo apt-get upgrade -yqq
sudo apt-get autoclean -yqq
sudo apt-get install wget -y
sudo wget -qO- https://raw.githubusercontent.com/Pandaura/Install/master/install.sh | sudo bash
sudo wget -qO- https://raw.githubusercontent.com/MHA-Team/Install/master/install.sh | sudo bash
```
The installation will then take you through the setup which is self-explanatory.
### Optional - updating your PTS to Pandaura
IDoMnCi came up with a great script to change all the links on an existing PTS-Team (NOT PG 8.x) to the Pandaura.
Details - https://github.com/Pandaura/Install/pull/4
### Alternative method of installing PTS fork (without removing your current build)
**NOTE** This has currently only been tested with PG v8.5-8.7
Type or paste the following:
```
sudo wget -qO- https://raw.githubusercontent.com/Pandaura/Install/master/relocate.sh | sudo bash
sudo apt-get update -yqq
sudo apt-get upgrade -yqq
sudo apt-get autoclean -yqq
sudo apt-get install wget -y
sudo wget -qO- https://raw.githubusercontent.com/MHA-Team/Install/master/install.sh | sudo bash
```
### Optional - updating your PTS-Team fork to the new MHA-Team fork
IDoMnCi came up with a great script to change all the links on an existing PTS-Team fork (NOT PG 8.x) to the MHA-Team fork.
Details - https://github.com/MHA-Team/Install/pull/4
```
sudo wget -qO- https://raw.githubusercontent.com/MHA-Team/Install/master/relocate.sh | sudo bash
sudo ptsupdate
```
## Configuring Pandaura
### Testing Only - Not Supported - Install PTS-Team fork via Windows 10 20H1 WSL2 Ubuntu 18.04
Then type the following to run the Pandaura menu: `sudo pandaura`
Sammykins has tested installing the PTS-Team form on a Windows 10 machine via the new WSL2 system built into Windows.
Follow the above (#ii-installing-pts) in a WSL2 terminal shell, if you do not know how to enable WSL2 and install an Ubuntu 18.04 system for this method it is recommended not to install.
* Set up and deploy Traefik ([see here](https://github.com/Pandaura/PTS-Team/wiki/Traefik))
DO NOT ASK FOR SUPPORT OR FIXES FOR THIS METHOD IT IS PROVIDED AS-IS AND WE TAKE NO RESPONSIBILITY IF ANYTHING BELOW DOES NOT FUNCTION OR BREAKS YOUR WINDOWS 10 INSTALLATION. YOU DO THE BELOW AT YOUR OWN RISK.
* Close ports using Port Guard ([see here](https://github.com/Pandaura/PTS-Team/wiki/PTS-Port-Guard))
* Follow the following page to install and setup WSL2 ([see here](https://docs.microsoft.com/en-us/windows/wsl/install-win10))
* Only use an Ubuntu 18.04 VM from the Microsoft Store
* Prior to install follow this to enable systemd: ([see here](https://github.com/DamionGans/ubuntu-wsl2-systemd-script))
* The script may fail to create the plexguide network in docker, simply run `docker network create plexguide` to fix
* Use MultiHD to set another drive as the main path for data, we recommend this if your C drive is too small as WSL2 will default run on the OS drive, e.g. if you have a D: drive, this would be `/mnt/d/pathtoanewfolderforptsfiles`
* Follow the rest of the guides for configuring PTS
* Deploy Pandaura Shield (GOAuth - all apps supported) [see here](https://github.com/Pandaura/PTS-Team/wiki/PTS-Shield)
## Configuring PTS
* Set up and deploy Clone. You can restore you backup keys at this stage. [see here](https://github.com/Pandaura/PTS-Team/wiki/PTS-Clone)
Configuring PTS fork is the same as configuring PG / PlexGuide.
* (Optional) Restore PTS backup (created in step 1) using Vault. [see here](https://github.com/Pandaura/PTS-Team/wiki/PTS-Vault---Data-Storage)
Then type the following to run the PTS menu: `sudo pts`
* Install desired core/community applications (Do this regardless of whether it is a fresh install with restore or overwrite) [see here](https://github.com/Pandaura/PTS-Team/wiki/core-apps)
* Set up and deploy Traefik ([see here](https://github.com/MHA-Team/PTS-Team/wiki/Traefik))
* (Optional) If overwriting/restoring, you will need to change 2 remote path mappings in applications (NZB clients / Torrent clients / radarr / sonarr / lidarr etc) [see here](https://github.com/Pandaura/PTS-Team/wiki/Remote-Path-Mappings)
* Close ports using Port Guard ([see here](https://github.com/MHA-Team/PTS-Team/wiki/PTS-Port-Guard))
* Deploy PTS Shield (GOAuth - all apps supported) [see here](https://github.com/MHA-Team/PTS-Team/wiki/PTS-Shield)
* Set up and deploy PTS-Clone. You can restore you backup keys at this stage. [see here](https://github.com/MHA-Team/PTS-Team/wiki/PTS-Clone)
* (Optional) Restore PTS backup (created in step 1) using PTS-Vault. [see here](https://github.com/MHA-Team/PTS-Team/wiki/PTS-Vault---Data-Storage)
* Install desired core/community applications (Do this regardless of whether it is a fresh install with restore or overwrite) [see here](https://github.com/MHA-Team/PTS-Team/wiki/core-apps)
* (Optional) If overwriting/restoring, you will need to change 2 remote path mappings in applications (NZB clients / Torrent clients / radarr / sonarr / lidarr etc) [see here](https://github.com/MHA-Team/PTS-Team/wiki/Remote-Path-Mappings)
**Why do I need to change remote paths?**
Pandaura will create one download folder for completed downloads using any NZB client `/mnt/downloads/nzb` and one download folder for completed downloads using any torrent client `/mnt/downloads/torrent`. Both folder names are different to those used in previous versions of PTS. This remote paths need to be changed in your configuration settings (nzbget/radarr/sonarr etc) which you can do in either in terminal or webUI.
PTS will create one download folder for completed downloads using any NZB client `/mnt/downloads/nzb` and one download folder for completed downloads using any torrent client `/mnt/downloads/torrent`. Both folder names are different to those used in previous versions of PTS. This remote paths need to be changed in your configuration settings (nzbget/radarr/sonarr etc) which you can do in either in terminal or webUI.
**NOTE** PTS does **not** install PGUI by default.
**NOTE** PTS fork does **not** install PGUI by default.
# 2. Project Statement
Pandaura is a **fork** of PTS/MHA, an all-in-one media solution that deploys a Media Server through the use of either your local HDD or Google Drive; serving as unlimited back-end storage.
PTS is a **fork** of PG / Plexguide, an all-in-one media solution that deploys a Media Server through the use of either your local HDD or Google Drive; serving as unlimited back-end storage. PTS utilizes Ansible and Docker to streamline your Media Server while deploying multiple tools for your server operations.
# 3. Functional Use
@@ -133,8 +147,8 @@ Pandaura is a **fork** of PTS/MHA, an all-in-one media solution that deploys a
# 4. Recommended Reading
[**[Click Here]**](https://github.com/Pandaura/PTS-Team/wiki/Pre-Reading) to view the list!
[**[Click Here]**](https://github.com/MHA-Team/PTS-Team/wiki/Pre-Reading) to view the list!
## 5. Having Issues?
[**[Click Here]**](https://github.com/Pandaura/PTS-Team/wiki/Common-Issues) for more information!
[**[Click Here]**](https://github.com/MHA-Team/PTS-Team/wiki/Common-Issues) for more information!

View File

@@ -1,7 +1,7 @@
#!/bin/bash
#
# Title: PTS List commands
# Author(s): Pandaura
# Author(s): MrDoobPG
# GNU: General Public License v3.0
################################################################################
---
@@ -26,10 +26,26 @@
###### Install PGBlitz
- name: Pandaura
- name: PlexGuide
template:
src: pandaura
dest: /bin/pandaura
src: plexguide
dest: /bin/plexguide
force: yes
mode: 0775
owner: root
- name: PTS
template:
src: pts
dest: /bin/pts
force: yes
mode: 0775
owner: root
- name: PGBlitz
template:
src: pgblitz
dest: /bin/pgblitz
force: yes
mode: 0775
owner: root

View File

@@ -6,7 +6,7 @@
################################################################################
rm -rf /opt/ptsupdate 1>/dev/null 2>&1
mkdir -p /opt/ptsupdate 1>/dev/null 2>&1
git clone --single-branch https://github.com/Pandaura/PTS-Update.git /opt/ptsupdate 1>/dev/null 2>&1
git clone --single-branch https://github.com/MHA-Team/PTS-Update.git /opt/ptsupdate 1>/dev/null 2>&1
chown -cR 1000:1000 /opt/ptsupdate 1>/dev/null 2>&1
chmod -cR 775 /opt/ptsupdate 1>/dev/null 2>&1

45
menu/alias/templates/pg Normal file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
file="/var/pgblitz/pg.number"
if [ -e "$file" ]; then
check="$(cat /var/pgblitz/pg.number | head -c 1)"
if [[ "$check" == "5" || "$check" == "6" || "$check" == "7" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌎 INSTALLER BLOCK: Notice
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
We detected PG Version $check is running! Per the instructions, PG 8
must be installed on a FRESH BOX! Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
exit
fi
fi
source /opt/plexguide/menu/functions/functions.sh
source /opt/plexguide/menu/functions/start.sh
source /opt/plexguide/menu/functions/install.sh
mkdir -p /opt/plexguide/roles/log
mkdir -p /var/plexguide/logs
mkdir -p /opt/appdata/plexguide
sudocheck
missingpull
if [[ ! -e "/bin/pgblitz" ]]; then
cp /opt/plexguide/menu/alias/templates/pgblitz /bin
fi
chown 1000:1000 /bin/pgblitz &>/dev/null &
chmod 0755 /bin/pgblitz &>/dev/null &
# pg deploy contains pgdeploy at end
pginstall

View File

@@ -0,0 +1,39 @@
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
file="/var/plexguide/pg.number"
if [ -e "$file" ]; then
check="$(cat /var/plexguide/pg.number | head -c 1)"
if [[ "$check" == "5" || "$check" == "6" || "$check" == "7" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌎 INSTALLER BLOCK: Notice
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
We detected PG Version $check is running! Per the instructions, PG 8
must be installed on a FRESH BOX! Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
exit
fi
fi
source /opt/plexguide/menu/functions/functions.sh
source /opt/plexguide/menu/functions/start.sh
source /opt/plexguide/menu/functions/install.sh
mkdir -p /opt/plexguide/roles/log
mkdir -p /var/plexguide/logs
mkdir -p /opt/appdata/plexguide
sudocheck
missingpull
# pg deploy contains pgdeploy at end
pginstall

View File

@@ -0,0 +1,44 @@
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
file="/var/plexguide/pg.number"
if [ -e "$file" ]; then
check="$(cat /var/plexguide/pg.number | head -c 1)"
if [[ "$check" == "5" || "$check" == "6" || "$check" == "7" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌎 INSTALLER BLOCK: Notice
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
We detected PG Version $check is running! Per the instructions, PG 8
must be installed on a FRESH BOX! Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
exit
fi
fi
source /opt/plexguide/menu/functions/functions.sh
source /opt/plexguide/menu/functions/start.sh
source /opt/plexguide/menu/functions/install.sh
mkdir -p /opt/plexguide/roles/log
mkdir -p /var/plexguide/logs
mkdir -p /opt/appdata/plexguide
sudocheck
missingpull
if [[ ! -e "/bin/pgblitz" ]]; then
cp /opt/plexguide/menu/alias/templates/pgblitz /bin/ &>/dev/null &
chown 1000:1000 /bin/pgblitz
chmod 0755 /bin/pgblitz
fi
# pg deploy contains pgdeploy at end
pginstall

View File

@@ -10,17 +10,9 @@ source /opt/plexguide/menu/functions/functions.sh
source /opt/plexguide/menu/functions/start.sh
source /opt/plexguide/menu/functions/install.sh
mkdir -p /opt/plexguide/roles/log
mkdir -p /var/plexguide/logs
mkdir -p /opt/appdata/plexguide
sudocheck
missingpull
if [[ ! -e "/bin/pandaura" ]]; then
cp /opt/plexguide/menu/alias/templates/pandaura /bin/ &>/dev/null &
chown 1000:1000 /bin/pandaura
chmod 0755 /bin/pandaura
fi
# pg deploy contains pgdeploy at end
clear
pginstall

View File

@@ -6,7 +6,7 @@
################################################################################
rm -rf /opt/ptsupdate 1>/dev/null 2>&1
mkdir -p /opt/ptsupdate 1>/dev/null 2>&1
git clone --single-branch https://github.com/Pandaura/PTS-Update.git /opt/ptsupdate 1>/dev/null 2>&1
git clone --single-branch https://github.com/MHA-Team/PTS-Update.git /opt/ptsupdate 1>/dev/null 2>&1
chown -cR 1000:1000 /opt/ptsupdate 1>/dev/null 2>&1
chmod -cR 775 /opt/ptsupdate 1>/dev/null 2>&1

View File

@@ -15,15 +15,14 @@ source /opt/plexguide/menu/functions/functions.sh
# FIRST QUESTION
question1() {
typed="${typed,,}"
appguard=$(cat /var/plexguide/server.ht)
if [ "$appguard" == "" ]; then
guard="DISABLED" && opp="Enable"
else guard="ENABLED" && opp="Disable"; fi
appguard=$(cat /var/plexguide/server.ht)
if [ "$appguard" == "" ]; then
guard="DISABLED" && opp="Enable"
else guard="ENABLED" && opp="Disable"; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Welcome to AppGuard
🌎 Welcome to AppGuard!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Reference: http://appguard.pgblitz.com
@@ -35,25 +34,25 @@ Z. Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Type a Number | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
if [ "$guard" == "DISABLED" ]; then
echo ""
read -p '↘️ [Type] a USERNAME | PRESS [ENTER] ' user </dev/tty
read -p '↘️ [Type] a PASSWORD | PRESS [ENTER] ' pw </dev/tty
htpasswd -cbs /var/plexguide/server.ht $user $pw
read -p 'Type a Number | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
if [ "$guard" == "DISABLED" ]; then
echo ""
read -p '↘️ [Type] a USERNAME! | PRESS [ENTER] ' user </dev/tty
read -p '↘️ [Type] a PASSWORD! | PRESS [ENTER] ' pw </dev/tty
htpasswd -cbs /var/plexguide/server.ht $user $pw
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ AppGuard - Hashed UserName & Password
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
sleep 3
else echo "" >/var/plexguide/server.ht; fi
bash /opt/plexguide/menu/appguard/rebuild.sh
elif [[ "${typed,,}" == "z" ]]; then
exit
else badinput1; fi
bash /opt/plexguide/menu/appguard/rebuild.sh
elif [[ "$typed" == "z" || "$typed" == "Z" ]]; then
exit
else badinput1; fi
}
# FUNCTIONS END ##############################################################

View File

@@ -5,9 +5,9 @@
command: ptsupdate
Info : Update PTS-Edition
- name: pandaura
command: pandaura
Info: Open Pandaura Interface
- name: PTS
command: plexguide
Info: Open PTS Interface
- name: server reboot
command: reboot

View File

@@ -18,7 +18,7 @@ question1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⌛ Cron - Would you like to schedule Cron Jobs (Backups) for $program?
⌛ Cron - Schedule Cron Jobs (Backups) | $program?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ 1 ] No
@@ -28,12 +28,12 @@ question1() {
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
ansible-playbook /opt/plexguide/menu/cron/remove.yml && exit
elif [ "$typed" == "2" ]; then
break="on"
else badinput; fi
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
ansible-playbook /opt/plexguide/menu/cron/remove.yml && exit
elif [ "$typed" == "2" ]; then
break="on"
else badinput; fi
}
# SECOND QUESTION
@@ -41,10 +41,10 @@ question2() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⌛ Cron - How often and when do you want to run backups?
⌛ Cron - Backup How Often?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WEEKLY BACKUP SCHEDULE
WEEKLY
[ 0 / 7 ] - Sunday
[ 1 ] - Monday
@@ -54,7 +54,7 @@ WEEKLY BACKUP SCHEDULE
[ 5 ] - Friday
[ 6 ] - Saturday
DAILY BACKUPS
DAILY
[ 8 ] - Daily
RANDOM
@@ -63,11 +63,11 @@ RANDOM
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" -ge "0" && "$typed" -le "7" ]]; then echo $typed >/var/plexguide/cron/cron.day && break=1;
elif [ "$typed" == "8" ]; then echo "*" > /var/plexguide/cron/cron.day && break=1;
elif [ "$typed" == "9" ]; then echo $RAN >/var/plexguide/cron/cron.day && break=1;
if [[ "$typed" -ge "0" && "$typed" -le "7" ]]; then echo $typed >/var/plexguide/cron/cron.day && break=1;
elif [ "$typed" == "8" ]; then echo "*" > /var/plexguide/cron/cron.day && break=1;
elif [ "$typed" == "9" ]; then echo $RAN >/var/plexguide/cron/cron.day && break=1;
else badinput; fi
}
@@ -76,7 +76,7 @@ question3() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⌛ Cron - Select time of the day?
⌛ Cron - Hour of the Day?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Type an HOUR from [0 to 23]
@@ -88,10 +88,10 @@ Type an HOUR from [0 to 23]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type a Number | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" -ge "0" && "$typed" -le "23" ]]; then
echo $typed >/var/plexguide/cron/cron.hour && break=1
else badinput; fi
read -p '↘️ Type a Number | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" -ge "0" && "$typed" -le "23" ]]; then
echo $typed >/var/plexguide/cron/cron.hour && break=1
else badinput; fi
}
# FUNCTIONS END ##############################################################

View File

@@ -4,176 +4,15 @@
# Author(s): Admin9705 - Deiteq
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
program=$(cat /tmp/program_var)
cname=$program
#################################################################################
if [[ -f "/var/plexguide/$program.cname" ]]; then
cname=$(cat /var/plexguide/$program.cname)
fi
# KEY VARIABLE RECALL & EXECUTION
mkdir -p /var/plexguide/cron/
mkdir -p /opt/appdata/plexguide/cron
# FUNCTIONS START ##############################################################
source /opt/plexguide/menu/functions/functions.sh
domain=$(cat /var/plexguide/server.domain)
port=$(cat /tmp/program_port)
ip=$(cat /var/plexguide/server.ip)
ports=$(cat /var/plexguide/server.ports)
hdpath=$(cat /var/plexguide/server.hd.path)
if [ "$program" == "plex" ]; then extra="/web"; else extra=""; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Access configuration info
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
tee <<-EOF
▫ https://$program:${port} <- Use this as the url when connecting another app to $program.
EOF
if [ "$ports" == "" ]; then
tee <<-EOF
▫ https://$ip:${port}${extra}
EOF
fi
if [ "$domain" != "NOT-SET" ]; then
if [ "$ports" == "" ]; then
tee <<-EOF
▫ $domain:${port}${extra}
EOF
fi
tee <<-EOF
▫ $cname.$domain${extra}
EOF
fi
if [ "$program" == "plex" ]; then
tee <<-EOF
First Time Plex Claim Notice
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
if [ "$domain" != "NOT-SET" ]; then
tee <<-EOF
▫ http://plex.${domain}:32400 <-- Use http; not https
EOF
fi
tee <<-EOF
▫ $ip:${port}${extra}
EOF
fi
if [[ "$program" == *"sonarr"* ]] || [[ "$program" == *"radarr"* ]] || [[ "$program" == *"lidarr"* ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Manual configuration required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$program requires additional manual configuration
EOF
if [[ "$program" == *"sonarr"* ]] || [[ "$program" == *"radarr"* ]] || [[ "$program" == *"lidarr"* ]] || [[ "$program" == *"qbittorrent"* ]]; then
tee <<-EOF
$program requires "downloader mappings" to enable hardlinking and rapid importing.
If you do not have these mappings, $program can't rename and move the files on import.
This will result in files being copied instead of moved, and it will cause other issues.
The mappings are on the download client settings (advanced setting), at the bottom of the page.
Visit https://github.com/Pandaura/PTS-Team/wiki/Remote-Path-Mappings for more information.
EOF
fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ Failure to perform manual configuration changes will cause problems
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌍 Visit the wiki for instructions on how to configure $program.
https://github.com/Pandaura/PTS-Team/wiki/$program
EOF
fi
####--------
if [[ "$program" == *"sabnzbd"* ]] || [[ "$program" == *"nzbget"* ]] ; then
cclean=$(cat /var/plexguide/cloneclean)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 NOTE / INFO
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
For incomplete downloads $program uses the folder $hdpath/incomplete/nzb
For finished downloads $program uses the folder $hdpath/downloads/nzb
beware the cloneclean is set to $cclean min
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [[ "$program" == *"sabnzbd"* ]] ; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Sabnzbd api_key = $sbakey
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [[ "$program" == *"rutorrent"* ]] || [[ "$program" == *"qbittorrent"* ]] || [[ "$program" == *"deluge"* ]]; then
cclean=$(cat /var/plexguide/cloneclean)
tclean=$(($cclean*2))
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 NOTE / INFO
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
For incomplete downloads $program uses the folder $hdpath/incomplete/nzb
For finished downloads $program uses the folder $hdpath/downloads/nzb
Beware that CloneClean is set to $tclean min
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [ "$program" == "plex" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Manual configuration required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
We prefer using plex_autoscan, unlike other alternatives,
that does not put a lot of pressure on the API of your Google account.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [ "$hdpath" != "/mnt" ]; then
sbakey=$(cat /opt/appdata/sabnzbd/sabnzbd.ini | grep "api_key" | head -n 1 | awk '{print $3}')
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You must add /mnt self to the docker container again
Your $hdpath is not /mnt
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
weekrandom() {
while read p; do
echo "$p" >/tmp/program_var
echo $(($RANDOM % 23)) >/var/plexguide/cron/cron.hour
@@ -208,20 +47,20 @@ question1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PTS Cron - Schedule Cron Jobs (Backups) | Mass Program Interface
PTS Cron - Schedule Cron Jobs (Backups) | Mass Program Interface
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Reference: https://github.com/Pandaura/PTS-Team/wiki/PTS-Cron
Reference: https://github.com/MHA-Team/PTS-Team/wiki/PTS-Cron
[1] Skip - All Cron Jobs]
[2] Manual - Select for each app]
[3] Daily - Select random times]
[4] Weekly - Select random times & days]
[1] No [Skip - All Cron Jobs]
[2] Yes [Manual - Select for Each App]
[3] Yes [Daily - Select Random Times]
[4] Yes [Weekly - Select Random Times & Days]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
exit
elif [ "$typed" == "2" ]; then

View File

@@ -19,9 +19,9 @@ emergency(){
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
Emergency & Warning Log Generator
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE: This can be turned [On] or [Off] in Settings.
NOTE: This can be turned [On] or Off in Settings!
EOF
@@ -32,7 +32,7 @@ EOF
done <<<"$(ls /opt/appdata/plexguide/emergency)"
echo
read -n 1 -s -r -p "Acknowledge info | Press [ENTER]"
read -n 1 -s -r -p "Acknowledge Info | Press [ENTER]"
echo
else
touch ${abc}/emergency.log

View File

@@ -9,12 +9,12 @@
# BAD INPUT
badinput() {
echo
read -p ' ERROR - Bad Input! | Press [ENTER] ' typed </dev/tty
read -p ' ERROR - Bad Input! | Press [ENTER] ' typed </dev/tty
}
badinput1() {
echo
read -p ' ERROR - Bad Input! | Press [ENTER] ' typed </dev/tty
read -p ' ERROR - Bad Input! | Press [ENTER] ' typed </dev/tty
question1
}

View File

@@ -26,6 +26,7 @@ pginstall() {
core docstart
rollingpart
portainer
oruborus
core motd
core gcloud
core cleaner
@@ -35,6 +36,7 @@ pginstall() {
core mountcheck
emergency
pgdeploy
# oruborus
}
############################################################ INSTALLER FUNCTIONS
@@ -112,6 +114,16 @@ updateprime() {
echo "21" >${abc}/pg.mountcheck
echo "11" >${abc}/pg.watchtower
}
oruborus() {
wstatus=$(docker ps --format '{{.Names}}' | grep "watchtower")
if [[ "$wstatus" == "watchtower" ]]; then
docker stop watchtower >/dev/null 2>&1
docker rm watchtower >/dev/null 2>&1
ansible-playbook /opt/plexguide/menu/functions/ouroboros.yml
fi
ostatus=$(docker ps --format '{{.Names}}' | grep "ouroboros")
if [[ "$ostatus" != "ouroboros" ]]; then ansible-playbook /opt/plexguide/menu/functions/ouroboros.yml; fi
}
gcecheck() {
gcheck=$(dnsdomainname | tail -c 10)
if [[ "$gcheck" == ".internal" ]]; then

View File

@@ -11,24 +11,28 @@ question1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📂 System & network auditor
📂 System & Network Auditor
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] System & network benchmark - Basic
[2] System & network benchmark - Advanced
[1] System & Network Benchmark - Basic
[2] System & Network Benchmark - Advanced
[3] Simple speedtest
[3] Simple SpeedTest
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
end_menu
# Standby
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1)
sudo wget -qO- bench.sh | bash
echo ""
read -p ' Process Complete | Press [ENTER] ' typed </dev/tty
read -p '🌍 Process Complete | Press [ENTER] ' typed </dev/tty
question1
;;
2)
@@ -36,13 +40,13 @@ end_menu
echo ""
curl -LsO git.io/bench.sh; chmod +x bench.sh && ./bench.sh -a
echo ""
read -p ' Process Complete | Press [ENTER] ' typed </dev/tty
read -p '🌍 Process Complete | Press [ENTER] ' typed </dev/tty
question1
;;
3)
curl -LsO git.io/bench.sh; chmod +x bench.sh && ./bench.sh -speed
echo ""
read -p ' Process Complete | Press [ENTER] ' typed </dev/tty
read -p '🌍 Process Complete | Press [ENTER] ' typed </dev/tty
question1 ;;
z) exit ;;
Z) exit ;;

View File

@@ -0,0 +1,66 @@
#!/bin/bash
# Title: ouroboros
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
# FACTS #######################################################################
- name: 'Ensure Monitors File Exists'
copy:
content: ''
dest: '/var/plexguide/pgupdater.output'
force: 'no'
group: '1000'
owner: '1000'
mode: '0755'
- name: 'Register Monitor List'
shell: 'cat /var/plexguide/pgupdater.output'
register: 'pgupdater'
- name: 'Set Known Facts'
set_fact:
pgrole: 'ouroboros'
- name: 'Setting {{pgrole}} Volumes'
set_fact:
pg_volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- '/etc/localtime:/etc/localtime:ro'
- name: 'Setting {{pgrole}} ENV'
set_fact:
pg_env:
LATEST: 'false' #Some containers will break if set to latest, use tag already set by setting this to false
CLEANUP: 'true'
INTERVAL: '86400' #cEvery 24 hours in seconds
LOG_LEVEL: 'info'
SELF_UPDATE: 'true'
MONITOR: '{{pgupdater.stdout}}' #Can set to specific container only see wiki for details (https://github.com/pyouroboros/ouroboros/wiki/Usage#monitor)
IGNORE: 'mariadb influxdb mongo postgres plexautoscan'
LABELS_ONLY: 'false' #https://github.com/pyouroboros/ouroboros/wiki/Usage#label-enable
LABEL_ENABLE: 'false'
# DATA_EXPORT: 'influxdb'
# INFLUX_URL: 'influxdb'
# INFLUX_PORT: '8086'
# INFLUX_USERNAME: 'admin'
# INFLUX_PASSWORD: 'adminpass'
# INFLUX_DATABASE: 'ouroboros'
# INFLUX_SSL: 'false'
# INFLUX_VERIFY_SSL 'false'
NOTIFIERS: ''
# MAIN DEPLOYMENT #############################################################
- name: 'Deploying {{pgrole}}'
docker_container:
name: '{{pgrole}}'
image: 'pyouroboros/ouroboros'
pull: yes
volumes: '{{pg_volumes}}'
env: '{{pg_env}}'
restart_policy: unless-stopped
networks:
- name: plexguide
aliases:
- 'ouroboros'
state: started

File diff suppressed because it is too large Load Diff

View File

@@ -1,173 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Description: Do the Plex Dance!
Author: Blacktwin, SwiftPanda16
Requires: plexapi, requests
Original Dance moves
1. Move all files for the media item out of the directory your Library is looking at,
so Plex will not “see” it anymore
2. Scan the library (to detect changes)
3. Empty trash
4. Clean bundles
5. Double check naming schema and move files back
6. Scan the library
https://forums.plex.tv/t/the-plex-dance/197064
Script Dance moves
1. Create .plexignore file in affected items library root
.plexignore will contain:
# Ignoring below file for Plex Dance
*Item_Root/*
- if .plexignore file already exists in library root, append contents
2. Scan the library
3. Empty trash
4. Clean bundles
5. Remove or restore .plexignore
6. Scan the library
7. Optimize DB
Example:
Dance with rating key 110645
plex_dance.py --ratingKey 110645
From Unraid host OS
plex_dance.py --ratingKey 110645 --path /mnt/user
*Dancing only works with Show or Movie rating keys
**After Dancing, if you use Tautulli the rating key of the dancing item will have changed.
Please use this script to update your Tautulli database with the new rating key
https://gist.github.com/JonnyWong16/f554f407832076919dc6864a78432db2
"""
from __future__ import print_function
from __future__ import unicode_literals
from plexapi.server import PlexServer
from plexapi.server import CONFIG
import requests
import argparse
import time
import os
# Using CONFIG file
PLEX_URL = ''
PLEX_TOKEN = ''
IGNORE_FILE = "# Ignoring below file for Plex Dance\n{}"
if not PLEX_TOKEN:
PLEX_TOKEN = CONFIG.data['auth'].get('server_token')
if not PLEX_URL:
PLEX_URL = CONFIG.data['auth'].get('server_baseurl')
session = requests.Session()
# Ignore verifying the SSL certificate
session.verify = False # '/path/to/certfile'
# If verify is set to a path to a directory,
# the directory must have been processed using the c_rehash utility supplied
# with OpenSSL.
if session.verify is False:
# Disable the warning that the request is insecure, we know that...
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
plex = PlexServer(PLEX_URL, PLEX_TOKEN, session=session)
def section_path(section, filepath):
for location in section.locations:
if filepath.startswith(location):
return location
def refresh_section(sectionID):
plex = PlexServer(PLEX_URL, PLEX_TOKEN, session=session)
section = plex.library.sectionByID(sectionID)
section.update()
time.sleep(10)
plex = PlexServer(PLEX_URL, PLEX_TOKEN, session=session)
section = plex.library.sectionByID(sectionID)
while section.refreshing is True:
time.sleep(10)
print("Waiting for library to finish refreshing to continue dance.")
plex = PlexServer(PLEX_URL, PLEX_TOKEN, session=session)
section = plex.library.sectionByID(sectionID)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Do the Plex Dance!",
formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--ratingKey', nargs="?", type=int, required=True,
help='Rating key of item that needs to dance.')
parser.add_argument('--path', nargs="?", type=str,
help='Prefix path for libraries behind mount points.\n'
'Example: /mnt/user Resolves: /mnt/user/library_root')
opts = parser.parse_args()
item = plex.fetchItem(opts.ratingKey)
item.reload()
sectionID = item.librarySectionID
section = plex.library.sectionByID(sectionID)
old_plexignore = ''
if item.type == 'movie':
item_file = item.media[0].parts[0].file
locations = os.path.split(item.locations[0])
item_root = os.path.split(locations[0])[1]
library_root = section_path(section, locations[0])
elif item.type == 'show':
locations = os.path.split(item.locations[0])
item_root = locations[1]
library_root = section_path(section, locations[0])
else:
print("Media type not supported.")
exit()
library_root = opts.path + library_root if opts.path else library_root
plexignore = IGNORE_FILE.format('*' + item_root + '/*')
item_ignore = os.path.join(library_root, '.plexignore')
# Check for existing .plexignore file in library root
if os.path.exists(item_ignore):
# If file exists append new ignore params and store old params
with open(item_ignore, 'a+') as old_file:
old_plexignore = old_file.readlines()
old_file.write('\n' + plexignore)
# 1. Create .plexignore file
print("Creating .plexignore file for dancing.")
with open(item_ignore, 'w') as f:
f.write(plexignore)
# 2. Scan library
print("Refreshing library of dancing item.")
refresh_section(sectionID)
# 3. Empty library trash
print("Emptying Trash from library.")
section.emptyTrash()
time.sleep(5)
# 4. Clean library bundles
print("Cleaning Bundles from library.")
plex.library.cleanBundles()
time.sleep(5)
# 5. Remove or restore .plexignore
if old_plexignore:
print("Replacing new .plexignore with old .plexignore.")
with open(item_ignore, 'w') as new_file:
new_file.writelines(old_plexignore)
else:
print("Removing .plexignore file from dancing directory.")
os.remove(item_ignore)
# 6. Scan library
print("Refreshing library of dancing item.")
refresh_section(sectionID)
# 7. Optimize DB
print("Optimizing library database.")
plex.library.optimize()

View File

@@ -70,6 +70,54 @@
state: started
labels: '{{pg_labels}}'
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:
pgrole: 'ouroboros'
- name: 'Setting {{pgrole}} Volumes'
set_fact:
pg_volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- '/etc/localtime:/etc/localtime:ro'
- name: 'Setting {{pgrole}} ENV'
set_fact:
pg_env:
LATEST: 'true' #Some containers will break if set to latest, use tag already set by setting this to false
CLEANUP: 'true'
INTERVAL: '86400' #cEvery 24 hours in seconds
LOG_LEVEL: 'info'
SELF_UPDATE: 'true'
MONITOR: '' #Can set to specific container only see wiki for details (https://github.com/pyouroboros/ouroboros/wiki/Usage#monitor)
IGNORE: 'mariadb influxdb mongo postgres'
LABELS_ONLY: 'false' #https://github.com/pyouroboros/ouroboros/wiki/Usage#label-enable
LABEL_ENABLE: 'false'
# DATA_EXPORT: 'influxdb'
# INFLUX_URL: 'influxdb'
# INFLUX_PORT: '8086'
# INFLUX_USERNAME: 'admin'
# INFLUX_PASSWORD: 'adminpass'
# INFLUX_DATABASE: 'ouroboros'
# INFLUX_SSL: 'false'
# INFLUX_VERIFY_SSL 'false'
NOTIFIERS: ''
# MAIN DEPLOYMENT #############################################################
- name: 'Deploying {{pgrole}}'
docker_container:
name: '{{pgrole}}'
image: 'pyouroboros/ouroboros'
pull: yes
volumes: '{{pg_volumes}}'
env: '{{pg_env}}'
restart_policy: unless-stopped
networks:
- name: plexguide
aliases:
- 'ouroboros'
state: started
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:

View File

@@ -9,21 +9,19 @@ source /opt/plexguide/menu/functions/functions.sh
abc="/var/plexguide"
################################################################################
serverid() {
declare NF='\033[1;32m'
declare NC='\033[0m'
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Create a Server ID - Please use one word & keep it simple
↘️ Establishing Server ID 💬 Use One Word & Keep it Simple
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '💬 TYPE Server ID | Press [ENTER]: ' typed </dev/tty
read -p '🌏 TYPE Server ID | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" == "" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ WARNING! - The Server ID cannot be left blank!
⛔️ WARNING! - The Server ID Cannot Be Blank!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1
@@ -32,7 +30,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Server ID $(echo -e ${NF}$typed${NC}) stored ✔️
✅️ PASS: Server ID $typed Established
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo "$typed" >${abc}/server.id
@@ -42,21 +40,19 @@ EOF
}
####################################
serveridnew() {
declare NF='\033[1;32m'
declare NC='\033[0m'
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Create a Server ID - Please use one word & keep it simple
↘️ Establishing New Server ID 💬 Use One Word & Keep it Simple
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '💬 TYPE Server ID | Press [ENTER]: ' typed </dev/tty
read -p '🌏 TYPE Server ID | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" == "" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ WARNING! - The Server ID cannot be left blank!
⛔️ WARNING! - The Server ID Cannot Be Blank!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1
@@ -65,7 +61,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Server ID $(echo -e ${NF}$typed${NC}) stored ✔️
✅️ PASS: Server ID $typed Established
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo "$typed" >${abc}/server.id
@@ -83,7 +79,7 @@ if [[ -e "$conf" ]]; then
rclone mkdir gdrive:/plexguide/backup/$(cat /var/plexguide/server.id) --config /opt/appdata/plexguide/rclone.conf;fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Backup folder created on GDrive ✔️
✅ PASS: Backup folder created on GDrive
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
@@ -98,17 +94,17 @@ status=$(cat /var/plexguide/server.id)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Create a Server ID - Use one word & keep it simple
↘️ Establishing New Server ID 💬 Use One Word & Keep it Simple
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] Deploy new Server ID
[2] Use existing ones [ $status ]
[1] Deploy New ServerID
[2] use existing ones [ $status ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Z] - Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1) serveridnew && clear && exit ;;

View File

@@ -1,318 +1,71 @@
#!/bin/bash
#
# Title: PTS major file
# Title: PTS major file
# org.Author(s): Admin9705 - Deiteq
# Mod: Pandaura - history at bottom
# GNU: General Public License v3.0
# Mod from MrDoob for PTS
# GNU: General Public License v3.0
################################################################################
source /opt/plexguide/menu/functions/functions.sh
source /opt/plexguide/menu/functions/install.sh
declare NY='\033[0;33m'
declare NC='\033[0m'
declare NG='\033[1;32m'
sudocheck() {
if [[ $EUID -ne 0 ]]; then
if [[ $EUID -ne 0 ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You must execute as a SUDO USER (with sudo) or as ROOT!
You Must Execute as a SUDO USER (with sudo) or as ROOT!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
exit 0
fi
exit 0
fi
}
gitupdate() {
cd /opt/plexguide/
git fetch
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "$BRANCH" > $filevg/panda.branch
if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date" > $filevg/panda.update
elif [ $LOCAL = $BASE ]; then
echo "🌟 Update Available!🌟" > $filevg/panda.update
elif [ $REMOTE = $BASE ]; then
echo "Need to push" > $filevg/panda.update
else
echo "Diverged"
fi
}
test
downloadpg() {
gitupdate
update=$(cat /var/plexguide/panda.update)
dev=$(cat /var/plexguide/pgcloner.projectversion)
BRANCH=$(cat /var/plexguide/panda.branch)
if [[ "dev" == "$dev" ]]; then
if [[ "$BRANCH" == "master" ]]; then
#rm -rf /opt/plexguide 1>/dev/null 2>&1
git checkout -b dev origin/$dev 1>/dev/null 2>&1
git pull 1>/dev/null 2>&1
ansible-playbook /opt/plexguide/menu/alias/alias.yml 1>/dev/null 2>&1
fi
if [[ "$update" == "🌟 Update Available!🌟" ]]; then
#rm -rf /opt/plexguide 1>/dev/null 2>&1
git checkout -b dev origin/$dev 1>/dev/null 2>&1
git pull 1>/dev/null 2>&1
ansible-playbook /opt/plexguide/menu/alias/alias.yml 1>/dev/null 2>&1
fi
fi
if [[ "master" == "$dev" ]]; then
if [[ "$BRANCH" == "dev" ]]; then
#rm -rf /opt/plexguide 1>/dev/null 2>&1
git checkout -b dev origin/$dev 1>/dev/null 2>&1
git pull 1>/dev/null 2>&1
ansible-playbook /opt/plexguide/menu/alias/alias.yml 1>/dev/null 2>&1
fi
if [[ "$update" == "🌟 Update Available!🌟" ]]; then
#rm -rf /opt/plexguide 1>/dev/null 2>&1
git checkout -b dev origin/$dev 1>/dev/null 2>&1
git pull 1>/dev/null 2>&1
ansible-playbook /opt/plexguide/menu/alias/alias.yml 1>/dev/null 2>&1
fi
fi
rm -rf /opt/plexguide
git clone --single-branch https://github.com/MHA-Team/PTS-Team.git /opt/plexguide 1>/dev/null 2>&1
ansible-playbook /opt/plexguide/menu/version/missing_pull.yml
ansible-playbook /opt/plexguide/menu/alias/alias.yml 1>/dev/null 2>&1
rm -rf /opt/plexguide/place.holder >/dev/null 2>&1
rm -rf /opt/plexguide/.git* >/dev/null 2>&1
}
missingpull() {
file="/opt/plexguide/menu/functions/install.sh"
if [ ! -e "$file" ]; then
file="/opt/plexguide/menu/functions/install.sh"
if [ ! -e "$file" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Base folder is missing!
Base folder went missing!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 2
sleep 2
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Re-downloading Pandaura
🍖 NOM NOM - Re-Downloading PTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 2
downloadpg
sleep 2
downloadpg
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Repair complete. Standby!
✅️ Repair Complete! Standby!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 2
fi
sleep 2
fi
}
exitcheck() {
bash /opt/plexguide/menu/version/file.sh
file="/var/plexguide/exited.upgrade"
if [ ! -e "$file" ]; then
bash /opt/plexguide/menu/interface/ending.sh
else
rm -rf /var/plexguide/exited.upgrade 1>/dev/null 2>&1
echo ""
bash /opt/plexguide/menu/interface/ending.sh
fi
}
edition=$(cat /var/plexguide/pg.edition)
serverid=$(cat /var/plexguide/server.id)
pgnumber=$(cat /var/plexguide/pg.number)
top_menu() {
if [[ $# -eq 0 ]]; then
menu=$pgnumber
else
menu=$1
fi
# Menu Interface
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 $transport $menu ID: $serverid
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- SB-API Access: 🟢 - Internal API Access: 🟢 - $(echo -e $Memory)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$(echo -e $update)
Disk Used Space: $used of $capacity | $percentage Used Capacity
EOF
}
disk_space_used_space() {
# Displays Second Drive of GCE
edition=$(cat /var/plexguide/pg.server.deploy)
if [ "$edition" == "feeder" ]; then
used_gce=$(df -h /mnt --local | tail -n +2 | awk '{print $3}')
capacity_gce=$(df -h /mnt --local | tail -n +2 | awk '{print $2}')
percentage_gce=$(df -h /mnt --local | tail -n +2 | awk '{print $5}')
echo " GCE disk used space: $used_gce of $capacity_gce | $percentage_gce Used Capacity"
fi
disktwo=$(cat "/var/plexguide/server.hd.path")
if [ "$edition" != "feeder" ]; then
used_gce2=$(df -h "$disktwo" --local | tail -n +2 | awk '{print $3}')
capacity_gce2=$(df -h "$disktwo" --local | tail -n +2 | awk '{print $2}')
percentage_gce2=$(df -h "$disktwo" --local | tail -n +2 | awk '{print $5}')
if [[ "$disktwo" != "/mnt" ]]; then
echo " 2nd disk used space: $used_gce2 of $capacity_gce2 | $percentage_gce2 Used Capacity"
fi
bash /opt/plexguide/menu/version/file.sh
file="/var/plexguide/exited.upgrade"
if [ ! -e "$file" ]; then
bash /opt/plexguide/menu/interface/ending.sh
else
rm -rf /var/plexguide/exited.upgrade 1>/dev/null 2>&1
echo ""
bash /opt/plexguide/menu/interface/ending.sh
fi
}
main_menu() {
# For PG UI - Force Variable to Set
ports=$(cat /var/plexguide/server.ports)
if [ "$ports" == "" ]; then
echo "Open" >$filevg/pg.ports
else echo "Closed" >$filevg/pg.ports; fi
tee <<-EOF
[1] Networking : Reverse Proxy | Domain Setup
[2] Security : Secure your server
[3] Mount : Mount Cloud Based Storage
[4] Apps : Apps ~ Core, Community & Removal
[5] Vault : Backup & Restore
-------------------------------------------------------------------------
[8] Tools : Tools
[9] IRC : Matrix chat client to Discord
[0] Settings : Settings
EOF
}
end_menu() {
tee <<-EOF
_________________________________________________________________________
[Z] Exit
https://discord.sudobox.io https://sudobox.io/
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
}
end_menu_back() {
tee <<-EOF
_________________________________________________________________________
[Z] Back
https://discord.sudobox.io https://sudobox.io/
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
}
sub_menu_networking() { # first sub menu
tee <<-EOF
[1]$(echo -e ${NG}Networking${NC}) : Reverse Proxy | Domain Setup
[E] Reverse Proxy - Setup a domain using Traefik [🟢 ]
[2] Security : Secure your server
[3] Mount : Mount Cloud Based Storage
[4] Apps : Apps ~ Core, Community & Removal
[5] Vault : Backup & Restore
-------------------------------------------------------------------------
[8] Tools : Tools
[9] IRC : Matrix chat client to Discord
[0] Settings : Settings
EOF
}
sub_menu_security() { # Menu Interface
tee <<-EOF
[1] Networking : Reverse Proxy | Domain Setup
[2] $(echo -e ${NG}Security${NC}) : Secure your server
[E] Shield - Single Sign-On MFA Portal [🟢 ]
[D] PortGuard - Close vulnerable container ports [🟢 ]
[C] VPN - Setup a secure network [🟢 ]
[3] Mount : Mount Cloud Based Storage
[4] Apps : Apps ~ Core, Community & Removal
[5] Vault : Backup & Restore
-------------------------------------------------------------------------
[8] Tools : Tools
[9] IRC : Matrix chat client to Discord
[0] Settings : Settings
EOF
}
sub_menu_mount() { # first sub menu
tee <<-EOF
[1]Networking : Reverse Proxy | Domain Setup
[2] Security : Secure your server
[3] $(echo -e ${NG}Mount${NC}) : Mount Cloud based storage
[E] Mount Settings
[D] Deploy Uploader
[C] Add keys
--$(echo -e ${NY}UPDATE MOUNT DETAILS${NC})--
[R] Update credentials - Setup a secure network
[F] Update mount options - Setup a secure network
[4] Apps : Apps ~ Core, Community & Removal
[5] Vault : Backup & Restore
-------------------------------------------------------------------------
[8] Tools : Tools
[9] IRC : Matrix chat client to Discord
[0] Settings : Settings
EOF
}
sub_menu_app() { # Menu Interface
tee <<-EOF
[1] Networking : Reverse Proxy | Domain Setup
[2] Security : Secure your server
[3] Mount : Mount Cloud Based Storage
[4] $(echo -e ${NG}Apps${NC}) : Apps ~ Core, Community & Removal
--$(echo -e ${NY}INSTALL${NC})--
[E] Core 11/11
[D] Community apps 11/11
[C] Personal apps
--$(echo -e ${NY}REMOVE${NC})--
[R] Remove apps
[F] Full wipe (appdata too) # needs research
--$(echo -e ${NY}UPDATE${NC})--
[V] Update app
[T] Update app subdomain
--$(echo -e ${NY}THEMES${NC})--
[5] Vault : Backup & Restore
-------------------------------------------------------------------------
[8] Tools : Tools
[9] IRC : Matrix chat client to Discord
[0] Settings : Settings
EOF
}
sub_menu_vault() { # Menu Interface
tee <<-EOF
[1] Networking : Reverse Proxy | Domain Setup
[2] Security : Secure your server
[3] Mount : Mount Cloud Based Storage
[4] Apps$ : Apps ~ Core, Community & Removal
[5] $(echo -e ${NG}Vault${NC}) : Backup & Restore
--$(echo -e ${NY}BACKUP${NC})--
[E] Backup menu
-------------------------------------------------------------------------
[8] Tools : Tools
[9] IRC : Matrix chat client to Discord
[0] Settings : Settings
EOF
}
# Previous modders - MrDoob
#[E] Backup a container 11/11
# [D] Backup all
# --$(echo -e ${NY}RESTORE${NC})--
# [C] Restore a container
#[R] Restore all
#--$(echo -e ${NY}Processing Location${NC})--
#[F] Change location

View File

@@ -12,7 +12,7 @@ sudocheck() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You must execute as a SUDO USER (with sudo) or as ROOT!
You Must Execute as a SUDO USER (with sudo) or as ROOT!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -31,12 +31,12 @@ tee <<-EOF
mergerfs installed version = $mgstored
mergerfs latest version = $mgversion
[Y] UPDATE to latest version
[Y] UPDATE to lateste version
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
@@ -55,18 +55,18 @@ rcstored="$(rclone --version | awk '{print $2}' | tail -n 3 | head -n 1)"
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Rclone update panel $rcstored
rClone Update Panel $rcstored
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Rclone installed version = $rcstored
Rclone latest version = $rcversion
rclone installed version = $rcstored
rclone latest version = $rcversion
[Y] UPDATE to latest version
[Y] UPDATE to lateste version
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
Y) ansible-playbook /opt/plexguide/menu/pg.yml --tags rcloneinstall && $check ;;

View File

@@ -21,7 +21,7 @@ source /opt/plexguide/menu/gce/functions/destroy.sh
# BAD INPUT
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
gcestart
}
sudocheck() {
@@ -29,7 +29,7 @@ sudocheck() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You Must Execute as a SUDO USER (with sudo) or as ROOT!
You Must Execute as a SUDO USER (with sudo) or as ROOT!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -63,7 +63,7 @@ gcestart() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 GCE Deployment
🌎 GCE Deployment
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ 1 ] Log Into the Account : [ $account ]

View File

@@ -17,7 +17,7 @@ deployserver() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 ERROR: GCE Instance Already Detected
🚀 ERROR: GCE Instance Already Detected
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INFORMATION: The prior GCE Server must be deleted prior to deloying a
@@ -36,7 +36,7 @@ EOF
#tee <<-EOF
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#🛈 Deleting Old IP Address
#🚀 Deleting Old IP Address
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#EOF
@@ -50,7 +50,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Creating Firewall Rules | Does Not Exist
🚀 Creating Firewall Rules | Does Not Exist
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -65,7 +65,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Deleting Old Template
🚀 Deleting Old Template
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -99,7 +99,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Finalizing - Assigned IP Address to Instance
🚀 Finalizing - Assigned IP Address to Instance
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF

View File

@@ -16,7 +16,7 @@ destroyserver() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 SYSTEM MESSAGE: No GCE Server Deployed! Exiting!
🌎 SYSTEM MESSAGE: No GCE Server Deployed! Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -33,7 +33,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 SYSTEM MESSAGE: Destroying Server - Can Take Awhile!
🌎 SYSTEM MESSAGE: Destroying Server - Can Take Awhile!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -43,7 +43,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 SYSTEM MESSAGE: Releasing IP Address
🌎 SYSTEM MESSAGE: Releasing IP Address
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -64,7 +64,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 SYSTEM MESSAGE: Process Complete!
🌎 SYSTEM MESSAGE: Process Complete!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF

View File

@@ -12,7 +12,7 @@ billingdeny() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 MESSAGE TYPE: ERROR
🌎 MESSAGE TYPE: ERROR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REASON: Billing Failed
@@ -35,7 +35,7 @@ EOF
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
projectinterface
}
@@ -58,7 +58,7 @@ deployfail() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Deployment Checks Failed!
🌎 Deployment Checks Failed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Unfortunately, the deploy failed,
@@ -86,7 +86,7 @@ clear
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 GCE Calculaor
🚀 GCE Calculaor
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
if they want to know what an instance would cost them; click on this link,
@@ -107,7 +107,7 @@ nvmecount() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 NVME Count
🌎 NVME Count
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Most users will only need to utilize 1 - 2 NVME Drives.
@@ -149,7 +149,7 @@ ramcount() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 RAM Count
🌎 RAM Count
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Most users will only need to utilize 8 Gb Ram.
@@ -172,7 +172,7 @@ imagecount() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 OS Image
🌎 OS Image
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ 1 ] Ubuntu 1804 = Public OS Image
@@ -200,7 +200,7 @@ processorcount() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Processor Count
🌎 Processor Count
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INFORMATION:
@@ -226,7 +226,7 @@ projectinterface() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Project Interface
🌎 Project Interface
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Project ID: [ $projectid ]
@@ -250,7 +250,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Utilize/Change Existing Project
🌎 Utilize/Change Existing Project
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
QUESTION:
@@ -300,7 +300,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PLEASE WAIT! Enabling Billing ~ Project $typed
🌎 PLEASE WAIT! Enabling Billing ~ Project $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -310,7 +310,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PLEASE WAIT! Enabling Compute API ~ Project $typed
🌎 PLEASE WAIT! Enabling Compute API ~ Project $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -319,7 +319,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PLEASE WAIT! Enabling Drive API ~ Project $typed
🌎 PLEASE WAIT! Enabling Drive API ~ Project $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -329,7 +329,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 NOTICE: Project Default Set ~ $typed
🌎 NOTICE: Project Default Set ~ $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -345,7 +345,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Create & Set a Project Name
🌎 Create & Set a Project Name
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INSTRUCTIONS:
@@ -375,7 +375,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Project Message
🌎 Project Message
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INFO: $projectfinal created.
@@ -396,7 +396,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Delete Existing Projects
🌎 Delete Existing Projects
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING : Deleting projects will result in deleting keys that are
@@ -448,7 +448,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 System Message: Project Deleted ~ $typed
🌎 System Message: Project Deleted ~ $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -475,7 +475,7 @@ noprojects() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 No Projects Exist
🌎 No Projects Exist
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING: No projects exists! Cannot delete the default active project if
@@ -495,7 +495,7 @@ projectdeny() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 MESSAGE TYPE: ERROR
🌎 MESSAGE TYPE: ERROR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REASON: Project ID Not Set

View File

@@ -34,7 +34,7 @@ regioncenter() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Select a GCE Region
🚀 Select a GCE Region
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ $profinal ]

View File

@@ -15,7 +15,7 @@ file2="/var/plexguide/gce.check"
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You Must Execute as a SUDO USER (with sudo) or as ROOT!
You Must Execute as a SUDO USER (with sudo) or as ROOT!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF

View File

@@ -31,7 +31,7 @@ if [ "$test" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - You Must Input an API Token from Hetzner First!
WARNING! - You Must Input an API Token from Hetzner First!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ 1 } Activate a Hetzner Cloud Account
@@ -141,7 +141,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Deploying Your Server!
🚀 Deploying Your Server!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -237,7 +237,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Server: $destroy - Does Not Exist!
Server: $destroy - Does Not Exist!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF

View File

@@ -7,14 +7,14 @@
################################################################################
source /opt/plexguide/menu/functions/install.sh
emergency
file="/bin/pandaura"
if [[ ! -f "/bin/pandaura" ]]; then
cp /opt/plexguide/menu/alias/templates/pts /bin && chown 1000:1000 /bin/pandaura && chmod 0755 /bin/pandaura; fi
file="/bin/pts"
if [[ ! -f "/bin/pts" ]]; then
cp /opt/plexguide/menu/alias/templates/pts /bin && chown 1000:1000 /bin/pts && chmod 0755 /bin/pts; fi
#
clear
printf '
┌─────────────────────────────────────┐
│ -== Pandaura ==-
-== Team PTS ==- │
│ ————————————————————————————————————│
│ Restart PTS: pts │
│ Update PTS: ptsupdate │
@@ -22,13 +22,20 @@ clear
│ Download Your PTS Fork: pgfork │
│ │
│ ————————————————————————————————————│
│ Thanks For being a part of the team │
│ Thanks For Being Part of the Team
│ │
│ Thanks to: │
│ │
Hawkinzzz, Syndrogo, Anap_
Xaritomi, Demon, Man1234,
Pianomanx, xr3negadex, salty, │ |
Davaz, Deiteq, FlickerRate,
ClownFused, MrDoob, Sub7Seven,
TimeKills, The_Creator, Desimaniac, │
│ l3uddz, RXWatcher, Calmcacil, │
│ ΔLPHΔ , Maikash , Porkie │
│ CDN_RAGE , hawkinzzz , The_DeadPool │
│ BugHunter : Krallenkiller │
│ │
└─────────────────────────────────────┘
'

View File

@@ -38,8 +38,6 @@ else
echo "command_warnings = False" >>/etc/ansible/ansible.cfg
echo "callback_whitelist = profile_tasks" >>/etc/ansible/ansible.cfg
echo "inventory = /etc/ansible/inventories/local" >>/etc/ansible/ansible.cfg
echo "no_target_syslog = True" >>/etc/ansible/ansible.cfg
echo "syslog_facility = LOG_USER" >>/etc/ansible/ansible.cfg
### Disabling cows for people that have cowsay installed
echo "nocows = 1" >>/etc/ansible/ansible.cfg

View File

@@ -14,27 +14,27 @@ abc="/var/plexguide"
serverid() {
if [[ "$start" != "$stored" ]]; then
clear
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Create a Server ID - Please use one word & keep it simple
↘️ Establishing New Server ID 💬 Use One Word & Keep it Simple
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '💬 TYPE Server ID | Press [ENTER]: ' typed </dev/tty
read -p '🌏 TYPE Server ID | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" == "" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ WARNING! - The Server ID cannot be blank!
⛔️ WARNING! - The Server ID Cannot Be Blank!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1
sleep 3
serverid
exit
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Server ID $(echo -e ${NF}$typed${NC}) stored ✔️
✅️ PASS: New ServerID Set
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF

View File

@@ -6,22 +6,18 @@
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
typed="${typed,,}"
source /opt/plexguide/menu/functions/functions.sh
source /opt/plexguide/menu/functions/install.sh
################################################################################
source /opt/plexguide/menu/functions/serverid.sh
source /opt/plexguide/menu/functions/nvidia.sh
source /opt/plexguide/menu/functions/uichange.sh
branch="cat /var/plexguide/pgcloner.projectversion"
dev="sed -i '1s/.*/dev/' $branch"
final="sed -i '1s/.*/final/' $branch"
rcdupe() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 RClone dedupe
🚀 RClone dedupe
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INFO AND NOTE
Interactively find duplicate files and delete/rename them.
@@ -89,7 +85,7 @@ touch /var/plexguide/pgui.switch
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 Settings Interface Menu
🚀 Settings Interface Menu
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] MultiHD : Add Multiple HDs and/or Mount Points to MergerFS
@@ -99,11 +95,9 @@ touch /var/plexguide/pgui.switch
[5] Server ID change : Change your ServerID
[6] NVIDIA Docker Role : NVIDIA Docker
[7] RCLONE DEDUPE
--------------------------------------------------------------------------
[T] TroubleShoot : PreInstaller
[B] Change Branch : Change Github
[U] Updater : Update fork automatically
__________________________________________________________________________
[99] TroubleShoot : PreInstaller
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -126,38 +120,11 @@ EOF
6) nvidia && clear && setstart ;;
7) rcdupe ;;
###########################################################################
t) bash /opt/plexguide/menu/functions/tshoot.sh && clear && setstart ;;
T) bash /opt/plexguide/menu/functions/tshoot.sh && clear && setstart ;;
B) branch && clear && setstart ;;
99) bash /opt/plexguide/menu/functions/tshoot.sh && clear && setstart ;;
z) exit ;;
Z) exit ;;
*) setstart ;;
esac
}
branch(){
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💪 Set Pandaura branch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Here you can set which Pandaura branch you wish to use.
Type on of the following to continue:
final
dev
--------------------------------------------------------------------------
Current Branch : $branch
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type in a branch | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" == "" ]]; then setstart; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then setstart; fi
if [[ "$typed" == "dev" ]]; then $dev; fi
if [[ "$typed" == "dev" ]]; then $final; fi
}
setstart
setstart

View File

@@ -7,7 +7,6 @@
################################################################################
rm -rf /var/plexguide/ver.temp 1>/dev/null 2>&1
touch /var/plexguide/ver.temp
typed="${typed,,}"
sleep 4
## Builds Version List for Display
@@ -32,7 +31,7 @@ while [ "$break" == "no" ]; do
read -p '↘️ Type | PRESS ENTER: ' typed
storage=$(grep $typed /var/plexguide/ver.temp)
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
echo ""
touch /var/plexguide/exited.upgrade
exit
@@ -54,7 +53,7 @@ EOF
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SYSTEM MESSAGE: Version $storage does not exist! - Standby!
SYSTEM MESSAGE: Version $storage does not exist! - Standby!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 4

View File

@@ -82,3 +82,7 @@ $W GDrive | uncrypted : $G$gdrive
$W TDrive | uncrypted : $G$tdrive
$W GDrive | crypted : $G$gcrypt
$W TDrive | crypted : $G$tcrypt
$W %++++++++++ WISE WORD OF THE DAY ++++++++++%
$W $W$wisword
$W %++++++++++ WISE WORD OF THE DAY ++++++++++%"

View File

@@ -6,11 +6,11 @@
# GNU: General Public License v3.0
################################################################################
removepoint() {
rolevars
rolevars
# Nothing Exist; kick user back to main menu
frontoutput=$(cat /var/plexguide/multihd.paths)
if [[ "$frontoutput" == "" ]]; then
# Nothing Exist; kick user back to main menu
frontoutput=$(cat /var/plexguide/multihd.paths)
if [[ "$frontoutput" == "" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -23,18 +23,18 @@ that does not exist! EXITING!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -rp '↘️ Acknowledge Info | Press [ENTER] ' typed </dev/tty
multihdstart
fi
read -rp '↘️ Acknowledge Info | Press [ENTER] ' typed </dev/tty
multihdstart
fi
inputphase
inputphase
}
inputphase() {
typed="${typed,,}"
rm -rf /var/plexguide/.tmp.removepointmenu 1>/dev/null 2>&1
# Starting Process
rm -rf /var/plexguide/.tmp.removepointmenu 1>/dev/null 2>&1
# Starting Process
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -43,12 +43,12 @@ inputphase() {
NOTE: Type a number selection in order to remove one of the HD/Mountpoints
EOF
num=0
while read p; do
((num++))
echo "[$num] $p"
echo "[$num] $p" >>/var/plexguide/.tmp.removepointmenu
done </var/plexguide/multihd.paths
num=0
while read p; do
((num++))
echo "[$num] $p"
echo "[$num] $p" >>/var/plexguide/.tmp.removepointmenu
done </var/plexguide/multihd.paths
tee <<-EOF
@@ -56,31 +56,31 @@ Quitting? Type >>> exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -rp '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
read -rp '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then multihdstart; fi
if [[ "$typed" == "" ]]; then inputphase; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then multihdstart; fi
if [[ "$typed" == "" ]]; then inputphase; fi
if [[ "$typed" -ge "1" && "$typed" -le "$num" ]]; then removepointfinal; fi
if [[ "$typed" -ge "1" && "$typed" -le "$num" ]]; then removepointfinal; fi
inputphase
inputphase
}
removepointfinal() {
cat /var/plexguide/.tmp.removepointmenu | grep "$typed" >/var/plexguide/.tmp.removepointmenu.select
removestore=$(cat /var/plexguide/.tmp.removepointmenu.select | awk '{print $2}')
cat /var/plexguide/.tmp.removepointmenu | grep "$typed" >/var/plexguide/.tmp.removepointmenu.select
removestore=$(cat /var/plexguide/.tmp.removepointmenu.select | awk '{print $2}')
rm -rf /var/plexguide/.tmp.removebuild 1>/dev/null 2>&1
num=0
while read p; do
if [[ "$removestore" != "$p" ]]; then echo "$p" >>/var/plexguide/.tmp.removebuild; fi
done </var/plexguide/multihd.paths
rm -rf /var/plexguide/.tmp.removebuild 1>/dev/null 2>&1
num=0
while read p; do
if [[ "$removestore" != "$p" ]]; then echo "$p" >>/var/plexguide/.tmp.removebuild; fi
done </var/plexguide/multihd.paths
rm -rf /var/plexguide/multihd.paths
cp /var/plexguide/.tmp.removebuild /var/plexguide/multihd.paths
rm -rf /var/plexguide/multihd.paths
cp /var/plexguide/.tmp.removebuild /var/plexguide/multihd.paths
# Congrats! The Path Should Now Be Removed
# Congrats! The Path Should Now Be Removed
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -97,7 +97,7 @@ through rClone!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -rp '↘️ Acknowledge Info | Press [ENTER] ' typed </dev/tty
read -rp '↘️ Acknowledge Info | Press [ENTER] ' typed </dev/tty
multihdstart
multihdstart
}

View File

@@ -60,7 +60,7 @@ chk=$(figlet PTS - UI | lolcat )
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PTS UI
🚀 PTS UI
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$chk
@@ -89,7 +89,7 @@ status=$(cat /var/plexguide/varken/api.check)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PTS-Varken -EDITION
🚀 PTS-Varken -EDITION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] MaxmInd API [ $status ]

View File

@@ -22,7 +22,7 @@ question1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 $program - Set subdomains & ports
$program - Set subdomains & ports
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -62,7 +62,7 @@ EOF
if [[ "$typed" == "A" || "$typed" == "a" ]]; then
exit
elif [ "$typed" == "1" ]; then
read -p "↘️ Type subdomain to use for $program | Press [ENTER]: " typed </dev/tty
read -p "🌍 Type subdomain to use for $program | Press [ENTER]: " typed </dev/tty
if [[ "$typed" == "" ]]; then
badinput1
@@ -75,7 +75,7 @@ EOF
fi
fi
elif [ "$typed" == "2" ]; then
read -p "↘️ Type port 1025-65535 to use for $program | blank for default | Press [ENTER]: " typed </dev/tty
read -p "🌍 Type port 1025-65535 to use for $program | blank for default | Press [ENTER]: " typed </dev/tty
if [[ "$typed" == "" ]]; then
echo "" >"/var/plexguide/$program.port"
else

View File

@@ -7,214 +7,216 @@
################################################################################
# FUNCTIONS START ##############################################################
typed="${typed,,}"
source /opt/plexguide/menu/functions/functions.sh
queued() {
echo
read -p " ERROR - ${typed} is already queued! | Press [ENTER] " typed </dev/tty
question1
echo
read -p " ERROR - $typed already queued! | Press [ENTER] " typed </dev/tty
question1
}
value() {
bash /opt/plexguide/menu/pgbox/value.sh
bash /opt/plexguide/menu/pgbox/value.sh
}
exists() {
echo ""
echo " ERROR - ${typed} is already installed!"
read -p '⚠️ Reinstall? [Y/N] | Press [ENTER] ' foo </dev/tty
echo ""
echo " ERROR - $typed already installed!"
read -p '⚠️ Reinstall? [Y/N] | Press [ENTER] ' foo </dev/tty
if [[ "$foo" == "y" || "$foo" == "Y" ]]; then
part1
elif [[ "$foo" == "n" || "$foo" == "N" ]]; then
question1
else exists; fi
if [[ "$foo" == "y" || "$foo" == "Y" ]]; then
part1
elif [[ "$foo" == "n" || "$foo" == "N" ]]; then
question1
else exists; fi
}
badinputcom() {
echo ""
echo " ERROR - Bad input! ${typed} not exist"
echo ""
read -p 'PRESS [ENTER] ' typed </dev/tty
echo ""
echo " ERROR - Bad Input! $typed not exist"
echo ""
read -p 'PRESS [ENTER] ' typed </dev/tty
}
cronexe() {
croncheck=$(cat /opt/communityapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
croncheck=$(cat /opt/communityapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
}
cronmass() {
croncheck=$(cat /opt/communityapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
croncheck=$(cat /opt/communityapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
}
initial() {
rm -rf /var/plexguide/pgbox.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgbox.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
touch /var/plexguide/pgbox.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgbox.buildup
rm -rf /var/plexguide/pgbox.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgbox.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
touch /var/plexguide/pgbox.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgbox.buildup
folder && ansible-playbook /opt/plexguide/menu/pgbox/community/community.yml >/dev/null 2>&1
folder && ansible-playbook /opt/plexguide/menu/pgbox/community/community.yml >/dev/null 2>&1
file="/opt/communityapps/place.holder"
waitvar=0
while [ "$waitvar" == "0" ]; do
sleep .5
if [ -e "$file" ]; then waitvar=1; fi
done
apt-get install dos2unix -yqq
dos2unix /opt/communityapps/apps/image/_image.sh >/dev/null 2>&1
dos2unix /opt/communityapps/apps/_appsgen.sh >/dev/null 2>&1
file="/opt/communityapps/place.holder"
waitvar=0
while [ "$waitvar" == "0" ]; do
sleep .5
if [ -e "$file" ]; then waitvar=1; fi
done
apt-get install dos2unix -yqq
dos2unix /opt/communityapps/apps/image/_image.sh >/dev/null 2>&1
dos2unix /opt/communityapps/apps/_appsgen.sh >/dev/null 2>&1
}
question1() {
typed="${typed,,}"
### Remove Running Apps
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/app.list
done </var/plexguide/pgbox.running
cp /var/plexguide/app.list /var/plexguide/app.list2
### Remove Running Apps
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/app.list
done </var/plexguide/pgbox.running
file="/var/plexguide/community.app"
#if [ ! -e "$file" ]; then
ls -la /opt/communityapps/apps | sed -e 's/.yml//g' |
cp /var/plexguide/app.list /var/plexguide/app.list2
file="/var/plexguide/community.app"
#if [ ! -e "$file" ]; then
ls -la /opt/communityapps/apps | sed -e 's/.yml//g' |
awk '{print $9}' | tail -n +4 >/var/plexguide/app.list
while read p; do
echo "" >>/opt/communityapps/apps/$p.yml
echo "##PG-Community" >>/opt/communityapps/apps/$p.yml
while read p; do
echo "" >>/opt/communityapps/apps/$p.yml
echo "##PG-Community" >>/opt/communityapps/apps/$p.yml
mkdir -p /opt/mycontainers
touch /opt/appdata/plexguide/rclone.conf
done </var/plexguide/app.list
touch /var/plexguide/community.app
#fi
mkdir -p /opt/mycontainers
touch /opt/appdata/plexguide/rclone.conf
done </var/plexguide/app.list
touch /var/plexguide/community.app
#fi
#bash /opt/communityapps/apps/_appsgen.sh
docker ps | awk '{print $NF}' | tail -n +2 >/var/plexguide/pgbox.running
#bash /opt/communityapps/apps/_appsgen.sh
docker ps | awk '{print $NF}' | tail -n +2 >/var/plexguide/pgbox.running
### Remove Official Apps
while read p; do
# reminder, need one for custom apps
baseline=$(cat /opt/communityapps/apps/$p.yml | grep "##PG-Community")
if [ "$baseline" == "" ]; then sed -i -e "/$p/d" /var/plexguide/app.list; fi
done </var/plexguide/app.list
### Remove Official Apps
while read p; do
# reminder, need one for custom apps
baseline=$(cat /opt/communityapps/apps/$p.yml | grep "##PG-Community")
if [ "$baseline" == "" ]; then sed -i -e "/$p/d" /var/plexguide/app.list; fi
done </var/plexguide/app.list
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
### List Out Apps In Readable Order (One's Not Installed)
sed -i -e "/templates/d" /var/plexguide/app.list
sed -i -e "/image/d" /var/plexguide/app.list
sed -i -e "/_/d" /var/plexguide/app.list
num=0
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [[ "$num" == "7" ]]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/app.list
### List Out Apps In Readable Order (One's Not Installed)
sed -i -e "/templates/d" /var/plexguide/app.list
sed -i -e "/image/d" /var/plexguide/app.list
sed -i -e "/_/d" /var/plexguide/app.list
num=0
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [[ "$num" == "7" ]]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/app.list
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgbox.output)
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgbox.output)
if [ "$buildup" == "" ]; then buildup="NONE"; fi
if [ "$buildup" == "" ]; then buildup="NONE"; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💼 Multi-App Installer Community Apps
🚀 Multi-App Installer | Community APPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📂 Potential apps to install
📂 Potential Apps to Install
$notrun
-------------------------------------------------------------------------
💾 Apps below are queued for installation
💾 Apps Queued for Installation
$buildup
_________________________________________________________________________
[A] Install [Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[A] Install
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '💬 Type an app to queue for install | Press [ENTER]: ' typed </dev/tty
read -p '↪️ Type app to queue install | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "deploy" || "${typed}" == "install" || "${typed}" == "a" ]]; then question2; fi
if [[ "$typed" == "deploy" || "$typed" == "Deploy" || "$typed" == "DEPLOY" || "$typed" == "install" || "$typed" == "Install" || "$typed" == "INSTALL" || "$typed" == "a" || "$typed" == "A" ]]; then question2; fi
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then exit; fi
current=$(cat /var/plexguide/pgbox.buildup | grep "\<$typed\>")
if [ "$current" != "" ]; then queued && question1 ; fi
current=$(cat /var/plexguide/pgbox.buildup | grep "\<$typed\>")
if [ "$current" != "" ]; then queued && question1 ; fi
current=$(cat /var/plexguide/pgbox.running | grep "\<$typed\>")
if [ "$current" != "" ]; then exists && question1 ; fi
current=$(cat /var/plexguide/pgbox.running | grep "\<$typed\>")
if [ "$current" != "" ]; then exists && question1 ; fi
current=$(cat /var/plexguide/program.temp | grep "\<$typed\>")
if [ "$current" == "" ]; then badinputcom && question1 ; fi
current=$(cat /var/plexguide/program.temp | grep "\<$typed\>")
if [ "$current" == "" ]; then badinputcom && question1 ; fi
part1
part1
}
part1() {
echo "$typed" >>/var/plexguide/pgbox.buildup
num=0
echo "$typed" >>/var/plexguide/pgbox.buildup
num=0
touch /var/plexguide/pgbox.output && rm -rf /var/plexguide/pgbox.output
touch /var/plexguide/pgbox.output && rm -rf /var/plexguide/pgbox.output
while read p; do
echo -n $p >>/var/plexguide/pgbox.output
echo -n " " >>/var/plexguide/pgbox.output
if [[ "$num" == 7 ]]; then
num=0
echo " " >>/var/plexguide/pgbox.output
fi
done </var/plexguide/pgbox.buildup
while read p; do
echo -n $p >>/var/plexguide/pgbox.output
echo -n " " >>/var/plexguide/pgbox.output
if [[ "$num" == 7 ]]; then
num=0
echo " " >>/var/plexguide/pgbox.output
fi
done </var/plexguide/pgbox.buildup
sed -i "/^$typed\b/Id" /var/plexguide/app.list
sed -i "/^$typed\b/Id" /var/plexguide/app.list
question1
question1
}
final() {
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
echo
exit
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
echo
exit
}
question2() {
# Image Selector
image=off
while read p; do
# Image Selector
image=off
while read p; do
echo "$p" >/tmp/program_var
echo "$p" >/tmp/program_var
bash /opt/communityapps/apps/image/_image.sh
done </var/plexguide/pgbox.buildup
bash /opt/communityapps/apps/image/_image.sh
done </var/plexguide/pgbox.buildup
# Cron Execution
edition=$(cat /var/plexguide/pg.edition)
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
else
croncount=$(sed -n '$=' /var/plexguide/pgbox.buildup)
echo "false" >/var/plexguide/cron.count
if [ "$croncount" -ge 2 ]; then bash /opt/plexguide/menu/cron/mass.sh; fi
fi
# Cron Execution
edition=$(cat /var/plexguide/pg.edition)
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
else
croncount=$(sed -n '$=' /var/plexguide/pgbox.buildup)
echo "false" >/var/plexguide/cron.count
if [ "$croncount" -ge 2 ]; then bash /opt/plexguide/menu/cron/mass.sh; fi
fi
# CName & Port Execution
bash /opt/plexguide/menu/pgbox/cname.sh
# CName & Port Execution
bash /opt/plexguide/menu/pgbox/cname.sh
while read p; do
while read p; do
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -223,36 +225,36 @@ $p - Now Installing!
EOF
##### CHECK START #####
value
##### CHECK EXIT #####
##### CHECK START #####
value
##### CHECK EXIT #####
# Store Used Program
echo "$p" >/tmp/program_var
# Execute Main Program
ansible-playbook /opt/communityapps/apps/$p.yml
# Store Used Program
echo "$p" >/tmp/program_var
# Execute Main Program
ansible-playbook /opt/communityapps/apps/$p.yml
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
elif [ "$croncount" -eq "1" ]; then cronexe; fi
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
elif [ "$croncount" -eq "1" ]; then cronexe; fi
# End Banner
bash /opt/plexguide/menu/pgbox/endbanner.sh >>/tmp/output.info
# End Banner
bash /opt/plexguide/menu/pgbox/endbanner.sh >>/tmp/output.info
sleep 2
done </var/plexguide/pgbox.buildup
echo "" >>/tmp/output.info
cat /tmp/output.info
final
sleep 2
done </var/plexguide/pgbox.buildup
echo "" >>/tmp/output.info
cat /tmp/output.info
final
}
start() {
initial
question1
initial
question1
}
folder() {
mkdir -p /opt/communityapps
mkdir -p /opt/communityapps
}
# FUNCTIONS END ##############################################################

View File

@@ -13,7 +13,7 @@
- name: Cloning Community Apps
git:
repo: 'https://github.com/Pandaura/Apps-Community'
repo: 'https://github.com/MHA-Team/Apps-Community'
dest: /opt/communityapps
version: 'master'
force: yes

View File

@@ -1,259 +1,249 @@
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
# FUNCTIONS START ##############################################################
source /opt/plexguide/menu/functions/functions.sh
source /opt/plexguide/menu/functions/start.sh
typed="${typed,,}"
queued() {
echo
read -p "⛔️ ERROR - $typed is already queued! | Press [ENTER] " typed </dev/tty
question1
echo
read -p "⛔️ ERROR - $typed Already Queued! | Press [ENTER] " typed </dev/tty
question1
}
value() {
bash /opt/plexguide/menu/pgbox/value.sh
bash /opt/plexguide/menu/pgbox/value.sh
}
exists() {
echo ""
echo "⛔️ ERROR - $typed is already installed!"
read -p "⚠️ Would you like to reinstall $typed? [Y/N] | Press [ENTER] " foo </dev/tty
echo ""
echo "⛔️ ERROR - $typed Already Installed!"
read -p '⚠️ Reinstall? [Y/N] | Press [ENTER] ' foo </dev/tty
if [[ "$foo" == "y" || "$foo" == "Y" ]]; then
part1
elif [[ "$foo" == "n" || "$foo" == "N" ]]; then
question1
else exists; fi
if [[ "$foo" == "y" || "$foo" == "Y" ]]; then
part1
elif [[ "$foo" == "n" || "$foo" == "N" ]]; then
question1
else exists; fi
}
badinputcore() {
echo ""
echo "⛔️ ERROR - Bad input! $typed not exist"
echo ""
read -p 'PRESS [ENTER] ' typed </dev/tty
echo ""
echo "⛔️ ERROR - Bad Input! $typed not exist"
echo ""
read -p 'PRESS [ENTER] ' typed </dev/tty
}
cronexe() {
croncheck=$(cat /opt/coreapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
croncheck=$(cat /opt/coreapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
}
cronmass() {
croncheck=$(cat /opt/coreapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
croncheck=$(cat /opt/coreapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
}
initial() {
rm -rf /var/plexguide/pgbox.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgbox.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
touch /var/plexguide/pgbox.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgbox.buildup
rm -rf /var/plexguide/pgbox.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgbox.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
touch /var/plexguide/pgbox.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgbox.buildup
folder && ansible-playbook /opt/plexguide/menu/pgbox/core/core.yml >/dev/null 2>&1
folder && ansible-playbook /opt/plexguide/menu/pgbox/core/core.yml >/dev/null 2>&1
file="/opt/coreapps/place.holder"
waitvar=0
while [ "$waitvar" == "0" ]; do
sleep .5
if [ -e "$file" ]; then waitvar=1; fi
done
apt-get install dos2unix -yqq
dos2unix /opt/coreapps/apps/image/_image.sh >/dev/null 2>&1
dos2unix /opt/coreapps/apps/_appsgen.sh >/dev/null 2>&1
file="/opt/coreapps/place.holder"
waitvar=0
while [ "$waitvar" == "0" ]; do
sleep .5
if [ -e "$file" ]; then waitvar=1; fi
done
apt-get install dos2unix -yqq
dos2unix /opt/coreapps/apps/image/_image.sh >/dev/null 2>&1
dos2unix /opt/coreapps/apps/_appsgen.sh >/dev/null 2>&1
}
question1() {
typed="${typed,,}"
### Remove Running Apps
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/app.list
done </var/plexguide/pgbox.running
cp /var/plexguide/app.list /var/plexguide/app.list2
### Remove Running Apps
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/app.list
done </var/plexguide/pgbox.running
file="/var/plexguide/core.app"
#if [ ! -e "$file" ]; then
ls -la /opt/coreapps/apps | sed -e 's/.yml//g' |
cp /var/plexguide/app.list /var/plexguide/app.list2
file="/var/plexguide/core.app"
#if [ ! -e "$file" ]; then
ls -la /opt/coreapps/apps | sed -e 's/.yml//g' |
awk '{print $9}' | tail -n +4 >/var/plexguide/app.list
while read p; do
echo "" >>/opt/coreapps/apps/$p.yml
echo "##PG-Core" >>/opt/coreapps/apps/$p.yml
while read p; do
echo "" >>/opt/coreapps/apps/$p.yml
echo "##PG-Core" >>/opt/coreapps/apps/$p.yml
mkdir -p /opt/mycontainers
touch /opt/appdata/plexguide/rclone.conf
done </var/plexguide/app.list
touch /var/plexguide/core.app
#fi
mkdir -p /opt/mycontainers
touch /opt/appdata/plexguide/rclone.conf
done </var/plexguide/app.list
touch /var/plexguide/core.app
#fi
#bash /opt/coreapps/apps/_appsgen.sh
docker ps | awk '{print $NF}' | tail -n +2 >/var/plexguide/pgbox.running
#bash /opt/coreapps/apps/_appsgen.sh
docker ps | awk '{print $NF}' | tail -n +2 >/var/plexguide/pgbox.running
### Remove Official Apps
while read p; do
# reminder, need one for custom apps
baseline=$(cat /opt/coreapps/apps/$p.yml | grep "##PG-Core")
if [ "$baseline" == "" ]; then sed -i -e "/$p/d" /var/plexguide/app.list; fi
done </var/plexguide/app.list
### Remove Official Apps
while read p; do
# reminder, need one for custom apps
baseline=$(cat /opt/coreapps/apps/$p.yml | grep "##PG-Core")
if [ "$baseline" == "" ]; then sed -i -e "/$p/d" /var/plexguide/app.list; fi
done </var/plexguide/app.list
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
### List Out Apps In Readable Order (One's Not Installed)
declare NF='\033[1;32m'
declare NC='\033[0m'
tempfile='/var/plexguide/program.temp'
pgboxinstalled=$(docker ps --format '{{.Names}}')
num=0
sed -i -e "/templates/d" /var/plexguide/app.list
sed -i -e "/image/d" /var/plexguide/app.list
sed -i -e "/watchtower/d" /var/plexguide/app.list
sed -i -e "/_/d" /var/plexguide/app.list
while read p; do
installed=false #boolean
for app in $pgboxinstalled
do
if [ "$p" == "$app" ]; then
installed=true
fi
done
if [ $installed == true ]; then
echo -n "$(echo -e ${NF}$p${NC})" >>$tempfile
else
echo -n $p >>$tempfile
fi
echo -n " " >>$tempfile
num=$((num + 1))
if [[ "$num" == "7" ]]; then
num=0
echo " " >>$tempfile
fi
done </var/plexguide/app.list
### List Out Apps In Readable Order (One's Not Installed)
num=0
sed -i -e "/templates/d" /var/plexguide/app.list
sed -i -e "/image/d" /var/plexguide/app.list
sed -i -e "/watchtower/d" /var/plexguide/app.list
sed -i -e "/_/d" /var/plexguide/app.list
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [[ "$num" == "7" ]]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/app.list
notrun=$(cat $tempfile)
buildup=$(cat /var/plexguide/pgbox.output)
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgbox.output)
if [ "$buildup" == "" ]; then buildup="NONE"; fi # make this tidy by removing from list once added
if [ "$buildup" == "" ]; then buildup="NONE"; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💼 Multi-App Installer Core Apps
🚀 Multi-App Installer | Core Edition
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📂 Potential apps to install - Installed apps will be $(echo -e ${NF}GREEN${NC})
📂 Potential Apps to Install
$notrun
-------------------------------------------------------------------------
💾 Apps below are queued for installation
💾 Apps Queued for Installation
$buildup
_________________________________________________________________________
[A] Install
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
end_menu
read -p '💬 Type an app to queue for install | Press [ENTER]: ' typed </dev/tty #convert to lowercase all the fucking time
read -p '↪️ Type app to queue install | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "deploy" || "${typed}" == "install" || "${typed}" == "a" ]]; then question2; fi
if [[ "$typed" == "deploy" || "$typed" == "Deploy" || "$typed" == "DEPLOY" || "$typed" == "install" || "$typed" == "Install" || "$typed" == "INSTALL" || "$typed" == "a" || "$typed" == "A" ]]; then question2; fi
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then exit; fi
current=$(cat /var/plexguide/pgbox.buildup | grep "\<$typed\>")
if [ "$current" != "" ]; then queued && question1; fi
current=$(cat /var/plexguide/pgbox.buildup | grep "\<$typed\>")
if [ "$current" != "" ]; then queued && question1; fi
current=$(cat /var/plexguide/pgbox.running | grep "\<$typed\>")
if [ "$current" != "" ]; then exists && question1; fi
current=$(cat /var/plexguide/pgbox.running | grep "\<$typed\>")
if [ "$current" != "" ]; then exists && question1; fi
current=$(cat /var/plexguide/program.temp | grep "\<$typed\>")
if [ "$current" == "" ]; then badinputcore && question1; fi
current=$(cat /var/plexguide/program.temp | grep "\<$typed\>")
if [ "$current" == "" ]; then badinputcore && question1; fi
part1
part1
}
part1() {
echo "$typed" >>/var/plexguide/pgbox.buildup
num=0
echo "$typed" >>/var/plexguide/pgbox.buildup
num=0
touch /var/plexguide/pgbox.output && rm -rf /var/plexguide/pgbox.output
touch /var/plexguide/pgbox.output && rm -rf /var/plexguide/pgbox.output
while read p; do
echo -n $p >>/var/plexguide/pgbox.output
echo -n " " >>/var/plexguide/pgbox.output
if [[ "$num" == 7 ]]; then
num=0
echo " " >>/var/plexguide/pgbox.output
fi
done </var/plexguide/pgbox.buildup
while read p; do
echo -n $p >>/var/plexguide/pgbox.output
echo -n " " >>/var/plexguide/pgbox.output
if [[ "$num" == 7 ]]; then
num=0
echo " " >>/var/plexguide/pgbox.output
fi
done </var/plexguide/pgbox.buildup
sed -i "/^$typed\b/Id" /var/plexguide/app.list
sed -i "/^$typed\b/Id" /var/plexguide/app.list
question1
question1
}
final() {
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
echo
exit
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
echo
exit
}
question2() {
# Image Selector
image=off
while read p; do
# Image Selector
image=off
while read p; do
echo "$p" >/tmp/program_var
echo "$p" >/tmp/program_var
bash /opt/coreapps/apps/image/_image.sh
bash /opt/coreapps/apps/image/_image.sh
# CName & Port Execution
bash /opt/plexguide/menu/pgbox/cname.sh
done </var/plexguide/pgbox.buildup
# CName & Port Execution
bash /opt/plexguide/menu/pgbox/cname.sh
done </var/plexguide/pgbox.buildup
# Cron Execution
edition=$(cat /var/plexguide/pg.edition)
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
else
croncount=$(sed -n '$=' /var/plexguide/pgbox.buildup)
echo "false" >/var/plexguide/cron.count
if [ "$croncount" -ge 2 ]; then bash /opt/plexguide/menu/cron/mass.sh; fi
fi
# Cron Execution
edition=$(cat /var/plexguide/pg.edition)
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
else
croncount=$(sed -n '$=' /var/plexguide/pgbox.buildup)
echo "false" >/var/plexguide/cron.count
if [ "$croncount" -ge 2 ]; then bash /opt/plexguide/menu/cron/mass.sh; fi
fi
while read p; do
while read p; do
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$p - Is now installing...
$p - Now Installing!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1
value
# Store Used Program
echo "$p" >/tmp/program_var
# Execute Main Program
ansible-playbook /opt/coreapps/apps/$p.yml
sleep 1
value
# Store Used Program
echo "$p" >/tmp/program_var
# Execute Main Program
ansible-playbook /opt/coreapps/apps/$p.yml
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
elif [ "$croncount" -eq "1" ]; then cronexe; fi
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
elif [ "$croncount" -eq "1" ]; then cronexe; fi
# End Banner
bash /opt/plexguide/menu/pgbox/endbanner.sh >>/tmp/output.info
# End Banner
bash /opt/plexguide/menu/pgbox/endbanner.sh >>/tmp/output.info
sleep 2
done </var/plexguide/pgbox.buildup
echo "" >>/tmp/output.info
cat /tmp/output.info
final
sleep 2
done </var/plexguide/pgbox.buildup
echo "" >>/tmp/output.info
cat /tmp/output.info
final
}
@@ -264,16 +254,10 @@ start() {
}
folder() {
mkdir -p /opt/coreapps
mkdir -p /opt/coreapps
}
# FUNCTIONS END ##############################################################
# replaces line 279 of:
# https://github.com/Pandaura/PTS-Team/blob/687c31fc6b2c8722b57515181f1f28b75f0629df/menu/pgbox/core/core.sh#L279
# only execute the start funtion if this script it called directly and but not when sourced.
# this has been done, as question2 funtion is reused by the pts script for direct app(s) installation
# e.g pts install radarr will utilize question2 funtion while skipping the start part.
echo "" >/tmp/output.info
start

View File

@@ -13,7 +13,7 @@
- name: Cloning Core Apps
git:
repo: 'https://github.com/Pandaura/Apps-Core'
repo: 'https://github.com/MHA-Team/Apps-Core'
dest: /opt/coreapps
version: 'master'
force: yes

View File

@@ -1,79 +0,0 @@
#!/bin/bash
IFS=$'\n'
# File name or path
APPS_FILE="/var/plexguide/app.list"
# Read file as array
apps=($(cat "$APPS_FILE"))
length=$((${#apps[@]} - 1))
index=0
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
function print_list() {
local count=0
clear
for i in ${apps[@]}; do
if [[ $count -ne $index ]]; then
echo -e "${RED}${i}"
else
echo -e "${GREEN}${i}"
fi
((count++))
done
echo -ne "${NC}"
}
function your_code_here() {
local app=$*
echo "Your selected app: ${app} "
}
function select_app() {
while read -sN1 key >/dev/null; do
# catch multi-char special key sequences
read -sN1 -t 0.0001 k1
read -sN1 -t 0.0001 k2
read -sN1 -t 0.0001 k3
key+=${k1}${k2}${k3}
case "$key" in
$'\e[A' | $'\e0A' | $'\e[D' | $'\e0D') # cursor up, left: previous item
if [[ $index -gt 0 ]]; then
((index--))
fi
;;
$'\e[B' | $'\e0B' | $'\e[C' | $'\e0C') # cursor down, right: next item
if [[ $index -lt $length ]]; then
((index++))
fi
;;
$'\e[1~' | $'\e0H' | $'\e[H') # home: first item
index=0
;;
$'\e[4~' | $'\e0F' | $'\e[F') # end: last item
index=$length
;;
' ') # space: mark/unmark item
your_code_here "${apps[index]}"
return 0
;;
q | '') # q, carriage return: quit
return 0 ;;
esac
print_list
done
}
print_list
select_app

View File

@@ -1,185 +1,23 @@
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705 - Deiteq
# URL: https://pgblitz.com - http://github.pgblitz.com
# Title: MHA-Team
# Author(s): iDoMnCi
# URL: https://github.com/MHA-Team/MHA-Team
# GNU: General Public License v3.0
################################################################################
typed="${typed,,}"
program=$(cat /tmp/program_var)
cname=$program
if [[ -f "/var/plexguide/$program.cname" ]]; then
cname=$(cat /var/plexguide/$program.cname)
fi
# FUNCTIONS START ##############################################################
source /opt/plexguide/menu/functions/functions.sh
domain=$(cat /var/plexguide/server.domain)
port=$(cat /tmp/program_port)
ip=$(cat /var/plexguide/server.ip)
ports=$(cat /var/plexguide/server.ports)
hdpath=$(cat /var/plexguide/server.hd.path)
if [ "$program" == "plex" ]; then extra="/web"; else extra=""; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Access Configuration Info
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
tee <<-EOF
▫ $program:${port} <- Use this as the url when connecting another app to $program.
EOF
if [ "$ports" == "" ]; then
tee <<-EOF
▫ $ip:${port}${extra}
EOF
fi
if [ "$domain" != "NOT-SET" ]; then
if [ "$ports" == "" ]; then
tee <<-EOF
▫ $domain:${port}${extra}
EOF
fi
tee <<-EOF
▫ $cname.$domain${extra}
EOF
fi
if [ "$program" == "plex" ]; then
tee <<-EOF
First Time Plex Claim Notice
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
if [ "$domain" != "NOT-SET" ]; then
tee <<-EOF
▫ http://plex.${domain}:32400 <-- Use http; not https
EOF
fi
tee <<-EOF
▫ $ip:${port}${extra}
EOF
fi
if [[ "$program" == *"sonarr"* ]] || [[ "$program" == *"radarr"* ]] || [[ "$program" == *"lidarr"* ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 Manual Configuration Required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$program requires additional manual configuration!
EOF
if [[ "$program" == *"sonarr"* ]] || [[ "$program" == *"radarr"* ]] || [[ "$program" == *"lidarr"* ]] || [[ "$program" == *"qbittorrent"* ]]; then
tee <<-EOF
$program requires "downloader mappings" to enable hardlinking and rapid importing.
If you do not have these mappings, $program can't rename and move the files on import.
This will result in files being copied instead of moved, and it will cause other issues.
The mappings are on the download client settings (advanced setting), at the bottom of the page.
Visit https://github.com/Pandaura/PTS-Team/wiki/Remote-Path-Mappings for more information.
EOF
fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Failure to perform manual configuration changes will cause problems!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌍 Visit the wiki for instructions on how to configure $program.
https://github.com/Pandaura/PTS-Team/wiki/$program
EOF
fi
####--------
if [[ "$program" == *"sabnzbd"* ]] || [[ "$program" == *"nzbget"* ]] ; then
cclean=$(cat /var/plexguide/cloneclean)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 NOTE / INFO
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
for incomplete downloads $program used the folder $hdpath/incomplete/nzb
for finished downloads $program used the folder $hdpath/downloads/nzb
beware the cloneclean is set to $cclean min
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [[ "$program" == *"sabnzbd"* ]] ; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 sabnzbd api_key = $sbakey
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [[ "$program" == *"rutorrent"* ]] || [[ "$program" == *"qbittorrent"* ]] || [[ "$program" == *"deluge"* ]]; then
cclean=$(cat /var/plexguide/cloneclean)
tclean=$(($cclean*2))
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 NOTE / INFO
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
for incomplete downloads $program used the folder $hdpath/incomplete/torrent
for finished downloads $program used the folder $hdpath/downloads/torrent
beware the cloneclean is set to $tclean min
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [ "$program" == "plex" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 Manual Configuration Required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
we prefer using plex_autoscan, unlike other alternatives,
that does not put a lot of pressure on the API of your Google Account.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [ "$hdpath" != "/mnt" ]; then
sbakey=$(cat /opt/appdata/sabnzbd/sabnzbd.ini | grep "api_key" | head -n 1 | awk '{print $3}')
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You must add /mnt self to the docker container again
Your $hdpath is not /mnt
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
queued() {
echo
read -p "⛔️ ERROR - $typed Already Queued! | Press [ENTER] " typed </dev/tty
appselect
}
badinput() {
echo ""
echo " ERROR - Bad Input! $typed not exist"
echo " ERROR - Bad Input! $typed not exist"
echo ""
read -p 'PRESS [ENTER] ' typed </dev/tty
}
@@ -239,7 +77,7 @@ appselect() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Multi-App Auto Updater
🚀 Multi-App Auto Updater
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📂 Potential Apps to Auto Update
@@ -259,9 +97,9 @@ $buildup
EOF
read -p '↪️ Type App Name to Queue Auto Updating | Type ALL to select all | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "deploy" || "${typed}" == "install" || "${typed}" == "a" ]]; then start; fi
if [[ "$typed" == "deploy" || "$typed" == "Deploy" || "$typed" == "DEPLOY" || "$typed" == "install" || "$typed" == "Install" || "$typed" == "INSTALL" || "$typed" == "a" || "$typed" == "A" ]]; then question2; fi
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then exit; fi
current=$(cat /var/plexguide/pgbox.buildup | grep "\<$typed\>")
if [ "$current" != "" ]; then queued && appselect; fi
@@ -303,6 +141,19 @@ complete() {
exit
}
question2() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Rebuilding Ouroboros!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
ansible-playbook /opt/plexguide/menu/functions/ouroboros.yml
complete
}
start() {
startup
appselect

View File

@@ -1,7 +1,6 @@
#!/bin/bash
channelsdvr() {
typed="${typed,,}"
hdpath=$(cat /var/plexguide/server.hd.path)
hdpath=$(cat /var/plexguide/server.hd.path)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -21,46 +20,46 @@ $hdpath/dvrfolder
Go Back? Type > exit
EOF
read -p '↘️ Type channelsdvr local Location | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type channelsdvr local Location | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
exit 0
else
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
exit 0
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 SYSTEM MESSAGE: Checking Path $typed
🚀 SYSTEM MESSAGE: Checking Path $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1.5
sleep 1.5
##################################################### TYPED CHECKERS - START
typed2=$typed
bonehead=no
##### If user forgot to add a / in the beginning, we fix for them
initial="$(echo $typed | head -c 1)"
if [ "$initial" != "/" ]; then
typed="/$typed"
fi
##### If user added a / at the end, we fix for them
initial="${typed: -1}"
if [ "$initial" == "/" ]; then
typed=${typed::-1}
fi
##################################################### TYPED CHECKERS - START
typed2=$typed
bonehead=no
##### If user forgot to add a / in the beginning, we fix for them
initial="$(echo $typed | head -c 1)"
if [ "$initial" != "/" ]; then
typed="/$typed"
fi
##### If user added a / at the end, we fix for them
initial="${typed: -1}"
if [ "$initial" == "/" ]; then
typed=${typed::-1}
fi
##################################################### TYPED CHECKERS - START
##################################################### TYPED CHECKERS - START
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 SYSTEM MESSAGE: Checking if Location is Valid
🚀 SYSTEM MESSAGE: Checking if Location is Valid
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1.5
sleep 1.5
mkdir $typed/test 1>/dev/null 2>&1
mkdir $typed/test 1>/dev/null 2>&1
file="$typed/test"
if [ -e "$file" ]; then
file="$typed/test"
if [ -e "$file" ]; then
tee <<-EOF
@@ -70,27 +69,28 @@ EOF
EOF
### Removes /mnt if /mnt/unionfs exists
#check=$(echo $typed | head -c 12)
#if [ "$check" == "/mnt/unionfs" ]; then
#typed=${typed:4}
#fi
### Removes /mnt if /mnt/unionfs exists
#check=$(echo $typed | head -c 12)
#if [ "$check" == "/mnt/unionfs" ]; then
#typed=${typed:4}
#fi
echo "$typed" >/var/plexguide/channelsdvr.folder
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
else
echo "$typed" >/var/plexguide/channelsdvr.folder
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔ ALERT: Path $typed DOES NOT Exist!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Note: You must ensure that linux is able to READ your location.
It's start again for you
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
channelsdvr
fi
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
channelsdvr
fi
fi
}

View File

@@ -1,8 +1,8 @@
#/bin/bash
#/bin/bash
###plaxt.sh
api() {
typed="${typed,,}"
domain=$(cat /var/plexguide/server.domain)
domain=$(cat /var/plexguide/server.domain)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -24,14 +24,14 @@ Go Back? Type > exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type API Client | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/trakt.id
read -p '↘️ Type API Secret | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/trakt.sec
read -p '↘️ Type API Client | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/trakt.id
read -p '↘️ Type API Secret | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/trakt.sec
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
exit 0
else
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
exit 0
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -44,8 +44,8 @@ INFO: Messed up? Rerun this API Interface to update the information!
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fi
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fi
}
api

View File

@@ -1,25 +1,25 @@
#/bin/bash
#/bin/bash
####rcwebui.sh
start0() {
folder && rcwebui
folder && rcwebui
}
folder() {
if [[ ! -e "/var/plexguide/rcwebui" ]]; then
remove
if [[ ! -e "/var/plexguide/rcwebui" ]]; then
remove
else create; fi
}
remove() {
rm -rf /var/plexguide/rcwebui
mkdir -p /var/plexguide/rcwebui
echo "NOT-SET" >/var/plexguide/rcwebui/rcuser.user
echo "NOT-SET" >/var/plexguide/rcwebui/rcpass.pass
rm -rf /var/plexguide/rcwebui
mkdir -p /var/plexguide/rcwebui
echo "NOT-SET" >/var/plexguide/rcwebui/rcuser.user
echo "NOT-SET" >/var/plexguide/rcwebui/rcpass.pass
}
create() {
mkdir -p /var/plexguide/rcwebui
echo "NOT-SET" >/var/plexguide/rcwebui/rcuser.user
echo "NOT-SET" >/var/plexguide/rcwebui/rcpass.pass
mkdir -p /var/plexguide/rcwebui
echo "NOT-SET" >/var/plexguide/rcwebui/rcuser.user
echo "NOT-SET" >/var/plexguide/rcwebui/rcpass.pass
}
rcwebui() {
@@ -37,13 +37,13 @@ Go Back? Type > exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Username | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/rcwebui/rcuser.user
read -p '↘️ Type Password | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/rcwebui/rcpass.pass
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then then
exit 0
else
read -p '↘️ Type Username | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/rcwebui/rcuser.user
read -p '↘️ Type Password | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/rcwebui/rcpass.pass
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
exit 0
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -55,8 +55,8 @@ Password : $(cat /var/plexguide/rcwebui/rcpass.pass)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fi
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fi
}
start0

View File

@@ -9,7 +9,7 @@ program=$(cat /tmp/program_var)
cname=$program
if [[ -f "/var/plexguide/$program.cname" ]]; then
cname=$(cat /var/plexguide/$program.cname)
cname=$(cat /var/plexguide/$program.cname)
fi
domain=$(cat /var/plexguide/server.domain)
@@ -25,168 +25,7 @@ if [ "$program" == "plex" ]; then extra="/web"; else extra=""; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Access Configuration Info
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
tee <<-EOF
▫ $program:${port} <- Use this as the url when connecting another app to $program.
EOF
if [ "$ports" == "" ]; then
tee <<-EOF
▫ $ip:${port}${extra}
EOF
fi
if [ "$domain" != "NOT-SET" ]; then
if [ "$ports" == "" ]; then
tee <<-EOF
▫ $domain:${port}${extra}
EOF
fi
tee <<-EOF
▫ $cname.$domain${extra}
EOF
fi
if [ "$program" == "plex" ]; then
tee <<-EOF
First Time Plex Claim Notice
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
if [ "$domain" != "NOT-SET" ]; then
tee <<-EOF
▫ http://plex.${domain}:32400 <-- Use http; not https
EOF
fi
tee <<-EOF
▫ $ip:${port}${extra}
EOF
fi
if [[ "$program" == *"sonarr"* ]] || [[ "$program" == *"radarr"* ]] || [[ "$program" == *"lidarr"* ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 Manual Configuration Required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$program requires additional manual configuration!
EOF
if [[ "$program" == *"sonarr"* ]] || [[ "$program" == *"radarr"* ]] || [[ "$program" == *"lidarr"* ]] || [[ "$program" == *"qbittorrent"* ]]; then
tee <<-EOF
$program requires "downloader mappings" to enable hardlinking and rapid importing.
If you do not have these mappings, $program can't rename and move the files on import.
This will result in files being copied instead of moved, and it will cause other issues.
The mappings are on the download client settings (advanced setting), at the bottom of the page.
Visit https://github.com/Pandaura/PTS-Team/wiki/Remote-Path-Mappings for more information.
EOF
fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Failure to perform manual configuration changes will cause problems!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌍 Visit the wiki for instructions on how to configure $program.
https://github.com/Pandaura/PTS-Team/wiki/$program
EOF
fi
####--------
if [[ "$program" == *"sabnzbd"* ]] || [[ "$program" == *"nzbget"* ]] ; then
cclean=$(cat /var/plexguide/cloneclean)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 NOTE / INFO
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
for incomplete downloads $program used the folder $hdpath/incomplete/nzb
for finished downloads $program used the folder $hdpath/downloads/nzb
beware the cloneclean is set to $cclean min
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [[ "$program" == *"sabnzbd"* ]] ; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 sabnzbd api_key = $sbakey
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [[ "$program" == *"rutorrent"* ]] || [[ "$program" == *"qbittorrent"* ]] || [[ "$program" == *"deluge"* ]]; then
cclean=$(cat /var/plexguide/cloneclean)
tclean=$(($cclean*2))
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 NOTE / INFO
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
for incomplete downloads $program used the folder $hdpath/incomplete/torrent
for finished downloads $program used the folder $hdpath/downloads/torrent
beware the cloneclean is set to $tclean min
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [ "$program" == "plex" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 Manual Configuration Required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
we prefer using plex_autoscan, unlike other alternatives,
that does not put a lot of pressure on the API of your Google Account.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [ "$hdpath" != "/mnt" ]; then
sbakey=$(cat /opt/appdata/sabnzbd/sabnzbd.ini | grep "api_key" | head -n 1 | awk '{print $3}')
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You must add /mnt self to the docker container again
Your $hdpath is not /mnt
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
port=$(cat /tmp/program_port)
ip=$(cat /var/plexguide/server.ip)
ports=$(cat /var/plexguide/server.ports)
hdpath=$(cat /var/plexguide/server.hd.path)
if [ "$program" == "plex" ]; then extra="/web"; else extra=""; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Access configuration info
🌎 Access Configuration Info
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -249,7 +88,7 @@ EOF
The mappings are on the download client settings (advanced setting), at the bottom of the page.
Visit https://github.com/Pandaura/PTS-Team/wiki/Remote-Path-Mappings for more information.
Visit https://github.com/MHA-Team/PTS-Team/wiki/Remote-Path-Mappings for more information.
EOF
fi
@@ -260,7 +99,7 @@ EOF
🌍 Visit the wiki for instructions on how to configure $program.
https://github.com/Pandaura/PTS-Team/wiki/$program
https://github.com/MHA-Team/PTS-Team/wiki/$program
EOF
fi

View File

@@ -10,125 +10,125 @@
source /opt/plexguide/menu/functions/functions.sh
queued() {
echo
read -p " ERROR - $typed Already Queued! | Press [ENTER] " typed </dev/tty
question1
echo
read -p " ERROR - $typed Already Queued! | Press [ENTER] " typed </dev/tty
question1
}
exists() {
echo ""
echo " ERROR - $typed Already Installed!"
read -p '⚠️ Reinstall? [Y/N] | Press [ENTER] ' foo </dev/tty
echo ""
echo " ERROR - $typed Already Installed!"
read -p '⚠️ Reinstall? [Y/N] | Press [ENTER] ' foo </dev/tty
if [[ "$foo" == "y" || "$foo" == "Y" ]]; then
part1
elif [[ "$foo" == "n" || "$foo" == "N" ]]; then
question1
else exists; fi
if [[ "$foo" == "y" || "$foo" == "Y" ]]; then
part1
elif [[ "$foo" == "n" || "$foo" == "N" ]]; then
question1
else exists; fi
}
badinputgce() {
echo ""
echo " ERROR - Bad Input! $typed not exist"
echo ""
read -p 'PRESS [ENTER] ' typed </dev/tty
echo ""
echo " ERROR - Bad Input! $typed not exist"
echo ""
read -p 'PRESS [ENTER] ' typed </dev/tty
}
cronexe() {
croncheck=$(cat /opt/coreapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
croncheck=$(cat /opt/coreapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
}
cronmass() {
croncheck=$(cat /opt/coreapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
croncheck=$(cat /opt/coreapps/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
}
initial() {
rm -rf /var/plexguide/pgbox.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgbox.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
touch /var/plexguide/pgbox.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgbox.buildup
rm -rf /var/plexguide/pgbox.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgbox.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
touch /var/plexguide/pgbox.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgbox.buildup
folder && ansible-playbook /opt/plexguide/menu/pgbox/gce/gcecore.yml >/dev/null 2>&1
folder && ansible-playbook /opt/plexguide/menu/pgbox/gce/gcecore.yml >/dev/null 2>&1
file="/opt/coreapps/place.holder"
waitvar=0
while [ "$waitvar" == "0" ]; do
sleep .5
if [ -e "$file" ]; then waitvar=1; fi
done
apt-get install dos2unix -yqq
dos2unix /opt/coreapps/apps/image/_image.sh >/dev/null 2>&1
dos2unix /opt/coreapps/apps/_appsgen.sh >/dev/null 2>&1
file="/opt/coreapps/place.holder"
waitvar=0
while [ "$waitvar" == "0" ]; do
sleep .5
if [ -e "$file" ]; then waitvar=1; fi
done
apt-get install dos2unix -yqq
dos2unix /opt/coreapps/apps/image/_image.sh >/dev/null 2>&1
dos2unix /opt/coreapps/apps/_appsgen.sh >/dev/null 2>&1
}
question1() {
### Remove Running Apps
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/app.list
done </var/plexguide/pgbox.running
### Remove Running Apps
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/app.list
done </var/plexguide/pgbox.running
cp /var/plexguide/app.list /var/plexguide/app.list2
cp /var/plexguide/app.list /var/plexguide/app.list2
file="/var/plexguide/core.app"
#if [ ! -e "$file" ]; then
ls -la /opt/coreapps/apps | sed -e 's/.yml//g' |
file="/var/plexguide/core.app"
#if [ ! -e "$file" ]; then
ls -la /opt/coreapps/apps | sed -e 's/.yml//g' |
awk '{print $9}' | tail -n +4 >/var/plexguide/app.list
while read p; do
echo "" >>/opt/coreapps/apps/$p.yml
echo "##PG-Core" >>/opt/coreapps/apps/$p.yml
while read p; do
echo "" >>/opt/coreapps/apps/$p.yml
echo "##PG-Core" >>/opt/coreapps/apps/$p.yml
touch /opt/appdata/plexguide/rclone.conf
done </var/plexguide/app.list
touch /var/plexguide/core.app
#fi
touch /opt/appdata/plexguide/rclone.conf
done </var/plexguide/app.list
touch /var/plexguide/core.app
#fi
#bash /opt/coreapps/apps/_appsgen.sh
docker ps | awk '{print $NF}' | tail -n +2 >/var/plexguide/pgbox.running
#bash /opt/coreapps/apps/_appsgen.sh
docker ps | awk '{print $NF}' | tail -n +2 >/var/plexguide/pgbox.running
### Remove Official Apps
while read p; do
# reminder, need one for custom apps
baseline=$(cat /opt/coreapps/apps/$p.yml | grep "##PG-Core")
if [ "$baseline" == "" ]; then sed -i -e "/$p/d" /var/plexguide/app.list; fi
done </var/plexguide/app.list
### Remove Official Apps
while read p; do
# reminder, need one for custom apps
baseline=$(cat /opt/coreapps/apps/$p.yml | grep "##PG-Core")
if [ "$baseline" == "" ]; then sed -i -e "/$p/d" /var/plexguide/app.list; fi
done </var/plexguide/app.list
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
### List Out Apps In Readable Order (One's Not Installed)
num=0
sed -i -e "/templates/d" /var/plexguide/app.list
sed -i -e "/image/d" /var/plexguide/app.list
sed -i -e "/watchtower/d" /var/plexguide/app.list
sed -i -e "/_/d" /var/plexguide/app.list
sed -i -e "/plex/d" /var/plexguide/app.list
### List Out Apps In Readable Order (One's Not Installed)
num=0
sed -i -e "/templates/d" /var/plexguide/app.list
sed -i -e "/image/d" /var/plexguide/app.list
sed -i -e "/watchtower/d" /var/plexguide/app.list
sed -i -e "/_/d" /var/plexguide/app.list
sed -i -e "/plex/d" /var/plexguide/app.list
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [[ "$num" == "7" ]]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/app.list
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [[ "$num" == "7" ]]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/app.list
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgbox.output)
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgbox.output)
if [ "$buildup" == "" ]; then buildup="NONE"; fi
if [ "$buildup" == "" ]; then buildup="NONE"; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Multi-App Installer | GCE Edition
🚀 Multi-App Installer | GCE Edition
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📂 Potential Apps to Install
@@ -146,75 +146,75 @@ $buildup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↪️ Type app to queue install | Press [ENTER]: ' typed </dev/tty
read -p '↪️ Type app to queue install | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "deploy" || "${typed}" == "install" || "${typed}" == "a" ]]; then question2; fi
if [[ "$typed" == "deploy" || "$typed" == "Deploy" || "$typed" == "DEPLOY" || "$typed" == "install" || "$typed" == "Install" || "$typed" == "INSTALL" || "$typed" == "a" || "$typed" == "A" ]]; then question2; fi
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then exit; fi
current=$(cat /var/plexguide/pgbox.buildup | grep "\<$typed\>")
if [ "$current" != "" ]; then queued && question1; fi
current=$(cat /var/plexguide/pgbox.buildup | grep "\<$typed\>")
if [ "$current" != "" ]; then queued && question1; fi
current=$(cat /var/plexguide/pgbox.running | grep "\<$typed\>")
if [ "$current" != "" ]; then exists && question1; fi
current=$(cat /var/plexguide/pgbox.running | grep "\<$typed\>")
if [ "$current" != "" ]; then exists && question1; fi
current=$(cat /var/plexguide/program.temp | grep "\<$typed\>")
if [ "$current" == "" ]; then badinputgce && question1; fi
current=$(cat /var/plexguide/program.temp | grep "\<$typed\>")
if [ "$current" == "" ]; then badinputgce && question1; fi
part1
part1
}
part1() {
echo "$typed" >>/var/plexguide/pgbox.buildup
num=0
echo "$typed" >>/var/plexguide/pgbox.buildup
num=0
touch /var/plexguide/pgbox.output && rm -rf /var/plexguide/pgbox.output
touch /var/plexguide/pgbox.output && rm -rf /var/plexguide/pgbox.output
while read p; do
echo -n $p >>/var/plexguide/pgbox.output
echo -n " " >>/var/plexguide/pgbox.output
if [[ "$num" == 7 ]]; then
num=0
echo " " >>/var/plexguide/pgbox.output
fi
done </var/plexguide/pgbox.buildup
while read p; do
echo -n $p >>/var/plexguide/pgbox.output
echo -n " " >>/var/plexguide/pgbox.output
if [[ "$num" == 7 ]]; then
num=0
echo " " >>/var/plexguide/pgbox.output
fi
done </var/plexguide/pgbox.buildup
sed -i "/^$typed\b/Id" /var/plexguide/app.list
sed -i "/^$typed\b/Id" /var/plexguide/app.list
question1
question1
}
final() {
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
echo
exit
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
echo
exit
}
question2() {
# Image Selector
image=off
while read p; do
# Image Selector
image=off
while read p; do
echo "$p" >/tmp/program_var
echo "$p" >/tmp/program_var
bash /opt/coreapps/apps/image/_image.sh
bash /opt/coreapps/apps/image/_image.sh
# CName & Port Execution
bash /opt/plexguide/menu/pgbox/cname.sh
done </var/plexguide/pgbox.buildup
# CName & Port Execution
bash /opt/plexguide/menu/pgbox/cname.sh
done </var/plexguide/pgbox.buildup
# Cron Execution
edition=$(cat /var/plexguide/pg.edition)
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
else
croncount=$(sed -n '$=' /var/plexguide/pgbox.buildup)
echo "false" >/var/plexguide/cron.count
if [ "$croncount" -ge 2 ]; then bash /opt/plexguide/menu/cron/mass.sh; fi
fi
# Cron Execution
edition=$(cat /var/plexguide/pg.edition)
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
else
croncount=$(sed -n '$=' /var/plexguide/pgbox.buildup)
echo "false" >/var/plexguide/cron.count
if [ "$croncount" -ge 2 ]; then bash /opt/plexguide/menu/cron/mass.sh; fi
fi
while read p; do
while read p; do
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -223,25 +223,25 @@ $p - Now Installing!
EOF
sleep 1
sleep 1
# Store Used Program
echo "$p" >/tmp/program_var
# Execute Main Program
ansible-playbook /opt/coreapps/apps/$p.yml
# Store Used Program
echo "$p" >/tmp/program_var
# Execute Main Program
ansible-playbook /opt/coreapps/apps/$p.yml
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
elif [ "$croncount" -eq "1" ]; then cronexe; fi
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
elif [ "$croncount" -eq "1" ]; then cronexe; fi
# End Banner
bash /opt/plexguide/menu/pgbox/endbanner.sh >>/tmp/output.info
# End Banner
bash /opt/plexguide/menu/pgbox/endbanner.sh >>/tmp/output.info
sleep 2
done </var/plexguide/pgbox.buildup
echo "" >>/tmp/output.info
cat /tmp/output.info
final
sleep 2
done </var/plexguide/pgbox.buildup
echo "" >>/tmp/output.info
cat /tmp/output.info
final
}
@@ -252,7 +252,7 @@ start() {
}
folder() {
mkdir -p /opt/coreapps
mkdir -p /opt/coreapps
}
# FUNCTIONS END ##############################################################

View File

@@ -13,7 +13,7 @@
- name: Cloning GCE Apps
git:
repo: 'https://github.com/Pandaura/Apps-GCE'
repo: 'https://github.com/MHA-Team/Apps-GCE'
dest: /opt/coreapps
version: 'master'
force: yes

View File

@@ -7,7 +7,6 @@
################################################################################
# FUNCTIONS START ##############################################################
typed="${typed,,}"
source /opt/plexguide/menu/functions/functions.sh
variable /var/plexguide/boxpersonal.user NON-SET
variable /var/plexguide/boxpersonal.repo NON-SET
@@ -15,119 +14,119 @@ variable /var/plexguide/boxpersonal.branch NON-SET
queued() {
echo
read -p " ERROR - $typed Already Queued! | Press [ENTER] " typed </dev/tty
question1
echo
read -p " ERROR - $typed Already Queued! | Press [ENTER] " typed </dev/tty
question1
}
value() {
bash /opt/plexguide/menu/pgbox/value.sh
bash /opt/plexguide/menu/pgbox/value.sh
}
exists() {
echo ""
echo " ERROR - $typed Already Installed!"
read -p '⚠️ Reinstall? [Y/N] | Press [ENTER] ' foo </dev/tty
echo ""
echo " ERROR - $typed Already Installed!"
read -p '⚠️ Reinstall? [Y/N] | Press [ENTER] ' foo </dev/tty
if [[ "$foo" == "y" || "$foo" == "Y" ]]; then
part1
elif [[ "$foo" == "n" || "$foo" == "N" ]]; then
question1
else exists; fi
if [[ "$foo" == "y" || "$foo" == "Y" ]]; then
part1
elif [[ "$foo" == "n" || "$foo" == "N" ]]; then
question1
else exists; fi
}
cronexe() {
croncheck=$(cat /opt/mycontainers/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
croncheck=$(cat /opt/mycontainers/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
}
cronmass() {
croncheck=$(cat /opt/mycontainers/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
croncheck=$(cat /opt/mycontainers/apps/_cron.list | grep -c "\<$p\>")
if [ "$croncheck" == "0" ]; then bash /opt/plexguide/menu/cron/cron.sh; fi
}
initial() {
rm -rf /var/plexguide/pgbox.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgbox.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
touch /var/plexguide/pgbox.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgbox.buildup
rm -rf /var/plexguide/pgbox.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgbox.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
touch /var/plexguide/pgbox.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgbox.buildup
mkdir -p /opt/mycontainers
mkdir -p /opt/mycontainers
ansible-playbook /opt/plexguide/menu/pgbox/personal/personal.yml
file="/opt/mycontainers/place.holder"
waitvar=0
while [ "$waitvar" == "0" ]; do
sleep .5
if [ -e "$file" ]; then waitvar=1; fi
done
ansible-playbook /opt/plexguide/menu/pgbox/personal/personal.yml
file="/opt/mycontainers/place.holder"
waitvar=0
while [ "$waitvar" == "0" ]; do
sleep .5
if [ -e "$file" ]; then waitvar=1; fi
done
}
question1() {
### Remove Running Apps
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/app.list
done </var/plexguide/pgbox.running
### Remove Running Apps
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/app.list
done </var/plexguide/pgbox.running
cp /var/plexguide/app.list /var/plexguide/app.list2
cp /var/plexguide/app.list /var/plexguide/app.list2
file="/var/plexguide/personal.app"
#if [ ! -e "$file" ]; then
ls -la /opt/mycontainers/apps | sed -e 's/.yml//g' |
file="/var/plexguide/personal.app"
#if [ ! -e "$file" ]; then
ls -la /opt/mycontainers/apps | sed -e 's/.yml//g' |
awk '{print $9}' | tail -n +4 >/var/plexguide/app.list
while read p; do
echo "" >>/opt/mycontainers/apps/$p.yml
echo "##PG-personal" >>/opt/mycontainers/apps/$p.yml
while read p; do
echo "" >>/opt/mycontainers/apps/$p.yml
echo "##PG-personal" >>/opt/mycontainers/apps/$p.yml
mkdir -p /opt/mycontainers
touch /opt/appdata/plexguide/rclone.conf
done </var/plexguide/app.list
touch /var/plexguide/personal.app
#fi
mkdir -p /opt/mycontainers
touch /opt/appdata/plexguide/rclone.conf
done </var/plexguide/app.list
touch /var/plexguide/personal.app
#fi
#bash /opt/mycontainers/apps/_appsgen.sh
docker ps | awk '{print $NF}' | tail -n +2 >/var/plexguide/pgbox.running
#bash /opt/mycontainers/apps/_appsgen.sh
docker ps | awk '{print $NF}' | tail -n +2 >/var/plexguide/pgbox.running
### Remove Official Apps
while read p; do
# reminder, need one for custom apps
baseline=$(cat /opt/mycontainers/apps/$p.yml | grep "##PG-personal")
if [ "$baseline" == "" ]; then sed -i -e "/$p/d" /var/plexguide/app.list; fi
done </var/plexguide/app.list
### Remove Official Apps
while read p; do
# reminder, need one for custom apps
baseline=$(cat /opt/mycontainers/apps/$p.yml | grep "##PG-personal")
if [ "$baseline" == "" ]; then sed -i -e "/$p/d" /var/plexguide/app.list; fi
done </var/plexguide/app.list
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
### List Out Apps In Readable Order (One's Not Installed)
num=0
sed -i -e "/templates/d" /var/plexguide/app.list
sed -i -e "/image/d" /var/plexguide/app.list
sed -i -e "/watchtower/d" /var/plexguide/app.list
sed -i -e "/_/d" /var/plexguide/app.list
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [[ "$num" == "7" ]]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/app.list
### List Out Apps In Readable Order (One's Not Installed)
num=0
sed -i -e "/templates/d" /var/plexguide/app.list
sed -i -e "/image/d" /var/plexguide/app.list
sed -i -e "/watchtower/d" /var/plexguide/app.list
sed -i -e "/_/d" /var/plexguide/app.list
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [[ "$num" == "7" ]]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/app.list
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgbox.output)
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgbox.output)
if [ "$buildup" == "" ]; then buildup="NONE"; fi
if [ "$buildup" == "" ]; then buildup="NONE"; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PTS ~ Multi-App Installer || Personal Versions
🚀 PTS ~ Multi-App Installer || Personal Versions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📂 Potential Apps to Install
@@ -145,75 +144,75 @@ $buildup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↪️ Type app to queue install | Press [ENTER]: ' typed </dev/tty
read -p '↪️ Type app to queue install | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "deploy" || "${typed}" == "install" || "${typed}" == "a" ]]; then question2; fi
if [[ "$typed" == "deploy" || "$typed" == "Deploy" || "$typed" == "DEPLOY" || "$typed" == "install" || "$typed" == "Install" || "$typed" == "INSTALL" || "$typed" == "a" || "$typed" == "A" ]]; then question2; fi
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then exit; fi
current=$(cat /var/plexguide/pgbox.buildup | grep "\<$typed\>")
if [ "$current" != "" ]; then queued && question1; fi
current=$(cat /var/plexguide/pgbox.buildup | grep "\<$typed\>")
if [ "$current" != "" ]; then queued && question1; fi
current=$(cat /var/plexguide/pgbox.running | grep "\<$typed\>")
if [ "$current" != "" ]; then exists && question1; fi
current=$(cat /var/plexguide/pgbox.running | grep "\<$typed\>")
if [ "$current" != "" ]; then exists && question1; fi
current=$(cat /var/plexguide/program.temp | grep "\<$typed\>")
if [ "$current" == "" ]; then badinput1 && question1; fi
current=$(cat /var/plexguide/program.temp | grep "\<$typed\>")
if [ "$current" == "" ]; then badinput1 && question1; fi
part1
part1
}
part1() {
echo "$typed" >>/var/plexguide/pgbox.buildup
num=0
echo "$typed" >>/var/plexguide/pgbox.buildup
num=0
touch /var/plexguide/pgbox.output && rm -rf /var/plexguide/pgbox.output
touch /var/plexguide/pgbox.output && rm -rf /var/plexguide/pgbox.output
while read p; do
echo -n $p >>/var/plexguide/pgbox.output
echo -n " " >>/var/plexguide/pgbox.output
if [[ "$num" == 7 ]]; then
num=0
echo " " >>/var/plexguide/pgbox.output
fi
done </var/plexguide/pgbox.buildup
while read p; do
echo -n $p >>/var/plexguide/pgbox.output
echo -n " " >>/var/plexguide/pgbox.output
if [[ "$num" == 7 ]]; then
num=0
echo " " >>/var/plexguide/pgbox.output
fi
done </var/plexguide/pgbox.buildup
sed -i "/^$typed\b/Id" /var/plexguide/app.list
sed -i "/^$typed\b/Id" /var/plexguide/app.list
question1
question1
}
final() {
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
echo
exit
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
echo
exit
}
question2() {
# Image Selector
image=off
while read p; do
# Image Selector
image=off
while read p; do
echo "$p" >/tmp/program_var
if [[ -d "/opt/mycontainers/apps/image/" ]]; then
bash /opt/mycontainers/apps/image/_image.sh ; fi
echo "$p" >/tmp/program_var
if [[ -d "/opt/mycontainers/apps/image/" ]]; then
bash /opt/mycontainers/apps/image/_image.sh ; fi
# CName & Port Execution
bash /opt/plexguide/menu/pgbox/cname.sh
done </var/plexguide/pgbox.buildup
# CName & Port Execution
bash /opt/plexguide/menu/pgbox/cname.sh
done </var/plexguide/pgbox.buildup
# Cron Execution
edition=$(cat /var/plexguide/pg.edition)
if [[ "$edition" == "Edition - HD Solo" ]]; then
a=b
else
croncount=$(sed -n '$=' /var/plexguide/pgbox.buildup)
echo "false" >/var/plexguide/cron.count
if [ "$croncount" -ge 2 ]; then bash /opt/plexguide/menu/cron/mass.sh; fi
fi
# Cron Execution
edition=$(cat /var/plexguide/pg.edition)
if [[ "$edition" == "Edition - HD Solo" ]]; then
a=b
else
croncount=$(sed -n '$=' /var/plexguide/pgbox.buildup)
echo "false" >/var/plexguide/cron.count
if [ "$croncount" -ge 2 ]; then bash /opt/plexguide/menu/cron/mass.sh; fi
fi
while read p; do
while read p; do
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -222,41 +221,41 @@ $p - Now Installing!
EOF
sleep 1
##### CHECK START #####
value
##### CHECK EXIT #####
sleep 1
##### CHECK START #####
value
##### CHECK EXIT #####
# Store Used Program
echo "$p" >/tmp/program_var
# Execute Main Program
ansible-playbook /opt/mycontainers/apps/$p.yml
# Store Used Program
echo "$p" >/tmp/program_var
# Execute Main Program
ansible-playbook /opt/mycontainers/apps/$p.yml
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
elif [ "$croncount" -eq "1" ]; then cronexe; fi
if [[ "$edition" == "PG Edition - HD Solo" ]]; then
a=b
elif [ "$croncount" -eq "1" ]; then cronexe; fi
# End Banner
bash /opt/plexguide/menu/pgbox/endbanner.sh >>/tmp/output.info
# End Banner
bash /opt/plexguide/menu/pgbox/endbanner.sh >>/tmp/output.info
sleep 2
done </var/plexguide/pgbox.buildup
echo "" >>/tmp/output.info
cat /tmp/output.info
final
sleep 2
done </var/plexguide/pgbox.buildup
echo "" >>/tmp/output.info
cat /tmp/output.info
final
}
mainbanner() {
boxuser=$(cat /var/plexguide/boxpersonal.user)
boxrepo=$(cat /var/plexguide/boxpersonal.repo)
boxbranch=$(cat /var/plexguide/boxpersonal.branch)
boxuser=$(cat /var/plexguide/boxpersonal.user)
boxrepo=$(cat /var/plexguide/boxpersonal.repo)
boxbranch=$(cat /var/plexguide/boxpersonal.branch)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PTS personal Box Edition!
🚀 PTS personal Box Edition!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬
@@ -273,10 +272,10 @@ Branch: $boxbranch
EOF
read -p 'Type a Selection | Press [ENTER]: ' typed </dev/tty
read -p 'Type a Selection | Press [ENTER]: ' typed </dev/tty
case $typed in
1)
case $typed in
1)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -288,27 +287,27 @@ Username / Branch & Repo are both case sensitive!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Username | Press [ENTER]: ' boxuser </dev/tty
read -p 'REPO | Press [ENTER]: ' boxrepo </dev/tty
read -p 'Branch | Press [ENTER]: ' boxbranch </dev/tty
echo "$boxuser" >/var/plexguide/boxpersonal.user
echo "$boxrepo" >/var/plexguide/boxpersonal.repo
echo "$boxbranch" >/var/plexguide/boxpersonal.branch
mainbanner
;;
2)
existcheck=$(git ls-remote --exit-code -h "https://github.com/$(cat /var/plexguide/boxpersonal.user)/$(cat /var/plexguide/boxpersonal.repo)" | grep "$(cat /var/plexguide/boxpersonal.branch)")
if [ "$existcheck" == "" ]; then
echo
read -p '💬 Exiting! Forked Version Does Not Exist! | Press [ENTER]: ' typed </dev/tty
mainbanner
fi
read -p 'Username | Press [ENTER]: ' boxuser </dev/tty
read -p 'REPO | Press [ENTER]: ' boxrepo </dev/tty
read -p 'Branch | Press [ENTER]: ' boxbranch </dev/tty
echo "$boxuser" >/var/plexguide/boxpersonal.user
echo "$boxrepo" >/var/plexguide/boxpersonal.repo
echo "$boxbranch" >/var/plexguide/boxpersonal.branch
mainbanner
;;
2)
existcheck=$(git ls-remote --exit-code -h "https://github.com/$(cat /var/plexguide/boxpersonal.user)/$(cat /var/plexguide/boxpersonal.repo)" | grep "$(cat /var/plexguide/boxpersonal.branch)")
if [ "$existcheck" == "" ]; then
echo
read -p '💬 Exiting! Forked Version Does Not Exist! | Press [ENTER]: ' typed </dev/tty
mainbanner
fi
initial && question1 ;;
z) exit ;;
Z) exit ;;
*) mainbanner ;;
esac
initial && question1 ;;
z) exit ;;
Z) exit ;;
*) mainbanner ;;
esac
}
# FUNCTIONS END ##############################################################

View File

@@ -5,7 +5,6 @@
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
typed="${typed,,}"
rm -rf /tmp/backup.build 1>/dev/null 2>&1
rm -rf /tmp/backup.list 1>/dev/null 2>&1
rm -rf /tmp/backup.final 1>/dev/null 2>&1
@@ -25,13 +24,13 @@ sed -i -e "/portainer/d" /tmp/backup.list
#### Commenting Out To Let User See
num=0
while read p; do
let "num++"
echo -n $p >>/tmp/backup.final
echo -n " " >>/tmp/backup.final
if [[ "$num" == 7 ]]; then
num=0
echo " " >>/tmp/backup.final
fi
let "num++"
echo -n $p >>/tmp/backup.final
echo -n " " >>/tmp/backup.final
if [[ "$num" == 7 ]]; then
num=0
echo " " >>/tmp/backup.final
fi
done </tmp/backup.list
running=$(cat /tmp/backup.final)
@@ -40,12 +39,12 @@ running=$(cat /tmp/backup.final)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 App Removal Interface
🚀 App Removal Interface
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ This will remove your app data folder. Make sure you backup!
⚠️ Backup Data if Required! Removes Local App Data!
💾 Apps currently installed
💾 Current Installed Apps or Folders
$running
@@ -56,37 +55,37 @@ $running
EOF
read -p '🌍 Type APP for QUEUE | Press [[ENTER]: ' typed </dev/tty
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then exit; fi
tcheck=$(echo $running | grep "\<$typed\>")
if [[ "$tcheck" == "" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Type an Application Name! Case Senstive! Restarting!
WARNING! - Type an Application Name! Case Senstive! Restarting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1.5
bash /opt/plexguide/menu/pgbox/remove/removal.sh
exit
sleep 1.5
bash /opt/plexguide/menu/pgbox/remove/removal.sh
exit
fi
if [[ "$typed" == "" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Cannot be left blank. Please type an app
WARNING! - The App Name Cannot Be Blank!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
bash /opt/traefik/tld.sh
exit
sleep 3
bash /opt/traefik/tld.sh
exit
fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💎 Now uninstalling - $typed
💎 PASS: Uninstalling - $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1.5
@@ -96,12 +95,12 @@ if [[ "$drunning" == "$typed" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🍖 NOM NOM - Stopping container & uninstalling > $typed
🍖 NOM NOM - Stopping | Removing > $typed Docker Container
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
docker stop $typed 1>/dev/null 2>&1
docker rm $typed 1>/dev/null 2>&1
rm -rf /opt/appdata/$typed
docker stop $typed 1>/dev/null 2>&1
docker rm $typed 1>/dev/null 2>&1
rm -rf /opt/appdata/$typed
fi
if [[ "$drunning" != "$typed" ]]; then
@@ -111,14 +110,14 @@ tee <<-EOF
🍖 NOM NOM - Removing /opt/appdata/$typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
rm -rf /opt/appdata/$typed
rm -rf /opt/appdata/$typed
fi
file="/opt/coreapps/apps/$typed.yml"
if [[ -e "$file" ]]; then
check=$(cat /opt/coreapps/apps/$typed.yml | grep '##PG-Community')
if [[ "$check" == "##PG-Community" ]]; then rm -r /opt/communityapps/apps/$typed.yml; fi
rm -rf /var/plexguide/community.app
check=$(cat /opt/coreapps/apps/$typed.yml | grep '##PG-Community')
if [[ "$check" == "##PG-Community" ]]; then rm -r /opt/communityapps/apps/$typed.yml; fi
rm -rf /var/plexguide/community.app
fi
sleep 1.5
@@ -126,7 +125,7 @@ sleep 1.5
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ Successfully uninstalled $typed - Now exiting...
✅️ PASS: Uninstalled - $typed - Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 2

View File

@@ -7,10 +7,10 @@
################################################################################
GCEtest(){
gce=$(cat /var/plexguide/pg.server.deploy)
gce=$(cat /var/plexguide/pg.server.deploy)
if [[ $gce == "feeder" ]]; then
mainstart2
if [[ $gce == "feeder" ]]; then
mainstart2
else mainstart1; fi
}
@@ -18,63 +18,63 @@ mainstart1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Box Apps Interface Selection
🚀 Box Apps Interface Selection
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 Pandaura installs a series of Core and Community applications
💬 PTS Box installs a series of Core and Community applications!
[1] Pandaura : Core
[2] Pandaura : Community
---------------------------------
[3] Personal Fork : Use your own Github fork
[4] Uninstaller : Remove installed apps
[5] Apps : Auto Update
[1] PTS : Core
[2] PTS : Community
--------------------------------
[3] Apps : Personal Forks
[4] Apps : Removal
[5] Apps : Auto Update
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
# Standby
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
# Standby
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1) clear && bash /opt/plexguide/menu/pgbox/core/core.sh ;;
2) clear && bash /opt/plexguide/menu/pgbox/community/community.sh ;;
3) clear && bash /opt/plexguide/menu/pgbox/personal/personal.sh ;;
4) clear && bash /opt/plexguide/menu/pgbox/remove/removal.sh ;;
5) clear && bash /opt/plexguide/menu/pgbox/customparts/autobackup.sh ;;
z) exit ;;
Z) exit ;;
*) GCEtest ;;
esac
case $typed in
1) bash /opt/plexguide/menu/pgbox/core/core.sh ;;
2) bash /opt/plexguide/menu/pgbox/community/community.sh ;;
3) bash /opt/plexguide/menu/pgbox/personal/personal.sh ;;
4) bash /opt/plexguide/menu/pgbox/remove/removal.sh ;;
5) bash /opt/plexguide/menu/pgbox/customparts/autobackup.sh ;;
z) exit ;;
Z) exit ;;
*) GCEtest ;;
esac
}
mainstart2() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 GCE optimized Apps
🚀 GCE APPS optimized Apps
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] GCE optimized Apps : GCE APPS
[1] PTS GCE optimized Apps : GCE APPS
[2] Uninstaller : Remove installed apps
[2] Apps : Removal
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1) bash /opt/plexguide/menu/pgbox/gce/gcecore.sh ;;
2) bash /opt/plexguide/menu/pgbox/remove/removal.sh ;;
z) exit ;;
Z) exit ;;
*) GCEtest ;;
esac
case $typed in
1) bash /opt/plexguide/menu/pgbox/gce/gcecore.sh ;;
2) bash /opt/plexguide/menu/pgbox/remove/removal.sh ;;
z) exit ;;
Z) exit ;;
*) GCEtest ;;
esac
}
GCEtest

View File

@@ -47,7 +47,7 @@ mainbanner() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 $roleproper
🚀 $roleproper
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$clonerinfo
@@ -91,7 +91,7 @@ pinterface() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 $roleproper
🚀 $roleproper
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 User: $user | Branch: $branch

View File

@@ -25,7 +25,7 @@
- name: Clone Role
git:
repo: 'https://github.com/Pandaura/{{pname.stdout}}'
repo: 'https://github.com/MHA-Team/{{pname.stdout}}'
dest: '/opt/{{prole.stdout}}'
version: '{{pversion.stdout}}'
force: yes

View File

@@ -50,7 +50,7 @@ mainbanner() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 $roleproper
🚀 $roleproper
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$clonerinfo
@@ -95,7 +95,7 @@ pinterface() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 $roleproper
🚀 $roleproper
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 User: $user | Branch: $branch

View File

@@ -25,7 +25,7 @@
- name: Clone Role
git:
repo: 'https://github.com/Pandaura/{{pname.stdout}}'
repo: 'https://github.com/MHA-Team/{{pname.stdout}}'
dest: '/opt/{{prole.stdout}}'
version: '{{pversion.stdout}}'
force: yes

View File

@@ -25,7 +25,7 @@
- name: Clone Role
git:
repo: 'https://github.com/Pandaura/{{pname.stdout}}'
repo: 'https://github.com/MHA-Team/{{pname.stdout}}'
dest: '/opt/{{prole.stdout}}'
version: '{{pversion.stdout}}'
force: yes

View File

@@ -29,6 +29,15 @@ startlink=$(cat /var/plexguide/pgcloner.startlink)
mkdir -p "/opt/$rolename"
initial() {
ansible-playbook "/opt/plexguide/menu/pgcloner/clone/primary.yml" >/dev/null 2>&1
echo ""
echo "💬 Pulling Update Files - Please Wait"
file="/opt/$rolename/place.holder"
waitvar=0
while [ "$waitvar" == "0" ]; do
sleep .5
if [ -e "$file" ]; then waitvar=1; fi
done
bash /opt/${rolename}/${startlink}
}
initial

45
menu/pgcloner/pgvault.sh Normal file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
### FILL OUT THIS AREA ###
echo 'pgvault' >/var/plexguide/pgcloner.rolename
echo 'PTS-Vault' >/var/plexguide/pgcloner.roleproper
echo 'PTS-Vault' >/var/plexguide/pgcloner.projectname
echo 'master' >/var/plexguide/pgcloner.projectversion
echo 'pgvault.sh' >/var/plexguide/pgcloner.startlink
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
echo "💬 Vault is a combined group of services that utilizes the backup
and restore processes, which enables the safe storage and transport through
the use of Google Drive in a hasty and efficient manner!" >/var/plexguide/pgcloner.info
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
### START PROCESS
source /opt/plexguide/menu/functions/functions.sh
rolename=$(cat /var/plexguide/pgcloner.rolename)
roleproper=$(cat /var/plexguide/pgcloner.roleproper)
projectname=$(cat /var/plexguide/pgcloner.projectname)
projectversion=$(cat /var/plexguide/pgcloner.projectversion)
startlink=$(cat /var/plexguide/pgcloner.startlink)
mkdir -p "/opt/$rolename"
initial() {
ansible-playbook "/opt/plexguide/menu/pgcloner/clone/primary.yml" >/dev/null 2>&1
echo ""
echo "💬 Pulling Update Files - Please Wait"
file="/opt/$rolename/place.holder"
waitvar=0
while [ "$waitvar" == "0" ]; do
sleep .5
if [ -e "$file" ]; then waitvar=1; fi
done
bash /opt/${rolename}/${startlink}
}
initial

View File

@@ -15,7 +15,7 @@ file2="/var/plexguide/gce.check"
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You Must Execute as a SUDO USER (with sudo) or as ROOT!
You Must Execute as a SUDO USER (with sudo) or as ROOT!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF

View File

@@ -1,129 +1,125 @@
#!/bin/bash
# FUNCTIONS START ##############################################################
pgautoscan="autoscan"
typed="${typed,,}"
rmoldinstall() {
dcheck=$(systemctl is-active plex_autoscan.service)
if [[ "$dcheck" == "active" ]]; then
service plex_autoscan stop
rm -rf /opt/plex_autoscan
rm -rf /etc/systemd/system/plex_autoscan.service
rm -rf /var/plexguide/pgscan
fresh
else fresh; fi
dcheck=$(systemctl is-active plex_autoscan.service)
if [[ "$dcheck" == "active" ]]; then
service plex_autoscan stop
rm -rf /opt/plex_autoscan
rm -rf /etc/systemd/system/plex_autoscan.service
rm -rf /var/plexguide/pgscan
fresh
else fresh; fi
}
fresh() {
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
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
}
variable() {
file="$1"
if [[ ! -e "$file" ]]; then echo "$2" >$1; fi
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
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
ptokendep=$(cat /var/plexguide/pgscan/plex.token)
if [[ "$ptokendep" != "" ]]; then
if [[ ! -f "/opt/appdata/plexautoscan/config/config.json" ]]; then
pstatus="❌ TOKEN DEPLOYED || PAS CONFIG MISSING";
pstatus="❌ TOKEN DEPLOYED || PAS CONFIG MISSING";
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
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
else pstatus="⚠️ NOT DEPLOYED"; fi
}
plexcheck() {
pcheck=$(docker ps --format '{{.Names}}' | grep "plex")
if [[ "$pcheck" == "" ]]; then
printf '
pcheck=$(docker ps --format '{{.Names}}' | grep "plex")
if [[ "$pcheck" == "" ]]; then
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Plex is Not Installed or Running! Exiting!
WARNING! - Plex is Not Installed or Running! Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
dontwork
fi
'
dontwork
fi
}
token() {
touch /var/plexguide/pgscan/plex.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 [[ ! -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 '
if [[ "$ptoken" != "$X_PLEX_TOKEN" ]]; then
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! Failed to Generate a Valid Plex Token!
WARNING! Exiting Deployment!
WARNING! Failed to Generate a Valid Plex Token!
WARNING! Exiting Deployment!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
dontwork
fi
'
dontwork
fi
fi
}
tokencreate() {
printf '
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 START Plex_AutoScan Token Create
🚀 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)
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
cp -r $template $templatebackup
echo $X_PLEX_TOKEN >/var/plexguide/pgscan/plex.token
printf '
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ FINISHED Plex_AutoScan Token 🛈 START SERVERPASS Create
✅ 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
RAN=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo $RAN >/var/plexguide/pgscan/pgscan.serverpass
printf '
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ FINISHED Plex_AutoScan Token || SERVERPASS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
'
timerremove
question1
timerremove
question1
}
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
clear && question1
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
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
echo
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
clear && question1
}
credits() {
clear
printf '
clear
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Plex_AutoScan Credits
🚀 Plex_AutoScan Credits
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#########################################################################
@@ -139,87 +135,87 @@ credits() {
#########################################################################
# GNU General Public License v3.0 #
#########################################################################
'
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
clear && question1
'
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
clear && question1
}
doneenter() {
echo
read -p 'All done | PRESS [ENTER] ' typed </dev/tty
clear && question1
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
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
dcheck=$(docker ps --format '{{.Names}}' | grep "plexautoscan")
if [[ "$dcheck" == "plexautoscan" ]]; then
removepas
else
notinstalled
fi
}
removepas() {
printf '
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 STARTING Remove Plex AutoScan Docker || l3uddz/plex_autoscan
🚀 STARTING Remove Plex AutoScan Docker || l3uddz/plex_autoscan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
'
docker stop plexautoscan
docker rm plexautoscan
rm -rf /opt/appdata/plexautoscan
rm -rf /var/plexguide/pgscan
fresh
echo "en" >/var/plexguide/pgscan/fixmatch.lang
echo "false" >/var/plexguide/pgscan/fixmatch.status
echo "NOT-SET" >/var/plexguide/pgscan/plex.docker
docker stop plexautoscan
docker rm plexautoscan
rm -rf /opt/appdata/plexautoscan
rm -rf /var/plexguide/pgscan
fresh
echo "en" >/var/plexguide/pgscan/fixmatch.lang
echo "false" >/var/plexguide/pgscan/fixmatch.status
echo "NOT-SET" >/var/plexguide/pgscan/plex.docker
printf '
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 FINISHED REMOVE Plex AutoScan Docker
🚀 FINISHED REMOVE Plex AutoScan Docker
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
timerremove
question1
'
timerremove
question1
}
notinstalled() {
printf '
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - PAS is Not Installed or Running! Exiting!
WARNING! - PAS is Not Installed or Running! Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
timerremove
question1
'
timerremove
question1
}
##### REMOVE END
logger() {
dcheck=$(docker ps --format '{{.Names}}' | grep "$pgautoscan")
if [[ "$dcheck" == "$pgautoscan" ]]; then
printf '
dcheck=$(docker ps --format '{{.Names}}' | grep "plexautoscan")
if [[ "$dcheck" == "plexautoscan" ]]; then
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 ACTIVE LOGS Plex AutoScan Docker || l3uddz/plex_autoscan
🚀 ACTIVE LOGS Plex AutoScan Docker || l3uddz/plex_autoscan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
tail -n 50 /opt/appdata/$pgautoscan/config/plex_autoscan.log
doneenter
else
notinstalled
fi
'
tail -n 50 /opt/appdata/plexautoscan/config/plex_autoscan.log
doneenter
else
notinstalled
fi
}
fxmatch() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Plex_AutoScan FixMatching
🚀 Plex_AutoScan FixMatching
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE :
Plex Autoscan will compare the TVDBID/TMDBID/IMDBID sent
@@ -239,21 +235,21 @@ entry before correcting the match on the new item.
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
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
case $typed in
1) lang && clear && fxmatch ;;
2) runs && clear && fxmatch ;;
z) question1 ;;
Z) question1 ;;
*) fxmatch ;;
esac
}
lang() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Plex_AutoScan FixMatching Lang
🚀 Plex_AutoScan FixMatching Lang
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE : Sample :
@@ -271,11 +267,11 @@ Default is "en"
EOF
read -p '↘️ Type Lang | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Lang | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
fxmatch
else
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
fxmatch
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -287,16 +283,16 @@ Language Set Is: $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo $typed >/var/plexguide/pgscan/fixmatch.lang
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fxmatch
fi
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
🚀 Plex_AutoScan Fix Missmatch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] True
@@ -307,28 +303,28 @@ runs() {
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
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
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() {
plexcontainerversion=$(docker ps --format '{{.Image}}' | grep "plex:")
if [[ "$plexcontainerversion" == "linuxserver/plex:latest" ]]; then
echo -e "abc" >/var/plexguide/pgscan/plex.dockeruserset
else echo "plex" >/var/plexguide/pgscan/plex.dockeruserset
fi
pasuserdocker=$(cat /var/plexguide/pgscan/plex.dockeruserset)
plexcontainerversion=$(docker ps --format '{{.Image}}' | grep "plex:")
if [[ "$plexcontainerversion" == "linuxserver/plex:latest" ]]; then
echo -e "abc" >/var/plexguide/pgscan/plex.dockeruserset
else echo "plex" >/var/plexguide/pgscan/plex.dockeruserset
fi
pasuserdocker=$(cat /var/plexguide/pgscan/plex.dockeruserset)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Plex Docker
🚀 Plex Docker
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Linuxserver Docker used "abc"
Plex Docker used "plex"
@@ -341,40 +337,40 @@ Set Plex Docker user: [ $pasuserdocker ]
EOF
cp -r /var/plexguide/pgscan/plex.dockeruserset /var/plexguide/pgscan/plex.docker 1>/dev/null 2>&1
doneenter
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:3030/$(cat /var/plexguide/pgscan/pgscan.serverpass)"
else showpaspage="http://$(cat /var/plexguide/server.ip):3030/$(cat /var/plexguide/pgscan/pgscan.serverpass)"; fi
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)"
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
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
clear
ansible-playbook /opt/plexguide/menu/pgscan/yml/plexautoscan.yml
clear
}
undeployed() {
langfa=$(cat /var/plexguide/pgscan/fixmatch.status)
lang=$(cat /var/plexguide/pgscan/fixmatch.lang)
dplexset=$(cat /var/plexguide/pgscan/plex.docker)
tokenstatus
deploycheck
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
🚀 Plex_AutoScan Interface || l3uddz/plex_autoscan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] Deploy Plex Token [ $pstatus ]
@@ -391,34 +387,34 @@ tee <<-EOF
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
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
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
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
🚀 Plex_AutoScan Interface || l3uddz/plex_autoscan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] Deploy Plex Token [ $pstatus ]
@@ -445,24 +441,24 @@ PAS Webhook ARRs : [ $showpaspage ]
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
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
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 ##############################################################
rmoldinstall

View File

@@ -1,48 +0,0 @@
# override the minimum age to 2 minutes:
minimum-age: 2m
# override the interval scan stats are displayed:
# defaults to 1 hour / 0s to disable
scan-stats: 1h
# you can set multiple anchor files
anchors:
- /mnt/unionfs/.anchors/cloud.anchor
- /mnt/unionfs/.anchors/local.anchor
# Optionally, protect your webhooks with authentication
authentication:
username: hello
password: general
# port for Autoscan webhooks to listen on
port: 3030
triggers:
# The manual trigger is always enabled, the config only adjusts its priority and the rewrite rules.
manual:
priority: 1
rewrite:
sonarr:
# name of sonarr in portainer.
- name: sonarr
priority: 2
# name of sonarr4k in portainer.
- name: sonarr4k
priority: 3
radarr:
# name of radarr in portainer
- name: radarr
priority: 2
# name of radarr4k in portainer
- name: radarr4k
priority: 3
targets:
plex:
# plex url
- url: http://plex:32400
# plex API key
token: {{plex_auth_token}}

View File

@@ -9,9 +9,9 @@
- name: 'Set Known Facts'
set_fact:
pgrole: 'plexautoscan'
intport: '3030'
extport: '3030'
image: 'cloudb0x/autoscan:master'
intport: '3468'
extport: '3468'
image: 'sabrsorensen/alpine-plex_autoscan:1df2c05'
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
@@ -21,7 +21,7 @@
include_tasks: './pastask.yml'
# LABELS ######################################################################
- name: 'Adding Traefik for {{pgrole}}'
- name: 'Adding Traefik'
set_fact:
pg_labels:
traefik.enable: 'true'
@@ -38,52 +38,23 @@
traefik.frontend.headers.customResponseHeaders: 'X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex'
traefik.frontend.headers.forceSTSHeader: 'true'
## Anchors ###########################################################-07-09-2021
- name: 'Create {{pgrole}} folders'
file: "path={{ item }} state=directory mode=0775 owner=1000 group=1000 recurse=yes"
with_items:
- '/opt/appdata/{{pgrole}}'
- '/mnt/unionfs/.anchors/'
- name: 'Create {{pgrole}} anchors file'
file: "path={{ item }} state=touch mode=0775 owner=1000 group=1000"
with_items:
- '/mnt/unionfs/.anchors/cloud.anchor'
- '/mnt/unionfs/.anchors/local.anchor'
## ConfigFile ###########################################################-07-09-2021
- name: 'Checking for existing {{pgrole}}/config.yml'
stat:
path: /opt/appdata/{{pgrole}}/yml/config.yml
register: confcheck
- name: 'Creating {{pgrole}}/yml/config.yml'
file: "path={{ item }} state=file mode=0775 owner=1000 group=1000 recurse=yes"
with_items:
- '/opt/appdata/{{pgrole}}/yml/config.yml'
ignore_errors: yes
when: confcheck.stat.exists == false
# Volumes ######################################################################
- name: 'Setting {{pgrole}} Volumes'
set_fact:
pg_volumes:
- '/mnt/unionfs/:/data'
- '/opt/appdata/plexguide:/rclone_config'
- '/opt/appdata/{{pgrole}}/yml:/config'
- '/opt/appdata/{{pgrole}}/config:/config'
- '/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases/:/plexDb'
- '{{path.stdout}}:{{path.stdout}}'
- '/etc/localtime:/etc/localtime:ro'
- '/var/run/docker.sock:/var/run/docker.sock'
# Env ######################################################################
- name: 'Setting {{pgrole}} ENV'
set_fact:
pg_env:
PUID: '1000'
PGID: '1000'
AUTOSCAN_VERBOSITY: '1'
DOCKERGID: '999'
# MAIN DEPLOYMENT #############################################################
- name: 'Deploying {{pgrole}}'

View File

@@ -7,11 +7,11 @@
path: /opt/pgstage
register: stat_result
- debug:
msg: "Pandaura is checking folder exists"
msg: "PTS Check for missing pull"
- name: 'Cloning Pandaura Install files'
- name: 'Cloning PTS Install files'
git:
repo: 'https://github.com/Pandaura/Install'
repo: 'https://github.com/MHA-Team/Install'
dest: '/opt/pgstage'
clone: yes
version: 'master'
@@ -23,7 +23,7 @@
path: /opt/pgstage
register: p
- debug:
msg: "Path exists"
msg: "Path exists and PTS folder are pulled"
when: p.stat.isdir is defined and p.stat.isdir
- name: Remove .githube folder and .git files

View File

@@ -15,7 +15,7 @@
pgrole: 'pgui'
intport: '80'
extport: '8555'
image: 'hawkinzzz/dngele'
image: 'mrdoob/dngele:latest'
# CORE (MANDATORY) ############################################################
- name: 'Including core job'

View File

@@ -134,7 +134,7 @@ padding: 10px;
</head>
<body text="#FFFFFF">
<ul class="navigation">
<li><a class="active" href="https://github.com/Pandaura/PTS-Team/wiki">PTS-Wiki</a></li>
<li><a class="active" href="https://github.com/MHA-Team/PTS-Team/wiki">PTS-Wiki</a></li>
<li><a href="https://discord.gg/cKsMwMZ">Discord</a></li>
</ul>
<div class="image">

View File

@@ -142,7 +142,7 @@ a:visited {
</head>
<body text="#FFFFFF">
<ul class="navigation">
<li><a class="active" href="https://github.com/Pandaura/PTS-Team/wiki">PTS-Wiki</a></li>
<li><a class="active" href="https://github.com/MHA-Team/PTS-Team/wiki">PTS-Wiki</a></li>
<li><a href="https://discord.gg/cKsMwMZ">Discord</a></li>
</ul>
<div class="image">

View File

@@ -109,11 +109,11 @@ while true; do
fi
##### Warning for Ports Open with Traefik Deployed
if [[ $(cat /var/plexguide/pg.ports) != "Closed" && $(docker ps --format '{{.Names}}' | grep "traefik") == "traefik" ]]; then
echo "Warning: Traefik has been deployed with ports open! Server is at risk for exploitation!" >/opt/appdata/plexguide/emergency/message.a
echo "Warning: Traefik deployed with ports open! Server at risk for explotation!" >/opt/appdata/plexguide/emergency/message.a
elif [[ -e "/opt/appdata/plexguide/emergency/message.a" ]]; then rm -rf /opt/appdata/plexguide/emergency/message.a; fi
if [[ $(cat /var/plexguide/pg.ports) == "Closed" && $(docker ps --format '{{.Names}}' | grep "traefik") == "" ]]; then
echo "Warning: Apps cannot be accessed! Ports are closed & Traefik is not deployed! Either deploy Traefik or open your ports (which is worst for security)" >/opt/appdata/plexguide/emergency/message.b
echo "Warning: Apps Cannot Be Accessed! Ports are Closed & Traefik is not enabled! Either deploy traefik or open your ports (which is worst for security)" >/opt/appdata/plexguide/emergency/message.b
elif [[ -e "/opt/appdata/plexguide/emergency/message.b" ]]; then rm -rf /opt/appdata/plexguide/emergency/message.b; fi
##### Warning for Bad Traefik Deployment - message.c is tied to traefik showing a status! Do not change unless you know what your doing
touch /opt/appdata/plexguide/traefik.check
@@ -124,7 +124,7 @@ while true; do
fi
wget -q "https://${cname}.${domain}" -O "/opt/appdata/plexguide/traefik.check"
if [[ $(cat /opt/appdata/plexguide/traefik.check) == "" && $(docker ps --format '{{.Names}}' | grep "traefik" ) == "traefik" ]]; then
echo "Traefik is not deployed properly! Cannot Reach the Portainer SubDomain!" >/opt/appdata/plexguide/emergency/message.c
echo "Traefik is Not Deployed Properly! Cannot Reach the Portainer SubDomain!" >/opt/appdata/plexguide/emergency/message.c
else
if [[ -e "/opt/appdata/plexguide/emergency/message.c" ]]; then
rm -rf /opt/appdata/plexguide/emergency/message.c
@@ -132,7 +132,7 @@ while true; do
fi
##### Warning for Traefik Rate Limit Exceeded
if [[ $(cat /opt/appdata/plexguide/traefik.check) == "" && $(docker logs traefik | grep "rateLimited") != "" ]]; then
echo "$domain's rated limited exceed | Traefik (LetsEncrypt)! Takes up to one week to clear up (or use a new domain)" >/opt/appdata/plexguide/emergency/message.d
echo "$domain's rated limited exceed | Traefik (LetsEncrypt)! Takes upto one week to clear up (or use a new domain)" >/opt/appdata/plexguide/emergency/message.d
else
if [[ -e "/opt/appdata/plexguide/emergency/message.d" ]]; then
rm -rf /opt/appdata/plexguide/emergency/message.d

View File

@@ -134,7 +134,7 @@ padding: 10px;
</head>
<body text="#FFFFFF">
<ul class="navigation">
<li><a class="active" href="https://github.com/Pandaura/PTS-Team/wiki">PTS-Wiki</a></li>
<li><a class="active" href="https://github.com/MHA-Team/PTS-Team/wiki">PTS-Wiki</a></li>
<li><a href="https://discord.gg/cKsMwMZ">Discord</a></li>
</ul>
<div class="image">

View File

@@ -142,7 +142,7 @@ a:visited {
</head>
<body text="#FFFFFF">
<ul class="navigation">
<li><a class="active" href="https://github.com/Pandaura/PTS-Team/wiki">PTS-Wiki</a></li>
<li><a class="active" href="https://github.com/MHA-Team/PTS-Team/wiki">PTS-Wiki</a></li>
<li><a href="https://discord.gg/cKsMwMZ">Discord</a></li>
</ul>
<div class="image">

View File

@@ -134,7 +134,7 @@ padding: 10px;
</head>
<body text="#FFFFFF">
<ul class="navigation">
<li><a class="active" href="https://github.com/Pandaura/PTS-Team/wiki">PTS-Wiki</a></li>
<li><a class="active" href="https://github.com/MHA-Team/PTS-Team/wiki">PTS-Wiki</a></li>
<li><a href="https://discord.gg/cKsMwMZ">Discord</a></li>
</ul>
<div class="image">

View File

@@ -4,151 +4,144 @@
# Author(s): Admin9705
# GNU: General Public License v3.0
################################################################################
declare YELLOW='\033[0;33m'
declare NC='\033[0m'
declare total_size_in_bytes=0
declare total_program=0
declare program_number=0
runningcheck() {
initial2
runcheck5=$(docker ps | grep ${program_var})
if [[ "$runcheck5" != "" ]]; then running=1; else running=0; fi
initial2
runcheck5=$(docker ps | grep ${program_var})
if [[ "$runcheck5" != "" ]]; then running=1; else running=0; fi
}
initial() {
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgvault.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
touch /var/plexguide/pgvault.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgvault.buildup
touch /var/plexguide/pgvault.output
touch /var/plexguide/rclone.size
space=$(cat /var/plexguide/data.location)
# To Get Used Space
used=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $3}')
# To Get All Space
capacity=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $2}')
# Percentage
percentage=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $5}')
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgvault.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
touch /var/plexguide/pgvault.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgvault.buildup
touch /var/plexguide/pgvault.output
touch /var/plexguide/rclone.size
space=$(cat /var/plexguide/data.location)
# To Get Used Space
used=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $3}')
# To Get All Space
capacity=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $2}')
# Percentage
percentage=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $5}')
}
initial2() {
path=$(cat /var/plexguide/server.hd.path)
tarlocation=$(cat /var/plexguide/data.location)
program_size=$(cat /var/plexguide/rclone.size)
program_var=$(cat /tmp/program_var)
server_id=$(cat /var/plexguide/server.id)
path=$(cat /var/plexguide/server.hd.path)
tarlocation=$(cat /var/plexguide/data.location)
program_size=$(cat /var/plexguide/rclone.size)
program_var=$(cat /tmp/program_var)
server_id=$(cat /var/plexguide/server.id)
}
final() {
total_size_readable=$(numfmt --to=iec --suffix=B $total_size_in_bytes)
echo
echo "All backup complete"$'\t\t\t'"${total_size_readable}"
read -p '' typed </dev/tty
bash /opt/plexguide/menu/pgvault/pgvault.sh
exit
echo
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
bash /opt/pgvault/pgvault.sh
exit
}
queued() {
echo
read -p "⛔️ ERROR - $typed Already Queued! | Press [ENTER] " typed </dev/tty
clear_lines 2
echo
read -p "⛔️ ERROR - $typed Already Queued! | Press [ENTER] " typed </dev/tty
}
badserver() {
echo
read -p '⛔️ ERROR - Type an Exact Server Name | Press [ENTER] ' typed </dev/tty
clear_lines 2
echo
read -p '⛔️ ERROR - Type an Exact Server Name | Press [ENTER] ' typed </dev/tty
}
#not used yet
rclonelist() {
ls -l /mnt/gdrive/plexguide/backup | grep "^d" | awk '{print $9}' >pgvault.serverlist
ls -l /mnt/gdrive/plexguide/backup | grep "^d" | awk '{print $9}' >pgvault.serverlist
}
pgboxrecall() {
ls -p /opt/coreapps/apps | grep -v / >/var/plexguide/pgvault.apprecall
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
done </opt/plexguide/menu/pgvault/exempt.list
ls -p /opt/coreapps/apps | grep -v / >/var/plexguide/pgvault.apprecall
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
done </opt/pgvault/exempt.list
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
basename "$p" .yml >>/var/plexguide/pgvault.apprecall
done </var/plexguide/pgvault.apprecall
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
basename "$p" .yml >>/var/plexguide/pgvault.apprecall
done </var/plexguide/pgvault.apprecall
}
mathprime() {
### List Out Apps In Readable Order (One's Not Installed)
num=0
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/pgvault.apprecall
### List Out Apps In Readable Order (One's Not Installed)
num=0
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/pgvault.apprecall
}
################################################ FOR BACKUP - START
apprecall() {
tree -d -L 1 /opt/appdata | awk '{print $2}' | tail -n +2 | head -n -2 >/var/plexguide/pgvault.apprecall
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
done </opt/plexguide/menu/pgvault/exempt.list
tree -d -L 1 /opt/appdata | awk '{print $2}' | tail -n +2 | head -n -2 >/var/plexguide/pgvault.apprecall
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
done </opt/pgvault/exempt.list
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
mathprime
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
mathprime
}
buildup() {
echo "$typed" >>/var/plexguide/pgvault.buildup
sed -i "/^$typed\b/Id" /var/plexguide/pgvault.apprecall
echo "$typed" >>/var/plexguide/pgvault.buildup
sed -i "/^$typed\b/Id" /var/plexguide/pgvault.apprecall
num=0
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/pgvault.output
echo -n " " >>/var/plexguide/pgvault.output
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/pgvault.output
fi
done </var/plexguide/pgvault.buildup
num=0
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/pgvault.output
echo -n " " >>/var/plexguide/pgvault.output
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/pgvault.output
fi
done </var/plexguide/pgvault.buildup
mathprime
vaultbackup
mathprime
vaultbackup
}
################################################ FOR BACKUP - END
serverprime() {
tree -d -L 1 /mnt/gdrive/plexguide/backup | awk '{print $2}' | tail -n +2 | head -n -2 >/tmp/server.list
tree -d -L 1 /mnt/gdrive/plexguide/backup | awk '{print $2}' | tail -n +2 | head -n -2 >/tmp/server.list
### List Out Apps In Readable Order (One's Not Installed)
num=0
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </tmp/server.list
### List Out Apps In Readable Order (One's Not Installed)
num=0
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </tmp/server.list
servers=$(cat /var/plexguide/program.temp)
server_id=$(cat /var/plexguide/server.id)
servers=$(cat /var/plexguide/program.temp)
server_id=$(cat /var/plexguide/server.id)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Vault ~ Server Recall
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -160,53 +153,53 @@ $servers
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🌍 Type Server Name | Press [ENTER]: ' server </dev/tty
clear_lines 12
echo $server >/tmp/server.select
read -p '🌍 Type Server Name | Press [ENTER]: ' server </dev/tty
echo $server >/tmp/server.select
if [[ "$server" == "exit" || "$server" == "Exit" || "$server" == "EXIT" || "$server" == "z" || "$server" == "Z" ]]; then exit; fi
if [[ "$server" == "exit" || "$server" == "Exit" || "$server" == "EXIT" || "$server" == "z" || "$server" == "Z" ]]; then exit; fi
current2=$(cat /tmp/server.list | grep "\<$server\>")
if [ "$current2" == "" ]; then
badserver
serverprime
fi
current2=$(cat /tmp/server.list | grep "\<$server\>")
if [ "$current2" == "" ]; then
badserver
serverprime
fi
tempserver=$server
ls -l /mnt/gdrive/plexguide/backup/$tempserver | awk '{print $9}' | tail -n +2 >/var/plexguide/pgvault.restoreapps
tempserver=$server
ls -l /mnt/gdrive/plexguide/backup/$tempserver | awk '{print $9}' | tail -n +2 >/var/plexguide/pgvault.restoreapps
### Blank Out Temp List
rm -rf /var/plexguide/pgvault.apprecall 1>/dev/null 2>&1
touch /var/plexguide/pgvault.apprecall
### Blank Out Temp List
rm -rf /var/plexguide/pgvault.apprecall 1>/dev/null 2>&1
touch /var/plexguide/pgvault.apprecall
while read p; do
basename "$p" .tar >>/var/plexguide/pgvault.apprecall
done </var/plexguide/pgvault.restoreapps
while read p; do
basename "$p" .tar >>/var/plexguide/pgvault.apprecall
done </var/plexguide/pgvault.restoreapps
### Blank Out Temp List
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
touch /var/plexguide/program.temp
mathprime
### Blank Out Temp List
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
touch /var/plexguide/program.temp
mathprime
}
buildup2() {
echo "$typed" >>/var/plexguide/pgvault.buildup
sed -i "/^$typed\b/Id" /var/plexguide/pgvault.apprecall
echo "$typed" >>/var/plexguide/pgvault.buildup
sed -i "/^$typed\b/Id" /var/plexguide/pgvault.apprecall
num=0
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/pgvault.output
echo -n " " >>/var/plexguide/pgvault.output
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/pgvault.output
fi
done </var/plexguide/pgvault.buildup
num=0
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/pgvault.output
echo -n " " >>/var/plexguide/pgvault.output
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/pgvault.output
fi
done </var/plexguide/pgvault.buildup
mathprime
vaultrestore
mathprime
vaultrestore
}
################################################ FOR RESTORE - START
@@ -215,142 +208,127 @@ buildup2() {
######################################################## START - PG Vault Backup
backup_all_start() {
total_size_in_bytes=0
program_number=0
total_program=$(wc -l < /var/plexguide/pgvault.apprecall)
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🚀 Vault backup start..."
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
line_above=2
while read p; do
change_line_text $line_above "🚀 Vault is now backing up ${YELLOW}\"$p\"${NC}"
let line_above+=1
let program_number+=1
sleep 2.5
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
backup_process
while read p; do
tee <<-EOF
sleep 2
done </var/plexguide/pgvault.apprecall
final
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vault - Backing Up: $p
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 2.5
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
backup_process
sleep 2
done </var/plexguide/pgvault.apprecall
final
}
backup_start() {
total_size_in_bytes=0
program_number=0
total_program=$(wc -l < /var/plexguide/pgvault.buildup)
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🚀 Vault backup start..."
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
line_above=2
while read p; do
change_line_text $line_above "🚀 Vault is now backing up ${YELLOW}\"$p\"${NC}"
let line_above+=1
let program_number+=1
sleep 2.5
while read p; do
tee <<-EOF
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
backup_process
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vault - Backing Up: $p
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
sleep 2
done </var/plexguide/pgvault.buildup
final
EOF
sleep 2.5
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
backup_process
sleep 2
done </var/plexguide/pgvault.buildup
final
}
backup_process() {
initial2
##### Stop Docker Container if Running
runningcheck
if [[ "$running" == "1" ]]; then
echo "↘️ Stopping Docker Container - $program_var"
initial2
##### Stop Docker Container if Running
runningcheck
if [[ "$running" == "1" ]]; then
tee <<-EOF
sleep 1
docker stop $program_var 1>/dev/null 2>&1
clear_lines 1
fi
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Stopping Docker Container - $program_var
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
###### Start the Backup Process - Backup Locally First
echo "↘️ Zipping Data Locally - $program_var"
EOF
sleep 1
docker stop $program_var 1>/dev/null 2>&1
fi
path=$(cat /var/plexguide/server.hd.path)
tarlocation=$(cat /var/plexguide/data.location)
server_id=$(cat /var/plexguide/server.id)
###### Start the Backup Process - Backup Locally First
tee <<-EOF
tar \
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Zipping Data Locally - $program_var
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
path=$(cat /var/plexguide/server.hd.path)
tarlocation=$(cat /var/plexguide/data.location)
server_id=$(cat /var/plexguide/server.id)
tar \
--warning=no-file-changed --ignore-failed-read --absolute-names --warning=no-file-removed \
--exclude-from=/opt/plexguide/menu/pgvault/exclude.list \
-C /opt/appdata/${program_var} -cvf ${tarlocation}/${program_var}.tar ./ \
| cut -b1-$(tput cols) | sed -u 'i\\o033[2K' | stdbuf -o0 tr '\n' '\r'; echo
--exclude-from=/opt/pgvault/exclude.list \
-C /opt/appdata/${program_var} -cvf ${tarlocation}/${program_var}.tar ./
clear_lines 2
##### Restart Docker Application if was Running Prior
if [[ "$running" == "1" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Restarting Docker Application - $program_var
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
##### Restart Docker Application if was Running Prior
if [[ "$running" == "1" ]]; then
echo "↘️ Restarting Docker Application - $program_var"
sleep 2
docker restart $program_var 1>/dev/null 2>&1
clear_lines 1
fi
EOF
sleep 2
docker restart $program_var 1>/dev/null 2>&1
fi
###### Backing Up Files to GDrive
echo "↘️ Sending Zipped Data to Google Drive - $program_var"
###### Backing Up Files to GDrive
tee <<-EOF
useragent="$(cat /var/plexguide/uagent 1>/dev/null 2>&1)"
bwlimit="$(cat /var/plexguide/blitz.bw 1>/dev/null 2>&1)"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Sending Zipped Data to Google Drive - $program_var
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
vfs_dcs="$(cat /var/plexguide/vfs_dcs 1>/dev/null 2>&1)"
vfs_mt="$(cat /var/plexguide/vfs_mt 1>/dev/null 2>&1)"
vfs_t="$(cat /var/plexguide/vfs_t 1>/dev/null 2>&1)"
vfs_c="$(cat /var/plexguide/vfs_c 1>/dev/null 2>&1)"
EOF
useragent="$(cat /var/plexguide/uagent)"
bwlimit="$(cat /var/plexguide/blitz.bw)"
rclone --config /opt/appdata/plexguide/rclone.conf mkdir gdrive:/plexguide/backup/${server_id} 1>/dev/null 2>&1
vfs_dcs="$(cat /var/plexguide/vfs_dcs)"
vfs_mt="$(cat /var/plexguide/vfs_mt)"
vfs_t="$(cat /var/plexguide/vfs_t)"
vfs_c="$(cat /var/plexguide/vfs_c)"
rclone moveto ${tarlocation}/${program_var}.tar \
rclone --config /opt/appdata/plexguide/rclone.conf mkdir gdrive:/plexguide/backup/${server_id} 1>/dev/null 2>&1
rclone moveto ${tarlocation}/${program_var}.tar \
gdrive:/plexguide/backup/${server_id}/${program_var}.tar \
--config /opt/appdata/plexguide/rclone.conf \
-v --checksum --stats-one-line --stats 1s --progress \
--tpslimit=10 \
--checkers="$vfs_c" \
--transfers="$vfs_t" \
--no-traverse \
--fast-list \
--bwlimit="$bwlimit" \
--drive-chunk-size="$vfs_dcs" \
--user-agent="$useragent" 1>/dev/null 2>&1
--config /opt/appdata/plexguide/rclone.conf \
-v --checksum --stats-one-line --stats 1s --progress \
--tpslimit=10 \
--checkers="$vfs_c" \
--transfers="$vfs_t" \
--no-traverse \
--fast-list \
--bwlimit="$bwlimit" \
--drive-chunk-size="$vfs_dcs" \
--user-agent="$useragent"
# Show completed
clear_lines 1
tar_file_size_bytes=$(wc -c < ${tarlocation}/${program_var}.tar)
let total_size_in_bytes+=tar_file_size_bytes
tar_file_size_readable=$(du -h ${tarlocation}/${program_var}.tar | awk '{print $1}')
echo "✅ ${program_var} backup complete"$'\t\t\t'"${tar_file_size_readable}"$'\t'"Backup ${program_number}/${total_program}"
read -p '↘️ Type | PRESS ENTER: ' typed
clear
##### Remove File Incase
rm -rf ${tarlocation}/${program_var}.tar 1>/dev/null 2>&1
}
## Clear output text for n lines (arg $1)
clear_lines() {
for (( i=1; i <= $(($1)); i++ ));do
tput cuu1
tput el
done
}
## Change text in n lines above (arg $1) with string (arg $2)
change_line_text() {
tput sc
for (( i=1; i <= $(($1)); i++ ));do
tput cuu1
done
tput el
echo -e $2
tput rc
##### Remove File Incase
rm -rf ${tarlocation}/${program_var}.tar 1>/dev/null 2>&1
}

View File

@@ -5,13 +5,13 @@
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
source /opt/plexguide/menu/functions/start.sh
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ SETTING: Backup Download Location
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Paying attention to your disk space is important! Type the name of your
location is very important! Keep in mind Pandaura does not format the
location is very important! Keep in mind PG does not format the
location for you!
Examples:
@@ -19,15 +19,17 @@ Examples:
2. /hd2/spongebob
NOTE: Start with a / and end with no trailing slash!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
end_menu_back
# Standby
read -p 'TYPE the location | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
read -p 'TYPE the Location & Press [ENTER]: ' typed </dev/tty
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ NOTICE: Checking - $typed's existance. Please standby...
⚠️ NOTICE: Checking - $typed's existance ! Please Standby
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -36,82 +38,83 @@ if [ "$typed" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! - The ID cannot be blank!
⛔️ WARNING! - The ID Cannot Be Blank!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
bash /opt/plexguide/menu/interface/serverid.sh
exit
sleep 3
bash /opt/plexguide/menu/interface/serverid.sh
exit
else
##################################################### TYPED CHECKERS - START
typed2=$typed
bonehead=no
##### If BONEHEAD forgot to add a / in the beginning, we fix for them
initial="$(echo $typed | head -c 1)"
if [ "$initial" != "/" ]; then
typed="/$typed"
bonehead=yes
fi
##### If BONEHEAD added a / at the end, we fix for them
initial="${typed: -1}"
if [ "$initial" == "/" ]; then
typed=${typed::-1}
bonehead=yes
fi
##################################################### TYPED CHECKERS - START
typed2=$typed
bonehead=no
##### If BONEHEAD forgot to add a / in the beginning, we fix for them
initial="$(echo $typed | head -c 1)"
if [ "$initial" != "/" ]; then
typed="/$typed"
bonehead=yes
fi
##### If BONEHEAD added a / at the end, we fix for them
initial="${typed: -1}"
if [ "$initial" == "/" ]; then
typed=${typed::-1}
bonehead=yes
fi
##### Notify User is a Bonehead
if [ "$bonehead" == "yes" ]; then
##### Notify User is a Bonehead
if [ "$bonehead" == "yes" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ ALERT! We fixed the typos for you! Yes, you're welcome.
⛔️ ALERT! We fixed the typos for you! Yes, Your Welcome!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You Typed : $typed2
Changed To: $typed
EOF
read -n 1 -s -r -p "Press [ANY KEY] to continue "
echo ""
fi
read -n 1 -s -r -p "Press [ANY KEY] to Continue "
echo ""
fi
#################################################### TYPED CHECKERS - END
#################################################### TYPED CHECKERS - END
mkdir "$typed/pgcheck" &>/dev/null
# Recalls for to check existance
rcheck=$(ls -la $typed | grep "\<pgcheck\>")
if [ "$rcheck" == "" ]; then
mkdir "$typed/pgcheck" &>/dev/null
# Recalls for to check existance
rcheck=$(ls -la $typed | grep "\<pgcheck\>")
if [ "$rcheck" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! - This location does not exist! Exiting... (Case senstive)
⛔️ WARNING! - This Location Does Not Exist! Exiting! (Case Senstive)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 4
exit
fi
sleep 4
exit
fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ PASS: Location! Storing the name of the location!
✅️ PASS: Location! Storing the Name of the Location!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
# Prevents From Repeating
rm -rf $typed/pgcheck
sleep 3
# Prevents From Repeating
rm -rf $typed/pgcheck
sleep 3
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌇 PASS: Process complete!
🌇 PASS: Process Complete!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo "$typed" >/var/plexguide/data.location
read -n 1 -s -r -p "Press [ANY] Key to Continue "
echo "$typed" >/var/plexguide/data.location
read -n 1 -s -r -p "Press [ANY] Key to Continue "
fi

File diff suppressed because it is too large Load Diff

View File

@@ -5,8 +5,8 @@
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
source /opt/plexguide/menu/pgvault/functions.sh
source /opt/plexguide/menu/functions/pgvault.func
source /opt/pgvault/functions.sh
source /opt/pgvault/pgvault.func
file="/var/plexguide/restore.id"
if [ ! -e "$file" ]; then
echo "[NOT-SET]" >/var/plexguide/restore.id

View File

@@ -6,143 +6,143 @@
# GNU: General Public License v3.0
################################################################################
runningcheck() {
initial2
runcheck5=$(docker ps | grep ${program_var})
if [ "$runcheck5" != "" ]; then running=1; else running=0; fi
initial2
runcheck5=$(docker ps | grep ${program_var})
if [ "$runcheck5" != "" ]; then running=1; else running=0; fi
}
initial() {
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgvault.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
touch /var/plexguide/pgvault.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgvault.buildup
touch /var/plexguide/pgvault.output
touch /var/plexguide/rclone.size
space=$(cat /var/plexguide/data.location)
# To Get Used Space
used=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $3}')
# To Get All Space
capacity=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $2}')
# Percentage
percentage=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $5}')
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
rm -rf /var/plexguide/pgvault.buildup 1>/dev/null 2>&1
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
rm -rf /var/plexguide/app.list 1>/dev/null 2>&1
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
touch /var/plexguide/pgvault.output
touch /var/plexguide/program.temp
touch /var/plexguide/app.list
touch /var/plexguide/pgvault.buildup
touch /var/plexguide/pgvault.output
touch /var/plexguide/rclone.size
space=$(cat /var/plexguide/data.location)
# To Get Used Space
used=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $3}')
# To Get All Space
capacity=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $2}')
# Percentage
percentage=$(df -h /opt/appdata/plexguide | tail -n +2 | awk '{print $5}')
}
initial2() {
path=$(cat /var/plexguide/server.hd.path)
tarlocation=$(cat /var/plexguide/data.location)
program_size=$(cat /var/plexguide/rclone.size)
program_var=$(cat /tmp/program_var)
server_id=$(cat /var/plexguide/server.id)
path=$(cat /var/plexguide/server.hd.path)
tarlocation=$(cat /var/plexguide/data.location)
program_size=$(cat /var/plexguide/rclone.size)
program_var=$(cat /tmp/program_var)
server_id=$(cat /var/plexguide/server.id)
}
final() {
echo
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
clear_lines 2
bash /opt/pgvault/pgvault.sh
exit
echo
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
read -p '✅ Process Complete! | PRESS [ENTER] ' typed </dev/tty
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
bash /opt/pgvault/pgvault.sh
exit
}
queued() {
echo
read -p "⛔️ ERROR - $typed Already Queued! | Press [ENTER] " typed </dev/tty
clear_lines 2
echo
read -p "⛔️ ERROR - $typed Already Queued! | Press [ENTER] " typed </dev/tty
}
badserver() {
echo
read -p '⛔️ ERROR - Type an Exact Server Name | Press [ENTER] ' typed </dev/tty
clear_lines 2
echo
read -p '⛔️ ERROR - Type an Exact Server Name | Press [ENTER] ' typed </dev/tty
}
#not used yet
rclonelist() {
ls -l /mnt/gdrive/plexguide/backup | grep "^d" | awk '{print $9}' >pgvault.serverlist
ls -l /mnt/gdrive/plexguide/backup | grep "^d" | awk '{print $9}' >pgvault.serverlist
}
pgboxrecall() {
ls -p /opt/coreapps/apps | grep -v / >/var/plexguide/pgvault.apprecall
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
done </opt/pgvault/exempt.list
ls -p /opt/coreapps/apps | grep -v / >/var/plexguide/pgvault.apprecall
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
done </opt/pgvault/exempt.list
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
basename "$p" .yml >>/var/plexguide/pgvault.apprecall
done </var/plexguide/pgvault.apprecall
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
basename "$p" .yml >>/var/plexguide/pgvault.apprecall
done </var/plexguide/pgvault.apprecall
}
mathprime() {
### List Out Apps In Readable Order (One's Not Installed)
num=0
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/pgvault.apprecall
### List Out Apps In Readable Order (One's Not Installed)
num=0
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </var/plexguide/pgvault.apprecall
}
################################################ FOR BACKUP - START
apprecall() {
tree -d -L 1 /opt/appdata | awk '{print $2}' | tail -n +2 | head -n -2 >/var/plexguide/pgvault.apprecall
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
done </opt/pgvault/exempt.list
tree -d -L 1 /opt/appdata | awk '{print $2}' | tail -n +2 | head -n -2 >/var/plexguide/pgvault.apprecall
while read p; do
sed -i "/^$p\b/Id" /var/plexguide/pgvault.apprecall
done </opt/pgvault/exempt.list
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
mathprime
### Blank Out Temp List
rm -rf /var/plexguide/program.temp && touch /var/plexguide/program.temp
mathprime
}
buildup() {
echo "$typed" >>/var/plexguide/pgvault.buildup
sed -i "/^$typed\b/Id" /var/plexguide/pgvault.apprecall
echo "$typed" >>/var/plexguide/pgvault.buildup
sed -i "/^$typed\b/Id" /var/plexguide/pgvault.apprecall
num=0
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/pgvault.output
echo -n " " >>/var/plexguide/pgvault.output
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/pgvault.output
fi
done </var/plexguide/pgvault.buildup
num=0
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/pgvault.output
echo -n " " >>/var/plexguide/pgvault.output
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/pgvault.output
fi
done </var/plexguide/pgvault.buildup
mathprime
vaultbackup
mathprime
vaultbackup
}
################################################ FOR BACKUP - END
serverprime() {
tree -d -L 1 /mnt/gdrive/plexguide/backup | awk '{print $2}' | tail -n +2 | head -n -2 >/tmp/server.list
tree -d -L 1 /mnt/gdrive/plexguide/backup | awk '{print $2}' | tail -n +2 | head -n -2 >/tmp/server.list
### List Out Apps In Readable Order (One's Not Installed)
num=0
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </tmp/server.list
### List Out Apps In Readable Order (One's Not Installed)
num=0
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/program.temp
echo -n " " >>/var/plexguide/program.temp
num=$((num + 1))
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/program.temp
fi
done </tmp/server.list
servers=$(cat /var/plexguide/program.temp)
server_id=$(cat /var/plexguide/server.id)
servers=$(cat /var/plexguide/program.temp)
server_id=$(cat /var/plexguide/server.id)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Backup & Restore ~ Server Recall [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -154,53 +154,53 @@ $servers
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🌍 Type Server Name | Press [ENTER]: ' server </dev/tty
clear_lines 12
echo $server >/tmp/server.select
read -p '🌍 Type Server Name | Press [ENTER]: ' server </dev/tty
echo $server >/tmp/server.select
if [[ "$server" == "exit" || "$server" == "Exit" || "$server" == "EXIT" || "$server" == "z" || "$server" == "Z" ]]; then exit; fi
if [[ "$server" == "exit" || "$server" == "Exit" || "$server" == "EXIT" || "$server" == "z" || "$server" == "Z" ]]; then exit; fi
current2=$(cat /tmp/server.list | grep "\<$server\>")
if [ "$current2" == "" ]; then
badserver
serverprime
fi
current2=$(cat /tmp/server.list | grep "\<$server\>")
if [ "$current2" == "" ]; then
badserver
serverprime
fi
tempserver=$server
ls -l /mnt/gdrive/plexguide/backup/$tempserver/protected/ | awk '{print $9}' | tail -n +2 >/var/plexguide/pgvault.restoreapps
tempserver=$server
ls -l /mnt/gdrive/plexguide/backup/$tempserver/protected/ | awk '{print $9}' | tail -n +2 >/var/plexguide/pgvault.restoreapps
### Blank Out Temp List
rm -rf /var/plexguide/pgvault.apprecall 1>/dev/null 2>&1
touch /var/plexguide/pgvault.apprecall
### Blank Out Temp List
rm -rf /var/plexguide/pgvault.apprecall 1>/dev/null 2>&1
touch /var/plexguide/pgvault.apprecall
while read p; do
basename "$p" .tar >>/var/plexguide/pgvault.apprecall
done </var/plexguide/pgvault.restoreapps
while read p; do
basename "$p" .tar >>/var/plexguide/pgvault.apprecall
done </var/plexguide/pgvault.restoreapps
### Blank Out Temp List
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
touch /var/plexguide/program.temp
mathprime
### Blank Out Temp List
rm -rf /var/plexguide/program.temp 1>/dev/null 2>&1
touch /var/plexguide/program.temp
mathprime
}
buildup2() {
echo "$typed" >>/var/plexguide/pgvault.buildup
sed -i "/^$typed\b/Id" /var/plexguide/pgvault.apprecall
echo "$typed" >>/var/plexguide/pgvault.buildup
sed -i "/^$typed\b/Id" /var/plexguide/pgvault.apprecall
num=0
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/pgvault.output
echo -n " " >>/var/plexguide/pgvault.output
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/pgvault.output
fi
done </var/plexguide/pgvault.buildup
num=0
rm -rf /var/plexguide/pgvault.output 1>/dev/null 2>&1
while read p; do
echo -n $p >>/var/plexguide/pgvault.output
echo -n " " >>/var/plexguide/pgvault.output
if [ "$num" == 7 ]; then
num=0
echo " " >>/var/plexguide/pgvault.output
fi
done </var/plexguide/pgvault.buildup
mathprime
vaultrestore
mathprime
vaultrestore
}
################################################ FOR RESTORE - START
@@ -210,229 +210,287 @@ buildup2() {
backup_all_start() {
while read p; do
echo " Backing Up: $p"
while read p; do
tee <<-EOF
sleep 2.5
clear_lines 1
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Backing Up: $p
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
backup_process
EOF
sleep 2
done </var/plexguide/pgvault.apprecall
final
sleep 2.5
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
backup_process
sleep 2
done </var/plexguide/pgvault.apprecall
final
}
backup_start() {
while read p; do
echo " Backing Up: $p"
while read p; do
tee <<-EOF
sleep 2.5
clear_lines 1
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Backing Up: $p
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
backup_process
EOF
sleep 2
done </var/plexguide/pgvault.buildup
final
sleep 2.5
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
backup_process
sleep 2
done </var/plexguide/pgvault.buildup
final
}
backup_process() {
initial2
initial2
runningcheck
if [ "$running" == "1" ]; then
echo "↘️ Stopping Docker Container - $program_var [ Protected APPS ]"
runningcheck
if [ "$running" == "1" ]; then
tee <<-EOF
sleep 1
docker stop $program_var 1>/dev/null 2>&1
clear_lines 1
fi
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Stopping Docker Container - $program_var [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
###### Start the Backup Process - Backup Locally First
echo "↘️ Zipping Data Locally - $program_var [ Protected APPS ]"
EOF
sleep 1
docker stop $program_var 1>/dev/null 2>&1
fi
path=$(cat /var/plexguide/server.hd.path)
tarlocation=$(cat /var/plexguide/data.location)
server_id=$(cat /var/plexguide/server.id)
###### Start the Backup Process - Backup Locally First
tee <<-EOF
tar \
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Zipping Data Locally - $program_var [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
path=$(cat /var/plexguide/server.hd.path)
tarlocation=$(cat /var/plexguide/data.location)
server_id=$(cat /var/plexguide/server.id)
tar \
--warning=no-file-changed --ignore-failed-read --absolute-names --warning=no-file-removed \
--exclude-from=/opt/plexguide/menu/pgvault/exclude.list \
-czf - /opt/appdata/${program_var} | openssl enc -e -aes256 -out /opt/appdata/plexguide/${program_var}.tar.gz ./ \
| cut -b1-$(tput cols) | sed -u 'i\\o033[2K' | stdbuf -o0 tr '\n' '\r'; echo
--exclude-from=/opt/pgvault/exclude.list \
-czf - /opt/appdata/${program_var} | openssl enc -e -aes256 -out /opt/appdata/plexguide/${program_var}.tar.gz ./
clear_lines 2
##### Restart Docker Application if was Running Prior
if [ "$running" == "1" ]; then
tee <<-EOF
##### Restart Docker Application if was Running Prior
if [ "$running" == "1" ]; then
echo "↘️ Restarting Docker Application - $program_var [ Protected APPS ]"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Restarting Docker Application - $program_var [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
sleep 2
docker restart $program_var 1>/dev/null 2>&1
clear_lines 1
fi
EOF
sleep 2
docker restart $program_var 1>/dev/null 2>&1
fi
###### Backing Up Files to GDrive
echo "↘️ Sending Zipped Data to Google Drive - $program_var [ Protected APPS ]"
###### Backing Up Files to GDrive
tee <<-EOF
# User specifying VARS
useragent="$(cat /var/plexguide/uagent 1>/dev/null 2>&1)"
bwlimit="$(cat /var/plexguide/blitz.bw 1>/dev/null 2>&1)"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Sending Zipped Data to Google Drive - $program_var [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
vfs_dcs="$(cat /var/plexguide/vfs_dcs 1>/dev/null 2>&1)"
vfs_mt="$(cat /var/plexguide/vfs_mt 1>/dev/null 2>&1)"
vfs_t="$(cat /var/plexguide/vfs_t 1>/dev/null 2>&1)"
vfs_c="$(cat /var/plexguide/vfs_c 1>/dev/null 2>&1)"
EOF
# User specifying VARS
useragent="$(cat /var/plexguide/uagent)"
bwlimit="$(cat /var/plexguide/blitz.bw)"
vfs_dcs="$(cat /var/plexguide/vfs_dcs)"
vfs_mt="$(cat /var/plexguide/vfs_mt)"
vfs_t="$(cat /var/plexguide/vfs_t)"
vfs_c="$(cat /var/plexguide/vfs_c)"
rclone --config /opt/appdata/plexguide/rclone.conf mkdir gdrive:/plexguide/backup/${server_id}/protected/ 1>/dev/null 2>&1
rclone --config /opt/appdata/plexguide/rclone.conf mkdir gdrive:/plexguide/backup/${server_id}/protected/ 1>/dev/null 2>&1
rclone moveto ${tarlocation}/${program_var}.tar.gz \
rclone moveto ${tarlocation}/${program_var}.tar.gz \
gdrive:/plexguide/backup/${server_id}/protected/${program_var}.tar.gz \
--config /opt/appdata/plexguide/rclone.conf \
-v --checksum --stats-one-line --stats 1s --progress \
--tpslimit=10 \
--checkers="$vfs_c" \
--transfers="$vfs_t" \
--no-traverse \
--fast-list \
--bwlimit="$bwlimit" \
--drive-chunk-size="$vfs_dcs" \
--user-agent="$useragent" 1>/dev/null 2>&1
--config /opt/appdata/plexguide/rclone.conf \
-v --checksum --stats-one-line --stats 1s --progress \
--tpslimit=10 \
--checkers="$vfs_c" \
--transfers="$vfs_t" \
--no-traverse \
--fast-list \
--bwlimit="$bwlimit" \
--drive-chunk-size="$vfs_dcs" \
--user-agent="$useragent"
##### Remove File Incase
rm -rf ${tarlocation}/${program_var}.tar.gz 1>/dev/null 2>&1
clear_lines 1
echo "✅ \"$program_var\" has been backed up to Google Drive"
##### Remove File Incase
rm -rf ${tarlocation}/${program_var}.tar.gz 1>/dev/null 2>&1
}
######################################################## END - PG Vault Backup
#
##################################################### START - PG Vault Restore
restore_all_start() {
while read p; do
echo " Restoring: $p"
while read p; do
tee <<-EOF
sleep 2.5
clear_lines 1
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Restoring: $p
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
restore_process
EOF
sleep 2
done </var/plexguide/pgvault.apprecall
final
sleep 2.5
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
restore_process
sleep 2
done </var/plexguide/pgvault.apprecall
final
}
restore_start() {
while read p; do
echo " Restoring: $p"
while read p; do
tee <<-EOF
sleep 2.5
clear_lines 1
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Restoring: $p
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
restore_process
EOF
sleep 2
done </var/plexguide/pgvault.buildup
final
sleep 2.5
# Store Used Program
echo $p >/tmp/program_var
# Execute Main Program
restore_process
sleep 2
done </var/plexguide/pgvault.buildup
final
}
restore_process() {
initial2
srecall=$(cat /tmp/server.select)
echo "↘️ Determining Initial File Size - $program_var [ Protected APPS ]"
initial2
srecall=$(cat /tmp/server.select)
tee <<-EOF
size=$(du -sh --apparent-size /mnt/gdrive/plexguide/backup/${srecall}/protected/${program_var}.tar.gz | /usr/bin/awk '{print $1}')
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Determining Initial File Size - $program_var [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
size=$(du -sh --apparent-size /mnt/gdrive/plexguide/backup/${srecall}/protected/${program_var}.tar.gz | /usr/bin/awk '{print $1}')
sleep 2
echo "Initial File Size: $size"
sleep 2
###### Backing Up Files to GDrive
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Downloading Data From Google Drive - $program_var [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
# User specifying VARS
useragent="$(cat /var/plexguide/uagent)"
bwlimit="$(cat /var/plexguide/blitz.bw)"
vfs_dcs="$(cat /var/plexguide/vfs_dcs)"
vfs_mt="$(cat /var/plexguide/vfs_mt)"
vfs_t="$(cat /var/plexguide/vfs_t)"
vfs_c="$(cat /var/plexguide/vfs_c)"
rclone copy gdrive:/plexguide/backup/${srecall}/protected/${program_var}.tar.gr ${tarlocation} \
--config /opt/appdata/plexguide/rclone.conf \
-v --checksum --stats-one-line --stats 1s --progress \
--tpslimit=10 \
--checkers="$vfs_c" \
--transfers="$vfs_t" \
--no-traverse \
--fast-list \
--bwlimit="$bwlimit" \
--drive-chunk-size="$vfs_dcs" \
--user-agent="$useragent"
##### Stop Docker Container if Running
runningcheck
if [ "$running" == "1" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Stopping Docker Container - $program_var [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1
docker stop $program_var 1>/dev/null 2>&1
fi
###### Start the Backup Process - Backup Locally First
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ UnZipping & Restoring Data - $program_var [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
mkdir -p "/opt/appdata/${program_var}"
rm -rf "/opt/appdata/${program_var}/*"
chown -R 1000:1000 "/opt/appdata/${program_var}"
chmod -R 775 "/opt/appdata/${program_var}"
openssl enc -d -aes256 -in /opt/appdata/${program_var} | tar xz -C ${tarlocation}/${program_var}.tar.gz
chown -R 1000:1000 "/opt/appdata/${program_var}"
chmod -R 775 "/opt/appdata/${program_var}"
##### Restart Docker Application if was Running Prior
if [ "$running" == "1" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Restarting Docker Application - $program_var
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 2
echo "Initial File Size: $size"
sleep 2
clear_lines 2
docker restart $program_var 1>/dev/null 2>&1
fi
###### Backing Up Files to GDrive
echo "↘️ Downloading Data From Google Drive - $program_var [ Protected APPS ]"
# User specifying VARS
useragent="$(cat /var/plexguide/uagent)"
bwlimit="$(cat /var/plexguide/blitz.bw)"
vfs_dcs="$(cat /var/plexguide/vfs_dcs)"
vfs_mt="$(cat /var/plexguide/vfs_mt)"
vfs_t="$(cat /var/plexguide/vfs_t)"
vfs_c="$(cat /var/plexguide/vfs_c)"
rclone copy gdrive:/plexguide/backup/${srecall}/protected/${program_var}.tar.gr ${tarlocation} \
--config /opt/appdata/plexguide/rclone.conf \
-v --checksum --stats-one-line --stats 1s --progress \
--tpslimit=10 \
--checkers="$vfs_c" \
--transfers="$vfs_t" \
--no-traverse \
--fast-list \
--bwlimit="$bwlimit" \
--drive-chunk-size="$vfs_dcs" \
--user-agent="$useragent" \
| cut -b1-$(tput cols) | sed -u 'i\\o033[2K' | stdbuf -o0 tr '\n' '\r'; echo
clear_lines 2
##### Stop Docker Container if Running
runningcheck
if [ "$running" == "1" ]; then
echo "↘️ Stopping Docker Container - $program_var [ Protected APPS ]"
sleep 1
docker stop $program_var 1>/dev/null 2>&1
clear_lines 1
fi
###### Start the Backup Process - Backup Locally First
echo "↘️ UnZipping & Restoring Data - $program_var [ Protected APPS ]"
mkdir -p "/opt/appdata/${program_var}"
rm -rf "/opt/appdata/${program_var}/*"
chown -R 1000:1000 "/opt/appdata/${program_var}"
chmod -R 775 "/opt/appdata/${program_var}"
openssl enc -d -aes256 -in /opt/appdata/${program_var} | tar xz -C ${tarlocation}/${program_var}.tar.gz
chown -R 1000:1000 "/opt/appdata/${program_var}"
chmod -R 775 "/opt/appdata/${program_var}"
clear_lines 1
##### Restart Docker Application if was Running Prior
if [ "$running" == "1" ]; then
echo "↘️ Restarting Docker Application - $program_var"
sleep 2
docker restart $program_var 1>/dev/null 2>&1
clear_lines 1
fi
##### Remove File Incase
rm -rf ${tarlocation}/${program_var}.tar 1>/dev/null 2>&1
##### Remove File Incase
rm -rf ${tarlocation}/${program_var}.tar 1>/dev/null 2>&1
}
##################################################### END - PG Vault Restore
#
##################################################### START - Backup Interface
vaultbackup() {
### List Out Apps In Readable Order (One's Not Installed)
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgvault.output)
### List Out Apps In Readable Order (One's Not Installed)
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgvault.output)
if [ "$buildup" == "" ]; then buildup="NONE"; fi
if [ "$buildup" == "" ]; then buildup="NONE"; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Backup & Restore ~ Data Storage [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -449,38 +507,39 @@ $buildup
[A] Backup
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🌍 Type APP for QUEUE | Type all to backup all apps | Press [ENTER]: ' typed </dev/tty
clear_lines 17
read -p '🌍 Type APP for QUEUE | Type all to backup all apps | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" == "all" || "$typed" == "All" || "$typed" == "ALL" ]]; then
backup_all_start
fi
if [[ "$typed" == "backup" || "$typed" == "a" || "$typed" == "A" ]]; then backup_start; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then exit; fi
if [[ "$typed" == "all" || "$typed" == "All" || "$typed" == "ALL" ]]; then
backup_all_start
fi
if [[ "$typed" == "backup" || "$typed" == "a" || "$typed" == "A" ]]; then backup_start; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then exit; fi
current2=$(cat /var/plexguide/pgvault.buildup | grep "\<$typed\>")
if [ "$current2" != "" ]; then
queued
vaultbackup
fi
current2=$(cat /var/plexguide/pgvault.buildup | grep "\<$typed\>")
if [ "$current2" != "" ]; then
queued
vaultbackup
fi
cat /var/plexguide/pgvault.buildup >/tmp/appcheck.5
cat /var/plexguide/pgvault.apprecall >>/tmp/appcheck.5
current1=$(cat /tmp/appcheck.5 | grep "\<$typed\>")
if [ "$current1" == "" ]; then badinput && vaultbackup; fi
cat /var/plexguide/pgvault.buildup >/tmp/appcheck.5
cat /var/plexguide/pgvault.apprecall >>/tmp/appcheck.5
current1=$(cat /tmp/appcheck.5 | grep "\<$typed\>")
if [ "$current1" == "" ]; then badinput && vaultbackup; fi
buildup
buildup
}
##################################################### END - Backup Interface
#
##################################################### START - Restore Interface
vaultrestore() {
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgvault.output)
notrun=$(cat /var/plexguide/program.temp)
buildup=$(cat /var/plexguide/pgvault.output)
if [ "$buildup" == "" ]; then buildup="NONE"; fi
if [ "$buildup" == "" ]; then buildup="NONE"; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Backup & Restore ~ Data Recall [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -497,92 +556,87 @@ $buildup
[A] Restore
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🌍 Type APP for QUEUE | Type all to restore all apps | Press [ENTER]: ' typed </dev/tty
clear_lines 17
read -p '🌍 Type APP for QUEUE | Type all to restore all apps | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" == "all" || "$typed" == "All" || "$typed" == "ALL" ]]; then restore_all_start; fi
if [[ "$typed" == "all" || "$typed" == "All" || "$typed" == "ALL" ]]; then restore_all_start; fi
if [[ "$typed" == "restore" || "$typed" == "a" || "$typed" == "A" ]]; then restore_start; fi
if [[ "$typed" == "restore" || "$typed" == "a" || "$typed" == "A" ]]; then restore_start; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then exit; fi
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then exit; fi
current2=$(cat /var/plexguide/pgvault.buildup | grep "\<$typed\>")
if [ "$current2" != "" ]; then
queued
vaultrestore
fi
current2=$(cat /var/plexguide/pgvault.buildup | grep "\<$typed\>")
if [ "$current2" != "" ]; then
queued
vaultrestore
fi
cat /var/plexguide/pgvault.buildup >/tmp/appcheck.5
cat /var/plexguide/pgvault.apprecall >>/tmp/appcheck.5
current1=$(cat /tmp/appcheck.5 | grep "\<$typed\>")
if [ "$current1" == "" ]; then badinput && vaultrestore; fi
cat /var/plexguide/pgvault.buildup >/tmp/appcheck.5
cat /var/plexguide/pgvault.apprecall >>/tmp/appcheck.5
current1=$(cat /tmp/appcheck.5 | grep "\<$typed\>")
if [ "$current1" == "" ]; then badinput && vaultrestore; fi
buildup2
buildup2
}
##################################################### START Primary Interface
primaryinterface() {
initial2
initial2
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📁 Backup & Restore Interface [ Protected APPS ]
📁 Backup & Restore Interface [ Protected APPS ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌵 Disk Used Space: $used of $capacity | $percentage Used Capacity
🌵 Disk Used Space: $used of $capacity | $percentage Used Capacity
[1] Backup your data
[2] Restore your data
[3] Change Server ID | Current Server ID : $server_id
[4] Processing Location | Current location : $tarlocation
[1] Data Backup
[2] Data Restore
[3] Current Server ID : $server_id
[4] Processing Location: $tarlocation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Type a Number | Press [ENTER]: ' typed </dev/tty
clear_lines 15
if [ "$typed" == "1" ]; then
vaultbackup
primaryinterface
elif [ "$typed" == "2" ]; then
serverprime
vaultrestore
primaryinterface
elif [ "$typed" == "3" ]; then
echo "0" >/var/plexguide/server.id.stored
bash /opt/plexguide/menu/interface/serverid.sh
primaryinterface
elif [ "$typed" == "4" ]; then
bash /opt/pgvault/location.sh
primaryinterface
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then
exit
else
badinput
primaryinterface
fi
EOF
read -p 'Type a Number | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
vaultbackup
primaryinterface
elif [ "$typed" == "2" ]; then
serverprime
vaultrestore
primaryinterface
elif [ "$typed" == "3" ]; then
echo "0" >/var/plexguide/server.id.stored
bash /opt/plexguide/menu/interface/serverid.sh
primaryinterface
elif [ "$typed" == "4" ]; then
bash /opt/pgvault/location.sh
primaryinterface
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then
exit
else
badinput
primaryinterface
fi
}
##################################################### END Primary Interface
restorecheck() {
if [ "$restoreid" == "[NOT-SET]" ]; then
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "⛔️ WARNING! - You Must Set Your Recovery ID First! Restarting Process!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
if [ "$restoreid" == "[NOT-SET]" ]; then
tee <<-EOF
read -n 1 -s -r -p "Press [ANY] Key to Continue "
echo
clear_lines 5
primaryinterface
exit
fi
}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! - You Must Set Your Recovery ID First! Restarting Process!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
## Clear output text for n lines ($1 args)
clear_lines() {
for (( i=1; i <= $(($1)); i++ ));do
tput cuu1
tput el
done
EOF
read -n 1 -s -r -p "Press [ANY] Key to Continue "
echo
primaryinterface
exit
fi
}

View File

@@ -13,7 +13,7 @@ touch /var/plexguide/plex.claim
# BAD INPUT
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
}
start0() {
@@ -29,7 +29,7 @@ setserver() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PLEX Installer
🌎 PLEX Installer
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE: DO NOT SELECT LOCAL SYSTEM for a REMOTE SERVER outside of your
network as in using Hetzner, WholeSale Internet & Etc!
@@ -56,7 +56,7 @@ EOF
claim() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Remote Plex Server - Claim the Plex Server
🌎 Remote Plex Server - Claim the Plex Server
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
To Claim the Plex Server, visit https://www.plex.tv/claim/ and input the
@@ -81,7 +81,7 @@ EOF
updateplexlsio() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Update Plex Server Automatic Update for Linuxserver.io
🌎 Update Plex Server Automatic Update for Linuxserver.io
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ 1 ] docker:

View File

@@ -7,30 +7,30 @@
################################################################################
# FUNCTIONS START ##############################################################
typed="${typed,,}"
# BAD INPUT
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question1
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question1
}
badinput2() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question2
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question2
}
tokenstatus() {
ptokendep=$(cat /var/plexguide/plex.token)
if [ "$ptokendep" != "" ]; then
PGSELFTEST=$(curl -LI "http://$(hostname -I | awk '{print $1}'):32400/system?X-Plex-Token=$(cat /var/plexguide/plex.token)" -o /dev/null -w '%{http_code}\n' -s)
if [[ $PGSELFTEST -ge 200 && $PGSELFTEST -le 299 ]]; then
pstatus="✅ DEPLOYED"
else
pstatus="❌ DEPLOYED BUT TOKEN FAILED"
fi
else pstatus="⚠️ NOT DEPLOYED"; fi
ptokendep=$(cat /var/plexguide/plex.token)
if [ "$ptokendep" != "" ]; then
PGSELFTEST=$(curl -LI "http://$(hostname -I | awk '{print $1}'):32400/system?X-Plex-Token=$(cat /var/plexguide/plex.token)" -o /dev/null -w '%{http_code}\n' -s)
if [[ $PGSELFTEST -ge 200 && $PGSELFTEST -le 299 ]]; then
pstatus="✅ DEPLOYED"
else
pstatus="❌ DEPLOYED BUT TOKEN FAILED"
fi
else pstatus="⚠️ NOT DEPLOYED"; fi
}
# FIRST QUESTION
@@ -39,7 +39,7 @@ question1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PlexToken Generator
🌎 PlexToken Generator
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Token Status : [$pstatus]
@@ -52,12 +52,12 @@ Token Status : [$pstatus]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty
echo
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty
echo
if [ "${typed}" == "1" ]; then
read -p 'Enter the PLEX User Name | Press [ENTER]: ' user </dev/tty
read -p 'Enter the PLEX User Password | Press [ENTER]: ' pw </dev/tty
if [ "$typed" == "1" ]; then
read -p 'Enter the PLEX User Name | Press [ENTER]: ' user </dev/tty
read -p 'Enter the PLEX User Password | Press [ENTER]: ' pw </dev/tty
tee <<-EOF
@@ -65,9 +65,9 @@ EOF
🍖 NOM NOM - Saved Your Information!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
question2
elif [ "${typed}" == "2" ]; then
sleep 3
question2
elif [ "$typed" == "2" ]; then
tee <<-EOF
@@ -75,15 +75,15 @@ EOF
🍖 NOM NOM - Read Your Information!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
tokenexist
sleep 3
tokenexist
pw=$(cat /var/plexguide/plex.pw)
user=$(cat /var/plexguide/plex.user)
pw=$(cat /var/plexguide/plex.pw)
user=$(cat /var/plexguide/plex.user)
elif [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
exit
else badinput; fi
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then
exit
else badinput; fi
}
question2() {
@@ -106,9 +106,9 @@ User Pass: $pw
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
if [ "$typed" == "1" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -118,70 +118,70 @@ EOF
NOTE: If the token is bad, this process will repeat again!
EOF
sleep 4
question3
elif [ "$typed" == "2" ]; then
question1
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then
exit
else badinput2; fi
sleep 4
question3
elif [ "$typed" == "2" ]; then
question1
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then
exit
else badinput2; fi
}
question3() {
echo "$pw" >/var/plexguide/plex.pw
echo "$user" >/var/plexguide/plex.user
ansible-playbook /opt/plexguide/menu/plex/token.yml
token=$(cat /var/plexguide/plex.token)
if [ "$token" != "" ]; then
echo "$pw" >/var/plexguide/plex.pw
echo "$user" >/var/plexguide/plex.user
ansible-playbook /opt/plexguide/menu/plex/token.yml
token=$(cat /var/plexguide/plex.token)
if [ "$token" != "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ PlexToken Generation Succeeded!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 4
else
sleep 4
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PlexToken Generation Failed!
PlexToken Generation Failed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE: Process will repeat until you succeed or exit!
EOF
read -p 'Confirm Info | Press [ENTER] ' typed </dev/tty
question1
fi
read -p 'Confirm Info | Press [ENTER] ' typed </dev/tty
question1
fi
}
tokenexist(){
pw=$(cat /var/plexguide/plex.pw)
user=$(cat /var/plexguide/plex.user)
ansible-playbook /opt/plexguide/menu/plex/token.yml
token=$(cat /var/plexguide/plex.token)
token=$(cat /var/plexguide/plex.token)
if [ "$token" != "" ]; then
pw=$(cat /var/plexguide/plex.pw)
user=$(cat /var/plexguide/plex.user)
ansible-playbook /opt/plexguide/menu/plex/token.yml
token=$(cat /var/plexguide/plex.token)
token=$(cat /var/plexguide/plex.token)
if [ "$token" != "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ PlexToken Generation Succeeded!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 4
else
sleep 4
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PlexToken Generation Failed!
PlexToken Generation Failed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE: Process will repeat until you succeed or exit!
EOF
read -p 'Confirm Info | Press [ENTER] ' typed </dev/tty
question1
fi
read -p 'Confirm Info | Press [ENTER] ' typed </dev/tty
question1
fi
}
# FUNCTIONS END ##############################################################

View File

@@ -47,7 +47,7 @@ plexcheck() {
if [[ "$pcheck" == "" ]]; then
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Plex is Not Installed or Running! Exiting!
WARNING! - Plex is Not Installed or Running! Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
dontwork
@@ -64,8 +64,8 @@ token() {
if [[ "$ptoken" != "$X_PLEX_TOKEN" ]]; then
printf '
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! Failed to Generate a Valid Plex Token!
WARNING! Exiting Deployment!
WARNING! Failed to Generate a Valid Plex Token!
WARNING! Exiting Deployment!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
dontwork
@@ -79,7 +79,7 @@ echo $X_PLEX_TOKEN >/var/plex_dupe/plex.token
# BAD INPUT
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question1
}
@@ -95,7 +95,7 @@ chk=$(figlet Plex Dupe finder | lolcat )
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Plex_AutoScan Credits
🚀 Plex_AutoScan Credits
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$chk
@@ -132,7 +132,7 @@ status=$(cat /var/plex_dupe/plex.authdel)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Plex Dupefinder
🚀 Plex Dupefinder
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Set it to AUTO_DELETE [ $status ]
@@ -172,7 +172,7 @@ remove() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Remove Plex Dupefinder || l3uddz/plex_dupefinder
🚀 Remove Plex Dupefinder || l3uddz/plex_dupefinder
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ 1 ] - NO
@@ -200,7 +200,7 @@ deploycheck
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Plex Dupefinder Interface || l3uddz/plex_dupefinder
🚀 Plex Dupefinder Interface || l3uddz/plex_dupefinder
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE : Plex Dupefinder are located in /opt/plex_dupefinder

View File

@@ -6,18 +6,18 @@
################################################################################
# FUNCTIONS START ##############################################################
typed="${typed,,}"
# BAD INPUT
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question1
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question1
}
badinput2() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question2
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question2
}
# FIRST QUESTION
@@ -26,7 +26,7 @@ question1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Plex User Name Store
🌎 Plex User Name Store
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] - Generate stored details for Plex Dupefinder
@@ -35,12 +35,12 @@ question1() {
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty
echo
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty
echo
if [ "${typed}" == "1" ]; then
read -p 'Enter the PLEX User Name | Press [ENTER]: ' user </dev/tty
read -p 'Enter the PLEX User Pass | Press [ENTER]: ' pw </dev/tty
if [ "$typed" == "1" ]; then
read -p 'Enter the PLEX User Name | Press [ENTER]: ' user </dev/tty
read -p 'Enter the PLEX User Pass | Press [ENTER]: ' pw </dev/tty
tee <<-EOF
@@ -48,9 +48,9 @@ EOF
🍖 NOM NOM - Saved Your Information!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
question2
elif [ "${typed}" == "2" ]; then
sleep 3
question2
elif [ "$typed" == "2" ]; then
tee <<-EOF
@@ -58,15 +58,15 @@ EOF
🍖 NOM NOM - Read Your Information!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
question 2
sleep 3
question 2
pw=$(cat /var/plex_dupe/plex.pw)
user=$(cat /var/plex_dupe/plex.user)
pw=$(cat /var/plex_dupe/plex.pw)
user=$(cat /var/plex_dupe/plex.user)
elif [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
exit
else badinput; fi
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then
exit
else badinput; fi
}
question2() {
@@ -90,9 +90,9 @@ User Pass: [ $pw ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty
if [ "${typed}" == "1" ]; then
if [ "$typed" == "1" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -102,42 +102,42 @@ EOF
NOTE: If the token is bad, this process will repeat again!
EOF
sleep 4
question3
elif [ "${typed}" == "2" ]; then
question1
elif [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
exit
else badinput2; fi
sleep 4
question3
elif [ "$typed" == "2" ]; then
question1
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then
exit
else badinput2; fi
}
question3() {
echo "$pw" >/var/plex_dupe/plex.pw
echo "$user" >/var/plex_dupe/plex.user
echo "$pw" >/var/plex_dupe/plex.pw
echo "$user" >/var/plex_dupe/plex.user
bash /opt/plexguide/menu/plex_dupe/scripts/plex_token.sh
bash /opt/plexguide/menu/plex_dupe/scripts/plex_token.sh
token=$(cat /var/plex_dupe/plex.token)
if [ "$token" != "" ]; then
token=$(cat /var/plex_dupe/plex.token)
if [ "$token" != "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ Details stored Succeeded!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 4
else
sleep 4
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Details Failed!
Details Failed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE: Process will repeat until you succeed or exit!
EOF
read -p 'Confirm Info | Press [ENTER] ' typed </dev/tty
question1
fi
read -p 'Confirm Info | Press [ENTER] ' typed </dev/tty
question1
fi
}
question1
question1

View File

@@ -37,7 +37,7 @@ plexcheck() {
if [ "$pcheck" == "" ]; then
printf'
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Plex is Not Installed or Running! Exiting!
WARNING! - Plex is Not Installed or Running! Exiting!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
@@ -65,7 +65,7 @@ bash /opt/plexguide/menu/plexpatrol/token.sh && clear
# BAD INPUT
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question1
}
@@ -73,7 +73,7 @@ selection1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Instantly Kick Video Transcodes?
🚀 Instantly Kick Video Transcodes?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] False
@@ -93,7 +93,7 @@ selection2() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Instantly Kick 4k - Video Transcodes?
🚀 Instantly Kick 4k - Video Transcodes?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] False
@@ -113,7 +113,7 @@ selection3() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Instantly Kick Audio Transcodes?
🚀 Instantly Kick Audio Transcodes?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] False
@@ -133,7 +133,7 @@ selection4() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Limit Amount of Different IPs a User Can Make?
🚀 Limit Amount of Different IPs a User Can Make?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Set a Number from [ 1 ] - [ 10 ]
@@ -149,7 +149,7 @@ selection5() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Limit How Long a User Can Pause For!
🚀 Limit How Long a User Can Pause For!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Set a Number from [ 5 ] - [ 120 ] Mintues
@@ -165,7 +165,7 @@ selection6() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Check Interval # how often to check the active streams in seconds
🚀 Check Interval # how often to check the active streams in seconds
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Set a Number from [ 60 ] - [ 240 ] seconds
@@ -181,7 +181,7 @@ selection7() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Remove Plex Patrol || l3uddz/plex_patrol
🚀 Remove Plex Patrol || l3uddz/plex_patrol
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ 1 ] - NO
@@ -205,7 +205,7 @@ chk=$(figlet Plex Patrol | lolcat )
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Plex Patrol Credits
🚀 Plex Patrol Credits
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$chk
@@ -241,7 +241,7 @@ deploycheck
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Plex - Patrol Interface || l3uddz/plex_patrol
🚀 Plex - Patrol Interface || l3uddz/plex_patrol
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Plex Token [ $pstatus ]

View File

@@ -7,37 +7,37 @@
################################################################################
# FUNCTIONS START ##############################################################
typed="${typed,,}"
# BAD INPUT
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question1
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question1
}
badinput2() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question2
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question2
}
question1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PlexToken Generator
🌎 PlexToken Generator
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Generate new Token for Plex Patrol
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ PRESS [ENTER] ' typed </dev/tty
read -p '↘️ PRESS [ENTER] ' typed </dev/tty
case ${typed} in
*)
read -p 'Enter the PLEX User Name | Press [ENTER]: ' user </dev/tty
read -p 'Enter the PLEX User Password | Press [ENTER]: ' pw </dev/tty
case $typed in
*)
read -p 'Enter the PLEX User Name | Press [ENTER]: ' user </dev/tty
read -p 'Enter the PLEX User Password | Press [ENTER]: ' pw </dev/tty
tee <<-EOF
@@ -45,10 +45,10 @@ EOF
🍖 NOM NOM - Saved Your Information!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
question2
;;
esac
sleep 3
question2
;;
esac
}
question2() {
@@ -71,9 +71,9 @@ User Pass: $pw
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty
if [ "${typed}" == "1" ]; then
if [ "$typed" == "1" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -83,22 +83,22 @@ EOF
NOTE: If the token is bad, this process will repeat again!
EOF
sleep 4
question3
elif [ "${typed}" == "2" ]; then
question1
elif [[ "${typed}" == "z" ]]; then
exit
else badinput2; fi
sleep 4
question3
elif [ "$typed" == "2" ]; then
question1
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then
exit
else badinput2; fi
}
question3() {
echo "$pw" >/var/plexguide/plexpatrol/plex.pw
echo "$user" >/var/plexguide/plexpatrol/plex.user
PLEX_LOGIN=$(cat /var/plexguide/plexpatrol/plex.user)
PLEX_PASSWORD=$(cat /var/plexguide/plexpatrol/plex.pw)
echo "$pw" >/var/plexguide/plexpatrol/plex.pw
echo "$user" >/var/plexguide/plexpatrol/plex.user
PLEX_LOGIN=$(cat /var/plexguide/plexpatrol/plex.user)
PLEX_PASSWORD=$(cat /var/plexguide/plexpatrol/plex.pw)
curl -qu "${PLEX_LOGIN}":"${PLEX_PASSWORD}" 'https://plex.tv/users/sign_in.xml' \
curl -qu "${PLEX_LOGIN}":"${PLEX_PASSWORD}" 'https://plex.tv/users/sign_in.xml' \
-X POST -H 'X-Plex-Device-Name: PlexMediaServer' \
-H 'X-Plex-Provides: server' \
-H 'X-Plex-Version: 0.9' \
@@ -107,37 +107,37 @@ question3() {
-H 'X-Plex-Product: Plex Media Server'\
-H 'X-Plex-Device: Linux'\
-H 'X-Plex-Client-Identifier: XXXX' --compressed >/tmp/plex_sign_in
X_PLEX_TOKEN=$(sed -n 's/.*<authentication-token>\(.*\)<\/authentication-token>.*/\1/p' /tmp/plex_sign_in)
if [ -z "$X_PLEX_TOKEN" ]; then
cat /tmp/plex_sign_in
rm -f /tmp/plex_sign_in
>&2 echo 'Failed to retrieve the X-Plex-Token.'
exit 1
fi
echo $X_PLEX_TOKEN >/var/plexguide/plexpatrol/plex.token
X_PLEX_TOKEN=$(sed -n 's/.*<authentication-token>\(.*\)<\/authentication-token>.*/\1/p' /tmp/plex_sign_in)
if [ -z "$X_PLEX_TOKEN" ]; then
cat /tmp/plex_sign_in
rm -f /tmp/plex_sign_in
>&2 echo 'Failed to retrieve the X-Plex-Token.'
exit 1
fi
echo $X_PLEX_TOKEN >/var/plexguide/plexpatrol/plex.token
token=$(cat /var/plexguide/plexpatrol/plex.token)
if [ "$token" != "" ]; then
token=$(cat /var/plexguide/plexpatrol/plex.token)
if [ "$token" != "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ PlexToken Generation Succeeded!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 4
else
sleep 4
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PlexToken Generation Failed!
PlexToken Generation Failed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE: Process will repeat until you succeed or exit!
EOF
read -p 'Confirm Info | Press [ENTER] ' typed </dev/tty
question1
fi
read -p 'Confirm Info | Press [ENTER] ' typed </dev/tty
question1
fi
}
# FUNCTIONS END ##############################################################

View File

@@ -15,7 +15,7 @@ mkdir -p /opt/appdata/plexguide/cron
# BAD INPUT
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
}
@@ -28,19 +28,19 @@ question1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Welcome to PortGuard
🤖 Welcome to PortGuard!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Ports are currently: [$guard]
Ports Are Currently: [$guard]
[1] $opp ports
[ 1 ] $opp Ports
[Z] Exit
[ Z ] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1)

View File

@@ -22,17 +22,17 @@ count=$(wc -l </var/plexguide/container.running)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PortGuard - Rebuilding containers
⚠️ PortGuard - Rebuilding Containers!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1
sleep 2
for ((i = 1; i < $count + 1; i++)); do
app=$(sed "${i}q;d" /var/plexguide/container.running)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PortGuard - Rebuilding [$app]
↘️ PortGuard - Rebuilding [$app]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
@@ -47,8 +47,8 @@ done
echo ""
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 PortGuard - All containers are rebuilt ✔️
✅️ PortGuard - All Containers Rebuilt!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Continue | Press [ENTER] ' name </dev/tty
read -p 'Continue? | Press [ENTER] ' name </dev/tty

View File

@@ -6,10 +6,6 @@
# GNU: General Public License v3.0
################################################################################
# Create Variables (If New) & Recall
source /opt/plexguide/menu/functions/start.sh
source /opt/plexguide/menu/functions/pgvault.func
typed="${typed,,}"
pcloadletter() {
filevg="/var/plexguide"
touch $filevg/pgclone.transport
@@ -43,7 +39,7 @@ primestart() {
wisword=$(/usr/games/fortune -as | sed "s/^/ /")
varstart() {
###################### FOR VARIABLES ROLE SO DOESNT CREATE RED - START
###################### FOR VARIABLS ROLE SO DOESNT CREATE RED - START
filevg="/var/plexguide"
if [ ! -e "$filevg" ]; then
mkdir -p $filevg/logs 1>/dev/null 2>&1
@@ -57,7 +53,7 @@ varstart() {
chmod -R 775 $fileag 1>/dev/null 2>&1
fi
###################### FOR VARIABLES ROLE SO DOESNT CREATE RED - START
###################### FOR VARIABLS ROLE SO DOESNT CREATE RED - START
variable $filevg/pgfork.project "NOT-SET"
variable $filevg/pgfork.version "NOT-SET"
variable $filevg/tld.program "NOT-SET"
@@ -70,7 +66,6 @@ varstart() {
variable $filevg/transcode.path "standard"
variable $filevg/pgclone.transport "NOT-SET"
variable $filevg/plex.claim ""
variable $filevg/auto.update "NOT-SET"
#### Temp Fix - Fixes Bugged AppGuard
serverht=$(cat /var/plexguide/server.ht)
@@ -103,7 +98,7 @@ varstart() {
# For PG UI - Force Variable to Set
ports=$(cat /var/plexguide/server.ports)
if [ "$ports" == "" ]; then
if [ "$ports" == "" ]; then
echo "Open" >$filevg/pg.ports
else echo "Closed" >$filevg/pg.ports; fi
@@ -158,32 +153,65 @@ menuprime1
else menuprime2; fi
}
menuprime1() { # GCE Optimised Menu
transport=$(cat /var/plexguide/pg.transport)
top_menu
disk_space_used_space
menuprime1() {
transport=$(cat /var/plexguide/pg.transport)
# Menu Interface
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌎 $transport | Version: $pgnumber | ID: $serverid
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌵 Disk Used Space: $used of $capacity | $percentage Used Capacity
EOF
# Displays Second Drive If GCE
edition=$(cat /var/plexguide/pg.server.deploy)
if [ "$edition" == "feeder" ]; then
used_gce=$(df -h /mnt --local | tail -n +2 | awk '{print $3}')
capacity_gce=$(df -h /mnt --local | tail -n +2 | awk '{print $2}')
percentage_gce=$(df -h /mnt --local | tail -n +2 | awk '{print $5}')
echo " GCE Disk Used Space: $used_gce of $capacity_gce | $percentage_gce Used Capacity"
fi
disktwo=$(cat "/var/plexguide/server.hd.path")
if [ "$edition" != "feeder" ]; then
used_gce2=$(df -h "$disktwo" --local | tail -n +2 | awk '{print $3}')
capacity_gce2=$(df -h "$disktwo" --local | tail -n +2 | awk '{print $2}')
percentage_gce2=$(df -h "$disktwo" --local | tail -n +2 | awk '{print $5}')
if [[ "$disktwo" != "/mnt" ]]; then
echo " 2nd Disk Used Space: $used_gce2 of $capacity_gce2 | $percentage_gce2 Used Capacity"
fi
fi
# Declare Ports State
ports=$(cat /var/plexguide/server.ports)
if [ "$ports" == "" ]; then
echo "Open" >$filevg/pg.ports
else echo "Closed" >$filevg/pg.ports; fi
if [ "$ports" == "" ]; then
ports="OPEN"
else ports="CLOSED"; fi
tee <<-EOF
-- GCE optimized surface --
[1] Traefik : Reverse Proxy | Domain Setup
[1] PTS-Traefik : Reverse Proxy
[2] Port Guard : [$ports] Protects the Server App Ports
[3] Authelia : Enable Authelia
[4] Mount : Mount Cloud Based Storage
[5] Apps : Apps ~ Core, Community & Removal
[6] Vault : Backup & Restore
[7] Traktarr : Fill arrs with Trakt lists
[3] PTS-Shield : Enable Google's OAuthentication Protection
[4] PTS-Clone : Mount Transport
[5] PTS-Apps : Apps
[6] PTS-Vault : Backup & Restore
[7] Traktarr : Fill Sonarr/Radarr over Trakt lists.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Z] Exit
"$wisword"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
end_menu
# Standby
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1) clear && bash /opt/plexguide/menu/pgcloner/traefik.sh && clear && primestart ;;
@@ -191,136 +219,98 @@ end_menu
3) clear && bash /opt/plexguide/menu/shield/pgshield.sh && clear && primestart ;;
4) clear && bash /opt/plexguide/menu/pgcloner/pgclone.sh && clear && primestart ;;
5) clear && bash /opt/plexguide/menu/pgbox/select.sh && clear && primestart ;;
6) clear && bash /opt/plexguide/menu/pgvault/pgvault.sh && clear && primestart ;;
6) clear && bash /opt/plexguide/menu/pgcloner/pgvault.sh && clear && primestart ;;
7) clear && bash /opt/plexguide/menu/traktarr/traktarr.sh && clear && primestart ;;
z) clear && bash /opt/plexguide/menu/interface/ending.sh && exit ;;
Z) clear && bash /opt/plexguide/menu/interface/ending.sh && exit ;;
*) primestart ;;
esac
}
networking() {
top_menu
sub_menu_networking
end_menu
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "e" ]]; then clear && bash /opt/plexguide/menu/pgcloner/traefik.sh; fi
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
main_menu_options
}
security() {
top_menu
sub_menu_security
end_menu
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "e" ]]; then clear && bash /opt/plexguide/menu/shield/pgshield.sh; fi
if [[ "${typed}" == "d" ]]; then clear && bash /opt/plexguide/menu/portguard/portguard.sh; fi
if [[ "${typed}" == "c" ]]; then clear && bash /opt/plexguide/menu/pgbox/core/core.sh; fi
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
main_menu_options
}
mount() {
top_menu
sub_menu_mount
end_menu
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "e" ]]; then clear && bash /opt/plexguide/menu/pgcloner/pgclone.sh && clear && primestart; fi
if [[ "${typed}" == "e" ]]; then clear && bash /opt/plexguide/menu/portguard/portguard.sh; fi
if [[ "${typed}" == "e" ]]; then clear && bash /opt/plexguide/menu/pgbox/core/core.sh; fi
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
main_menu_options
}
apps() {
top_menu
sub_menu_app
end_menu
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "e" ]]; then clear && bash /opt/plexguide/menu/pgbox/core/core.sh; fi
if [[ "${typed}" == "d" ]]; then clear && bash /opt/plexguide/menu/pgbox/community/community.sh; fi
if [[ "${typed}" == "c" ]]; then clear && bash /opt/plexguide/menu/pgbox/personal/personal.sh; fi
if [[ "${typed}" == "r" ]]; then clear && bash /opt/plexguide/menu/pgbox/remove/removal.sh; fi
if [[ "${typed}" == "f" ]]; then clear && bash /opt/plexguide/menu/pgbox/remove/removal.sh; fi
if [[ "${typed}" == "t" ]]; then clear && bash /opt/plexguide/menu/pgbox/customparts/autobackup.sh; fi
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
main_menu_options
}
vault() {
source /opt/plexguide/menu/functions/pgvault.func
top_menu
sub_menu_vault
end_menu
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "e" ]]; then clear && bash /opt/plexguide/menu/pgvault/pgvault.sh; fi
if [[ "${typed}" == "d" ]]; then clear && backup_all_start; fi
if [[ "${typed}" == "c" ]]; then clear && initial && pgboxrecall && apprecall && vaultrestore; fi
if [[ "${typed}" == "r" ]]; then clear && restore_all_start; fi
if [[ "${typed}" == "f" ]]; then clear && bash /opt/plexguide/menu/pgvault/location.sh; fi
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then exit; fi
main_menu_options
}
menuprime2() { #
#welcome="Welcome to Pandaura. Thanks for being a part of the community"
#firstRun=True
#def writeFile(number):
# global firstRun
# if firstRun:
# print("${welcome}")
# firstRun=False
#print(str(number))
#for i in range(10):
# writeFile(i)
#downloadpg
menuprime2() {
transport=$(cat /var/plexguide/pg.transport)
top_menu
disk_space_used_space
main_menu
# Menu Interface
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌎 $transport | Version: $pgnumber | ID: $serverid
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌵 Disk Used Space: $used of $capacity | $percentage Used Capacity
EOF
# Displays Second Drive If GCE
edition=$(cat /var/plexguide/pg.server.deploy)
if [ "$edition" == "feeder" ]; then
used_gce=$(df -h /mnt --local | tail -n +2 | awk '{print $3}')
capacity_gce=$(df -h /mnt --local | tail -n +2 | awk '{print $2}')
percentage_gce=$(df -h /mnt --local | tail -n +2 | awk '{print $5}')
echo " GCE Disk Used Space: $used_gce of $capacity_gce | $percentage_gce Used Capacity"
fi
disktwo=$(cat "/var/plexguide/server.hd.path")
if [ "$edition" != "feeder" ]; then
used_gce2=$(df -h "$disktwo" --local | tail -n +2 | awk '{print $3}')
capacity_gce2=$(df -h "$disktwo" --local | tail -n +2 | awk '{print $2}')
percentage_gce2=$(df -h "$disktwo" --local | tail -n +2 | awk '{print $5}')
if [[ "$disktwo" != "/mnt" ]]; then
echo " 2nd Disk Used Space: $used_gce2 of $capacity_gce2 | $percentage_gce2 Used Capacity"
fi
fi
# Declare Ports State
ports=$(cat /var/plexguide/server.ports)
if [ "$ports" == "" ]; then
ports="🔴 "
else ports="🟢"; fi
ports="OPEN"
else ports="CLOSED"; fi
#if [[ "${typed}" == "2" ]]; then sub_menu_security; fi
end_menu
# Standby
read -p '💬 Type Number | Press [ENTER]: ' typed </dev/tty
tee <<-EOF
[1] PTS-Traefik : Reverse Proxy
[2] Port Guard : [$ports] Protects the Server App Ports
[3] PTS-Shield : Enable Google's OAuthentication Protection
[4] PTS-Clone : Mount Transport
[5] PTS-Apps : Apps ~ Core, Community & Removal
[6] CBOX-PAS : PlexAutoScan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[7] PTS-WordPress : Deploy WordPress Instances
[8] PTS-Vault : Backup & Restore
[9] PTS-Cloud : GCE & Virtual Instances
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[10] CBOX-PDUPE : Find and delete duplicate files in Plex
[11] Traktarr : Fill Sonarr/Radarr over Trakt lists.
[12] Plex Patrol : Kick transcodes (audio or video or both)
[13] Settings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Z] Exit
Used disk space: $used of $capacity | $percentage used capacity Deployed
"$wisword"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
main_menu_options() {
# Standby
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1) clear && networking;;
2) clear && security && clear && primestart;;
3) clear && mount && clear && primestart;;
4) clear && apps && clear && primestart;;
5) clear && vault && clear && primestart;;
esac
}
case $typed in
1) clear && networking && clear && primestart ;;
2) clear && security && clear && primestart ;;
3) clear && mount && clear && primestart;;
4) clear && apps && clear && primestart;;
5) clear && vault && clear && primestart;;
#/opt/plexguide/menu/pgscan/pgscan.sh && clear && primestart ;;
7) clear && bash /opt/plexguide/menu/pgvault/pgvault.sh && clear && primestart ;;
8) clear && bash /opt/plexguide/menu/plex_dupe/plex_dupe.sh && clear && primestart ;;
9) clear && bash /opt/plexguide/menu/traktarr/traktarr.sh && clear && primestart ;;
10) clear && bash /opt/plexguide/menu/plexpatrol/plexpatrol.sh && clear && primestart ;;
0) clear && bash /opt/plexguide/menu/interface/settings.sh && clear && primestart ;;
1) clear && bash /opt/plexguide/menu/pgcloner/traefik.sh && clear && primestart ;;
2) clear && bash /opt/plexguide/menu/portguard/portguard.sh && clear && primestart ;;
3) clear && bash /opt/plexguide/menu/shield/pgshield.sh && clear && primestart ;;
4) clear && bash /opt/plexguide/menu/pgcloner/pgclone.sh && clear && primestart ;;
5) clear && bash /opt/plexguide/menu/pgbox/select.sh && clear && primestart ;;
6) clear && bash /opt/plexguide/menu/pgscan/pgscan.sh && clear && primestart ;;
7) clear && bash /opt/plexguide/menu/pgcloner/pgpress.sh && clear && primestart ;;
8) clear && bash /opt/plexguide/menu/pgcloner/pgvault.sh && clear && primestart ;;
9) clear && bash /opt/plexguide/menu/interface/cloudselect.sh && clear && primestart ;;
10) clear && bash /opt/plexguide/menu/plex_dupe/plex_dupe.sh && clear && primestart ;;
11) clear && bash /opt/plexguide/menu/traktarr/traktarr.sh && clear && primestart ;;
12) clear && bash /opt/plexguide/menu/plexpatrol/plexpatrol.sh && clear && primestart ;;
13) clear && bash /opt/plexguide/menu/interface/settings.sh && clear && primestart ;;
z) clear && bash /opt/plexguide/menu/interface/ending.sh && exit ;;
Z) clear&& bash /opt/plexguide/menu/interface/ending.sh && exit ;;
*) primestart ;;
#These options are hidden
13) clear && bash /opt/plexguide/menu/interface/cloudselect.sh && clear && primestart ;;
12) clear && bash /opt/plexguide/menu/pgcloner/pgpress.sh && clear && primestart ;;
esac
}
#bash /opt/plexguide/menu/pgbox/select.sh && clear && primestart ;; this is for apps
primestart

View File

@@ -10,54 +10,54 @@
mkdir -p /var/plexguide/traktarr/
# FUNCTIONS START ##############################################################
typed="${typed,,}"
# FIRST FUNCTION
variable() {
file="$1"
if [ ! -e "$file" ]; then echo "$2" >$1; fi
file="$1"
if [ ! -e "$file" ]; then echo "$2" >$1; fi
}
deploycheck() {
dcheck=$(systemctl is-active traktarr.service)
if [ "$dcheck" == "active" ]; then
dstatus="✅ DEPLOYED"
else dstatus="⚠️ NOT DEPLOYED"; fi
dcheck=$(systemctl is-active traktarr.service)
if [ "$dcheck" == "active" ]; then
dstatus="✅ DEPLOYED"
else dstatus="⚠️ NOT DEPLOYED"; fi
}
sonarrcheck() {
pcheck=$(docker ps --format '{{.Names}}' | grep "sonarr")
if [ "$pcheck" == "" ]; then
pcheck=$(docker ps --format '{{.Names}}' | grep "sonarr")
if [ "$pcheck" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Sonarr is not Installed/Running! Cannot Proceed!
WARNING! - Sonarr is not Installed/Running! Cannot Proceed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
question1
fi
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
question1
fi
}
radarrcheck() {
pcheck=$(docker ps --format '{{.Names}}' | grep "radarr")
if [ "$pcheck" == "" ]; then
pcheck=$(docker ps --format '{{.Names}}' | grep "radarr")
if [ "$pcheck" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Radarr is not Installed/Running! Cannot Proceed!
WARNING! - Radarr is not Installed/Running! Cannot Proceed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
question1
fi
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
question1
fi
}
squality() {
sonarrcheck
sonarrcheck
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -80,30 +80,30 @@ HD - 720p/1080p
Go Back? Type > exit
EOF
read -p '↘️ Type Sonarr Location | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Sonarr Location | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
question1
else
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
question1
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ SYSTEM MESSAGE: Sonarr Path Completed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Quality Set Is: ${typed}
Quality Set Is: $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo "${typed}" >/var/plexguide/traktarr/pgtrak.sprofile
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
question1
fi
echo "$typed" >/var/plexguide/traktarr/pgtrak.sprofile
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
question1
fi
}
rquality() {
radarrcheck
radarrcheck
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -126,25 +126,25 @@ HD - 720p/1080p
Go Back? Type > exit
EOF
read -p '↘️ Type Radarr Location | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Radarr Location | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
question1
else
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
question1
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ SYSTEM MESSAGE: Radarr Path Completed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Quality Set Is: ${typed}
Quality Set Is: $typed
EOF
echo "${typed}" >/var/plexguide/traktarr/pgtrak.rprofile
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
question1
fi
echo "$typed" >/var/plexguide/traktarr/pgtrak.rprofile
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
question1
fi
}
api() {
@@ -169,14 +169,14 @@ Go Back? Type > exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type API Client | Press [ENTER]: ' typed </dev/tty
echo ${typed} >/var/plexguide/traktarr/pgtrak.client
read -p '↘️ Type API Secret | Press [ENTER]: ' typed </dev/tty
echo ${typed} >/var/plexguide/traktarr/pgtrak.secret
read -p '↘️ Type API Client | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/traktarr/pgtrak.client
read -p '↘️ Type API Secret | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/traktarr/pgtrak.secret
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
question1
else
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
question1
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -190,15 +190,15 @@ INFO: Messed up? Rerun this API Interface to update the information!
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
question1
fi
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
question1
fi
}
spath() {
hdpath=$(cat /var/plexguide/server.hd.path)
tvfolderprint=$(ls -ah $hdpath/unionfs/ | grep -E 'TV*|tv')
sonarrcheck
hdpath=$(cat /var/plexguide/server.hd.path)
tvfolderprint=$(ls -ah $hdpath/unionfs/ | grep -E 'TV*|tv')
sonarrcheck
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📁 Sonarr Path
@@ -216,46 +216,46 @@ $tvfolderprint
Go Back? Type > exit
EOF
read -p '↘️ Type Sonarr Location | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Sonarr Location | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
question1
else
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
question1
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 SYSTEM MESSAGE: Checking Path $typed
🚀 SYSTEM MESSAGE: Checking Path $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1.5
sleep 1.5
##################################################### TYPED CHECKERS - START
typed2=${typed}
bonehead=no
##### If user forgot to add a / in the beginning, we fix for them
initial="$(echo ${typed} | head -c 1)"
if [ "$initial" != "/" ]; then
typed="/${typed}"
fi
##### If user added a / at the end, we fix for them
initial="${typed: -1}"
if [ "$initial" == "/" ]; then
typed=${typed::-1}
fi
##################################################### TYPED CHECKERS - START
typed2=$typed
bonehead=no
##### If user forgot to add a / in the beginning, we fix for them
initial="$(echo $typed | head -c 1)"
if [ "$initial" != "/" ]; then
typed="/$typed"
fi
##### If user added a / at the end, we fix for them
initial="${typed: -1}"
if [ "$initial" == "/" ]; then
typed=${typed::-1}
fi
##################################################### TYPED CHECKERS - START
##################################################### TYPED CHECKERS - START
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 SYSTEM MESSAGE: Checking if Location is Valid
🚀 SYSTEM MESSAGE: Checking if Location is Valid
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1.5
sleep 1.5
mkdir ${typed}/test 1>/dev/null 2>&1
mkdir $typed/test 1>/dev/null 2>&1
file="${typed}/test"
if [ -e "$file" ]; then
file="$typed/test"
if [ -e "$file" ]; then
tee <<-EOF
@@ -265,21 +265,21 @@ EOF
EOF
### Removes /mnt if /mnt/unionfs exists
#check=$(echo ${typed} | head -c 12)
#if [ "$check" == "/mnt/unionfs" ]; then
#typed=${typed:4}
#fi
### Removes /mnt if /mnt/unionfs exists
#check=$(echo $typed | head -c 12)
#if [ "$check" == "/mnt/unionfs" ]; then
#typed=${typed:4}
#fi
echo "${typed}" >/var/plexguide/traktarr/pgtrak.spath
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
echo ""
question1
else
echo "$typed" >/var/plexguide/traktarr/pgtrak.spath
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
echo ""
question1
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔ ALERT: Path ${typed} DOES NOT Exist! No Changes Made!
⛔ ALERT: Path $typed DOES NOT Exist! No Changes Made!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Note: Exiting the Process! You must ensure that linux is able to READ
your location.
@@ -288,17 +288,17 @@ Advice: Exit PTS and (Test) Type >>> mkdir $typed/testfolder
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
echo "" && question1
fi
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
echo "" && question1
fi
fi
}
rpath() {
hdpath=$(cat /var/plexguide/server.hd.path)
moviefolderprint=$(ls -ah $hdpath/unionfs/ | grep -E 'Movi*|movi*')
radarrcheck
hdpath=$(cat /var/plexguide/server.hd.path)
moviefolderprint=$(ls -ah $hdpath/unionfs/ | grep -E 'Movi*|movi*')
radarrcheck
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -318,46 +318,46 @@ $moviefolderprint
Go Back? Type > exit
EOF
read -p '↘️ Type Radarr Location | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Radarr Location | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
question1
else
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
question1
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 SYSTEM MESSAGE: Checking Path $typed
🚀 SYSTEM MESSAGE: Checking Path $typed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1.5
sleep 1.5
##################################################### TYPED CHECKERS - START
typed2=${typed}
bonehead=no
##### If user forgot to add a / in the beginning, we fix for them
initial="$(echo ${typed} | head -c 1)"
if [ "$initial" != "/" ]; then
typed="/${typed}"
fi
##### If user added a / at the end, we fix for them
initial="${typed: -1}"
if [ "$initial" == "/" ]; then
typed=${typed::-1}
fi
##################################################### TYPED CHECKERS - START
typed2=$typed
bonehead=no
##### If user forgot to add a / in the beginning, we fix for them
initial="$(echo $typed | head -c 1)"
if [ "$initial" != "/" ]; then
typed="/$typed"
fi
##### If user added a / at the end, we fix for them
initial="${typed: -1}"
if [ "$initial" == "/" ]; then
typed=${typed::-1}
fi
##################################################### TYPED CHECKERS - START
##################################################### TYPED CHECKERS - START
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 SYSTEM MESSAGE: Checking if Location is Valid
🚀 SYSTEM MESSAGE: Checking if Location is Valid
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1.5
sleep 1.5
mkdir ${typed}/test 1>/dev/null 2>&1
mkdir $typed/test 1>/dev/null 2>&1
file="${typed}/test"
if [ -e "$file" ]; then
file="$typed/test"
if [ -e "$file" ]; then
tee <<-EOF
@@ -366,71 +366,71 @@ EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo "${typed}" >/var/plexguide/traktarr/pgtrak.rpath
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
echo ""
question1
else
echo "$typed" >/var/plexguide/traktarr/pgtrak.rpath
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
echo ""
question1
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔ ALERT: Path ${typed} DOES NOT Exist! No Changes Made!
⛔ ALERT: Path $typed DOES NOT Exist! No Changes Made!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Note: Exiting the Process! You must ensure that linux is able to READ
your location.
Advice: Exit PTS and (Test) Type >>> mkdir ${typed}/testfolder
Advice: Exit PTS and (Test) Type >>> mkdir $typed/testfolder
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
echo "" && question1
fi
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
echo "" && question1
fi
fi
}
#########################################################################
####Custom parts
#########################################################################
maxyear() {
((mnyear=$(date +"%Y")+1))
((mxyear=$(date +"%Y")+7))
((mnyear=$(date +"%Y")+1))
((mxyear=$(date +"%Y")+7))
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Limit the maximum allowed year for traktarr
🚀 Limit the maximum allowed year for traktarr
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Set a Year between [ $mnyear ] and [ $mxyear ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" -ge "$mnyear" && "${typed}" -le "$mxyear" ]]; then
echo "${typed}" >/var/plexguide/traktarr/pgtrakyear.max && question1
else maxyear ; fi
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" -ge "$mnyear" && "$typed" -le "$mxyear" ]]; then
echo "$typed" >/var/plexguide/traktarr/pgtrakyear.max && question1
else maxyear ; fi
}
minyear() {
((mnyear=$(date +"%Y")-80))
((mxyear=$(date +"%Y")-1))
((mnyear=$(date +"%Y")-80))
((mxyear=$(date +"%Y")-1))
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Limit the minimum allowed year for traktarr
🚀 Limit the minimum allowed year for traktarr
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Set a Year between [ $mnyear ] and [ $mxyear ]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "${typed}" -ge "$mnyear" && "${typed}" -le "$mxyear" ]]; then
echo "${typed}" >/var/plexguide/traktarr/pgtrakyear.min && question1
else minyear ; fi
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
if [[ "$typed" -ge "$mnyear" && "$typed" -le "$mxyear" ]]; then
echo "$typed" >/var/plexguide/traktarr/pgtrakyear.min && question1
else minyear ; fi
}
lang() {
@@ -438,7 +438,7 @@ lang() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Set language profile for Sonarr
🚀 Set language profile for Sonarr
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Language Profile that TV shows are assigned to. Only applies to Sonarr v3.
@@ -456,14 +456,14 @@ Spain
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type your language profile from Sonarr | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/traktarr/pgtrak.lang
if [[ "${typed}" == "exit" || "${typed}" == "z" ]]; then
echo -e "English" /var/plexguide/traktarr/pgtrak.lang
question1
else
clear
lprofil=$(cat /var/plexguide/traktarr/pgtrak.lang)
read -p '↘️ Type your language profile from Sonarr | Press [ENTER]: ' typed </dev/tty
echo $typed >/var/plexguide/traktarr/pgtrak.lang
if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" || "$typed" == "z" || "$typed" == "Z" ]]; then
echo -e "English" /var/plexguide/traktarr/pgtrak.lang
question1
else
clear
lprofil=$(cat /var/plexguide/traktarr/pgtrak.lang)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -474,17 +474,17 @@ EOF
If this is wrong now, traktarr will not work 100%
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
question1
fi
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
question1
fi
}
avbila() {
avacbact=$(cat /var/plexguide/traktarr/pgtrak.minimumavailability)
avacbact=$(cat /var/plexguide/traktarr/pgtrak.minimumavailability)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Set minimum availability movies for Radarr
🚀 Set minimum availability movies for Radarr
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The minimum availability for movies are actually set to
@@ -501,26 +501,26 @@ Choices are announced, in_cinemas, released (Physical/Web), or predb.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case $typed in
1) echo -e "announced" >/var/plexguide/traktarr/pgtrak.minimumavailability && question1 ;;
2) echo -e "in_cinemas" >/var/plexguide/traktarr/pgtrak.minimumavailability && question1 ;;
3) echo -e "released" >/var/plexguide/traktarr/pgtrak.minimumavailability && question1 ;;
4) echo -e "predb" >/var/plexguide/traktarr/pgtrak.minimumavailability && question1 ;;
z) exit ;;
Z) exit ;;
*) question1 ;;
case $typed in
1) echo -e "announced" >/var/plexguide/traktarr/pgtrak.minimumavailability && question1 ;;
2) echo -e "in_cinemas" >/var/plexguide/traktarr/pgtrak.minimumavailability && question1 ;;
3) echo -e "released" >/var/plexguide/traktarr/pgtrak.minimumavailability && question1 ;;
4) echo -e "predb" >/var/plexguide/traktarr/pgtrak.minimumavailability && question1 ;;
z) exit ;;
Z) exit ;;
*) question1 ;;
esac
}
##################################################################################
credits() {
clear
chk=$(figlet traktarr | lolcat )
clear
chk=$(figlet traktarr | lolcat )
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 traktarr Credits
🚀 traktarr Credits
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$chk
@@ -541,18 +541,18 @@ $chk
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
question1
echo
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
question1
}
prefill() {
clear
chk=$(figlet traktarr | lolcat )
clear
chk=$(figlet traktarr | lolcat )
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 traktarr prefilling the system
🚀 traktarr prefilling the system
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] Prefilling allowed (Runs a daily job that grabs up to 50 shows and
@@ -566,31 +566,31 @@ prefill() {
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
echo
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
case $typed in
1) ansible-playbook /opt/plexguide/menu/traktarr/traktarr-list/prefillallow.yml && question1 ;;
2) ansible-playbook /opt/plexguide/menu/traktarr/traktarr-list/prefillremove.yml && question1 ;;
z) exit ;;
Z) exit ;;
*) question1 ;;
esac
case $typed in
1) ansible-playbook /opt/plexguide/menu/traktarr/traktarr-list/prefillallow.yml && question1 ;;
2) ansible-playbook /opt/plexguide/menu/traktarr/traktarr-list/prefillremove.yml && question1 ;;
z) exit ;;
Z) exit ;;
*) question1 ;;
esac
}
# BAD INPUT
badinput() {
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question1
echo
read -p ' ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty
question1
}
endbanner() {
clear
chk=$(figlet traktarr | lolcat )
clear
chk=$(figlet traktarr | lolcat )
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 traktarr Commands
🚀 traktarr Commands
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$chk
@@ -616,53 +616,53 @@ Args:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
question1
echo
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
question1
}
#####################################################################################################################################
checkcase() {
sonarr=$(docker ps --format '{{.Names}}' | grep "sonarr")
radarr=$(docker ps --format '{{.Names}}' | grep "radarr")
if [[ "$radarr" == "" ]] && [[ "$sonarr" == "" ]]; then
if [[ "$radarr" == "" ]] && [[ "$sonarr" == "" ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Sonarr/Radarr is not Installed/Running!
WARNING! - Sonarr/Radarr is not Installed/Running!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
exit 0
elif [[ "$sonarr" = "sonarr" ]] && [[ "$radarr" = "" ]]; then
echo "⛔ WARNING! - Traktarr will only work for shows! Radarr Not Running!" >/var/plexguide/traktarr/docker.status
elif [[ "$radarr" = "radarr" ]] && [[ "$sonarr" = "" ]]; then
echo "⛔ WARNING! - Traktarr will only work for movies! Sonarr Not Running!" >/var/plexguide/traktarr/docker.status
else [[ "$radarr" = "radarr" ]] && [[ "$sonarr" = "sonarr" ]]
echo "🛈 Traktarr - Radarr and Sonarr detected | it will work for both" >/var/plexguide/traktarr/docker.status; fi
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
exit 0
elif [[ "$sonarr" = "sonarr" ]] && [[ "$radarr" = "" ]]; then
echo "⛔ WARNING! - Traktarr will only work for shows! Radarr Not Running!" >/var/plexguide/traktarr/docker.status
elif [[ "$radarr" = "radarr" ]] && [[ "$sonarr" = "" ]]; then
echo "⛔ WARNING! - Traktarr will only work for movies! Sonarr Not Running!" >/var/plexguide/traktarr/docker.status
else [[ "$radarr" = "radarr" ]] && [[ "$sonarr" = "sonarr" ]]
echo "🚀 Traktarr - Radarr and Sonarr detected | it will work for both" >/var/plexguide/traktarr/docker.status; fi
}
question1() {
api=$(cat /var/plexguide/traktarr/pgtrak.secret)
if [ "$api" == "NOT-SET" ]; then api="NOT-SET"; else api="SET"; fi
api=$(cat /var/plexguide/traktarr/pgtrak.secret)
if [ "$api" == "NOT-SET" ]; then api="NOT-SET"; else api="SET"; fi
rpath=$(cat /var/plexguide/traktarr/pgtrak.rpath)
spath=$(cat /var/plexguide/traktarr/pgtrak.spath)
rprofile=$(cat /var/plexguide/traktarr/pgtrak.rprofile)
sprofile=$(cat /var/plexguide/traktarr/pgtrak.sprofile)
mxyear=$(cat /var/plexguide/traktarr/pgtrakyear.max)
mnyear=$(cat /var/plexguide/traktarr/pgtrakyear.min)
langprofil=$(cat /var/plexguide/traktarr/pgtrak.lang)
avmin=$(cat /var/plexguide/traktarr/pgtrak.minimumavailability)
status=$(cat /var/plexguide/traktarr/docker.status)
rpath=$(cat /var/plexguide/traktarr/pgtrak.rpath)
spath=$(cat /var/plexguide/traktarr/pgtrak.spath)
rprofile=$(cat /var/plexguide/traktarr/pgtrak.rprofile)
sprofile=$(cat /var/plexguide/traktarr/pgtrak.sprofile)
mxyear=$(cat /var/plexguide/traktarr/pgtrakyear.max)
mnyear=$(cat /var/plexguide/traktarr/pgtrakyear.min)
langprofil=$(cat /var/plexguide/traktarr/pgtrak.lang)
avmin=$(cat /var/plexguide/traktarr/pgtrak.minimumavailability)
status=$(cat /var/plexguide/traktarr/docker.status)
deploycheck
deploycheck
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Traktarr Interface
🚀 Traktarr Interface
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$status
@@ -691,83 +691,83 @@ NOTE: Changes Made? Must Redeploy Traktarr when Complete!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
read -p '↘️ Type Number | Press [ENTER]: ' typed </dev/tty
case ${typed} in
1) api && question1 ;;
2) spath && question1 ;;
3) rpath && question1 ;;
4) squality && question1 ;;
5) rquality && question1 ;;
6) maxyear && question1 ;;
7) minyear && question1 ;;
8) lang && question1 ;;
9) avbila && question1 ;;
10)
sonarr=$(docker ps --format '{{.Names}}' | grep "sonarr")
radarr=$(docker ps --format '{{.Names}}' | grep "radarr")
if [ "$radarr" == "" ] && [ "$sonarr" == "" ]; then
case $typed in
1) api && question1 ;;
2) spath && question1 ;;
3) rpath && question1 ;;
4) squality && question1 ;;
5) rquality && question1 ;;
6) maxyear && question1 ;;
7) minyear && question1 ;;
8) lang && question1 ;;
9) avbila && question1 ;;
10)
sonarr=$(docker ps --format '{{.Names}}' | grep "sonarr")
radarr=$(docker ps --format '{{.Names}}' | grep "radarr")
if [ "$radarr" == "" ] && [ "$sonarr" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Sonarr or Radarr must be Running!
WARNING! - Sonarr or Radarr must be Running!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
question1
else
if [ "$sonarr" = "sonarr" ] && [ "$radarr" = "" ]; then
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
question1
else
if [ "$sonarr" = "sonarr" ] && [ "$radarr" = "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Traktarr will only work for shows! Radarr Not Running!
WARNING! - Traktarr will only work for shows! Radarr Not Running!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fi
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fi
if [ "$radarr" = "radarr" ] && [ "$sonarr" = "" ]; then
if [ "$radarr" = "radarr" ] && [ "$sonarr" = "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING! - Traktarr will only work for movies! Sonarr Not Running!
WARNING! - Traktarr will only work for movies! Sonarr Not Running!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fi
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fi
if [ "$radarr" = "radarr" ] && [ "$sonarr" = "sonarr" ]; then
if [ "$radarr" = "radarr" ] && [ "$sonarr" = "sonarr" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Traktarr - Radarr and Sonarr detected | it will work for both
🚀 Traktarr - Radarr and Sonarr detected | it will work for both
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🛈 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fi
read -p '🌎 Acknowledge Info | Press [ENTER] ' typed </dev/tty
fi
file="/opt/appdata/radarr/config.xml"
if [ -e "$file" ]; then
info=$(cat /opt/appdata/radarr/config.xml)
info=${info#*<ApiKey>} 1>/dev/null 2>&1
info1=$(echo ${info:0:32}) 1>/dev/null 2>&1
echo "$info1" >/var/plexguide/traktarr/pgtrak.rapi
fi
file="/opt/appdata/radarr/config.xml"
if [ -e "$file" ]; then
info=$(cat /opt/appdata/radarr/config.xml)
info=${info#*<ApiKey>} 1>/dev/null 2>&1
info1=$(echo ${info:0:32}) 1>/dev/null 2>&1
echo "$info1" >/var/plexguide/traktarr/pgtrak.rapi
fi
file="/opt/appdata/sonarr/config.xml"
if [ -e "$file" ]; then
info=$(cat /opt/appdata/sonarr/config.xml)
info=${info#*<ApiKey>} 1>/dev/null 2>&1
info2=$(echo ${info:0:32}) 1>/dev/null 2>&1
echo "$info2" >/var/plexguide/traktarr/pgtrak.sapi
fi
fi
ansible-playbook /opt/plexguide/menu/pg.yml --tags traktarr && question1 ;;
file="/opt/appdata/sonarr/config.xml"
if [ -e "$file" ]; then
info=$(cat /opt/appdata/sonarr/config.xml)
info=${info#*<ApiKey>} 1>/dev/null 2>&1
info2=$(echo ${info:0:32}) 1>/dev/null 2>&1
echo "$info2" >/var/plexguide/traktarr/pgtrak.sapi
fi
fi
ansible-playbook /opt/plexguide/menu/pg.yml --tags traktarr && question1 ;;
11) prefill && clear && question1 ;;
12) endbanner && clear && question1 ;;
C) credits && clear && question1 ;;
c) credits && clear && question1 ;;
z) exit ;;
Z) exit ;;
*) question1 ;;
esac
11) prefill && clear && question1 ;;
12) endbanner && clear && question1 ;;
C) credits && clear && question1 ;;
c) credits && clear && question1 ;;
z) exit ;;
Z) exit ;;
*) question1 ;;
esac
}
# FUNCTIONS END ##############################################################

View File

@@ -5,175 +5,14 @@
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
program=$(cat /tmp/program_var)
cname=$program
if [[ -f "/var/plexguide/$program.cname" ]]; then
cname=$(cat /var/plexguide/$program.cname)
fi
domain=$(cat /var/plexguide/server.domain)
port=$(cat /tmp/program_port)
ip=$(cat /var/plexguide/server.ip)
ports=$(cat /var/plexguide/server.ports)
hdpath=$(cat /var/plexguide/server.hd.path)
if [ "$program" == "plex" ]; then extra="/web"; else extra=""; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛈 Access Configuration Info
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
tee <<-EOF
▫ $program:${port} <- Use this as the url when connecting another app to $program.
EOF
if [ "$ports" == "" ]; then
tee <<-EOF
▫ $ip:${port}${extra}
EOF
fi
if [ "$domain" != "NOT-SET" ]; then
if [ "$ports" == "" ]; then
tee <<-EOF
▫ $domain:${port}${extra}
EOF
fi
tee <<-EOF
▫ $cname.$domain${extra}
EOF
fi
if [ "$program" == "plex" ]; then
tee <<-EOF
First Time Plex Claim Notice
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
if [ "$domain" != "NOT-SET" ]; then
tee <<-EOF
▫ http://plex.${domain}:32400 <-- Use http; not https
EOF
fi
tee <<-EOF
▫ $ip:${port}${extra}
EOF
fi
if [[ "$program" == *"sonarr"* ]] || [[ "$program" == *"radarr"* ]] || [[ "$program" == *"lidarr"* ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 Manual Configuration Required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$program requires additional manual configuration!
EOF
if [[ "$program" == *"sonarr"* ]] || [[ "$program" == *"radarr"* ]] || [[ "$program" == *"lidarr"* ]] || [[ "$program" == *"qbittorrent"* ]]; then
tee <<-EOF
$program requires "downloader mappings" to enable hardlinking and rapid importing.
If you do not have these mappings, $program can't rename and move the files on import.
This will result in files being copied instead of moved, and it will cause other issues.
The mappings are on the download client settings (advanced setting), at the bottom of the page.
Visit https://github.com/Pandaura/PTS-Team/wiki/Remote-Path-Mappings for more information.
EOF
fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Failure to perform manual configuration changes will cause problems!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌍 Visit the wiki for instructions on how to configure $program.
https://github.com/Pandaura/PTS-Team/wiki/$program
EOF
fi
####--------
if [[ "$program" == *"sabnzbd"* ]] || [[ "$program" == *"nzbget"* ]] ; then
cclean=$(cat /var/plexguide/cloneclean)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 NOTE / INFO
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
for incomplete downloads $program used the folder $hdpath/incomplete/nzb
for finished downloads $program used the folder $hdpath/downloads/nzb
beware the cloneclean is set to $cclean min
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [[ "$program" == *"sabnzbd"* ]] ; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 sabnzbd api_key = $sbakey
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [[ "$program" == *"rutorrent"* ]] || [[ "$program" == *"qbittorrent"* ]] || [[ "$program" == *"deluge"* ]]; then
cclean=$(cat /var/plexguide/cloneclean)
tclean=$(($cclean*2))
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 NOTE / INFO
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
for incomplete downloads $program used the folder $hdpath/incomplete/torrent
for finished downloads $program used the folder $hdpath/downloads/torrent
beware the cloneclean is set to $tclean min
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [ "$program" == "plex" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 Manual Configuration Required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
we prefer using plex_autoscan, unlike other alternatives,
that does not put a lot of pressure on the API of your Google Account.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
if [ "$hdpath" != "/mnt" ]; then
sbakey=$(cat /opt/appdata/sabnzbd/sabnzbd.ini | grep "api_key" | head -n 1 | awk '{print $3}')
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You must add /mnt self to the docker container again
Your $hdpath is not /mnt
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
fi
mainstart() {
mkdir -p /opt/ptsupdate 1>/dev/null 2>&1
git clone --single-branch https://github.com/MHA-Team/PTS-Update.git /opt/ptsupdate 1>/dev/null 2>&1
chown -cR 100:1000 /opt/ptsupdate 1>/dev/null 2>&1
chmod -cR 775 /opt/ptsupdate 1>/dev/null 2>&1
apt-get install dos2unix -yqq && dos2unix /opt/ptsupdate/update.sh 1>/dev/null 2>&1
ansible-playbook /opt/plexguide/menu/alias/alias.yml 1>/dev/null 2>&1
}
endline() {
tee <<-EOF

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 KiB

View File

@@ -1 +1 @@
fuuuu ---- Childish comment
fuuuu