ShoGinn Posted March 7, 2019 Share Posted March 7, 2019 Good Morning! I just wanted to share my script that uses the CA User Scripts Plugin to run a docker container that can change the speed of the Lenovo SA120 DAS. https://github.com/ShoGinn/lenovo_fanspeed This is a simple script that when running in the foreground will allow you to specify the speed between 1 and 7 Why?? Loading the SG3 utils and other general overhead is not something I want to do Spinning up a docker container is easy! 1 Quote Link to comment
trurl Posted March 7, 2019 Share Posted March 7, 2019 Starting dockers from a script isn't the way it's usually done in Unraid. We have a user interface that allows you to fill in all the parts of the docker run command using a web form. In addition to making it easy to run the docker, that same web form saves the entries to make it very easy to start the docker again, reinstall the docker, or even edit the entries to change the docker run command. You can even specify an icon and other things for the container so it all integrates very well into the Unraid webUI. Quote Link to comment
ShoGinn Posted March 7, 2019 Author Share Posted March 7, 2019 (edited) @trurl Peace on that, running a docker container via Unraid is very easy, but my intent here is to make a utility script with a purpose. This is a throw away container that is 45mb in size that prevents installation of multiple pre-reqs. Making it part of the CA User Script Plugin allows for one argument to be inputed and the container is spun up, and removed never leaving a trace (but it does leave the orphaned image to be used later). I do have a TODO on this, and that is to see if I can make sure that Docker is running before this script can be run. Completed the TODO and it now checks if Docker is enabled. Edited March 7, 2019 by ShoGinn fixed the TODO Quote Link to comment
quake101 Posted June 19, 2020 Share Posted June 19, 2020 Has this docker been removed? Quote Link to comment
Ansuz Posted November 18, 2020 Share Posted November 18, 2020 @ShoGinn - Would it be possible for you to provide the Dockerfile to build this image locally? It was really useful for us, so even if you don't want to maintain it on DockerHub (which I completely get) it would be super helpful to be able to still build it. Thanks a million! Quote Link to comment
ShoGinn Posted November 18, 2020 Author Share Posted November 18, 2020 I had removed this due to its lack of interest.. I should have archive it.. but here is the source (not docker file) but should be easy reverse engineer https://github.com/AndrewX192/lenovo-sa120-fanspeed-utility Quote Link to comment
ShoGinn Posted November 18, 2020 Author Share Posted November 18, 2020 Then if you are super nerdy, you can do the user script: #!/bin/bash #description=Starts a docker container to set the lenovo fan speed #argumentDescription=Fan speed from 1-7 #argumentDefault=1 if grep -xq DOCKER_ENABLED=\"yes\" /boot/config/docker.cfg then echo "Spinning up the container to set the fan speed at:" $1 echo "This may take a awhile" docker run \ --rm \ $(for dev in /dev/sg*; do echo -n "--device $dev:$dev "; done) \ shoginn/docker-lenovo-fancontrol:latest \ ./fancontrol.py $1 else echo "Enable Docker to use this script" fi Quote Link to comment
Ansuz Posted November 19, 2020 Share Posted November 19, 2020 Thanks. I ended up just installing python and sg3 on the unRaid host and messed with the script to call fancontrol.py rather than spin up the docker - never could figure out how to build the image myself. Either way, thanks for responding. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.