bostoneric wrote:not really sure how to do that?
am i ssh and "vi" the file?
here is what is currently in my file.
Code: Select all
WeighVersion() { #translates the version into a numerical "weight" that can be compared to see which version is newer
local Version=$1
local Vweight=0
Location=$(expr index $Version 'RBA')
#Test for unstable release
if [ $Location -gt 1 ]; then
#Unstable release found, weigh accordingly
Nversion=${Version:0:$Location-1} #strip the unstable part off, keep the numerical version
Vmajor=$(/bin/echo $Nversion | /usr/bin/cut -d. -f1)
Vminor=$(/bin/echo $Nversion | /usr/bin/cut -d. -f2)
Vfix=$(/bin/echo $Nversion | /usr/bin/cut -d. -f3)
let Vweight=$Vmajor*1000000+$Vminor*10000+$Vfix*100
case ${Version:$Location-1:1} in
R) #Release candidate
let Minus=${#Version}-$Location-1
let Vweight=$Vweight+80+${Version:-$Minus}
;;
B) #Beta
let Minus=${#Version}-$Location-3
let Vweight=$Vweight+40+${Version:-$Minus}
;;
A) #Alpha
let Minus=${#Version}-$Location-4
let Vweight=$Vweight+${Version:-$Minus}
;;
esac
else
#must be stable release, so
Vmajor=$(/bin/echo $Version | /usr/bin/cut -d. -f1)
Vminor=$(/bin/echo $Version | /usr/bin/cut -d. -f2)
Vfix=$(/bin/echo $Version | /usr/bin/cut -d. -f3)
let Vweight=99+$Vmajor*1000000+$Vminor*10000+$Vfix*100
fi
echo -n "$Vweight"
}
Hi Bostoneric,
If you install "Shell in a Box" from the appstore you can then access the NAS through a terminal window on your browser.
Im no expert so this is only a rough guide to editing the file, if there's anyone out there with more knowledge or spots a mistake please update the post.
1. Once the terminal window is open logon as root, password is the same as your admin password
2. Navigate your way to the file location, e.g. cd /usr/local/AppCentral/sabnzbdplus/CONTROL
3. Create a backup of the file you will be editing. e.g. cat start-stop.sh > start-stop.sh.old
4. Edit the file using "vi" e.g. vi start-stop.sh
5. Locate the WeightVersion section by using the arrow or page up / page down keys
6. To make changes in the file first press i and enter (this will initiate insert mode)
7. Make the changes to the required lines, in this case...
Insert line 5:-
let Locationm1=$Location-1
Update line 9 from :-
Nversion=${Version:0:$Location-1} #strip the unstable part off, keep the numerical version to Nversion=${Version:0:$Locationm1} #strip the unstable part off, keep the numerical version
Update line 14 from :-
case ${Version:$Location-1:1} in to case ${Version:$Locationm1:1} in
Update line 16 from :-
let Minus=${#Version}-$Location-1 to let Minus=$Location+1
Update line 17 from :-
let Vweight=$Vweight+80+${Version:-$Minus} to let Vweight=$Vweight+80+${Version:$Minus}
Update line 20 from :-
let Minus=${#Version}-$Location-3 to let Minus=$Location+3
Update line 21 from :-
let Vweight=$Vweight+40+${Version:-$Minus} to let Vweight=$Vweight+40+${Version:$Minus}
Update line 24 from :-
let Minus=${#Version}-$Location-4 to let Minus=$Location+4
Update line 25 from :-
let Vweight=$Vweight+${Version:-$Minus} to let Vweight=$Vweight+${Version:$Minus}
8. Once you've finished the changes press the ESC key to end insert mode
9. To save the changes type :w and then enter
10. To exit type :q and enter
11. Exit the shell terminal
12. Restart Sabnzbd in the appcenter.
Don't forget to the add the tag file ALL_RELEASES in the log directory (listed earlier in this thread).
I think that should do it.