[Solved] See last post for solution. THANK YOU grail!
OS: FreeNAS 0.7.1 (or later)
Goal: Create a small script that could download a file based on text pulled from another file and give user options on what version.
There is a file that is on the web:
Structure looks like this (just simple basic text):
The download links for each individual file look like this:
I am creating a script to install the package with the 4 options:
1) Upgrade/Install SABnzbd 0.5.0 (test good)
2) Upgrade/Install latest STABLE SABnzbd %variable1%
3) Upgrade/Install lastest BETA SABnzbd %variable2%
The script currently looks like this:
>>>snipped code - just does some prep work
echo "*******3. Downloading upgraded version of SABnzbd (0.5.0) and extracting*******"
echo "--Downloading upgraded version of SABnzbd (0.5.0)--"
#Edit the line below to get a newer version and be sure to update the cosmetic lines above
echo "--Extracting upgrade--"
tar -xzf SABnzbd*
echo "--Extracted upgrade--"
Here is what I am trying to do:
1. Have the script fetch the text file from the web.
2. Pull the #s from line 1 and line 3
3. Assign #s from line 1 to a X variable and line 3 assign to Y variable.
4. Present the user with 4 options, with two of the options displaying the variables (among other static text).
5. User selects an option that go through the script downloading the version based on the variable and option selected.
6. If option 2 is selected use this url+variableX to downlaod. If option 2 is select use differenturl+variableY to download.
Any one willing to give me a hang with syntax? I have attached my current script and will be posting my progress in some more posts.