Results 1 to 4 of 4

Thread: an enigmatic script intended to reactivate computer

  1. #1

    Default an enigmatic script intended to reactivate computer

    My earlier thread on this (under "64-bit") has gone cold, and perhaps it was misplaced -- but please refer there for history. With others' help I think I am on the right trail -- a perl script that becomes active when the machine goes inactive (!) and executes an rtcwake command designed to spur the computer into action at a designated time so that cron tasks are performed. The script, which is given below and which originated at a Ubuntu forum, is not working, and so I am trying to understand it. Not being familiar with perl, I'm stuck at the line containing the test if(m/^\s+boolean true/){ ... what does this mean? Thanks, jdw

    Code:
    #!/usr/bin/perl
    my $cmd = "dbus-monitor --session \"type='signal',interface='org.gnome.ScreenSaver', member='SessionIdleChanged'\"";
    while (<IN>) {
    if (m/^\s+boolean true/) {
    system("/usr/sbin/rtcwake -m mem -t $(date --date=01:00:00 +%s)");
    system("/usr/sbin/rtcwake -m mem -t $(date --date=05:00:00 +%s)");
    system("/usr/sbin/rtcwake -m mem -t $(date --date=10:00:00 +%s)");
    system("/usr/sbin/rtcwake -m mem -t $(date --date=15:00:00 +%s)");
    } elsif (m/^\s+boolean false/) {
    system("echo Issued a wake-up reminder to ensure scheduled crontab jobs run");
    }
    }

  2. #2
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: an enigmatic script intended to reactivate computer

    On 2011-03-30 00:36, j1d1w1 wrote:
    > Not
    > being familiar with perl, I'm stuck at the line containing the test
    > if(m/^\s+boolean true/){ ... what does this mean? Thanks, jdw


    There is a forum here dedicated to programming, you should ask there.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  3. #3

    Default Re: an enigmatic script intended to reactivate computer

    Thanks Carlos. I'm not sure where specifically you mean. I do see several sub-forums in the forum named "Get Technical Help Here" that mention "software" but its not clear to me which is most suitable. Cheers, jdw

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: an enigmatic script intended to reactivate computer

    On 2011-03-30 20:06, j1d1w1 wrote:
    >
    > Thanks Carlos. I'm not sure where specifically you mean. I do see
    > several sub-forums in the forum named "Get Technical Help Here" that
    > mention "software" but its not clear to me which is most suitable.



    http://forums.opensuse.org/forums/en...ing-scripting/

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •