Reply
Thread Tools
Posts: 45 | Thanked: 17 times | Joined on Mar 2010
#21
I'm having trouble with the banana script, it seems to never launch on boot?

I've not chmod'd, just put it into /etc/event.d, is there anything else I need to do apart from edit the top? Is there anyway to see debug upstart?

EDIT: Also, how about sending the cell tower info as well?

Last edited by Sonny_Jim; 2010-08-18 at 16:46.
 
Posts: 26 | Thanked: 11 times | Joined on Nov 2009
#22
Try commenting out these lines:
start on started hildon-desktop
stop on starting shutdown
script
end script

Then run it from terminal. What output do you get?
 
Posts: 45 | Thanked: 17 times | Joined on Mar 2010
#23
Nokia-N900:/etc/event.d# sh banana
: not founde 2:
: not founde 5:
: not founde 6:
: not founde 9:
: not founde 17:
: not founde 22:
banana: line 26: syntax error: "done" unexpected (expecting "do")

I didn't do anything apart from download it from the 1st post, put it into event.d and edit the top of the file

EDIT: I think it needs bash?

Last edited by Sonny_Jim; 2010-08-18 at 17:04.
 
Posts: 26 | Thanked: 11 times | Joined on Nov 2009
#24
did you copy over the sms files? also, maybe you're missing python runtime?
 
Posts: 45 | Thanked: 17 times | Joined on Mar 2010
#25
Nope, I can run the files just fine manually, it's just the upstart script. The one thing I did do was edit banana using vim for windows, so maybe it's screwing up the line endings or something. I'll try with a 'vanilla' banana and not edit it before copying it across.

EDIT: Nope, still not working. I hate to ask this but have you tried using the files from your zipfile? Are you sure that the zip program isn't doing something strange to the line endings?

Last edited by Sonny_Jim; 2010-08-18 at 17:21.
 
Posts: 26 | Thanked: 11 times | Joined on Nov 2009
#26
fyi i wrote it using winscp's built-in text editor

EDIT: I tried downloading the zip file, copying banana using winscp, and editing it using winscp's editor and the python program still runs as it should.

Last edited by boxhead; 2010-08-18 at 17:45.
 
Posts: 45 | Thanked: 17 times | Joined on Mar 2010
#27
I ended up having to format it like this to get it to work without errors:

export VALID_IMSI=
export SEND_TEXT_INTERVAL=120.0
export HOME_PHONE=
export TIME_WAIT_TO_CALL=60
export ALERT_CODE="XXXXXX"
touch /tmp/imsi
export imsiFile=/tmp/imsi
dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM Phone.Sim.get_imsi | grep string | cut -f 2 -d '"' > $imsiFile
while read line
do
imsiNum=$line
done < $imsiFile

if [ $imsiNum -ne $VALID_IMSI ]; then
python /usr/sbin/sms.py --sendinfo $HOME_PHONE $SEND_TEXT_INTERVAL $imsiNum $ALERT_CODE
python /usr/sbin/sms.py --listen 0 $SEND_TEXT_INTERVAL $imsiNum $ALERT_CODE &
sleep $TIME_WAIT_TO_CALL
run-standalone.sh dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.CreateWith string:"$HOME_PHONE" uint32:0
else
python /usr/sbin/sms.py --listen 0 $SEND_TEXT_INTERVAL $imsiNum $ALERT_CODE &
 
Posts: 26 | Thanked: 11 times | Joined on Nov 2009
#28
What does 'export' do? Also, is it working with upstart now? If so, could you attach your file to the post so I can test it and update the zip. Thx.
 
Posts: 45 | Thanked: 17 times | Joined on Mar 2010
#29
You are asking me what 'export' does? Sheesh.

Ok, I'll sit down and have a go at doing it properly and then get back to you.
 
Posts: 26 | Thanked: 11 times | Joined on Nov 2009
#30
hah yeah.. as i mentioned, I'm new to sh scripting. I see that it makes the variables global, but I don't see how that fixes the script on your end.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 06:51.