March 7, 20197 yr 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!
March 7, 20197 yr 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.
March 7, 20197 yr Author @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, 20197 yr by ShoGinn fixed the TODO
November 18, 20205 yr @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!
November 18, 20205 yr Author 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
November 18, 20205 yr Author 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
November 19, 20205 yr 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.
Archived
This topic is now archived and is closed to further replies.