This commit is contained in:
MrDoobPG
2019-08-24 19:01:05 +02:00
parent 5b46859bc9
commit 642e0238bf
11 changed files with 238 additions and 469 deletions

View File

@@ -1,124 +0,0 @@
#!/bin/bash
#
# Title: PGBlitz (Hetzner iGPU / GPU)
# Author(s): Admin9705 - Deiteq - Sub7Seven
# Coder : MrDoob | Freelaancer Coder TechLead
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⌛ Verifiying PG Hetzner iGPU / GPU HW-Transcode !
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo "Updating packages"
apt-get update -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "Upgrading packages"
apt-get upgrade -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "Dist-Upgrading packages"
apt-get dist-upgrade -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "Autoremove old Updates"
apt-get autoremove -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "install vainfo"
sudo apt-get install vainfo -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
apt-get install lsb-release -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "install complete"
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 PG Hetzner iGPU / GPU HW-Transcode
NOTE : You MUST have Plex Pass to enable hardware transcoding in the Plex server
Your Operations System : $(lsb_release -sd)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] Ubuntu 16.04 LTS
[2] Ubuntu 18.04 LTS
[3] Debian 9.6
[4] iGPU / GPU TEST
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
# Standby
read -p 'Type a Number | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
sed -i '/blacklist i915/s/^#*/#/g' /etc/modprobe.d/blacklist-hetzner.conf
sed -i '/blacklist i915_bdw/s/^#*/#/g' /etc/modprobe.d/blacklist-hetzner.conf
sed -i '/GRUB_CMDLINE_LINUX_DEFAULT/s/^#*/#/g' /etc/default/grub.d/hetzner.cfg
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo usermod -a -G video root
chmod -R 777 /dev/dri
docker exec plex apt-get -y update
docker exec plex apt-get -y install i965-va-driver vainfo
docker restart plex
echo " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ "
echo " ✅ PASSED ! PG Hetzner iGPU / GPU HW-Transcode - finish "
echo " ✅ PASSED ! Please reboot your server , and edit plex to hardware decode "
echo " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
sleep 10
elif [ "$typed" == "2" ]; then
sed -i '/blacklist i915/s/^#*/#/g' /etc/modprobe.d/blacklist-hetzner.conf
sed -i '/blacklist i915_bdw/s/^#*/#/g' /etc/modprobe.d/blacklist-hetzner.conf
sed -i '/GRUB_CMDLINE_LINUX_DEFAULT/s/^#*/#/g' /etc/default/grub
sudo update-grub
sudo usermod -a -G video root
chmod -R 777 /dev/dri
docker exec plex apt-get -y update
docker exec plex apt-get -y install i965-va-driver vainfo
docker restart plex
echo " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ "
echo " ✅ PASSED ! PG Hetzner iGPU / GPU HW-Transcode - finish "
echo " ✅ PASSED ! Please reboot your server , and edit plex to hardware decode "
echo " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
sleep 10
elif [ "$typed" == "3" ]; then
sed -i '/blacklist i915/s/^#*/#/g' /etc/modprobe.d/blacklist-hetzner.conf
sed -i '/blacklist i915_bdw/s/^#*/#/g' /etc/modprobe.d/blacklist-hetzner.conf
sed -i '/GRUB_CMDLINE_LINUX_DEFAULT/s/^#*/#/g' /etc/default/grub
sudo update-grub
sudo usermod -a -G video root
chmod -R 777 /dev/dri
docker exec plex apt-get -y update
docker exec plex apt-get -y install i965-va-driver vainfo
docker restart plex
echo " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ "
echo " ✅ PASSED ! PG Hetzner iGPU / GPU HW-Transcode - finish "
echo " ✅ PASSED ! Please reboot your server , and edit plex to hardware decode "
echo " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
sleep 10
elif [ "$typed" == "4" ]; then
GPU=$(lspci | grep VGA | cut -d ":" -f3)
RAM=$(
cardid=$(lspci | grep VGA | cut -d " " -f1)
lspci -v -s $cardid | grep " prefetchable" | cut -d "=" -f2
)
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo $GPU $RAM
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
apt-get autoremove -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
sleep 10
elif [ "$typed" == "Z" ] || [ "$typed" == "z" ]; then
exit
else
bash /opt/plexguide/menu/tools/tools.sh
exit
fi
bash /opt/plexguide/menu/tools/tools.sh
exit

