Skip to content

Commit

Permalink
New watchdog
Browse files Browse the repository at this point in the history
rewrote the watchdog needs beta testing
  • Loading branch information
swetoast authored Oct 23, 2021
1 parent 4b136f8 commit 903885c
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions plugin.program.steamlink/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,32 @@ def create_files():
outfile.close()
with open('/tmp/steamlink-watchdog.sh', 'w') as outfile:
outfile.write("""#!/bin/bash
systemctl stop mediacenter
if [ "$(systemctl is-active hyperion.service)" = "active" ]; then systemctl restart hyperion; fi
if [ "$(which steamlink)" = "" ]; then
apt install gnupg curl -y
kodi-send --action="Notification(Downloading and installing Steamlink... ,3000)";
if [ ! $(dpkg --list | grep gnupg) ]; then
kodi-send --action="Notification(Downloading and installing Steamlink depenancies (gnupg)... ,3000)"
sudo apt update; sudo apt install gnupg -y
fi
if [ ! $(dpkg --list | grep curl) ]; then
kodi-send --action="Notification(Downloading and installing Steamlink depenancies (curl)... ,3000)"
sudo apt update; sudo apt install curl -y
fi
if [ ! "$(which steamlink)" = "" ]; then
kodi-send --action="Notification(Downloading and installing Steamlink Application... ,3000)"
curl -o /tmp/steamlink.deb -#Of http://media.steampowered.com/steamlink/rpi/latest/steamlink.deb
dpkg -i /tmp/steamlink.deb
sudo dpkg -i /tmp/steamlink.deb
rm -f /tmp/steamlink.deb
fi
if ! grep -q "dtoverlay=vc4-fkms-v3d" /boot/config.txt;
then echo "dtoverlay=vc4-fkms-v3d" >> /boot/config.txt
kodi-send --action="Notification(dtoverlay=vc4-fkms-v3d was missing from /boot/config.txt, however it has been added and now it will reboot. ,3000)";
sleep 15
reboot
if ! grep -q "dtoverlay=vc4-fkms-v3d" /boot/config.txt; then
kodi-send --action="Notification(dtoverlay=vc4-fkms-v3d was missing from /boot/config.txt, however it has been added and now it will reboot. ,3000)"
echo "dtoverlay=vc4-fkms-v3d" >> /boot/config.txt
sleep 15
reboot
fi
if [ -f "/home/osmc/.wakeup" ]
then /usr/bin/wakeonlan "$(cat "/home/osmc/.wakeup")"
else sudo apt install wakeonlan -y; /usr/bin/wakeonlan "$(cat "/home/osmc/.wakeup")"
fi
systemctl stop mediacenter
if [ "$(systemctl is-active hyperion.service)" = "active" ]; then systemctl restart hyperion; fi
sudo -u osmc steamlink
openvt -c 7 -s -f clear
systemctl start mediacenter
Expand Down

0 comments on commit 903885c

Please sign in to comment.