maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting) (https://talk.maemo.org/showthread.php?t=46594)

Spotfist 2010-08-12 13:38

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
isn't sleep like a wait cammand? thanks ;)

Thanks for the link too, how come a google search nor power search returns all this good stuff! will use this as a start ;)

Spotfist 2010-08-12 15:22

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
right I created a script called starcon.sh I stuck it in /home/user/MyDocs/Scripts/starcon.sh

it has this line of "code" in it, it should open up a connection...

dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:"[ANY]" uint32:0

I set alarmed to run it say in a 1 mins time but nothing. is there something obvious Im doing wrong, does the script have to be in a certain location do I need a sudo gainroot line in the sh file?

I created the file in leafpad could that cause a problem? I have Autodisconnect installed aswell but thought that would just allow the connection as if by another app...

Spotfist 2010-08-13 08:34

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
sorry for the triple post but can anyone help with this issue? Spent all day trying out different ways to get the script to work, found another phone control page that showed a

#!/bin/sh

but this did not work, I know alarmed is working but there must be something wrong with my script could someone perhaps upload an example script to open "ANY" connection? Pleeeeease, this is driving me insane :(

x-lette 2010-08-13 11:56

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
1) Is the script executable? if not, alarmed will not be able to execute it. You could also prepend the call with a "/bin/sh" or "/bin/bash"

2) Did you try to run the script from commandline? If it works, you might double-check the calling line in alarmed. Watch out for case sensitivity!

3) If the script itself doesn't work try to replace ANY with a name of an existing data connection. (My line directly calls "E-Plus Internet" so there will be no unwanted connections to "mms" or "Dummy Network")


The line "#!/bin/sh" is called a shebang and only works within a script (it's prepended with a comment sign, therefore on command line it will just do nothing). This line tells the calling interpreter whether it shall call the script with another interpreter or work with some special options.

Spotfist 2010-08-13 12:17

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Do I execute with "exec=/home/user/scripts/starcon.sh" if so then no it doesn't execute it does nothing and goes to the next line.

I have replaced "#!/bin/sh" with /bin/sh and have also replaced the "ANY" with "web'n'walk" still nothing, I assumed the # implied that something was commented out but seriously I was cluching at straws as I found that on another phone control page.

Does web'n'walk have to be in caps? will try that...

Thanks for your help.

I tried a reboot script aswell but this also doesn't seem to work when I try exec=/home/user/scripts/reeboot.sh I have created the scripts in leafpad could that be a problem?

they look like this

/bin/sh dbus....blah....blah

all on one line.

x-lette 2010-08-13 13:15

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Quote:

Originally Posted by Spotfist (Post 785230)
Do I execute with "exec=/home/user/scripts/starcon.sh" if so then no it doesn't execute it does nothing and goes to the next line.

On commandline you call the script like that
/home/user/scripts/starcon.sh
or like that
/bin/sh /home/user/scripts/starcon.sh

The latter one if the file is not marked as executable. You can check that with calling the command
ls -l /home/user/scripts/starcon.sh
the resulting line should begin with
-rwxr--r-- (or similar)
On position 4 and probably 7 and 10 there should be an 'x', then it's executable. If there is a '-', it's not executable.

Quote:

I have replaced "#!/bin/sh" with /bin/sh
Where did you replace that? In the script, on command line or in alarmed?

Quote:

and have also replaced the "ANY" with "web'n'walk" still nothing, I assumed the # implied that something was commented out but seriously I was cluching at straws as I found that on another phone control page.
Yes, the '#' comments out the following line. In the special case it's in a script on the very first line and is followed by an exclamation mark '!' this has a a special meaning.

Quote:

Does web'n'walk have to be in caps? will try that...
I don't think so. But don't forget to put it in quotation marks.

Quote:

I tried a reboot script aswell but this also doesn't seem to work when I try exec=/home/user/scripts/reeboot.sh I have created the scripts in leafpad could that be a problem?

they look like this

/bin/sh dbus....blah....blah

all on one line.
In the script just call the dbus command with no /bin/sh preceeding the line. Also don't put that exec= to the call. I guess you may want to have a look at the scripts in the wiki and follow the guides explained there.

Spotfist 2010-08-13 15:14

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Wayhey! Got it! What a mission, "/bin/sh /home/user/scripts/starcon.sh" works, without the "/bin/sh" I get a permission denied error which of course wouldn't have been shown in Alarmed. I tried with "web'n'walk" and it did nothing but with "[ANY]" it worked but said "no saved connectiones available" at least I know it is working now so I can see if anyone has resolved this. Thanks!

GEONXT 2010-08-13 19:49

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
I have removed alarmed and re installed now cant see any of my scripts when i open alarmed, but they are all still running anyone know how to wipe all the scripts withought using alarmed?

shapeshifter 2010-08-14 11:38

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Quote:

Originally Posted by GEONXT (Post 785651)
I have removed alarmed and re installed now cant see any of my scripts when i open alarmed, but they are all still running anyone know how to wipe all the scripts withought using alarmed?

See the very first post:

Quote:

Notes:
  • If it should happen that you create an event and for some reason it gets lost from Alarmed's menu/list, but still exists and acts, look in /var/cache/alarmd/alarm_queue.ini and you'll find your event somewhere at the bottom. It comes with a "cookie", which identifies it. For example: "cookie: 886". You can then use the CLI interface to delete the event. It will tell you it doesn't exist, but it will nevertheless delete the backend-event:
    Code:

    /opt/alarmed/alarmed.py -CD 886
    Don't mess with the alarm_queue.ini, you might do serious damage!


Oyabun 2010-08-19 09:51

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Quote:

All functions (alarm, built-in function, switch profile) work fine except the command line. Coppied in xterm the same command does what it should, but in Alarmed nothing. Not even a message.
My mistake. Mea culpa! It works perfect! :)

I did rsync in the command line and the only way to check the function is to check the result on the transfered files. There is no other feedback from the program if it executes rsync or not (which is a bit awkward, but more a rsync-issue). So you need to trust it more or less.

Somethin else:
What about implementing a button like "Execute now"? This way you don't have to change the setting if you want to see the result, which could be very helpful for command execution mode. Just an idea...

And thanks a lot for the program!


All times are GMT. The time now is 05:42.

vBulletin® Version 3.8.8