Skip to content

Commit

Permalink
Update mountcheck.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Dec 2, 2019
1 parent a777b82 commit 5deaec4
Showing 1 changed file with 14 additions and 27 deletions.
41 changes: 14 additions & 27 deletions menu/pgui/templates/mountcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ mkdir -p /opt/appdata/plexguide
rm -rf /opt/appdata/plexguide/emergency/*
sleep 15
diskspace27=0
rm -rf /var/plexguide/status.mounts
while true; do
rm -rf /var/plexguide/status.mounts && touch /var/plexguide/status.mounts
rm -rf /var/plexguide/pg.blitz && touch /var/plexguide/pg.blitz

rm -rf /var/plexguide/pg.blitz
rm -rf /var/plexguide/status.mounts
while true; do

gdrivecheck=$(systemctl is-active gdrive)
gcryptcheck=$(systemctl is-active gcrypt)
Expand All @@ -29,36 +28,24 @@ while true; do
pgblitz=$(systemctl list-unit-files | grep pgblitz.service | awk '{ print $2 }')
pgmove=$(systemctl list-unit-files | grep pgmove.service | awk '{ print $2 }')

touch /var/plexguide/status.mounts
touch /var/plexguide/pg.blitz

status=$(tail -n 1 /var/plexguide/status.mounts)

if [[ "$pgmove" == "enabled" ]]; then
echo -e "1" >/var/plexguide/status.mounts
echo "1" >/var/plexguide/status.mounts
elif [[ "$pgblitz" == "enabled" ]]; then
echo -e "2" >/var/plexguide/status.mounts
else
echo -e "3" >/var/plexguide/status.mounts
echo "2" >/var/plexguide/status.mounts
else echo "3" >/var/plexguide/status.mounts
fi

if [[ "$status" == "1" ]] ; then
if [[ "$pgmovecheck" != "active" ]]; then
echo -e " 🔴 Not Operational MOVE" >/var/plexguide/pg.blitz
else
echo -e " ✅ Operational MOVE" >/var/plexguide/pg.blitz
fi
fi
if [[ "$status" == "2" ]] ; then
if [[ "$pgblitzcheck" != "active" ]]; then
echo -e " 🔴 Not Operational BLITZ" >/var/plexguide/pg.blitz
else
echo -e " ✅ Operational BLITZ" >/var/plexguide/pg.blitz
fi
fi

if [[ "$status" == "3" ]] ; then
echo " 🔴 Not Operational UPLOADER" >/var/plexguide/pg.blitz
if [[ "$pgmovecheck" != "active" ]]; then
echo " 🔴 Not Operational MOVE" >/var/plexguide/pg.blitz
else echo " ✅ Operational MOVE" >/var/plexguide/pg.blitz ; fi
elif [[ "$status" == "2" ]] ; then
if [[ "$pgblitzcheck" != "active" ]]; then
echo " 🔴 Not Operational BLITZ" >/var/plexguide/pg.blitz
else echo " ✅ Operational BLITZ" >/var/plexguide/pg.blitz ; fi
else echo " 🔴 Not Operational UPLOADER" >/var/plexguide/pg.blitz
fi

########################## UI
Expand Down

0 comments on commit 5deaec4

Please sign in to comment.