Want to run a User Script by pressing a button on a website. Is this possible? (or maybe another way to trigger a script easily remotely)
My Plex EasyAudioCodec seems to corrupt often and needs to be deleted. I get texts/phone calls often about how a title won't play. The solution is always to just run this script:
#!/bin/bash echo "stopping plex container" docker stop binhex-plex echo "deleting the EasyCodec folder in appdata" sudo rm -rf /mnt/user/appdata/binhex-plex/Plex\ Media\ Server/Codecs/EasyAudioEncoder-1847-linux-x86_64/ echo "restarting Plex container" docker start binhex-plex echo "All done"
Then I'm all set and working just fine. Problem is sometimes it breaks in the middle of the day and I'm not home and I don't have time to remote in just to run a script. Is there a way I can trigger this script by pressing a button on like my own personal website or something? Or maybe a discord trigger to a bot?
If I had hair, I'd be pulling it out. The real solution is to fix whatever it corrupting my codec transcodes and ruining the audio codec but I ask questions in Discords and online forums and literally nobody understands the problem or just won't answer. So here we are.
Comments Section
I recently found OliveTin for use cases like this.
track me
How do you execute a command like rcone with OliveTin?
I am not sure what you mean. OliveTin executes arbitrary shell commands with rclone being no exception. As long as you can put it in a sh/bash script, you can make it accessible with OliveTin.
I've just been playing with olivetin, cannot get it to run any scripts, restarting docker containers fail as do running python scripts.
Hey there, I'm the author of OliveTin, I'd love to help.
It's frustrating when things don't work, but like with all other software, for you to get the best help, we need to know what the error or behaviour is that you're seeing. Try to express your help for support like; "here's my current setup, here's what I'm trying to do, here's what is actually happening instead".
Probably the easiest format of support is via discord, where OliveTin has a dedicated support channel - and chat is a much nicer way to provide support.
I have joined the discord, thank you
I have rclone installed on my server with a user script to mount a unit and sync to a share. But when i try to execute rclone inside olivetin I get a 127 error "command not found". And I would also like to start a windows vm. ¿How can i make those accessible to olivetin docker?
I'm new to unraid and i don'k now how to make a lot of things.
Is there some way you can check if it's working via command line? If so you can just make a script that does a check and if it's not working do the other stuff and have it run every 5 mins or something.
Having a custom setup to press button on the web to run it doesn't really make sense as you can just connect to a VPN and run it from the unraid UI remotely, why reinvent the wheel. But I mean if you want to I can help you set something up.
Well to be truthful I'll be taken away from internet for weeks at a time, and I want my family to be able to hit the button while I'm gone.
Ah ok, well then one way you can do this is you need to spin up an nginx container with a volume mounted to have access to the correct files that you are deleting and a portainer container, then make a PHP script in the nginx container that calls the portainer API to stop the Plex container then delete the file with PHP then call the API again to start the container. This would only be a few lines of PHP which would be easy to setup. Then make a simple website with button that calls the PHP script.
If you made your own Docker image from the nginx image and installed Docker it in you could skip using portainer and just use Docker commands directly by passing unraid Docker socket into the container but portainer is much easier to setup then learning how to build a Docker image.
Just make it run every hour or day. It's what I do and haven't had any problems