View File

@@ -1,59 +0,0 @@
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705 - Deiteq
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
source /opt/plexguide/menu/functions/functions.sh
# Menu Interface
question1() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📂 System & Network Auditor
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] System & Network Benchmark - Basic
[2] System & Network Benchmark - Advanced
[3] Simple SpeedTest
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
# Standby
read -p 'Type a Number | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
sudo wget -qO- bench.sh | bash
echo ""
read -p '🌍 Process Complete | Press [ENTER] ' typed </dev/tty
question1
elif [ "$typed" == "2" ]; then
echo ""
curl -LsO raw.githubusercontent.com/MrDoobPG/Bench/master/bench.sh
chmod +x bench.sh
chmod +x bench.sh
echo ""
./bench.sh -a
echo ""
read -p '🌍 Process Complete | Press [ENTER] ' typed </dev/tty
question1
elif [ "$typed" == "3" ]; then
pip install speedtest-cli
echo ""
speedtest-cli
echo ""
read -p '🌍 Process Complete | Press [ENTER] ' typed </dev/tty
question1
elif [[ "$typed" == "z" || "$typed" == "Z" ]]; then
exit
else
badinput1
fi
}
question1

View File

@@ -1,164 +0,0 @@
#!/bin/bash
###############################################################################
# Title: PlexGuide | PGBlitz ( PG System Tweaker )
#
# Author(s): Admin9705
# Coder : MrDoob - freelance Coder
# URL: https://pgblitz.com
# Base : http://github.pgblitz.com
# GNU: General Public License v3.0E
#
################################################################################
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⌛ Verifiying PG System Tweaker
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo "Updating packages"
apt-get update -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "Upgrading packages"
apt-get upgrade -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "Dist-Upgrading packages"
apt-get dist-upgrade -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "Autoremove old Updates"
apt-get autoremove -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "install complete"
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 System Tweaker
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 System Tweaker
[1] Network Tweaker ( Debian 9 & Ubuntu 18 only )
[2] Docker Swapness
[3] PTS logrotator
[4] VnStat autoinstaller
[Z] Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
# Standby
read -p 'Type a Number | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
echo "networktools install | please wait"
apt-get install ethtool -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "networktools installed"
sleep 2
network=$(ifconfig | grep -E 'eno1|enp|ens5' | awk '{print $1}' | sed -e 's/://g')
sleep 2
echo $network "network detected"
ethtool -K $network tso off tx off
sed -i '$a\' /etc/crontab
sed -i '$a\#################################' /etc/crontab
sed -i '$a\## PTS Network tweak ' /etc/crontab
sed -i '$a\#################################' /etc/crontab
sed -i '$a\@reboot ethtool -K '$network' tso off tx off\' /etc/crontab
sleep 2
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo " ✅ PASSED ! Network Tweak done"
echo " ✅ PASSED ! crontab line added"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" && sleep 10
elif [ "$typed" == "2" ]; then
sudo sysctl vm.swappiness=0
sudo sysctl vm.overcommit_memory=1
sed -i '$a\' /etc/sysctl.conf
sed -i '$a\' /etc/sysctl.conf
sed -i '$a\#########################################' /etc/sysctl.conf
sed -i '$a\## Docker PG Swapness changes ' /etc/sysctl.conf
sed -i '$a\#########################################' /etc/sysctl.conf
sed -i '$a\vm.swappiness=0\' /etc/sysctl.conf
sed -i '$a\vm.overcommit_memory=1\' /etc/sysctl.conf
sleep 2
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo " ✅ PASSED ! Docker swappiness offline"
echo " ✅ PASSED ! systctl edit"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" && sleep 10
elif [ "$typed" == "3" ]; then
username=$(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}')
sed -i '/#compress/s/^#*//g' /etc/logrotate.conf
sed -i 's/weekly/daily/g' /etc/logrotate.conf
sed -i 's/rotate 4/rotate 1/g' /etc/logrotate.conf
sleep 2
sed -i '$a\ ' /etc/logrotate.conf
sed -i '$a\########################################' /etc/logrotate.conf
sed -i '$a\## PGBlitz Upload logrotate ' /etc/logrotate.conf
sed -i '$a\########################################' /etc/logrotate.conf
sed -i '$a\ ' /etc/logrotate.conf
sed -i '$a\/var/plexguide/logs/*.log {' /etc/logrotate.conf
sed -i '$a\ su '$username' '$username' ' /etc/logrotate.conf
sed -i '$a\ rotate 7' /etc/logrotate.conf
sed -i '$a\ daily' /etc/logrotate.conf
sed -i '$a\ compress' /etc/logrotate.conf
sed -i '$a\ missingok' /etc/logrotate.conf
sed -i '$a\ notifempty' /etc/logrotate.conf
sed -i '$a\ maxage 7' /etc/logrotate.conf
sed -i '$a\ create 755 '$username' '$username'' /etc/logrotate.conf
sed -i '$a\}' /etc/logrotate.conf
sed -i '$a\ ' /etc/logrotate.conf
sed -i '$a\######################################' /etc/logrotate.conf
sed -i '$a\## PGBlitz Upload logrotate ' /etc/logrotate.conf
sed -i '$a\######################################' /etc/logrotate.conf
sleep 2
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo " ✅ PASSED ! PGBlitz logrotate installed"
echo " ✅ PASSED ! Daily backup from the logs"
echo " ✅ PASSED ! max age 7 Days "
echo " ✅ PASSED ! auto delete older logs"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" && sleep 10
elif [ "$typed" == "4" ]; then
echo "networktools | vnstat | vnstati install | please wait"
apt-get install ethtool vnstat vnstati -yqq 2>&1 >>/dev/null
export DEBIAN_FRONTEND=noninteractive
echo "networktools | vnstat | vnstati installed"
sleep 2
network=$(ifconfig | grep -E 'eno1|enp|ens5' | awk '{print $1}' | sed -e 's/://g')
sleep 2
echo $network "network detected"
sed -i 's/eth0/'$network'/g' /etc/vnstat.conf
sed -i 's/UnitMode 0/UnitMode 1/g' /etc/vnstat.conf
sed -i 's/RateUnit 1/RateUnit 0/g' /etc/vnstat.conf
sed -i 's/Locale "-"/Locale "LC_ALL=en_US.UTF-8"/g' /etc/vnstat.conf
sleep 2
/etc/init.d/vnstat restart 2>&1 >>/dev/null
sleep 2
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo " ✅ PASSED ! vnstat installed"
echo " ✅ PASSED ! vnstat -l [ live traffic ]"
echo " ✅ PASSED ! vnstat -d [ daily traffic ]"
echo " ✅ PASSED ! vnstat -w [ weekly traffic ]"
echo " ✅ PASSED ! vnstat -m [ month traffic ]"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" && sleep 10
elif [ "$typed" == "Z" ] || [ "$typed" == "z" ]; then
exit
else
bash /opt/plexguide/menu/tools/tools.sh
exit
fi
bash /opt/plexguide/menu/tools/tools.sh
exit

