The Motorola Development Community


Go Back   MotorolaFans.com Forums > Developments > Development
Notices

Development Hacking, development, scripts etc

Reply

Moto Fans SENR

BruceLee's Avatar

Join Date: Jan 2008
Posts: 521
Thanks: 23
Thanked 134 Times in 81 Posts
Location: Romania

Quote  
#1
02-21-2008
Default .lin script: file test problem

i want to make a .lin script that activates (add to startup folder) or deactivates (remove from startup folder) another file.
The problem is that this test:
Quote:
[-e /mmc/mmca1/startup/poweronlog.lin]
has some certain problem because it always returns false so it always showing "Activate" instead of switching between "Activate" and "Deactivate" (the functionallity is the same.. always does the activation process.. never went through the other side of the if statement)

here's the script:

Quote:
#!/bin/bash

if [-e /mmc/mmca1/startup/poweronlog.lin];
then
buton="Deactivate"
else
buton="Activate"
fi

mmsg=`showQ -t30 -1 $buton -2 "Cancel" -m "PowerOn phone time logger"`

if [ "$mmsg" = "0" ]
then
if [-e /mmc/mmca1/startup/poweronlog.lin] then
mv /mmc/mmca1/startup/poweronlog.lin /mmc/mmca1/startup/inactive/
else
mv /mmc/mmca1/startup/inactive/poweronlog.lin /mmc/mmca1/startup/
fi
exit
fi
if [ "$mmsg" = "1" ]
then
exit
fi
Reply With Quote


User Information
Current Phone: ROKR E6
Firmware: R533_G_11.12.09P generic
Location: Romania

BruceLee is offlineReport Post
Moto Fans SENR

BruceLee's Avatar

Join Date: Jan 2008
Posts: 521
Thanks: 23
Thanked 134 Times in 81 Posts
Location: Romania

Quote  
#2
02-21-2008
Default

finally i made it work by simply adding a space to left and one to right between the []
Quote:
[ -e /mmc/mmca1/startup/poweronlog.lin ]
edit:
if you notice other problems in my script please tell me because i'm quite unfamiliar with the linux commands and environment and i'm just starting to learn

Last edited by BruceLee; 02-21-2008 at 07:33 AM. Reason: add
Reply With Quote


User Information
Current Phone: ROKR E6
Firmware: R533_G_11.12.09P generic
Location: Romania

BruceLee is offlineReport Post
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:26 PM. Search Engine Friendly URLs by vBSEO 3.2.0 Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd. VBulletin Skin by ForumMonkeys.