<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><div class=WordSection1><div><div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1F497D'>//snip//</span><o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I made some changes, but I don't think I "chmod" ed properly:<o:p></o:p></p></div><div><p class=MsoNormal> daryl@daryl-A780L3C:~$ cd /usr/local/bin<o:p></o:p></p></div><div><p class=MsoNormal>daryl@daryl-A780L3C:/usr/local/bin$ ls -al<o:p></o:p></p></div><div><p class=MsoNormal>total 20<o:p></o:p></p></div><div><p class=MsoNormal>drwxr-xr-x 2 root root 4096 Aug 13 13:55 .<o:p></o:p></p></div><div><p class=MsoNormal>drwxr-xr-x 10 root root 4096 Feb 13 17:07 ..<o:p></o:p></p></div><div><p class=MsoNormal>-rwxrwxr-x 1 root root 486 Aug 12 15:10 change-channel.sh<o:p></o:p></p></div><div><p class=MsoNormal>-rwxrwxr-x 1 root root 2088 Aug 12 14:13 change-channel.sh~<o:p></o:p></p></div><div><p class=MsoNormal>-rw-r--r-- 1 root root 1590 Aug 13 13:55 check_stb<o:p></o:p></p></div><div><p class=MsoNormal>daryl@daryl-A780L3C:/usr/local/bin$ <o:p></o:p></p></div><div><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Daryl – I’m about as far away from being an expert in these things as you can be and not be still using a stone axe but will give a quick response on this one in case it helps you move to the next step. I think the ‘</span>rw-r--r--<span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>’ next to the ‘</span>check_stb<span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>’ means:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>rw- (first group of 3 characters) owner (root) can read and write but not execute<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>r-- second group of 3 characters) group (root) can read but not write or execute<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>r--(third grouping of 3 characters) other can read but not write or execute<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>To change the permissions of owner to allow it to execute would need to:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>chmod 744 /usr/local/bin/check_stb<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>This should give ‘</span>rwxr--r--<span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>’ but would need to execute the file as owner (root) in your case most likely using sudo.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Note for me chmod can also only be run by superuser so I need to preface with sudo and then enter password, you might need to do the same:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>sudo chmod 744 /usr/local/bin/check_stb<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I tend to use 755 when setting a file to execute which should give permissions of ‘</span>rwxr-xr-x<span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>’. If the script is going to be called by other users (for example the mythtv user) then that would probably be recommended.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>sudo chmod 755 /usr/local/bin/check_stb<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You should then be able to execute as per the original command below.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>//snip//<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal>To test the script, you can simply run it manually from a terminal<br>prompt:<br><br> /usr/local/bin/check_stb<o:p></o:p></p></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>results of test:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> daryl@daryl-A780L3C:/usr/local/bin$ cd ~<o:p></o:p></p></div><div><p class=MsoNormal>daryl@daryl-A780L3C:~$ /usr/local/bin/check_stb<o:p></o:p></p></div><div><p class=MsoNormal>bash: /usr/local/bin/check_stb: Permission denied<o:p></o:p></p></div><div><p class=MsoNormal>daryl@daryl-A780L3C:~$ sudo /usr/local/bin/check_stb<o:p></o:p></p></div><div><p class=MsoNormal>[sudo] password for daryl: <o:p></o:p></p></div><div><p class=MsoNormal>sudo: /usr/local/bin/check_stb: command not found<o:p></o:p></p></div><div><p class=MsoNormal>daryl@daryl-A780L3C:~$ <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='color:#1F497D'>//snip//</span><o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>