Notices


Reply
Thread Tools
Posts: 54 | Thanked: 7 times | Joined on Mar 2010 @ Slovakia, Žilina
#61
multiboot, multiboot kernel - causes the problem
 
Posts: 429 | Thanked: 217 times | Joined on Apr 2010 @ Dubai
#62
Originally Posted by Pavol View Post
multiboot, multiboot kernel - causes the problem
see i told you
anyways hope you enjoy the script
__________________
N900 @850Mhz
My N900 changed my life and made it ALOT easier!
 
Posts: 1,751 | Thanked: 844 times | Joined on Feb 2010 @ Sweden
#63
Originally Posted by bakuur View Post
@almehdi

Code:
if [ ! "`dpkg -l | grep 'rootsh'`" ]; then   
   echo "not installed, installing..."
   sudo apt-get install rootsh
   exit
elif [ ! "`dpkg -l | grep 'kernel-power'`" ]; then
   echo "not installed, installing..."
   apt-get install kernel-power
   exit
elif [ ! "`dpkg -l | grep 'kernel-power-settings'`" ]; then
   echo "not installed, installing..."
   apt-get install kernel-power-settings
   exit
else
   echo "found and installed, will continue"
fi
i thought instead of giving off an error why not auto install it if not found??
so yeah this is what i ended up with i tested it on two of my mobiles
and i was hoping if you could point out any mistakes within it

cheers
Yes, that is good. Two things though.. rootsh can't be installed through apt-get. You need to have rootsh to use apt-get so the only way to install it is using the app manager.

And if you don't want the user to be prompted whit the "yes/no" if they want to install.. you could add an "-y" at the end. So it becomes "apt-get install -y kernel-power". Then the process would become more fluid.

Ohh.. and "else" will not be needed. If they already have rootsh and kernel-power installed than that could be come confusing. And "exit" was only needed for the rootsh one as that is the only reason for the script to abort. The dependecies get's installed in the other cases.

You could add another if-statment in case it need an reboot (halt). As you need to be root to use the script.. i added an check for that instead of the check for rootsh.

Code:
# Is the user root?
user=`whoami`
if [ $user != "root" ]; then
    echo "You are not root. You need to be root to run this script. If not installed. Then install it through the Application Manager."
    exit 1
fi

# Check for dependencies
if [ ! "`dpkg -l | grep 'kernel-power'`" ]; then
    echo "Enhanced kernel for power users is not installed, installing..."
    apt-get install -y kernel-power
        if [ ! "`dpkg -l | grep 'kernel-power-settings'`" ]; then
            echo "Enhanced kernel for power users (settings) is not installed, installing..."
            apt-get install -y kernel-power-settings
            halt
        fi
fi

if [ ! "`dpkg -l | grep 'kernel-power-settings'`" ]; then
    echo "Enhanced kernel for power users (settings) is not installed, installing..."
    apt-get install -y kernel-power-settings
        if [ ! "`dpkg -l | grep 'kernel-power'`" ]; then
            echo "Enhanced kernel for power users is not installed, installing..."
            apt-get install kernel-power
            halt
        fi
fi
__________________
You like what i do? Donate!

Make your desktop look awesome - use the AwOken Theme with the AwOken Icon Theme.

Add me on twitter @almehdin
Visit the swedish maemo/meego community forums

Last edited by AlMehdi; 2010-10-02 at 22:01.
 

The Following 2 Users Say Thank You to AlMehdi For This Useful Post:
RenaldoTT's Avatar
Posts: 511 | Thanked: 128 times | Joined on Aug 2010 @ Trinidad and Tobago
#64
I'm studying if I should test this master piece out. Will gather the materials then do some thinking.
 
Posts: 529 | Thanked: 194 times | Joined on Aug 2010 @ UK
#65
right heres a screen of what happens

many thanks
Attached Images
 

Last edited by stevomanu; 2010-10-03 at 11:49.
 
Posts: 1,751 | Thanked: 844 times | Joined on Feb 2010 @ Sweden
#66
Originally Posted by stevomanu View Post
right heres a screen of what happens



many thanks
Try

1. sudo gainroot
2. mv /home/user/MyDocs/oc-script /home/user/MyDocs/oc-script.sh
3. sh /home/user/MyDocs/oc-script.sh
__________________
You like what i do? Donate!

Make your desktop look awesome - use the AwOken Theme with the AwOken Icon Theme.

Add me on twitter @almehdin
Visit the swedish maemo/meego community forums

Last edited by AlMehdi; 2010-10-03 at 11:11.
 
RenaldoTT's Avatar
Posts: 511 | Thanked: 128 times | Joined on Aug 2010 @ Trinidad and Tobago
#67
Hey guys if you need help it would be appreciated if you made it easier to be helped, for instance try to have your fonts visible and background colour not being a pain to see. Thank You very much
 

The Following User Says Thank You to RenaldoTT For This Useful Post:
Posts: 529 | Thanked: 194 times | Joined on Aug 2010 @ UK
#68
first screen is proof file is there an secnod is after trying
mv /home/user/MyDocs/oc-script /home/user/MyDocs/oc-script.sh
Attached Images
  
 
Posts: 429 | Thanked: 217 times | Joined on Apr 2010 @ Dubai
#69
Originally Posted by stevomanu View Post
first screen is proof file is there an secnod is after trying
mv /home/user/MyDocs/oc-script /home/user/MyDocs/oc-script.sh
cause you wrote the destination wrong man!
now use this
Code:
sh /home/user/MyDocs/.documents/oc-script
__________________
N900 @850Mhz
My N900 changed my life and made it ALOT easier!
 
Posts: 429 | Thanked: 217 times | Joined on Apr 2010 @ Dubai
#70
Originally Posted by AlMehdi View Post
Yes, that is good. Two things though.. rootsh can't be installed through apt-get. You need to have rootsh to use apt-get so the only way to install it is using the app manager.

And if you don't want the user to be prompted whit the "yes/no" if they want to install.. you could add an "-y" at the end. So it becomes "apt-get install -y kernel-power". Then the process would become more fluid.

Ohh.. and "else" will not be needed. If they already have rootsh and kernel-power installed than that could be come confusing. And "exit" was only needed for the rootsh one as that is the only reason for the script to abort. The dependecies get's installed in the other cases.

You could add another if-statment in case it need an reboot (halt). As you need to be root to use the script.. i added an check for that instead of the check for rootsh.

Code:
# Is the user root?
user=`whoami`
if [ $user != "root" ]; then
    echo "You are not root. You need to be root to run this script. If not installed. Then install it through the Application Manager."
    exit 1
fi

# Check for dependencies
if [ ! "`dpkg -l | grep 'kernel-power'`" ]; then
    echo "Enhanced kernel for power users is not installed, installing..."
    apt-get install -y kernel-power
        if [ ! "`dpkg -l | grep 'kernel-power-settings'`" ]; then
            echo "Enhanced kernel for power users (settings) is not installed, installing..."
            apt-get install -y kernel-power-settings
            halt
        fi
fi

if [ ! "`dpkg -l | grep 'kernel-power-settings'`" ]; then
    echo "Enhanced kernel for power users (settings) is not installed, installing..."
    apt-get install -y kernel-power-settings
        if [ ! "`dpkg -l | grep 'kernel-power'`" ]; then
            echo "Enhanced kernel for power users is not installed, installing..."
            apt-get install kernel-power
            halt
        fi
fi
amazing! just simply amazing!!
thanks a lot ^^

PS: i think i removed the sudo before apt-get command in the script
__________________
N900 @850Mhz
My N900 changed my life and made it ALOT easier!
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 17:35.