View File

@@ -12,4 +12,5 @@
- { role: clean-encrypt, tags: ['clean-encrypt'] }
- { role: kernel, tags: ['kernel'] }
- { role: nvidia, tags: ['nvidia'] }
- { role: system, tags: ['system'] }
- { role: system, tags: ['system'] }
- { role: plex, tags: ['plex'] }

View File

@@ -0,0 +1,14 @@
#########################################################################
# Title: Cloudbox: Plex Role #
# Author(s): l3uddz, desimaniac #
# URL: https://github.com/cloudbox/cloudbox #
# Docker Image: cloudb0x/plex #
# -- #
# Part of the Cloudbox project: https://cloudbox.works #
#########################################################################
# GNU General Public License v3.0 #
#########################################################################
---
- name: Extra Tasks
import_tasks: "subtasks/extra.yml"
when: (not continuous_integration)

View File

@@ -0,0 +1,52 @@
##########################################################################
# Title: Cloudbox: Plex | Claim Server #
# Author(s): desimaniac #
# URL: https://github.com/cloudbox/cloudbox #
# -- #
# Part of the Cloudbox project: https://cloudbox.works #
##########################################################################
# GNU General Public License v3.0 #
##########################################################################
---
- name: Get Plex Media Server claim code via API
block:
- name: "Get Plex Media Server claim code"
uri:
url: https://plex.tv/api/claim/token.json
user: "{{ plex.user }}"
password: "{{ plex.pass }}"
force_basic_auth: yes
register: plex_claim
- name: "Set 'plex_claim_code' variable"
set_fact:
plex_claim_code: "{{ plex_claim.json.token }}"
when: (plex_account_enabled)
- name: Get Plex Media Server claim code via prompts
block:
- name: "Ask user for Plex Media Server claim code"
pause:
prompt: "Please visit 'https://plex.tv/claim', login with your Plex account,
copy the 'Claim Code', paste it below, and press ENTER."
register: plex_claim_code_prompt
- name: "Set 'plex_claim_code' variable"
set_fact:
plex_claim_code: "{{ plex_claim_code_prompt.user_input }}"
when: (not plex_account_enabled)
- name: Assert Plex Media Server claim code exists
assert:
that:
- "plex_claim_code is defined"
- "plex_claim_code is not none"
- "plex_claim_code | trim | length > 0"
- name: "Display Plex Media Server claim code"
debug:
msg: "Using Plex Claim Code{{ ':' }} {{ plex_claim_code }}"

