Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Lenovo SA120 Fan Control

Featured Replies

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!

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.

  • 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 by ShoGinn
fixed the TODO

  • 1 year later...

Has this docker been removed?

  • 4 months later...

@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!

  • 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

 

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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.