Author Topic: Execute shell-script using a scenario  (Read 1450 times)

aico

  • Veteran
  • ***
  • Posts: 74
    • View Profile
Execute shell-script using a scenario
« on: September 28, 2010, 07:22:21 am »
Hi,

first of all - all developers did a great job - LinuxMCE is the best peace of software - Thanks

At the moment i have in use or is planed:
1x Core/Hybrid - with two squeezeslaves - works great
1x Cisco 7970 - works great
1x MD - Asus EeeBook - Bedroom - works great
1x Eken M002 with WebOrbiter 2.0 - works great
1x MD for the Kitchen - not built
1x MD for the Bathroom - not built

Also in process is doing a template and ruby-code for the Biticino bus-system (light, climate, audio)

And now i whant to execute a shell-script using a scenario button - is this possible?
Is it also possible to shutdown the Eken M002 by sending the House to sleep-mode?

Regards
Johannes

sambuca

  • Guru
  • ****
  • Posts: 449
    • View Profile
Re: Execute shell-script using a scenario
« Reply #1 on: September 28, 2010, 08:54:13 am »
Hi,

I think the AppServer device can run arbitrary commands like shell scripts. Just send the Spawn Application command to the app server on the core/md you want to execute the shell script.
There might be various reasons to do so, but if you tell us what you are trying to do, maybe there is a better way than running shell scripts?

As the Eken only runs the weborbiter, we have virtually no control of it. Its not like the browser provides a way for a website to shut down the device it runs on. It could maybe be possible on a device that runs a native orbiter..

best regards,
sambuca

aico

  • Veteran
  • ***
  • Posts: 74
    • View Profile
Re: Execute shell-script using a scenario
« Reply #2 on: September 29, 2010, 06:35:50 am »
Hi sambuca,

yes you are right, the Eken runs as WbOrbiter. But i am looking arround to find some information to shutdown the Eken remote using e.g. a ssh connection or a Android App to control the Eken with the Core.

My installation looks like this:
In my bus-system there is a switch (I call it Party-Mode). On the Core I have a shell-script running (deamon) that checks two things every minute. First it checks the time. If it is not 10:00pm the script will exit. If it is 10:00pm or later it also checks the "Party-Mode" switch. If the "Party-Mode" switch ist pressed the script exits doing nothing. If the "Party-Mode" is turned off, the script starts to do a fiew things - e.g. turn off all audio components (bus-system), turn off all lights (bus-system), shutdown the Eken WebOrbiter, shutdown all MD's... May be it is possible to execute a LinuxMCE scenario (I do not know this).

One idea is to execute a shell script to shutdown the Eken via WLan.

Best Redars,
Johannes

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5505
  • DOES work for LinuxMCE.
    • View Profile
Re: Execute shell-script using a scenario
« Reply #3 on: September 29, 2010, 06:47:30 am »
Ew bro. You're all duct tape.

Why don't you actually learn DCE? Will make your life a lot simpler in the long run.

-Thom

aico

  • Veteran
  • ***
  • Posts: 74
    • View Profile
Re: Execute shell-script using a scenario
« Reply #4 on: September 29, 2010, 07:51:06 am »
Hi Tom,

where do I find some information about DCE - the LinuxMCE Wiki does not tell very much about it...

Thanks
Johannes

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3059
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Execute shell-script using a scenario
« Reply #5 on: September 29, 2010, 07:54:26 am »
http://lmgtfy.com?q=dce+site:wiki.linuxmce.org

will get you quite a few hits...

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5505
  • DOES work for LinuxMCE.
    • View Profile
Re: Execute shell-script using a scenario
« Reply #6 on: September 29, 2010, 07:55:26 am »
Wiki, search for Developers Guide.

also look for DCEGen, and sql2cpp

-Thom

aico

  • Veteran
  • ***
  • Posts: 74
    • View Profile
Re: Execute shell-script using a scenario
« Reply #7 on: September 29, 2010, 08:00:59 am »
Hi posde, Hi Tom,

thanks - this will be a very hard peace of work (for me) - but we will see...

Regards
Johannes

sambuca

  • Guru
  • ****
  • Posts: 449
    • View Profile
Re: Execute shell-script using a scenario
« Reply #8 on: September 29, 2010, 01:17:35 pm »
My installation looks like this:
In my bus-system there is a switch (I call it Party-Mode). On the Core I have a shell-script running (deamon) that checks two things every minute. First it checks the time. If it is not 10:00pm the script will exit. If it is 10:00pm or later it also checks the "Party-Mode" switch. If the "Party-Mode" switch ist pressed the script exits doing nothing. If the "Party-Mode" is turned off, the script starts to do a fiew things - e.g. turn off all audio components (bus-system), turn off all lights (bus-system), shutdown the Eken WebOrbiter, shutdown all MD's... May be it is possible to execute a LinuxMCE scenario (I do not know this).

If you create a driver for this installation bus in LMCE, all this (and more) could easily be set up using different events and scenarios.

best regards,
sambuca