maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [ANNOUNCED] Extremely easy Overclock Script -updated (https://talk.maemo.org/showthread.php?t=63208)

Pavol 2010-10-02 16:23

Re: [ANNOUNCED] Extremely easy Overclock Script -updated
 
multiboot, multiboot kernel - causes the problem

bakuur 2010-10-02 18:57

Re: [ANNOUNCED] Extremely easy Overclock Script -updated
 
Quote:

Originally Posted by Pavol (Post 831686)
multiboot, multiboot kernel - causes the problem

see i told you ;)
anyways hope you enjoy the script

AlMehdi 2010-10-02 21:11

Re: [ANNOUNCED] Extremely easy Overclock Script
 
Quote:

Originally Posted by bakuur (Post 831578)
@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 :D

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


RenaldoTT 2010-10-03 02:52

Re: [ANNOUNCED] Extremely easy Overclock Script -updated
 
I'm studying if I should test this master piece out. Will gather the materials then do some thinking.

stevomanu 2010-10-03 10:51

Re: [ANNOUNCED] Extremely easy Overclock Script -updated
 
1 Attachment(s)
right heres a screen of what happens

many thanks

AlMehdi 2010-10-03 11:05

Re: [ANNOUNCED] Extremely easy Overclock Script -updated
 
Quote:

Originally Posted by stevomanu (Post 832125)
right heres a screen of what happens

http://talk.maemo.org/attachment.php...1&d=1286102912

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

RenaldoTT 2010-10-03 11:31

Re: [ANNOUNCED] Extremely easy Overclock Script -updated
 
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

stevomanu 2010-10-03 11:47

Re: [ANNOUNCED] Extremely easy Overclock Script -updated
 
2 Attachment(s)
first screen is proof file is there an secnod is after trying
mv /home/user/MyDocs/oc-script /home/user/MyDocs/oc-script.sh

bakuur 2010-10-03 11:56

Re: [ANNOUNCED] Extremely easy Overclock Script -updated
 
Quote:

Originally Posted by stevomanu (Post 832163)
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

bakuur 2010-10-03 11:57

Re: [ANNOUNCED] Extremely easy Overclock Script
 
Quote:

Originally Posted by AlMehdi (Post 831862)
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


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

vBulletin® Version 3.8.8