View File

@@ -0,0 +1,32 @@
##########################################################################
# Title: Cloudbox: Plex | Extra Tasks #
# Author(s): desimaniac #
# URL: https://github.com/cloudbox/cloudbox #
# -- #
# Part of the Cloudbox project: https://cloudbox.works #
##########################################################################
# GNU General Public License v3.0 #
##########################################################################
---
- name: Wait for 'Preferences.xml' to be created by Plex
wait_for:
path: "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Preferences.xml"
state: present
- name: Wait for Plex DB to be created
wait_for:
path: "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db"
state: present
- name: Stop Plex Container
docker_container:
name: plex
state: stopped
- name: "DB Cache Size Settings"
import_tasks: "subtasks/settings/db_cache_size.yml"
tags: plex_db_cache_size
- name: "Forced Automatic Quality Settings"
import_tasks: "subtasks/settings/forced_quality.yml"
tags: plex_forced_quality

View File

@@ -0,0 +1,84 @@
##########################################################################
# Title: Cloudbox: Plex | DB Cache Size Settings #
# Author(s): desimaniac #
# URL: https://github.com/cloudbox/cloudbox #
# -- #
# Part of the Cloudbox project: https://cloudbox.works #
##########################################################################
# GNU General Public License v3.0 #
##########################################################################
---
- name: Wait for Plex DB to be created
wait_for:
path: "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db"
state: present
timeout: 600
- name: Get Current Plex DB Cache Size
shell: |
sqlite3 "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" \
"PRAGMA default_cache_size;"
args:
executable: /bin/bash
register: current_db_cache_size
- name: Set 'default_db_cache_size' variable
set_fact:
default_db_cache_size: '2000'
- name: Check if 'plex.db_cache_size' was specified
set_fact:
db_cache_size_is_specified: "{{ true if not (
(plex.db_cache_size is undefined)
or
(plex.db_cache_size is none)
or
(plex.db_cache_size | trim | length == 0)
)
else false }}"
- name: Get Desired Plex DB Cache Size
set_fact:
desired_db_cache_size: "{{ default_db_cache_size
if ( (not db_cache_size_is_specified) or (plex.db_cache_size == 'default') )
else ( (plex.db_cache_size) | regex_replace(',', '') | int ) }}"
- name: Make Plex DB Edits
block:
- name: Stop Plex Container
docker_container:
name: plex
state: stopped
when: ('plex_db_cache_size' in ansible_run_tags)
- name: Display Desired Plex DB Cache Size
debug:
msg: "Desired Plex DB Cache Size is '{{ desired_db_cache_size }}'"
- name: "Set Plex DB Cache Size"
shell: |
sqlite3 "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" \
"PRAGMA default_cache_size = '{{ desired_db_cache_size | int }}';"
args:
executable: /bin/bash
- name: Get New Plex DB Cache Size
shell: |
sqlite3 "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" \
"PRAGMA default_cache_size;"
args:
executable: /bin/bash
register: new_db_cache_size
- name: Display New Plex DB Cache Size
debug:
msg: "Plex DB cache size is now set to '{{ new_db_cache_size.stdout | int }}'."
- name: Start Plex Container
docker_container:
name: plex
state: started
when: ('plex_db_cache_size' in ansible_run_tags)
when: ( current_db_cache_size.stdout | int ) != ( desired_db_cache_size | regex_replace(',', '') | int )

