maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   Gnuite applet with run command (https://talk.maemo.org/showthread.php?t=2699)

pc4ever1 2006-08-05 23:06

Gnuite applet with run command
 
I have been trying to run commands from the Gnuite's load/run applet(see link below) . However they don't appear to be executing. I know the executable script files work because when I run them form Xterm command line they work.

I have been using the following to execute the command from the applet's run command:

./go2drv

or

sh ./go2drv

Neither one of these commands work within the applet but do work at the Xterm command line

I have a few questions.
*********************
Can someone suggest a method to make them execute "go2drv" from this applet.

Is there a way to have the applet open Xterm and then execute the "go2drv" file?

Thanks for the help!

http://gnuite.com:8080/nokia770/

BanditRider 2006-08-06 01:36

Put the file in /usr/bin

pc4ever1 2006-08-06 03:06

I must be dense.
I put the files into /usr/bin and still get no results when using the load/run app.
When I open xTerm and issue the same commands that I used in the load/run app it works.

Does the Load/Run app "run" command line actually issue a command to xTerm, if not where does it send it to?

By the way I have tried to uninstall and re-install the Load/Run app and that didn't work either.

BanditRider 2006-08-06 10:11

Put the file in /usr/bin and don't use ./ or sh

Just use the filename

pc4ever1 2006-08-06 13:47

I tried all of that ( nothing in front of the script name, then tried ./ and then sh ) and it still doesn't run.

Does the Load/Run app "run" command line actually issue a command to xTerm, if not where does it send it to?

Thanks for the suggestions

BanditRider 2006-08-06 14:46

It sends it to the shell - sh
can you run the command by just typing it's name?

pc4ever1 2006-08-06 15:34

Quote:

can you run the command by just typing it's name?
I'm assuming you mean running from within xTerm. If so then Yes, works great.

But when using the same command via run/load applet nothing happens, however after running the command the run/load command states "command completed with exit code 1".

BanditRider 2006-08-07 11:46

Show me the contents of your script.

pc4ever1 2006-08-07 12:35

Here's the script:
****************
#!/bin/sh
user=user
if grep $user /etc/passwd
then password=rootme
sudo su -
cd /home/user/MyDocs/.documents
./foto1.sh
fi

The script for foto1.sh is:
**************************
grep -q cifs /home/user/MyDocs/.documents || insmod ./cifs.ko
mount -t cifs //192.168.001.112/Photos /home/user/MyDocs/.documents/foto -o domain=MSHOME,user=guest,password=guest


Both scripts function from the xTerm prompt, but do nothing running from the Run/Load applet.

Thanks for checking this out.

BanditRider 2006-08-07 15:54

OK, Here's what I'd do:
as root,
move the cifs.ko file to /lib/modules
add the following line to /etc/init.d/minircS near the top after the PATH= line:

insmod /lib/modules/cifs.ko

add the folowing line to the bottom of /etc/fstab

//192.168.001.112/Photos /home/user/MyDocs/.documents/foto cifs rw,domain=MSHOME,user=guest,password=guest
0 0

(all on one line)

Now your single script should be:

#!/bin/sh
# mount cifs shared folder
# use gainroot to become root and relaunch itself
if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
sudo gainroot <<EOF
$0 $*
EOF
exit
fi
mount /home/user/MyDocs/.documents/foto

Put this script in /usr/bin, reboot and you're good to go.
Call it whatever you like, no need for ./ or a .sh extension. just make it executable.


All times are GMT. The time now is 16:36.

vBulletin® Version 3.8.8