Active Topics

 


Reply
Thread Tools
Saturn's Avatar
Posts: 1,648 | Thanked: 2,122 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#11
OK,

Put this in a script (using leafpad for example, but not notes) called myscript.sh in the folder /home/user/

Make it execulable: chmod 755 /home/user/myscript.sh

Code:
#!/bin/sh

# gain superuser rights.

if [ `id -u` != 0 ] ; then
    exec sudo gainroot <<EOF
exec sh $0 $*
EOF
	exit $?
fi   

# put your code below

rmmod wl12xx; 
rmmod mac80211; 
rmmod cfg80211; 
insmod /home/user/MyDocs/neo/compat.ko; 
insmod /home/user/MyDocs/neo/rfkill_backport.ko; 
insmod /home/user/MyDocs/neo/cfg80211.ko; 
insmod /home/user/MyDocs/neo/mac80211.ko; 
insmod /home/user/MyDocs/neo/wl1251.ko; 
insmod /home/user/MyDocs/neo/wl1251_spi.ko;

exit;
execute it as user by simply in an xterm:
/home/user/myscript.sh

If it does what you need then in your desktop file replace the exec line with:
Exec=/home/user/myscript.sh
 

The Following 5 Users Say Thank You to Saturn For This Useful Post:
JonWW's Avatar
Posts: 623 | Thanked: 289 times | Joined on Jan 2010 @ UK
#12
So if you type each command manually, then it works fine?
But if all commands are in a script then it doesn't?

You could try putting a sleep command inbetween each command, I don't know if that would work.
 

The Following User Says Thank You to JonWW For This Useful Post:
Saturn's Avatar
Posts: 1,648 | Thanked: 2,122 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#13
ooh, you changed your post while i was writing too..

How did you make the script? using notes or in windows?
 

The Following User Says Thank You to Saturn For This Useful Post:
Kieron's Avatar
Posts: 388 | Thanked: 115 times | Joined on Oct 2009 @ London, UK
#14
 
Saturn's Avatar
Posts: 1,648 | Thanked: 2,122 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#15
Originally Posted by Kieron View Post
Using Mac TexEdit, converted files to plantext. Uploaded via sftp on FileZilla.
how about if you use this and rename it to sh?
Attached Files
File Type: txt myscript.txt (469 Bytes, 314 views)
 
Kieron's Avatar
Posts: 388 | Thanked: 115 times | Joined on Oct 2009 @ London, UK
#16
Originally Posted by Saturn View Post
ooh, you changed your post while i was writing too..

How did you make the script? using notes or in windows?
It works. The myscript.sh.

I ****ing love you. Ah, you're lucky I don't know you IRL, I might just have to rape you!

I'm gonna change the .desktop files now and make sure it does indeed work.

Thanks! You're awesome!
 
Saturn's Avatar
Posts: 1,648 | Thanked: 2,122 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#17
Originally Posted by Kieron View Post
It works. The myscript.sh.

I ****ing love you. Ah, you're lucky I don't know you IRL, I might just have to rape you!

I'm gonna change the .desktop files now and make sure it does indeed work.

Thanks! You're awesome!
Man!! My wife just needs an excuse to forbid me to visit here.. you ain't helping
 

The Following User Says Thank You to Saturn For This Useful Post:
JonWW's Avatar
Posts: 623 | Thanked: 289 times | Joined on Jan 2010 @ UK
#18
Originally Posted by Kieron View Post
Using Mac TexEdit, converted files to plantext. Uploaded via sftp on FileZilla.
Ah! are you a Mac user?

Linux uses LF to denote new lines
Windows uses CRLF to denote new lines
Do Macs use CR to denote new lines? I think they might.

Linux throws a wobbly at CR new line characters saying stuff like 'no such file or directory' and 'does not exist' errors.
 

The Following User Says Thank You to JonWW For This Useful Post:
Posts: 2 | Thanked: 0 times | Joined on Dec 2010
#19
still not working for me, can you explain to me step by step, thanks

Originally Posted by Saturn View Post
OK,

Put this in a script (using leafpad for example, but not notes) called myscript.sh in the folder /home/user/

Make it execulable: chmod 755 /home/user/myscript.sh

Code:
#!/bin/sh

# gain superuser rights.

if [ `id -u` != 0 ] ; then
    exec sudo gainroot <<EOF
exec sh $0 $*
EOF
	exit $?
fi   

# put your code below

rmmod wl12xx; 
rmmod mac80211; 
rmmod cfg80211; 
insmod /home/user/MyDocs/neo/compat.ko; 
insmod /home/user/MyDocs/neo/rfkill_backport.ko; 
insmod /home/user/MyDocs/neo/cfg80211.ko; 
insmod /home/user/MyDocs/neo/mac80211.ko; 
insmod /home/user/MyDocs/neo/wl1251.ko; 
insmod /home/user/MyDocs/neo/wl1251_spi.ko;

exit;
execute it as user by simply in an xterm:
/home/user/myscript.sh

If it does what you need then in your desktop file replace the exec line with:
Exec=/home/user/myscript.sh
 
Posts: 21 | Thanked: 6 times | Joined on Apr 2010
#20
Hi!

I would like a shortcut that
1. opens X terminal
2. Runs
nohup x11vnc -forever&
3. And then waits there until I do a Ctrl+C

I have tried with a /usr/local/bin/StartVNCserver.sh with
Code:
#!/bin/sh
nohup x11vnc -forever&
And in /usr/share/applications/hildon/StartVNCserver.desktop I have
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=StartVNCserver
Exec=/usr/local/bin/StartVNCserver.sh
Icon=terminal
X-Osso-Type=application/x-executable
X-HildonDesk-ShowInToolbar=true
If I try with
Code:
Exec=osso-xterm
it opens a terminal, so I have also tried with
Code:
Exec=osso-xterm "nohup x11vnc -forever&"
But it don't stay there, it only closes down.

How can I do it?
 
Reply

Tags
maemo 5, script


 
Forum Jump


All times are GMT. The time now is 19:20.