View File

@@ -0,0 +1,54 @@
##########################################################################
# Title: Cloudbox: Plex | Forced Automatic Quality Settings #
# Author(s): desimaniac #
# URL: https://github.com/cloudbox/cloudbox #
# -- #
# Part of the Cloudbox project: https://cloudbox.works #
##########################################################################
# GNU General Public License v3.0 #
##########################################################################
# Based on the work by Michael Zemsky (https://github.com/zmike808) #
##########################################################################
---
- name: Install lxml pip module
pip: "name=lxml state=present"
- name: Wait for 'Preferences.xml' to be created by Plex
wait_for:
path: "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Preferences.xml"
state: present
# 'forceAutoAdjustQuality' in Preferences.xml
# Forces clients to use automatic quality for media unless the quality is set higher than the quality of the video.
- name: "Set 'forceAutoAdjustQuality' in 'Preferences.xml' to
'{{ (plex.force_auto_adjust_quality|default(false,true)) | ternary('Enabled','Disabled') }}'."
xml:
path: "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Preferences.xml"
xpath: /Preferences
attribute: forceAutoAdjustQuality
value: "{{ (plex.force_auto_adjust_quality|default(false,true)) | ternary('1','0') }}"
state: present
register: x
ignore_errors: yes
# 'AllowHighOutputBitrates' in Preferences.xml
# Forces transcode quality to upscale. But can cause high bandwidth usage for clients.
- name: "Set 'AllowHighOutputBitrates' in 'Preferences.xml' to
'{{ (plex.force_high_output_bitrates|default(false,true)) | ternary('Enabled','Disabled') }}'."
xml:
path: "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Preferences.xml"
xpath: /Preferences
attribute: AllowHighOutputBitrates
value: "{{ (plex.force_high_output_bitrates|default(false,true)) | ternary('1','0') }}"
state: present
register: y
ignore_errors: yes
- name: Restart plex container
docker_container:
name: plex
state: started
restart: yes
when: ('plex_forced_quality' in ansible_run_tags) and (x.changed or y.changed)

View File

