Skip to content

Commit

Permalink
Update install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Sep 11, 2019
1 parent 2798ed4 commit 2e7cefc
Showing 1 changed file with 20 additions and 180 deletions.
200 changes: 20 additions & 180 deletions menu/functions/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ relno=$(lsb_release -sr)
relno=$(printf "%.0f\n" "$relno")
hostname=$(hostname -I | awk '{print $1}')


updateprime() {
abc="/var/plexguide"
mkdir -p ${abc}
Expand Down Expand Up @@ -76,10 +75,8 @@ pginstall() {
updateprime
bash /opt/plexguide/menu/pggce/gcechecker.sh
core pythonstart
core aptupdate
core alias &>/dev/null &
core folders
# core dependency
core mergerinstall
core dockerinstall
core docstart
Expand All @@ -106,7 +103,7 @@ pginstall() {
core cleaner &>/dev/null &
core serverid
core prune
# customcontainers &>/dev/null &
customcontainers &>/dev/null &
pgedition
core mountcheck
emergency
Expand Down Expand Up @@ -136,56 +133,12 @@ aptupdate() {
sed -i 's/false/true/g' /etc/default/sysstat
}

# customcontainers() {
# mkdir -p /opt/mycontainers
# touch /opt/appdata/plexguide/rclone.conf
# mkdir -p /opt/communityapps/apps
# rclone --config /opt/appdata/plexguide/rclone.conf copy /opt/mycontainers/ /opt/communityapps/apps
# }

cleaner() {
ansible-playbook /opt/plexguide/menu/pg.yml --tags autodelete &>/dev/null &
ansible-playbook /opt/plexguide/menu/pg.yml --tags clean &>/dev/null &
ansible-playbook /opt/plexguide/menu/pg.yml --tags clean-encrypt &>/dev/null &
}

#- name: gather os specific variables
# include_vars: "{{ item }}"
# with_first_found:
# - "{{ ansible_distribution }}-{{ ansible_distribution_major_version}}.yml"
# - "{{ ansible_distribution }}.yml"
# tags: vars
#OR
# Include OS specific tasks
#- include: CentOS.yml
# when: ansible_distribution == "CentOS"
#- include: Ubuntu.yml
# when: ansible_distribution == "Ubuntu"

dependency() {
osname=$(lsb_release -si)
if echo $osname == "Debian" 2>&1 >> /dev/null; then
ansible-playbook /opt/pgstage/roles/dependency/debian-9.yml
elif echo $osname == "Ubuntu" 2>&1 >> /dev/null; then
ansible-playbook /opt/pgstage/roles/dependency/ubtunu-18.04-lts.yml
elif echo $osname == "Rasbian" || "Fedora" || "CentOS"; then

tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔ Argggggg ...... System Warning!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Supported: UBUNTU 16.xx - 18.10 ~ LTS/SERVER and Debian 9.* / 10
This server may not be supported due to having the incorrect OS detected!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 10
fi
}

docstart() {
ansible-playbook /opt/plexguide/menu/pg.yml --tags docstart
}
Expand Down Expand Up @@ -268,7 +221,7 @@ mergerinstall() {
echo "ub16" >/var/plexguide/mergerfs.version
wget "https://github.com/trapexit/mergerfs/releases/download/2.28.1/mergerfs_2.28.1.ubuntu-xenial_amd64.deb"

if [ "$ub18check" != "" ]; then
elif [ "$ub18check" != "" ]; then
activated=true
echo "ub18" >/var/plexguide/mergerfs.version
wget "https://github.com/trapexit/mergerfs/releases/download/2.28.1/mergerfs_2.28.1.ubuntu-bionic_amd64.deb"
Expand Down Expand Up @@ -298,28 +251,28 @@ mergerinstall() {
apt install -y ./mergerfs*_amd64.deb
rm mergerfs*_amd64.deb

tee <<-EOF
# tee <<-EOF

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ MergerFS has been updated! Requires Clone redeployment.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ↘️ MergerFS has been updated! Requires Clone redeployment.
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

INFORMATION: MergerFS was updated on your system and brings performance improvements!
Users have reported faster plex scanning and playback with the new mergerfs and pgclone configuration.
# INFORMATION: MergerFS was updated on your system and brings performance improvements!
# Users have reported faster plex scanning and playback with the new mergerfs and pgclone configuration.

ATTENTION:
You are required to re-deploy your mounts in the PG Clone menu (option 4, option A).
It is advised to check the VFS mount settings in the options menu (C,2), as options have been updated.
# ATTENTION:
# You are required to re-deploy your mounts in the PG Clone menu (option 4, option A).
# It is advised to check the VFS mount settings in the options menu (C,2), as options have been updated.

WARNING: This is not optional, you must redeploy your mounts in the PG Clone menu.
Your mounts are currently down until you re-deploy pg clone as it requires configuration updates!
This is not done for you, you must go to the PG Clone Menu (option 4) and deploy (option A).
# WARNING: This is not optional, you must redeploy your mounts in the PG Clone menu.
# Your mounts are currently down until you re-deploy pg clone as it requires configuration updates!
# This is not done for you, you must go to the PG Clone Menu (option 4) and deploy (option A).

We apologize for this one-time inconvenience.
# We apologize for this one-time inconvenience.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Acknowledge Info | Press [ENTER] ' typed </dev/tty
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# EOF
# read -p 'Acknowledge Info | Press [ENTER] ' typed </dev/tty

}

Expand All @@ -333,51 +286,6 @@ mountcheck() {
ansible-playbook /opt/plexguide/menu/pgui/mcdeploy.yml
}

# localspace() {
# ansible-playbook /opt/pgui/pgui.yml
# ansible-playbook /opt/plexguide/menu/pgui/localspace.yml
# }

# gtused() {
# ansible-playbook /opt/plexguide/menu/pgui/gtused.yml
# }

# crons() {
# ansible-playbook /opt/plexguide/menu/pgui/_cron.yml
# }

# check() {
# ansible-playbook /opt/plexguide/menu/pgui/dynamic.yml

tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ User Interface (PGUI) Installed / Updated
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INFORMATION: PGUI is a simple interface that provides information,
warnings, and stats that will assist both yourself and tech support!
To turn this off, goto settings and turn off/on the PG User Interface!
VISIT:
https://pgui.yourdomain.com | http://pgui.domain.com:8555 | ipv4:8555
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Acknowledge Info | Press [ENTER] ' typed </dev/tty

}

#newinstall="$(tail -n 1 /var/plexguide/kcgpnv.numbers)"

#if [ "$newinstall" == "4" ]; then
# ansible-playbook /opt/plexguide/menu/pg.yml --tags kernel
# ansible-playbook /opt/plexguide/menu/pg.yml --tags nvidia
# ansible-playbook /opt/plexguide/menu/pg.yml --tags system
# ansible-playbook /opt/plexguide/menu/pg.yml --tags common
# echo "8" >/var/plexguide/kcgpnv.numbers
#fi

newinstall() {
rm -rf /var/plexguide/pg.exit 1>/dev/null 2>&1
file="${abc}/new.install"
Expand Down Expand Up @@ -442,79 +350,11 @@ pgui() {

pythonstart() {
ansible-playbook /opt/plexguide/roles/pg.yml --tags python

# ansible="2.8.2"
# pip="19.1.1"

# apt-get install -y --reinstall \
# nano \
# git \
# build-essential \
# libssl-dev \
# libffi-dev \
# python3-dev \
# python3-pip \
# python-dev \
# python-pip
# python3 -m pip install --disable-pip-version-check --upgrade --force-reinstall pip==${pip}
# python3 -m pip install --disable-pip-version-check --upgrade --force-reinstall setuptools
# python3 -m pip install --disable-pip-version-check --upgrade --force-reinstall \
# pyOpenSSL \
# requests \
# netaddr
# python -m pip install --disable-pip-version-check --upgrade --force-reinstall pip==${pip}
# python -m pip install --disable-pip-version-check --upgrade --force-reinstall setuptools
# python -m pip install --disable-pip-version-check --upgrade --force-reinstall ansible==${1-$ansible}

# ## Copy pip to /usr/bin
# cp /usr/local/bin/pip /usr/bin/pip
# cp /usr/local/bin/pip3 /usr/bin/pip3

# mkdir -p /etc/ansible/inventories/ 1>/dev/null 2>&1
# echo "[local]" >/etc/ansible/inventories/local
# echo "127.0.0.1 ansible_connection=local" >>/etc/ansible/inventories/local

# ### Reference: https://docs.ansible.com/ansible/2.4/intro_configuration.html
# echo "[defaults]" >/etc/ansible/ansible.cfg
# echo "deprecation_warnings=False" >>/etc/ansible/ansible.cfg
# 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

# # Variables Need to Line Up with pg.sh (start)
# touch /var/plexguide/background.1
}

##need fixxes ! For Debian 9/10 && ubu 18.10
dockerinstall() {
# if [ "$osname" == "Debian" ]; then
# ansible-playbook /opt/plexguide/menu/pg.yml --tags dockerdeb
# else
ansible-playbook /opt/plexguide/menu/pg.yml --tags docker
# # If Docker FAILED, Emergency Install
# file="/usr/bin/docker"
# if [ ! -e "$file" ]; then
# clear
# echo "Installing Docker the Old School Way - (Please Be Patient)"
# sleep 2
# clear
# curl -fsSL get.docker.com -o get-docker.sh
# sh get-docker.sh
# echo ""
# echo "Starting Docker (Please Be Patient)"
# sleep 2
# systemctl start docker
# sleep 2
# fi

# ##### Checking Again, if fails again; warns user
# file="/usr/bin/docker"
# if [ -e "$file" ]; then
# sleep 5
# else
# echo "INFO - FAILED: Docker Failed to Install! Exiting PGBlitz!"
# exit
# fi
# fi
ansible-playbook /opt/plexguide/menu/pg.yml --tags docker
}

serverid() {
Expand Down

0 comments on commit 2e7cefc

Please sign in to comment.