I-Appliance BBS
The Official Source for Internet Appliance Upgrades and Mods

Click Here!
BBS Main List | Sign In | Sign Up | Search | Help | Linux-Hacker.netReply to Thread | Printer |

Home / Other I-Appliances / 3Com Audrey
A way to run shell script from SystemPanel.init

New MessageA way to run shell script from SystemPanel.init (modified 0 times) flipflop7146
Profile | Email
I wrote a little program that will allow you to run shell scripts from the SystemPanel.init.

1) put the execv file in /nto/photon/bin and "chmod +x execv"

2) put your shell script in /somewhere/shell_script.sh

3) make a symbolic link from /somewhere/shell_script to execv:
ln -s /nto/photon/bin/execv /whereever/shell_script

4) Then put /somewhere/shell_script in SystemPanel.init, and
it will call /bin/sh to execute the script in /somewhere/shell_script.sh

The way it works is it uses the execv() function to run /bin/sh with
the script name and original command line arguments, if any.

The files (executable and source) are at http://www.geocities.com/flipflop7146/audrey.html

10-18-2001 18:58:30

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) ghillis
Profile
I got it to work from the command line, but not from SystemPanel.init. Please point me in the right direction, I am sure I missed something painfully obvious, but I can't figure it out.

My shell script, /gary/vnc.sh consists of one line; I did a "chmod +x" on it:
/gary/vncviewer.ph 192.168.1.100

vncviewer.ph is located in /gary

ln -s /gary/vnc created a link named /gary/vnc (vnc.sh shows up in /gary as a link from the file open list of ped.)

In SystemPanel.init I added this line:
,vnc_button.gif,launch,/gary/vnc

I had created vnc_button.gif and vnc_button_activated.gif in anticipation of being able to run VNC from the Options menu. They are located in /kojak/img/eng/config, and appear properly in the menu.

The following will launch the VNC viewer successfully from the command line:
/gary/vncviewer.ph 192.168.1.100
/gary/vnc.sh
/gary/vnc

I did a "chmod -x execv" and the third line stopped working, so I know execv works on the command line level, and yes, I did a "chmod +x execv" and the third line works again. Based on this, it seems that the most probable issue is a)the line in SystemPanel.init is flawed, b)the shell file is flawed, c)I need to put the link somewhere else, or d)vnc isn't going to work with this.

10-19-2001 07:02:55

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) flipflop7146
Profile | Email
It sounds like your setup is right.

It might be that the LD_LIBRARY_PATH is set differently when the script is run from the SystemPanel, so that the vncviewer.ph command can't find its libaries. You could try explicitly setting this variable in your vnc.sh file.

Another possibility is that you didn't put a space at the beginning of the line in SystemPanel.init. I read somewhere that this space is required, but I don't know what happens if you omit it.

10-19-2001 07:26:21

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) acdana
Profile | Email
Please Help.

I am trying to get this to work to no avail.

This is what I am doing.


I ftp'd execv to /nto/photon/bin/execv
I then did a "chmod a+x /nto/photon/bin/execv"

I create a .sh file called phplayer.sh that includes only a single line:
nice -n-5 phplay &

I use mv to move it /kojak:
mv phplayer.sh /kojak/phplayer.sh

and then
chmod a+x /kojak/phplayer.sh

and then
ln -s /nto/photon/bin/execv /kojak/phplayer

I get a ln error saying that file or directory is not found.

I check and double-check execv is in the correct spot and that the permission are correct.

Help please! What am I missing here?

10-21-2001 13:13:01

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) D. Wood
Profile
try moving phplayer to /nto/bin and linkng it from there
10-21-2001 13:58:42

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) acdana
Profile | Email
Thanks it worked. But can you explain to me why it worked? I was specifying absolute paths. Why should moving it affect my ability to ln.

Thanks again,

alicia

10-21-2001 22:02:02

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) D. Wood
Profile
I believe files have to be in a /bin to be executed, not sure tho since I've only been using *nix for a week
10-21-2001 23:28:56

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) stephen18
Profile
ok i have voystart.sh in /bin

slay Browser
voyager -P voyager.server -S m

it runs fin in ksh

if i put execv in /nto/photob/bin
and do ln -s /nto/photon/bin execv /bin/voysrtat.sh
i get ln:targer file '/bin/...voy.sh' already exists. Use ln -f or -i??
i dont think i want to over right

i want my voyager button in the .init to run.
thanks

10-24-2001 11:49:22

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) flipflop7146
Profile | Email
Try:

ln -s /nto/photon/bin/execv /bin/voystart

Then run /bin/voystart from your SystemPanel.init file. The execv program will then append a .sh to the "voystart" name, and execute "/bin/sh voystart.sh"

10-24-2001 15:45:16

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) stephen18
Profile
# cd /bin
# ls
Ppco.can dhcp.client ls sh1
Ppnc.can dinit mkdir show_vesa
cat du more shutdown
chat esh mount slay
chkfsys flashctl mv sleep
chmod flashlzo on stty
cmp fs-cifs passwd tail
comp fshare pax tar
contrast ftp pdksh telnet
cp ftpd phs-to-bjc telnetd
date grep pidin tmp
dcheck if_up ping umount
deva-sb inetd pipe usb-ohci
devb-cf io-net pppd vi
devc-pty iscomp ps voystart
devc-ser8250 kill qtalk which
devf-ram ksh rm
device.map ln setup_codec
df login sh
# ln -s /nto/photon/bin/execv /bin/voystart
ln: Target file '/bin/voystart' already exists. Use ln -f or -i to overwrite.
#

still no luck...

10-25-2001 11:53:08

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) acdana
Profile | Email
Delete voystart from /bin to get a clean start

You need to create your shell program and name it voystart.sh

use cp or mv to move it to /nto/bin

Use chmod to make it an exutable:

chmod a+x /nto/bin/voystart.sh

then type:

ln -s /nto/photon/bin/execv /nto/bin/voystart

This will not work if you have a file or directory in /nto/bin already named voystart.

good luck,

Alicia

10-25-2001 19:52:22

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) fluxit
Profile
ghillis wrote:
>My shell script, /gary/vnc.sh consists of one line; I did a "chmod +x"
on it:
>/gary/vncviewer.ph 192.168.1.100

That needs to be "pterm /gary/vncviewer.ph 192.168.1.100" for vncviewer to query for your password. *visible* console io is not available under photon without a pterm.

To send your password automatically, the line would be "/gary/vncviewer.ph -passwd /etc/passwd.vnc 192.168.1.100". This assumes that your vncserver password file exists on audrey in /etc as passwd.vnc. Note that if you are transferring your encrypted password file from your vncserver using ftp, you should use Binary mode.

--fluxit

10-25-2001 20:08:35

New MessageRE:A way to run shell script from SystemPanel.init (modified 0 times) aardvarko
Profile
This is incredibly useful. Bump - for great justice.
02-06-2002 15:44:37

Reply to Thread | Printer |
All times are PSTPowered by UltraBoard v1.62



Copyright © 2000, Netmake Inc. All Rights Reserved.
See Terms and Conditions for more information.




i-opener opener laptop notebook computer help drivers dll free windows dos repair fix linux mac macintosh 2000 95 98 nt pc configure hardware software sound video netscape explorer network networking lan wan software cmos fat bios printer card mouse modem ide scsi cd rom controllers scanner tape hard drive cgi scripts source code mp3