|
SageTV for unRAID/Docker Discussion related to SageTV for unRAID/Docker. Questions, issues, problems, suggestions, etc. relating to SageTV for unRAID/Docker should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Adding a custom script during startup
While the docker container tries to do many things, it's likely that there are configurations that will require extra tweaking.
During startup if the following script exists in the SAGE_HOME (ie, root of the sagetv server) then it will get executed. Code:
sagetv-user-script.sh Code:
/opt/sagetv/server/sagetv-user-script.sh 1. Must have a script header like Code:
#!/bin/bash Code:
# chmod 775 sagetv-user-script.sh So, using the "sagetv-user-script.sh", you can do whatever you want BEFORE sagetv is started.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#2
|
|||
|
|||
Does SageTV wait for this script to complete before executing or does it execute SageTV concurrently with this script? Let's say I wanted to use a SageTV startup script to restart my HD-PVRs. If I ran the script to do a power cycle and then waited 10 seconds (or longer) would I be good?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#3
|
||||
|
||||
Quote:
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#4
|
|||
|
|||
Ok then I think this could be a good way to restart my HD-PVRs rather than using a cron job that runs during the weekly backup process described here.
On a related note - what is the easiest way to have SageTV trigger a SageTV system message when the service restarts? I use your notification plugin so this way I will see when this happens.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#5
|
|||
|
|||
Quote:
|
#6
|
|||
|
|||
I can share it but unless you have the same hardware, which in my case is a Digital Loggers web controlled power switch, then it won't be of any use to you. How to you plan to switch the power on and off?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#7
|
|||
|
|||
My fault, I was thinking you were telling them to reboot directly over the HD-PVR USB connection. I might be able to do it with my UPS. I'll look into it. Thanks.
|
#8
|
|||
|
|||
What user does this script run as?
__________________
Running SageTV on unRAID via Docker Tuning handled by HDHR3-6CC-3X2 using OpenDCT |
#9
|
||||
|
||||
It runs as sagetv. It also takes care of the ownerships and file format (ie, settting it properly) before running it.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#10
|
|||
|
|||
So I want to run a script that uses the telnet command. But telnet does not exist in the docker. I was able to manually install it with apt-get update and apt-get install telnet.
Will Linux commands installed by the end user within a docker get deleted (I am guessing that they will)? What causes them to get deleted? Can I request that telnet be added to the core sagetv docker builds? The reason is that telnet can be used to start or stop sagetv extenders.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#11
|
|||
|
|||
Quote:
But not being familiar with the inner workings of docker containers, I am also wondering if the sagetv-user-script.sh will be deleted or overlaid at some point by an update to the docker image. Also, I am not sure where the best place is to locate the python script that actually performs the power on function, so that it also does not go missing at some point in the future. Any docker gurus out there that could offer any guidance?
__________________
Server: MSI Z270 SLI Plus ATX Motherboard, Intel i7-7700T CPU, 32GB Memory, Unraid 6.11.5, sagetvopen-sagetv-server-opendct-java11 Docker (version 2.0.7) Tuners: 2 x SiliconDust HDHomeRun Prime Cable TV Tuners, SiliconDust HDHomeRun CONNECT 4K OTA Tuner Clients: Multiple HD300 Extenders, Multiple Fire TV Stick 4K Max w/MiniClient Miscellaneous: Multiple Sony RM-VLZ620 Universal Remote Controls |
#12
|
|||
|
|||
I am guessing that something else added Python to your docker as I am pretty sure that it is not installed by default. I am also pretty sure that the sagetv-user-script.sh should not be deleted by a docker upgrade as that was created by stuckless who built the docker and created the idea for this script.
You are probably responding because you read my other thread, but in case you haven't check out this thread that I created a few weeks ago. https://forums.sagetv.com/forums/showthread.php?t=66696
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#13
|
|||
|
|||
I did see your other thread, but I was looking for a solution that did not require installing additional software. Sure wish I knew how Python made it's way into my docker. In any case, I will use it to my advantage.
I ended up figuring out how to put inline Python code into a bash script, so now my sagetv-user-script.sh is all I need to power up all of my extenders. I am not using your trick to put a 30 second delay prior to attempting to power up the extender, the extender keeps looking for the server and once it gets a response, completes the connection and goes to the home screen.
__________________
Server: MSI Z270 SLI Plus ATX Motherboard, Intel i7-7700T CPU, 32GB Memory, Unraid 6.11.5, sagetvopen-sagetv-server-opendct-java11 Docker (version 2.0.7) Tuners: 2 x SiliconDust HDHomeRun Prime Cable TV Tuners, SiliconDust HDHomeRun CONNECT 4K OTA Tuner Clients: Multiple HD300 Extenders, Multiple Fire TV Stick 4K Max w/MiniClient Miscellaneous: Multiple Sony RM-VLZ620 Universal Remote Controls |
#14
|
|||
|
|||
I had originally written this script in Python but then I realized that this would required Python to be installed in the docker - which I didn't think you had. That is why I rewrote it as a shell script, but then realized that you may now have to install telnet since that isn't installed in the pared down linux commands available in the docker.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding custom main menu item -Video Folder or Category | wado1971 | SageTV v7 Customizations | 0 | 08-10-2010 02:58 PM |
Adding a custom filter to Sage Movie Wall | medwynd | SageMC Custom Interface | 0 | 04-25-2010 10:08 AM |
Adding custom command for launching external program | dinki | SageMC Custom Interface | 14 | 01-22-2010 08:16 AM |
TIP: Adding automatic Wiz.bin backup to startup | laurenglenn | SageTV Linux | 5 | 03-31-2006 11:52 AM |
Adding a pause during close in custom xml menu... | n3w813 | SageTV Customizations | 2 | 05-16-2005 01:37 PM |