How to start with scripts?

nasnice

Explorer
Joined
Jul 14, 2014
Messages
82
Good evening all,
Am trying to start with using scripts but miss some start info.
My goal is to use the fan control script (the spinscripts from the resources section) on my Supermicro Freenas server (chassis and X10 board).

Having a number of questions...
  1. Can I store the scripts in the jail directory that was autocreated by Freenas 11.1-U7 on the root of the first pool?
  2. What is the proper way to transfer them there, with ssh shell copy commands?
  3. How to start these scripts, just by calling them in the webGUI shell?
  4. How to automate startup, or how to execute a script post system initialization?
Searched a lot and sure enough read numerous times how to start a script from ssh, is webGUI the same?

I am @ a loss where to start reading... hope anyone can point me in the right direction..
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Can I store the scripts in the jail directory that was autocreated by Freenas 11.1-U7 on the root of the first pool?
You really shouldn't--that's for the exclusive use of the jails system. Put it just about anywhere else on your pool, but not there.
What is the proper way to transfer them there, with ssh shell copy commands?
There really is no "proper" way to do it. The simplest way to do it in most cases (since in most cases the scripts in question are in GitHub repos) is to change to wherever you want them to live and run git clone https://github.com/foo/bar (with the specific address typically being given in the documentation). If that isn't an option, you can create a shared directory on your FreeNAS box, download the script on one of your client machines, and copy it to the share. Or download it to the client machine and use scp to put it there. Or, if it's fairly small, paste it into nano on the FreeNAS box. Or no doubt many other methods I'm missing.
How to start these scripts, just by calling them in the webGUI shell?
Don't use the webGUI shell for anything. If you need shell access, ssh into your machine. To start the scripts to run once, ssh in to your machine and run them from there. If you want them to run on a schedule, you'd need to set up a cron task for that--see the manual.
How to automate startup, or how to execute a script post system initialization?
This can be set through the GUI--again, see the manual.
Searched a lot and sure enough read numerous times how to start a script from ssh, is webGUI the same?
Kind of, but much crappier. Don't use the webGUI "shell" button at all if you can help it.
 

nasnice

Explorer
Joined
Jul 14, 2014
Messages
82
@Redcoat thank you... just what i needed to read!
@danb35 thank you for the pointers...

Off to read....
 
Joined
Jan 4, 2014
Messages
1,644
Top