View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 3 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Nov 30, 2008 9:49 am 
Offline
Joined: Thu Mar 02, 2006 5:42 pm
Posts: 410
Location: middleton wi usa atsc
I am trying to run a script from a button on the remote in R5.5. The script should copy a new xorg.conf over the old one and then restart X. I have assigned the script to Alt0 in /etc/X11/fluxbox/keys with:
Code:
Mod1 0 :ExecCommand sudo /home/mythtv/zig/xorgOrig.sh

Here is the script:/home/mythtv/zig/xorgOrig.sh
Code:
#!/bin/bash
cp /etc/X11/xorg.conf.lastworkinggoodmulti /etc/X11/xorg.conf
pkill xinit

The script runs fine when I press Alt0 on the keyboard. I want to run it from the remote as well so I put the script path in "sudoers" and have this in /home/mythtv/.mythtv/lircrc
Code:
begin
    prog = irexec
    button = s0
    # script to restart X with original multi monitor xorg.conf
    config = /home/mythtv/zig/xorgOrig.sh
    # config = /home/mythtv/zig/xorgOrig.sh &
end
The problem is that when I press s0 on the remote the "cp" command is ignored but "pkill xinit" is executed. Why would one line be run and another line ignored? Especially when the script works ok from the keyboard?

(also not sure what the & does, but I saw it in an example and tried it with and without to no avail)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 30, 2008 11:05 am 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 1116
Location: SC
I believe it is failing because lirc is running as user mythtv and you forgot to put sudo in your config line of the lircrc file:
Code:
config = sudo /home/mythtv/zig/xorgOrig.sh


Britney


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 30, 2008 12:24 pm 
Offline
Joined: Thu Mar 02, 2006 5:42 pm
Posts: 410
Location: middleton wi usa atsc
Thanks, Britney! Worked like a charm! I thought that putting the script into "sudoers" took care of that. Now I"m wondering if it needs to be in "sudoers" at all?
Thanks again,
Ziggy


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu