mirror of
https://github.com/FakeTV/pseudo-channel.git
synced 2025-12-31 23:43:13 +00:00
Add files via upload
This commit is contained in:
@@ -1,55 +1,55 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# file: generate_daily_sched.sh
|
# file: generate_daily_sched.sh
|
||||||
|
|
||||||
#----
|
#----
|
||||||
# This file is meant to be setup with a crontab task to generate daily schedule (even if app is already running).
|
# This file is meant to be setup with a crontab task to generate daily schedule (even if app is already running).
|
||||||
#
|
#
|
||||||
# **This file is also used to startstop a running channel, trigger an update and restart the channel**
|
# **This file is also used to startstop a running channel, trigger an update and restart the channel**
|
||||||
#
|
#
|
||||||
# If planning on using the ./startstop.sh script to save power, etc. this script needs to be used to
|
# If planning on using the ./startstop.sh script to save power, etc. this script needs to be used to
|
||||||
# update the daily schedule if the app is not running.
|
# update the daily schedule if the app is not running.
|
||||||
#----
|
#----
|
||||||
|
|
||||||
#----
|
#----
|
||||||
# To Use:
|
# To Use:
|
||||||
# % crontab -e
|
# % crontab -e
|
||||||
# 0 0 * * * cd /home/pi/pseudo-channel/ && /home/pi/pseudo-channel/env/bin/python /home/pi/pseudo-channel/PseudoChannel.py -g >> /home/pi/pseudo-channel/pseudo-channel.log 2>&1
|
# 0 0 * * * cd /home/pi/pseudo-channel/ && /home/pi/pseudo-channel/env/bin/python /home/pi/pseudo-channel/PseudoChannel.py -g >> /home/pi/pseudo-channel/pseudo-channel.log 2>&1
|
||||||
#
|
#
|
||||||
# INFO: The above runs every midnight, triggering the virtualenv python version to trigger PsuedoChannel.py -g & send all output to the log.
|
# INFO: The above runs every midnight, triggering the virtualenv python version to trigger PsuedoChannel.py -g & send all output to the log.
|
||||||
# Update the paths as you see fit using your user / directories. Mine is using the defualt pi /home dir and virtualenv dirs.
|
# Update the paths as you see fit using your user / directories. Mine is using the defualt pi /home dir and virtualenv dirs.
|
||||||
#----
|
#----
|
||||||
|
|
||||||
#----BEGIN EDITABLE VARS----
|
#----BEGIN EDITABLE VARS----
|
||||||
|
|
||||||
pid_file=running.pid
|
pid_file=running.pid
|
||||||
|
|
||||||
output_pid_path=.
|
output_pid_path=.
|
||||||
|
|
||||||
python_to_use="$(which python)"
|
python_to_use="$(which python)"
|
||||||
|
|
||||||
log_file=pseudo-channel.log
|
log_file=pseudo-channel.log
|
||||||
|
|
||||||
SCRIPT_PATH=$(pwd)
|
SCRIPT_PATH=$(pwd)
|
||||||
|
|
||||||
#----END EDITABLE VARS-------
|
#----END EDITABLE VARS-------
|
||||||
|
|
||||||
if [ ! -e $SCRIPT_PATH/$pid_file ]; then
|
if [ ! -e $SCRIPT_PATH/$pid_file ]; then
|
||||||
|
|
||||||
$python_to_use $SCRIPT_PATH/PseudoChannel.py -g >> $SCRIPT_PATH/$log_file
|
$python_to_use $SCRIPT_PATH/PseudoChannel.py -g >> $SCRIPT_PATH/$log_file
|
||||||
|
|
||||||
echo "+++++ PseudoChannel.py is not already running am generating the daily schedule." >> $SCRIPT_PATH/$log_file
|
echo "+++++ PseudoChannel.py is not already running am generating the daily schedule." >> $SCRIPT_PATH/$log_file
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
echo "+++++ PseudoChannel.py @: $the_pid is already running, stopping channel and running daily schedule update." >> $SCRIPT_PATH/$log_file
|
echo "+++++ PseudoChannel.py @: $the_pid is already running, stopping channel and running daily schedule update." >> $SCRIPT_PATH/$log_file
|
||||||
|
|
||||||
bash $SCRIPT_PATH/startstop.sh
|
bash $SCRIPT_PATH/startstop.sh
|
||||||
|
|
||||||
$python_to_use $SCRIPT_PATH/PseudoChannel.py -g >> $SCRIPT_PATH/$log_file
|
$python_to_use $SCRIPT_PATH/PseudoChannel.py -g >> $SCRIPT_PATH/$log_file
|
||||||
|
|
||||||
bash $SCRIPT_PATH/startstop.sh
|
bash $SCRIPT_PATH/startstop.sh
|
||||||
|
|
||||||
echo "+++++ Successfully stopped running channel, generated daily schedule and restarted script."
|
echo "+++++ Successfully stopped running channel, generated daily schedule and restarted script."
|
||||||
|
|
||||||
fi
|
fi
|
||||||
528
channel-dir/pseudo_schedule.xml
Normal file
528
channel-dir/pseudo_schedule.xml
Normal file
@@ -0,0 +1,528 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!-- Welcome to PseudoChannel!
|
||||||
|
|
||||||
|
This will be the most difficult part in the process of setting up your PseudoChannel (but it is not hard,
|
||||||
|
just be sure to read this and you will be set).
|
||||||
|
|
||||||
|
There are a few things to keep in mind when setting up this XML.
|
||||||
|
|
||||||
|
1) What exactly is this file for?
|
||||||
|
|
||||||
|
The whole idea behind "PseudoChannel.py" is to create your own channel(s) to mimick real TV,
|
||||||
|
using your own "TV Shows", "Movies" and "Commercials". You are not supposed to intervene too often,
|
||||||
|
rather you are supposed to set it up (here) and just let it go as it advances in series episodes, playing
|
||||||
|
commercials to fill up gaps between scheduled content and playing movies where specified. That being said,
|
||||||
|
this particular file is where you map out what your channel looks like. I have my own schedule
|
||||||
|
below so you can reference it when building your own channel.
|
||||||
|
|
||||||
|
2) How do I make sense of these '<time></time>' blocks / '<weekdays></weekdays' blocks?
|
||||||
|
|
||||||
|
Since the whole concept of the channel is to have repeating blocks of content that changes throughout the
|
||||||
|
week depending on the day / time of day (like a real channel) you specify your "TV Shows" and "Movies" schedule
|
||||||
|
by adding a '<time></time>' block within the part of the week you want it to be scheduled for. For instance,
|
||||||
|
below I have "Looney Tunes" scheduled to play "everyday" starting at "6:00 AM", whereas I have "Garfield & Friends"
|
||||||
|
playing only on "weekday" mornings scheduled for after Looney Tunes starting at "8:00 AM". Also notice that
|
||||||
|
"Garfield & Friends" below is actually written as, "Garfield & Friends". This is especially important
|
||||||
|
to those new to editing XML. In XML, "UTF-8", you are forbidden from using certain characters like the and
|
||||||
|
character. It is important to encode your titles to XML friendly text (this is also important for non-english characters).
|
||||||
|
You can convert titles that have forbidden characters by using this online too: http://coderstoolbox.net/string/#!encoding=xml&action=encode&charset=us_ascii
|
||||||
|
|
||||||
|
3) Setting the available parameters: "title=", "type=", "strict-time=", "time-shift=", "xtra="
|
||||||
|
|
||||||
|
There are two required parameters: "title" and "type". The "title" value should be either the title of your series
|
||||||
|
(i.e. "Friends") or if you are scheduling a movie it should only be set to, "random". The "type" parameter should be set
|
||||||
|
to either "series" or "movie". The attribute "strict-time" can either be "true" or "false" and refers to
|
||||||
|
whether or not the particular "<time>" block will be scheduled for the exact time you specify or if it will
|
||||||
|
shift around to fill up gaps. This is useful as sometimes episodes are as short as 5 minutes (cartoons) while
|
||||||
|
other episodes that are normally ~25 minutes are an hour or so long. Setting "strict-time" to "false" will
|
||||||
|
tell the app to shift that time block closer to the previous episode. The corresponding, "time-shift" attribute
|
||||||
|
tells the app how to shift the item. Its value can be "1" or more and will help the scheduler determine when to schedule the
|
||||||
|
shifting time according to that value. So for instance, if you'd like no gaps between your content, then you want
|
||||||
|
to set "strict-time='false'" and "time-shift='1'". However if you want your content to shift but would rather
|
||||||
|
it 'hook' on to a pretty time, like "2:45 PM" versus "2:41 PM" then you would set "time-shift" to a value like "5".
|
||||||
|
This will shift content around and schedule it within 5 minutes of the previous item but hook it on to the
|
||||||
|
nearest multiple of "5". You could use "15" or "30" too for even prettier times. Experiment.
|
||||||
|
|
||||||
|
4) Movies. How do I schedule "Billy Madison" to play on Saturday afternoon?
|
||||||
|
|
||||||
|
Well, since the app is supposed to work like a real TV Channel, you aren't supposed to have that kind of
|
||||||
|
control. If you want to watch "Billy Madison" then why not just turn on your Plex TV app and play it? Instead
|
||||||
|
here you want to always use "random" tor the "title=" value of movie content. But let's say you have a ton of Adam Sandler
|
||||||
|
movies and want to schedule a "random" Adam Sandler movie on Saturday afternoon? That makes more sense, that way
|
||||||
|
you aren't playing the same movie every Saturday afternoon! For movies specifically, you have a new
|
||||||
|
attribute called "xtra". There you can add various parameters to narrow in on the random movie type you
|
||||||
|
want scheduled every Saturday afternoon. So if for some reason you are set on playing an Adam Sandler comedy
|
||||||
|
every Saturday, then you might have a <time> block that looks like this:
|
||||||
|
|
||||||
|
<time title="random" type="movie" strict-time="true" xtra='actor:adam sandler genre:comedy contentRating:PG'>12:45 PM</time>
|
||||||
|
|
||||||
|
The available "xtra" paramters are as follows (http://python-plexapi.readthedocs.io/en/latest/_modules/plexapi/library.html#LibrarySection.search):
|
||||||
|
|
||||||
|
* unwatched: Display or hide unwatched content (True, False). [all]
|
||||||
|
* duplicate: Display or hide duplicate items (True, False). [movie]
|
||||||
|
* actor: List of actors to search ([actor_or_id, ...]). [movie]
|
||||||
|
* collection: List of collections to search within ([collection_or_id, ...]). [all]
|
||||||
|
* contentRating: List of content ratings to search within ([rating_or_key, ...]). [movie]
|
||||||
|
* country: List of countries to search within ([country_or_key, ...]). [movie,music]
|
||||||
|
* decade: List of decades to search within ([yyy0, ...]). [movie]
|
||||||
|
* director: List of directors to search ([director_or_id, ...]). [movie]
|
||||||
|
* genre: List Genres to search within ([genere_or_id, ...]). [all]
|
||||||
|
* resolution: List of video resolutions to search within ([resolution_or_key, ...]). [movie]
|
||||||
|
* studio: List of studios to search within ([studio_or_key, ...]). [music]
|
||||||
|
* year: List of years to search within ([yyyy, ...]). [all]
|
||||||
|
|
||||||
|
Currently the "xtra" attribute is only available to be used with movies.
|
||||||
|
|
||||||
|
5) Commercials?
|
||||||
|
|
||||||
|
If you are planning on using "time-shift" with a value greater than "1", then you will have empty gaps
|
||||||
|
in between your scheduled content. A neat feature is to fill those gaps with commercials, music videos,
|
||||||
|
or whatever you can come up with. All you have to do is set the commercial flag in the "pseudo_config.py"
|
||||||
|
file to tell the app to use "commercial injection" and make sure you have a "Commercials" library in your
|
||||||
|
plex media library. In that library, fill it with as many commercials or short videos as you can. The more
|
||||||
|
the better! I have close to a thousand commercials in mine - this helps the app fill up the gaps with a
|
||||||
|
wide variety of video content of varied durations. (hint: use a tool like 'youtube-dl' to download full
|
||||||
|
playlists from yourtube. You can fill up your "Commercials" library quick). Once you have your commercials library
|
||||||
|
setup, make sure to run, "python PseudoChannel.py -u" once more to update your local db with your new commercials
|
||||||
|
library. Commercials will now be "injected" to fill up gaps upon the next days schedule (or you can manually
|
||||||
|
generate the schedule using the "-g" flag).
|
||||||
|
|
||||||
|
Ok, that should be it. I've made it sound much more complicated than it actually is. Just make sure that you aren't
|
||||||
|
accidentally overlapping times, aren't accidentally trying to use forbidden XML characters, etc. Once you have
|
||||||
|
everything set, it should be hands off form there on out. Just go back to the cli and run "python PseudoChannel.py -xml"
|
||||||
|
to tell the app that you have updated the XML.
|
||||||
|
|
||||||
|
Oh and lastly, make sure that your "series" title's are written exactly as they are in your Plex Library. So if you
|
||||||
|
have "The Office (us)" in your Plex library, you need to have it written exactly like that here (not case sensitive) or it won't work. In
|
||||||
|
my previous "garfield" example you might be tempted to write it as "Garfield and Friends" instead of the hassle of
|
||||||
|
using the XML ascii character "&". Well you cannot do that. I usually like to have my Plex Server web page
|
||||||
|
open in a tab while making my XML. That way for each "series" title I can double check the library to make sure I
|
||||||
|
am using the series title exactly as Plex is.
|
||||||
|
|
||||||
|
Ok, that is it. If you have questions feel free to contact Mark or I on discord here: https://discord.gg/7equn68,
|
||||||
|
or open an 'issue' on the github repository. Have fun!
|
||||||
|
|
||||||
|
-->
|
||||||
|
<schedule>
|
||||||
|
<everyday>
|
||||||
|
<!-- The first item is set to: strict-time=true - this isn't necessary but helps organize the schedule -->
|
||||||
|
<!--
|
||||||
|
The following is a good example of content that is extremely short. Looney Tunes cartoons are around
|
||||||
|
5 minutes in length per episode. Althrough sometimes they are as much as 25 minutes long.
|
||||||
|
Since strict-time is set to false, the app will adjust accordingly. I am however setting a *rough
|
||||||
|
intended time of 6:00 AM and incrementing by 10 minutes. The app will figure out the real
|
||||||
|
start times but this will help me conceptualize my schedule as I keep adding entries.
|
||||||
|
-->
|
||||||
|
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" >6:00 AM</time>
|
||||||
|
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" >6:10 AM</time>
|
||||||
|
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" >6:20 AM</time>
|
||||||
|
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" >6:40 AM</time>
|
||||||
|
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" >6:50 AM</time>
|
||||||
|
</everyday>
|
||||||
|
<mondays>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:00 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:30 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:00 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:30 AM</time>
|
||||||
|
|
||||||
|
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:00 AM</time>
|
||||||
|
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:30 AM</time>
|
||||||
|
|
||||||
|
<time title="macgyver" type="series" strict-time="false" time-shift="5" >11:00 AM</time>
|
||||||
|
|
||||||
|
<time title="boy meets world" type="series" strict-time="false" time-shift="5" >12:00 PM</time>
|
||||||
|
|
||||||
|
<time title="full house" type="series" strict-time="false" time-shift="5" >12:30 PM</time>
|
||||||
|
<time title="full house" type="series" strict-time="false" time-shift="5" >1:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Wonder Years" type="series" strict-time="false" time-shift="5" >1:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Simpsons" type="series" strict-time="false" time-shift="5" >2:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Monk" type="series" strict-time="false" time-shift="5" >2:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >3:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Fresh Prince of Bel-Air" type="series" strict-time="false" time-shift="5" >3:30 PM</time>
|
||||||
|
|
||||||
|
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >4:00 PM</time>
|
||||||
|
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >4:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Roseanne" type="series" strict-time="false" time-shift="5" >5:00 PM</time>
|
||||||
|
<time title="Roseanne" type="series" strict-time="false" time-shift="5" >5:30 PM</time>
|
||||||
|
|
||||||
|
<time title="seinfeld" type="series" strict-time="false" time-shift="5" >6:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Parker Lewis Can't Lose" type="series" strict-time="false" time-shift="5" >6:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Futurama" type="series" strict-time="false" time-shift="5" >7:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >7:30 PM</time>
|
||||||
|
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >8:00 PM</time>
|
||||||
|
|
||||||
|
<time title="new girl" type="series" strict-time="false" time-shift="5" >8:30 PM</time>
|
||||||
|
|
||||||
|
<time title="random" type="movie" strict-time="false" time-shift="5" xtra='actor:mike myers genre:comedy contentRating:PG-13'>9:00 PM</time>
|
||||||
|
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >9:30 PM</time>
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >9:40 PM</time>
|
||||||
|
<time title="Blossom" type="series" strict-time="false" time-shift="5" >10:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Frasier" type="series" strict-time="false" time-shift="1" >10:20 PM</time>
|
||||||
|
|
||||||
|
<time title="Mad About You" type="series" strict-time="false" time-shift="5" >10:30 PM</time>
|
||||||
|
<time title="Mad About You" type="series" strict-time="false" time-shift="5" >10:40 PM</time>
|
||||||
|
|
||||||
|
<time title="M*A*S*H" type="series" strict-time="false" time-shift="5" >10:50 PM</time>
|
||||||
|
|
||||||
|
<time title="Beverly Hills, 90210" type="series" strict-time="false" time-shift="5" >11:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Cheers" type="series" strict-time="false" time-shift="5" >11:20 PM</time>
|
||||||
|
|
||||||
|
<time title="Three's Company" type="series" strict-time="false" time-shift="5" >11:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Brady Bunch" type="series" strict-time="false" time-shift="5" >11:40 PM</time>
|
||||||
|
</mondays>
|
||||||
|
<tuesdays>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:00 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:30 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:00 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:30 AM</time>
|
||||||
|
|
||||||
|
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:00 AM</time>
|
||||||
|
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:30 AM</time>
|
||||||
|
|
||||||
|
<time title="macgyver" type="series" strict-time="false" time-shift="5" >11:00 AM</time>
|
||||||
|
|
||||||
|
<time title="boy meets world" type="series" strict-time="false" time-shift="5" >12:00 PM</time>
|
||||||
|
|
||||||
|
<time title="full house" type="series" strict-time="false" time-shift="5" >12:30 PM</time>
|
||||||
|
<time title="full house" type="series" strict-time="false" time-shift="5" >1:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Wonder Years" type="series" strict-time="false" time-shift="5" >1:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Simpsons" type="series" strict-time="false" time-shift="5" >2:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Monk" type="series" strict-time="false" time-shift="5" >2:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >3:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Fresh Prince of Bel-Air" type="series" strict-time="false" time-shift="5" >3:30 PM</time>
|
||||||
|
|
||||||
|
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >4:00 PM</time>
|
||||||
|
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >4:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Roseanne" type="series" strict-time="false" time-shift="5" >5:00 PM</time>
|
||||||
|
<time title="Roseanne" type="series" strict-time="false" time-shift="5" >5:30 PM</time>
|
||||||
|
|
||||||
|
<time title="seinfeld" type="series" strict-time="false" time-shift="5" >6:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Parker Lewis Can't Lose" type="series" strict-time="false" time-shift="5" >6:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Futurama" type="series" strict-time="false" time-shift="5" >7:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >7:30 PM</time>
|
||||||
|
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >8:00 PM</time>
|
||||||
|
|
||||||
|
<time title="new girl" type="series" strict-time="false" time-shift="5" >8:30 PM</time>
|
||||||
|
|
||||||
|
<time title="random" type="movie" strict-time="false" time-shift="5" xtra='actor:mike myers genre:comedy contentRating:PG-13'>9:00 PM</time>
|
||||||
|
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >9:30 PM</time>
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >9:40 PM</time>
|
||||||
|
<time title="Blossom" type="series" strict-time="false" time-shift="5" >10:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Frasier" type="series" strict-time="false" time-shift="1" >10:20 PM</time>
|
||||||
|
|
||||||
|
<time title="Mad About You" type="series" strict-time="false" time-shift="5" >10:30 PM</time>
|
||||||
|
<time title="Mad About You" type="series" strict-time="false" time-shift="5" >10:40 PM</time>
|
||||||
|
|
||||||
|
<time title="M*A*S*H" type="series" strict-time="false" time-shift="5" >10:50 PM</time>
|
||||||
|
|
||||||
|
<time title="Beverly Hills, 90210" type="series" strict-time="false" time-shift="5" >11:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Cheers" type="series" strict-time="false" time-shift="5" >11:20 PM</time>
|
||||||
|
|
||||||
|
<time title="Three's Company" type="series" strict-time="false" time-shift="5" >11:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Brady Bunch" type="series" strict-time="false" time-shift="5" >11:40 PM</time>
|
||||||
|
</tuesdays>
|
||||||
|
<wednesdays>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:00 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:30 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:00 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:30 AM</time>
|
||||||
|
|
||||||
|
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:00 AM</time>
|
||||||
|
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:30 AM</time>
|
||||||
|
|
||||||
|
<time title="macgyver" type="series" strict-time="false" time-shift="5" >11:00 AM</time>
|
||||||
|
|
||||||
|
<time title="boy meets world" type="series" strict-time="false" time-shift="5" >12:00 PM</time>
|
||||||
|
|
||||||
|
<time title="full house" type="series" strict-time="false" time-shift="5" >12:30 PM</time>
|
||||||
|
<time title="full house" type="series" strict-time="false" time-shift="5" >1:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Wonder Years" type="series" strict-time="false" time-shift="5" >1:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Simpsons" type="series" strict-time="false" time-shift="5" >2:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Monk" type="series" strict-time="false" time-shift="5" >2:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >3:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Fresh Prince of Bel-Air" type="series" strict-time="false" time-shift="5" >3:30 PM</time>
|
||||||
|
|
||||||
|
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >4:00 PM</time>
|
||||||
|
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >4:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Roseanne" type="series" strict-time="false" time-shift="5" >5:00 PM</time>
|
||||||
|
<time title="Roseanne" type="series" strict-time="false" time-shift="5" >5:30 PM</time>
|
||||||
|
|
||||||
|
<time title="seinfeld" type="series" strict-time="false" time-shift="5" >6:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Parker Lewis Can't Lose" type="series" strict-time="false" time-shift="5" >6:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Futurama" type="series" strict-time="false" time-shift="5" >7:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >7:30 PM</time>
|
||||||
|
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >8:00 PM</time>
|
||||||
|
|
||||||
|
<time title="new girl" type="series" strict-time="false" time-shift="5" >8:30 PM</time>
|
||||||
|
|
||||||
|
<time title="random" type="movie" strict-time="false" time-shift="5" xtra='actor:mike myers genre:comedy contentRating:PG-13'>9:00 PM</time>
|
||||||
|
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >9:30 PM</time>
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >9:40 PM</time>
|
||||||
|
<time title="Blossom" type="series" strict-time="false" time-shift="5" >10:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Frasier" type="series" strict-time="false" time-shift="1" >10:20 PM</time>
|
||||||
|
|
||||||
|
<time title="Mad About You" type="series" strict-time="false" time-shift="5" >10:30 PM</time>
|
||||||
|
<time title="Mad About You" type="series" strict-time="false" time-shift="5" >10:40 PM</time>
|
||||||
|
|
||||||
|
<time title="M*A*S*H" type="series" strict-time="false" time-shift="5" >10:50 PM</time>
|
||||||
|
|
||||||
|
<time title="Beverly Hills, 90210" type="series" strict-time="false" time-shift="5" >11:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Cheers" type="series" strict-time="false" time-shift="5" >11:20 PM</time>
|
||||||
|
|
||||||
|
<time title="Three's Company" type="series" strict-time="false" time-shift="5" >11:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Brady Bunch" type="series" strict-time="false" time-shift="5" >11:40 PM</time>
|
||||||
|
</wednesdays>
|
||||||
|
<thursdays>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:00 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:30 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:00 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:30 AM</time>
|
||||||
|
|
||||||
|
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:00 AM</time>
|
||||||
|
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:30 AM</time>
|
||||||
|
|
||||||
|
<time title="macgyver" type="series" strict-time="false" time-shift="5" >11:00 AM</time>
|
||||||
|
|
||||||
|
<time title="boy meets world" type="series" strict-time="false" time-shift="5" >12:00 PM</time>
|
||||||
|
|
||||||
|
<time title="full house" type="series" strict-time="false" time-shift="5" >12:30 PM</time>
|
||||||
|
<time title="full house" type="series" strict-time="false" time-shift="5" >1:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Wonder Years" type="series" strict-time="false" time-shift="5" >1:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Simpsons" type="series" strict-time="false" time-shift="5" >2:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Monk" type="series" strict-time="false" time-shift="5" >2:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >3:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Fresh Prince of Bel-Air" type="series" strict-time="false" time-shift="5" >3:30 PM</time>
|
||||||
|
|
||||||
|
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >4:00 PM</time>
|
||||||
|
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >4:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Roseanne" type="series" strict-time="false" time-shift="5" >5:00 PM</time>
|
||||||
|
<time title="Roseanne" type="series" strict-time="false" time-shift="5" >5:30 PM</time>
|
||||||
|
|
||||||
|
<time title="seinfeld" type="series" strict-time="false" time-shift="5" >6:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Parker Lewis Can't Lose" type="series" strict-time="false" time-shift="5" >6:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Futurama" type="series" strict-time="false" time-shift="5" >7:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >7:30 PM</time>
|
||||||
|
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >8:00 PM</time>
|
||||||
|
|
||||||
|
<time title="new girl" type="series" strict-time="false" time-shift="5" >8:30 PM</time>
|
||||||
|
|
||||||
|
<time title="random" type="movie" strict-time="false" time-shift="5" xtra='actor:mike myers genre:comedy contentRating:PG-13'>9:00 PM</time>
|
||||||
|
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >9:30 PM</time>
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >9:40 PM</time>
|
||||||
|
<time title="Blossom" type="series" strict-time="false" time-shift="5" >10:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Frasier" type="series" strict-time="false" time-shift="1" >10:20 PM</time>
|
||||||
|
|
||||||
|
<time title="Mad About You" type="series" strict-time="false" time-shift="5" >10:30 PM</time>
|
||||||
|
<time title="Mad About You" type="series" strict-time="false" time-shift="5" >10:40 PM</time>
|
||||||
|
|
||||||
|
<time title="M*A*S*H" type="series" strict-time="false" time-shift="5" >10:50 PM</time>
|
||||||
|
|
||||||
|
<time title="Beverly Hills, 90210" type="series" strict-time="false" time-shift="5" >11:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Cheers" type="series" strict-time="false" time-shift="5" >11:20 PM</time>
|
||||||
|
|
||||||
|
<time title="Three's Company" type="series" strict-time="false" time-shift="5" >11:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Brady Bunch" type="series" strict-time="false" time-shift="5" >11:40 PM</time>
|
||||||
|
</thursdays>
|
||||||
|
<fridays>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:00 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:30 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:00 AM</time>
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:30 AM</time>
|
||||||
|
|
||||||
|
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:00 AM</time>
|
||||||
|
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:30 AM</time>
|
||||||
|
|
||||||
|
<time title="macgyver" type="series" strict-time="false" time-shift="5" >11:00 AM</time>
|
||||||
|
|
||||||
|
<time title="boy meets world" type="series" strict-time="false" time-shift="5" >12:00 PM</time>
|
||||||
|
|
||||||
|
<time title="full house" type="series" strict-time="false" time-shift="5" >12:30 PM</time>
|
||||||
|
<time title="full house" type="series" strict-time="false" time-shift="5" >1:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Wonder Years" type="series" strict-time="false" time-shift="5" >1:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Simpsons" type="series" strict-time="false" time-shift="5" >2:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Monk" type="series" strict-time="false" time-shift="5" >2:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >3:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Fresh Prince of Bel-Air" type="series" strict-time="false" time-shift="5" >3:30 PM</time>
|
||||||
|
|
||||||
|
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >4:00 PM</time>
|
||||||
|
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >4:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Roseanne" type="series" strict-time="false" time-shift="5" >5:00 PM</time>
|
||||||
|
<time title="Roseanne" type="series" strict-time="false" time-shift="5" >5:30 PM</time>
|
||||||
|
|
||||||
|
<time title="seinfeld" type="series" strict-time="false" time-shift="5" >6:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Parker Lewis Can't Lose" type="series" strict-time="false" time-shift="5" >6:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >7:00 PM</time>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Here is an example of a day specific block. TGIF 90's style...
|
||||||
|
-->
|
||||||
|
<time title="Sabrina The Teenage Witch" type="series" strict-time="true" time-shift="1" >8:00 PM</time>
|
||||||
|
<time title="Boy Meets World" type="series" strict-time="false" time-shift="1" >8:20 PM</time>
|
||||||
|
<time title="Family Matters" type="series" strict-time="false" time-shift="1" >8:40 PM</time>
|
||||||
|
<time title="Family Matters" type="series" strict-time="false" time-shift="1" >9:00 PM</time>
|
||||||
|
|
||||||
|
<!-- - -->
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >9:30 PM</time>
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >9:40 PM</time>
|
||||||
|
<time title="Blossom" type="series" strict-time="false" time-shift="5" >10:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Frasier" type="series" strict-time="false" time-shift="1" >10:20 PM</time>
|
||||||
|
|
||||||
|
<time title="Mad About You" type="series" strict-time="false" time-shift="5" >10:30 PM</time>
|
||||||
|
<time title="Mad About You" type="series" strict-time="false" time-shift="5" >10:40 PM</time>
|
||||||
|
|
||||||
|
<time title="M*A*S*H" type="series" strict-time="false" time-shift="5" >10:50 PM</time>
|
||||||
|
|
||||||
|
<time title="Beverly Hills, 90210" type="series" strict-time="false" time-shift="5" >11:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Cheers" type="series" strict-time="false" time-shift="5" >11:20 PM</time>
|
||||||
|
|
||||||
|
<time title="Three's Company" type="series" strict-time="false" time-shift="5" >11:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Brady Bunch" type="series" strict-time="false" time-shift="5" >11:40 PM</time>
|
||||||
|
|
||||||
|
</fridays>
|
||||||
|
<saturdays>
|
||||||
|
<!--
|
||||||
|
Here is an example of using the xtra attr to specify a saturday late-afternoon 80's movie block.
|
||||||
|
-->
|
||||||
|
<time title="random" type="movie" strict-time="false" time-shift="5" xtra="decade:1980">5:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Elementary" type="show" strict-time="false" time-shift="5" >7:00 PM</time>
|
||||||
|
|
||||||
|
</saturdays>
|
||||||
|
<sundays>
|
||||||
|
<!--
|
||||||
|
Here is an example of using the xtra attr to specify a sunday late-afternoon romantic comedy movie block.
|
||||||
|
-->
|
||||||
|
<time title="random" type="movie" strict-time="false" time-shift="5" xtra="genre:comedy,romance">5:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Sherlock" type="show" strict-time="false" time-shift="5" >7:00 PM</time>
|
||||||
|
|
||||||
|
</sundays>
|
||||||
|
<weekends>
|
||||||
|
<!--
|
||||||
|
I am incrementing the start times by about 30 minutes. Since times will shift with a
|
||||||
|
5 minute "time-shift", the app will adjust the schedule according to the episode
|
||||||
|
duration / time-shift value.
|
||||||
|
-->
|
||||||
|
<time title="The Smurfs" type="series" strict-time="false" time-shift="5" >7:00 AM</time>
|
||||||
|
|
||||||
|
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >7:30 AM</time>
|
||||||
|
|
||||||
|
<time title="Batman" type="series" strict-time="false" time-shift="5" >8:00 AM</time>
|
||||||
|
|
||||||
|
<time title="random" type="movie" strict-time="false" time-shift="5" xtra="genre:comedy">8:30 AM</time>
|
||||||
|
|
||||||
|
<time title="The Adventures of Pete & Pete" type="series" strict-time="false" time-shift="5" >10:00 AM</time>
|
||||||
|
|
||||||
|
<time title="Gilligan's Island" type="series" strict-time="false" time-shift="5" >10:30 AM</time>
|
||||||
|
|
||||||
|
<time title="The Jetsons" type="series" strict-time="false" time-shift="5" >11:00 AM</time>
|
||||||
|
|
||||||
|
<time title="Blossom" type="series" strict-time="false" time-shift="5" >11:30 AM</time>
|
||||||
|
|
||||||
|
<time title="Clarissa Explains It All" type="series" strict-time="false" time-shift="5" >12:00 AM</time>
|
||||||
|
|
||||||
|
<time title="random" type="movie" strict-time="false" time-shift="5" xtra="genre:action decade:1990,1980,1970,1960">12:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Wonder Years" type="series" strict-time="false" time-shift="5" >2:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Simpsons" type="series" strict-time="false" time-shift="5" >2:30 PM</time>
|
||||||
|
|
||||||
|
<time title="Monk" type="series" strict-time="false" time-shift="5" >3:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Married... with Children" type="series" strict-time="false" time-shift="5" >3:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Fresh Prince of Bel-Air" type="series" strict-time="false" time-shift="5" >4:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Arrested Development" type="series" strict-time="false" time-shift="5" >4:30 PM</time>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Here I am leaving some room for saturdays/sundays specific content. I will keep strict-time false for all my
|
||||||
|
times so I can squeeze in as much content into my schedule without cutting anything off. If you choose to
|
||||||
|
use strict-time, then it's important to make sure you have left a good amount of room so scheduled content
|
||||||
|
doesn't get cutoff.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<time title="Beverly Hills, 90210" type="show" strict-time="false" time-shift="5" >8:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Daria" type="show" strict-time="false" time-shift="5" >9:00 PM</time>
|
||||||
|
|
||||||
|
<time title="The Scooby-Doo Show" type="show" strict-time="false" time-shift="5" >9:30 PM</time>
|
||||||
|
|
||||||
|
<time title="The Flintstones" type="show" strict-time="false" time-shift="5" >10:00 PM</time>
|
||||||
|
|
||||||
|
<time title="Happy Days" type="show" strict-time="false" time-shift="5" >10:30 PM</time>
|
||||||
|
|
||||||
|
</weekends>
|
||||||
|
<weekdays>
|
||||||
|
|
||||||
|
</weekdays>
|
||||||
|
</schedule>
|
||||||
@@ -1,29 +1,29 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""
|
||||||
Created on Thu Jun 28 22:59:57 2018
|
Created on Thu Jun 28 22:59:57 2018
|
||||||
|
|
||||||
@author: Matt
|
@author: Matt
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pseudo_config import plexLibraries as local_commercials
|
from pseudo_config import plexLibraries as local_commercials
|
||||||
|
|
||||||
commercials = local_commercials["Commercials"]
|
commercials = local_commercials["Commercials"]
|
||||||
movies = local_commercials["Movies"]
|
movies = local_commercials["Movies"]
|
||||||
tvs = local_commercials["TV Shows"]
|
tvs = local_commercials["TV Shows"]
|
||||||
|
|
||||||
commercials_file = open('Commercial_Libraries.txt','w')
|
commercials_file = open('Commercial_Libraries.txt','w')
|
||||||
movies_file = open('Movie_Libraries.txt','w')
|
movies_file = open('Movie_Libraries.txt','w')
|
||||||
tvs_file = open('TV_Libraries.txt','w')
|
tvs_file = open('TV_Libraries.txt','w')
|
||||||
for commercial in commercials:
|
for commercial in commercials:
|
||||||
commercials_file.write(commercial + '\n')
|
commercials_file.write(commercial + '\n')
|
||||||
for movie in movies:
|
for movie in movies:
|
||||||
movies_file.write(movie + '\n')
|
movies_file.write(movie + '\n')
|
||||||
for tv in tvs:
|
for tv in tvs:
|
||||||
tvs_file.write(tv + '\n')
|
tvs_file.write(tv + '\n')
|
||||||
|
|
||||||
commercials_file.close()
|
commercials_file.close()
|
||||||
movies_file.close()
|
movies_file.close()
|
||||||
tvs_file.close()
|
tvs_file.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,91 +1,91 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# file: startstop.sh
|
# file: startstop.sh
|
||||||
|
|
||||||
#----
|
#----
|
||||||
# Simple script to start / stop a python script in the background.
|
# Simple script to start / stop a python script in the background.
|
||||||
#----
|
#----
|
||||||
|
|
||||||
#----
|
#----
|
||||||
# To Use:
|
# To Use:
|
||||||
# Just run: "./startstop.sh". If the process is running it will stop it or it will start it if not.
|
# Just run: "./startstop.sh". If the process is running it will stop it or it will start it if not.
|
||||||
#----
|
#----
|
||||||
|
|
||||||
#----BEGIN EDITABLE VARS----
|
#----BEGIN EDITABLE VARS----
|
||||||
|
|
||||||
SCRIPT_TO_EXECUTE_PLUS_ARGS='PseudoChannel.py -m -r'
|
SCRIPT_TO_EXECUTE_PLUS_ARGS='PseudoChannel.py -m -r'
|
||||||
|
|
||||||
OUTPUT_PID_FILE=running.pid
|
OUTPUT_PID_FILE=running.pid
|
||||||
|
|
||||||
OUTPUT_PID_PATH=.
|
OUTPUT_PID_PATH=.
|
||||||
|
|
||||||
PYTHON_TO_USE="$(which python)"
|
PYTHON_TO_USE="$(which python)"
|
||||||
|
|
||||||
# If using 'virtualenv' with python, specify the local virtualenv dir.
|
# If using 'virtualenv' with python, specify the local virtualenv dir.
|
||||||
VIRTUAL_ENV_DIR="env"
|
VIRTUAL_ENV_DIR="env"
|
||||||
|
|
||||||
#----END EDITABLE VARS-------
|
#----END EDITABLE VARS-------
|
||||||
|
|
||||||
# If virtualenv specified & exists, using that version of python instead.
|
# If virtualenv specified & exists, using that version of python instead.
|
||||||
if [ -d "$VIRTUAL_ENV_DIR" ]; then
|
if [ -d "$VIRTUAL_ENV_DIR" ]; then
|
||||||
|
|
||||||
PYTHON_TO_USE="$VIRTUAL_ENV_DIR/bin/python"
|
PYTHON_TO_USE="$VIRTUAL_ENV_DIR/bin/python"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the .pid file doesn't exist (let's assume no processes are running)...
|
# If the .pid file doesn't exist (let's assume no processes are running)...
|
||||||
if [ ! -e "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE" ]; then
|
if [ ! -e "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE" ]; then
|
||||||
|
|
||||||
# If the running.pid file doesn't exists, create it, start PseudoChannel.py and add the PID to it.
|
# If the running.pid file doesn't exists, create it, start PseudoChannel.py and add the PID to it.
|
||||||
"$PYTHON_TO_USE" ./$SCRIPT_TO_EXECUTE_PLUS_ARGS > /dev/null 2>&1 & echo $! > "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE"
|
"$PYTHON_TO_USE" ./$SCRIPT_TO_EXECUTE_PLUS_ARGS > /dev/null 2>&1 & echo $! > "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE"
|
||||||
|
|
||||||
echo "Started $SCRIPT_TO_EXECUTE_PLUS_ARGS @ Process: $!"
|
echo "Started $SCRIPT_TO_EXECUTE_PLUS_ARGS @ Process: $!"
|
||||||
|
|
||||||
sleep .7
|
sleep .7
|
||||||
|
|
||||||
echo "Created $OUTPUT_PID_FILE file in $OUTPUT_PID_PATH dir"
|
echo "Created $OUTPUT_PID_FILE file in $OUTPUT_PID_PATH dir"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
# If the running.pid exists, read it & try to kill the process if it exists, then delete it.
|
# If the running.pid exists, read it & try to kill the process if it exists, then delete it.
|
||||||
the_pid=$(<$OUTPUT_PID_PATH/$OUTPUT_PID_FILE)
|
the_pid=$(<$OUTPUT_PID_PATH/$OUTPUT_PID_FILE)
|
||||||
|
|
||||||
rm "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE"
|
rm "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE"
|
||||||
|
|
||||||
echo "Deleted $OUTPUT_PID_FILE file in $OUTPUT_PID_PATH dir"
|
echo "Deleted $OUTPUT_PID_FILE file in $OUTPUT_PID_PATH dir"
|
||||||
|
|
||||||
echo "kill: $the_pid"
|
echo "kill: $the_pid"
|
||||||
|
|
||||||
kill "$the_pid"
|
kill "$the_pid"
|
||||||
|
|
||||||
COUNTER=1
|
COUNTER=1
|
||||||
|
|
||||||
while [ -e /proc/$the_pid ]
|
while [ -e /proc/$the_pid ]
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|
||||||
echo "$SCRIPT_TO_EXECUTE_PLUS_ARGS @: $the_pid is still running"
|
echo "$SCRIPT_TO_EXECUTE_PLUS_ARGS @: $the_pid is still running"
|
||||||
|
|
||||||
sleep .7
|
sleep .7
|
||||||
|
|
||||||
COUNTER=$[$COUNTER +1]
|
COUNTER=$[$COUNTER +1]
|
||||||
|
|
||||||
if [ $COUNTER -eq 20 ]; then
|
if [ $COUNTER -eq 20 ]; then
|
||||||
|
|
||||||
kill -9 "$the_pid"
|
kill -9 "$the_pid"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $COUNTER -eq 40 ]; then
|
if [ $COUNTER -eq 40 ]; then
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "$SCRIPT_TO_EXECUTE_PLUS_ARGS @: $the_pid has finished"
|
echo "$SCRIPT_TO_EXECUTE_PLUS_ARGS @: $the_pid has finished"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
Reference in New Issue
Block a user