Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-03-2007, 06:32 AM   #1
rexcrieg
Junior Member
rexcrieg began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2007
Shell Access - Installed Correctly?

Hello everyone.

I wondering why my scripts aren't working. I downloaded the 'script access' update as described through iDS however, cannot seem to run scripts. When I select them, nothing happens.

For example a script in the root of the memory called myip.sh
Code:

#!/bin/sh
export scriptdir=`/usr/bin/dirname $0`
cd $scriptdir
mkdir testdir
ifconfig -a > testdir/lan.txt


Any help would be much appreciated!
rexcrieg is offline   Reply With Quote
Old 05-03-2007, 07:13 AM   #2
tororebelde
No es el toro que piensas
tororebelde began at the beginning.
 
tororebelde's Avatar
 
Posts: 44
Karma: 10
Join Date: Mar 2007
Device: iRex iliad
Hi,

I init all my scripts with:

Code:
export DISPLAY=:0
export scriptdir=`/usr/bin/dirname $0`
cd $scriptdir

#put here your own stuff
So no need to put #!/bin/sh on your scripts.

Hope this helps you and welcome to mobileread!
tororebelde is offline   Reply With Quote
Advert
Old 05-03-2007, 07:19 AM   #3
tororebelde
No es el toro que piensas
tororebelde began at the beginning.
 
tororebelde's Avatar
 
Posts: 44
Karma: 10
Join Date: Mar 2007
Device: iRex iliad
By the way, I forget to say you must add a manifest.xml file to point to your script. Did you know this? Take this in mind, is important

This could help you: link
tororebelde is offline   Reply With Quote
Old 05-03-2007, 08:02 AM   #4
yokos
Pac-Man caught my iLiad.
yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.
 
yokos's Avatar
 
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
Did you try any of the MR apps? Does it work?
Does your script file have unix encoding ["Line Feed only"]?

@tororebelde: We don't need a manifest.xml to start a .sh.
yokos is offline   Reply With Quote
Old 05-03-2007, 08:03 AM   #5
henkvdg
Groupie
henkvdg has read War And Peace ... all of ithenkvdg has read War And Peace ... all of ithenkvdg has read War And Peace ... all of ithenkvdg has read War And Peace ... all of ithenkvdg has read War And Peace ... all of ithenkvdg has read War And Peace ... all of ithenkvdg has read War And Peace ... all of ithenkvdg has read War And Peace ... all of ithenkvdg has read War And Peace ... all of ithenkvdg has read War And Peace ... all of ithenkvdg has read War And Peace ... all of it
 
Posts: 180
Karma: 66830
Join Date: Oct 2006
Device: IREX iLiad, Pocketbook Pro 903
Quote:
Originally Posted by rexcrieg
Hello everyone.

I wondering why my scripts aren't working. I downloaded the 'script access' update as described through iDS however, cannot seem to run scripts. When I select them, nothing happens.

For example a script in the root of the memory called myip.sh
Code:

#!/bin/sh
export scriptdir=`/usr/bin/dirname $0`
cd $scriptdir
mkdir testdir
ifconfig -a > testdir/lan.txt


Any help would be much appreciated!

The scripts should be according to UNIX file format, so only linefeeds at the end of lines, no CR's.
If you work on a PC a way to achieve that is use the program DOS2UNIX
henkvdg is offline   Reply With Quote
Advert
Old 05-03-2007, 08:03 AM   #6
mtas
Enthusiast
mtas doesn't littermtas doesn't litter
 
Posts: 42
Karma: 145
Join Date: Oct 2006
Device: iLiad
Quote:
Originally Posted by tororebelde
By the way, I forget to say you must add a manifest.xml file to point to your script. Did you know this? Take this in mind, is important

This could help you: link
Just a clarification, there is no need to create a manifest file in order to execute a shell script. As long as the script has the extension .sh and the shell access is installed it can be run by selecting it in the content lister.

OTOH, it's a good idea to let the script start with #!/bin/sh since that makes it possible to run the script from a command line.

Regarding the problem rexcrieg has it seems to me that the shell access has not been successfully downloaded.
mtas is offline   Reply With Quote
Old 05-03-2007, 09:57 AM   #7
rexcrieg
Junior Member
rexcrieg began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2007
Thanks for all the replies. I'm thinking along the lines that the update didn't install correctly. According to iRex's records I have 'successfully' downloaded the update.

I'm sure my line endings are correct as I'm a linux man.

I will try the update again from home tonight.

If anyone has any further thoughts / suggestions or even a 'working' test script to create a directory in the contentlister or even a text file. It'd be much appreciated!

Thanks all.
rexcrieg is offline   Reply With Quote
Old 05-03-2007, 05:20 PM   #8
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
I know you aren't doing this but just in case someone stumbles into this thread some day, if your .sh file is on a EXT2/3 storage card you must have execute permission set on the .sh file (and any executables inside the .sh folder...) chmod +x <your>.sh

Here is my ifconfig.sh script that I have on my internal memory:
ifconfig -a >/mnt/free/if.txt

One line, works great.

I also keep a pair of these scripts on internal memory to deal with the !@#$ can't mount storage card timing issue:
mount /dev/hda1 /mnt/cf

If the card is already mounted you won't hurt anything. Running the script has always gotten my CF or MMC card mounted, where un-plugging/re-plugging might or might not.
scotty1024 is offline   Reply With Quote
Old 05-03-2007, 07:33 PM   #9
rexcrieg
Junior Member
rexcrieg began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2007
Hi Everyone,

Still can't run shell scripts. I downloaded the update from home (saw that the download was complete) It didn't however automatically reset. So I reset the Iliad manually.

I then went into Main memory -> newspapers and ran a simple program as listed above to create a directory in the current directory.

Still no luck,

Is there something I'm missing????????? (Going a bit mad by this point)
rexcrieg is offline   Reply With Quote
Old 05-07-2007, 05:35 AM   #10
tororebelde
No es el toro que piensas
tororebelde began at the beginning.
 
tororebelde's Avatar
 
Posts: 44
Karma: 10
Join Date: Mar 2007
Device: iRex iliad
@yokos, mtas
Thank you guys to point me about the manifest.xml tip. Didn't know that, but I want to learn more so your comments are really welcome!

@rexcrieg
Have you tried with a visual executable, i.e. mrxvt? Just to be sure you have the shell script extension well installed. -- Sure it may be ok, but don't understand why you have those problems. Doing a shell that creates a directory is not to find that it don't works.

Really weird.
tororebelde is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
iLiad shell access problem.. wklee iRex Developer's Corner 10 07-20-2008 07:22 AM
Problem getting shell access templario iRex 1 03-17-2008 10:25 PM
Can't get shell access MarkRPenn iRex 11 10-26-2007 06:58 PM
Shell Access ? grayfox iRex 6 10-14-2007 04:56 PM
2.11 Shell Access is Working Again Adam B. iRex 18 10-01-2007 02:38 AM


All times are GMT -4. The time now is 07:50 PM.


MobileRead.com is a privately owned, operated and funded community.