Notices


Reply
Thread Tools
Posts: 478 | Thanked: 101 times | Joined on Feb 2010
#291
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

Last edited by Spotfist; 2010-08-12 at 13:50.
 
Posts: 478 | Thanked: 101 times | Joined on Feb 2010
#292
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...
 
Posts: 478 | Thanked: 101 times | Joined on Feb 2010
#293
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
 
Posts: 539 | Thanked: 165 times | Joined on Feb 2010 @ Berlin, Germany
#294
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.

Last edited by x-lette; 2010-08-13 at 12:10. Reason: added own line
 

The Following User Says Thank You to x-lette For This Useful Post:
Posts: 478 | Thanked: 101 times | Joined on Feb 2010
#295
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.

Last edited by Spotfist; 2010-08-13 at 12:27.
 
Posts: 539 | Thanked: 165 times | Joined on Feb 2010 @ Berlin, Germany
#296
Originally Posted by Spotfist View Post
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.

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

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.

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.

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.
 

The Following User Says Thank You to x-lette For This Useful Post:
Posts: 478 | Thanked: 101 times | Joined on Feb 2010
#297
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's Avatar
Posts: 64 | Thanked: 21 times | Joined on Dec 2009 @ New Zealand
#298
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?
 
Posts: 187 | Thanked: 345 times | Joined on Nov 2009
#299
Originally Posted by GEONXT View Post
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:

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!
__________________
Author of:
  • The "Alarmed" scheduling and automation app. (Supports alarms, switching profiles, resetting the GPRS counter, setting custom commands to go off, cron syntax and much more. GUI and CLI).
  • "Reaction face-off", a two-player puzzle/knowledge/reaction game.
  • "ytcli", a simple but effective command line youtube client which allows you to play videos from the CLI instantly or download videos on a queue.
 

The Following User Says Thank You to shapeshifter For This Useful Post:
Posts: 2 | Thanked: 0 times | Joined on Aug 2010
#300
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!
 
Reply


 
Forum Jump


All times are GMT. The time now is 17:31.