@@ -58,12 +58,6 @@ tee <<-EOF
[1] Patrol
[2] Trakt
[3] Hetzner iGPU / GPU HW-Transcode
[4] DNS changer
[5] System Tweak
[6] Personal VPN Service Installer
[7] System & Network Auditor
[8] TroubleShoot ~ PreInstaller
[Z] Exit
@@ -79,19 +73,6 @@ if [ "$typed" == "1" ]; then
bash /opt/pgpatrol/pgpatrol.sh
elif [ "$typed" == "2" ]; then
bash /opt/plexguide/menu/pgtrakt/pgtrakt.sh
elif [ "$typed" == "3" ]; then
bash /opt/plexguide/menu/hetzner/pghetznerigpu.sh
elif [ "$typed" == "4" ]; then
bash /opt/plexguide/menu/pgdnsswitcher/pgdnschanger.sh
elif [ "$typed" == "5" ]; then
bash /opt/plexguide/menu/nttweak/nttweak.sh
elif [ "$typed" == "6" ]; then
echo 'vpnserver' >/var/plexguide/type.choice && bash /opt/plexguide/menu/core/scripts/main.sh
elif [ "$typed" == "7" ]; then
bash /opt/plexguide/menu/network/network.sh
elif [ "$typed" == "8" ]; then
bash /opt/plexguide/menu/tshoot/tshoot.sh
elif [ "$typed" == "Z" ] || [ "$typed" == "z" ]; then
exit
else
bash /opt/plexguide/menu/tools/tools.sh

View File

@@ -1,102 +0,0 @@
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705 - Deiteq
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
# Menu Interface
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚥 TroubleShoot Interface
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] Pre-Installer: Force the Entire Process Again
[2] UnInstaller : Docker & Running Containers | Force Pre-Install
[3] UnInstaller : PGBlitz
Z - Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
# Standby
read -p 'Type a Number | Press [ENTER]: ' typed </dev/tty
if [ "$typed" == "1" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🍖 NOM NOM - Resetting the Starting Variables!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
echo "0" >/var/plexguide/pg.preinstall.stored
echo "0" >/var/plexguide/pg.ansible.stored
echo "0" >/var/plexguide/pg.rclone.stored
echo "0" >/var/plexguide/pg.python.stored
echo "0" >/var/plexguide/pg.docker.stored
echo "0" >/var/plexguide/pg.docstart.stored
echo "0" >/var/plexguide/pg.watchtower.stored
echo "0" >/var/plexguide/pg.label.stored
echo "0" >/var/plexguide/pg.alias.stored
echo "0" >/var/plexguide/pg.dep.stored
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ WOOT WOOT - Process Complete! Exit & Restart PGBlitz Now!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 5
elif [ "$typed" == "2" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🍖 NOM NOM - Uninstalling Docker & Resetting the Variables!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
rm -rf /etc/docker
apt-get purge docker-ce
rm -rf /var/lib/docker
rm -rf /var/plexguide/dep*
echo "0" >/var/plexguide/pg.preinstall.stored
echo "0" >/var/plexguide/pg.ansible.stored
echo "0" >/var/plexguide/pg.rclone.stored
echo "0" >/var/plexguide/pg.python.stored
echo "0" >/var/plexguide/pg.docstart.stored
echo "0" >/var/plexguide/pg.watchtower.stored
echo "0" >/var/plexguide/pg.label.stored
echo "0" >/var/plexguide/pg.alias.stored
echo "0" >/var/plexguide/pg.dep
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ WOOT WOOT - Process Complete! Exit & Restart PGBlitz Now!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 5
elif [ "$typed" == "3" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🍖 NOM NOM - Starting the PTS UnInstaller
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
echo "uninstall" >/var/plexguide/type.choice && bash /opt/plexguide/menu/core/scripts/main.sh
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then
exit
else
bash /opt/plexguide/menu/tshoot/tshoot.sh
exit
fi
bash /opt/plexguide/menu/tshoot/tshoot.sh
exit