Active Topics

 


Reply
Thread Tools
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#61
hi folks... i'm struggeling with this one...

my desktop-file:
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=RandomVid
Exec=/usr/bin/osso-xterm /etc/hildon-welcome.d/lalala.sh
Icon=terminal
#X-Window-Icon=
X-Window-Icon=     
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
i did chmod:
Code:
chmod 755 /etc/hildon-welcome.d/lalala.sh
chmod a+x doesn't seem to help too.

and my script:
Code:
#!/bin/bash

# determine number of files in /dconfs
cd /etc/hildon-welcome.d/dconfs/
nof=$(ls *.conf | wc -l)

# get random number
rn=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")

# in range of 1 - nof
let "rr = $rn % $nof + 1"

# choose random conf
rf="$rr.conf"
echo "$rr.conf"

# copy it over to default.conf
cp $rf ../default.conf

# exit
exit 0
if i click on the shortcut a terminal opens up but then closes itself after a few seconds.

when i try to execute it (i'm already in the right folder) with:
Code:
lalala.sh
or
Code:
./lalala.sh
there is an error "/bin/sh: lalala.sh: not found" or "/bin/sh: ./lalala.sh: not found"

it only works with
Code:
sh lalala.sh
the echo-line shows up and my file gets replaced correctly

but i can't get the shortcut to work ;(

help appreciated! thanks in advance!
 
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#62
hmpf... i have to execute this whole script as root or a few commands in it... how do i do that!? o.O
 
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#63
tried to start it with
Exec=osso-xterm "sudo sh /etc/hildon-welcome.d/lalala.sh"
then i'm asked for the root password... -.-

even if i edit my script and write "sudo" before every command which have to be executed as root i'm getting asked for this password....

then i tried "sudo gainroot" as first line of my script.
it opens xterm but my script isn't executed...

it's driving me crazy o.O
 
ToJa92's Avatar
Posts: 1,091 | Thanked: 323 times | Joined on Feb 2010 @ ~
#64
I just type 'root' in the terminal when I want root access. I have installed rootsh, that may be it.
 
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#65
i have installed rootsh too.
and i can get root-access to my files via "sudo gainroot" in xterm.

but my problem is following:
i have a script and a desktop-shortcut to this script.

and now i have to execute this script with root-rights.
so how can this be done?

do i have to write something special after Exec= in the desktop-file?
do i have to write something special before the critical commands in the script?
what do i have to do!? i've tried so many things till now - nothing worked
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#66
Code:
Exec=/bin/busybox sh -c 'echo /etc/hildon-welcome.d/lalala.sh | sudo gainroot'
Thanks goes here.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following User Says Thank You to fatalsaint For This Useful Post:
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#67
thanks for your reply... but that also doesn't work... :/
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#68
Try adding the SH before it:

Exec=/bin/busybox sh -c 'echo sh /etc/hildon-welcome.d/lalala.sh | sudo gainroot'
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following User Says Thank You to fatalsaint For This Useful Post:
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#69
nope

i have added some echos in my script for watching where the problem might be...

but... if i click on the shortcut... a terminal opens up... it just says "randomvid", with a progress indicator to the right and a big black screen under the top bar...

after a few seconds the window closes itself

should i see my script running? (with all these echos in the terminal?!)
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#70
As user.. run this in a terminal window:

echo sh /etc/hildon-welcome.d/lalala.sh | sudo gainroot
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following User Says Thank You to fatalsaint For This Useful Post:
Reply

Tags
odod eht oollol


 
Forum Jump


All times are GMT. The time now is 22:54.