I tried to run your script. It ran fine except the cat command which failed with "Permission denied", even with sudo.
Not sure how to run the for loop. Can it be copy and pasted (right click) into ssh (I'm using Putty on Windows)?
My goal is the get the community packages working/available (http://packages.synocommunity.com/) in Package Center.
My SABnzbd is also failing with "Server news.usenetserver.com uses an untrusted certificate [Certificate not valid. This is most probably a server issue.]"
It would be great if someone could post