WIP WIP: Addons to control NAS
#1
First one is an addon I made about 6 months ago. It's a simple toggle type script. Basically, if you have a NAS or home server with your media on it, this addon can power the server on and off for you. For shutting down it does require that you have an ssh key set up, and that you have your server set up so that the user can sudo shutdown commands without password. For powering on it does require that your server/NAS accept WoL.
https://github.com/Dalton63841/script.nas.power

The second one, is one I just made and finished last night, but so far everything is working as it should. When you run this one, it will pop up a dialog asking if you want to power on/off, or send a command. Clicking Power On/Off does exactly the same thing as the first addon. Clicking Send a Command will pop up the on screen keyboard, where you can type a one-line command(exactly as you would type it in terminal). When you click Done, it will execute that command on your NAS over ssh, and then a text window will pop up showing any stdout/stderr that results from the command.
https://github.com/Dalton63841/script.nas.remote

Just install the zip file, go into the addons settings, and put in the username, IP address, and mac address of your home server/NAS, and if you use a command that is not "sudo shutdown -h now" to shut down, you can change the command there too.(halt, pm-suspend, etc...)

***Fairly certain this will only work on Linux/Mac operating systems, as it uses ssh and cat as shell commands. It also currently assumes that the ssh port is the default (22), but I'm fixing that soon. Also, there is currently very little in the way of error handling. I will be fixing that too, but it doesn't seem to be presenting an issue so far.

***I am just barely learning python, so any constructive criticism is VERY welcome!
Reply

Logout Mark Read Team Forum Stats Members Help
WIP: Addons to control NAS0