Help with Script

Associate
Joined
25 Jul 2004
Posts
2,052
Location
Aberdeen
I've never actually written a script in Linux before so having some trouble getting this working. I'm writing a script that gets run by SABnzbd+ when a download has finished. I'm hoping to restart the service Ushare.
This is what I have got so far

#!/bin/bash
service ushare restart
echo "Script has been run"

Now for some reason unknown to me it isn't working.
These commands work fine by themself when run directly in the terminal by me.
I can't even run the script myself in the terminal though?
Any help would be great.
 
First off, have you made the script executable by running
chmod +x scriptname.sh

If you've done that, does your usre have permission to restart the deamon? If not you might need to run the script as root.
 
I have set the script to executable, but have yet to check if the user has permission to restart, thanks for the idea!

*edit*
Aha! The user does not have permission to restart the service!
 
Ok going to be a bit more difficult than I thought to get this working, I want this to run without any user having to type passwords in. Any ideas on how I can get the user to restart the service then?
 
Back
Top Bottom