|
2010-10-02
, 10:27
|
Posts: 429 |
Thanked: 217 times |
Joined on Apr 2010
@ Dubai
|
#32
|
The Following User Says Thank You to bakuur For This Useful Post: | ||
|
2010-10-02
, 10:38
|
Posts: 54 |
Thanked: 7 times |
Joined on Mar 2010
@ Slovakia, Žilina
|
#33
|
|
2010-10-02
, 10:42
|
Posts: 429 |
Thanked: 217 times |
Joined on Apr 2010
@ Dubai
|
#34
|
|
2010-10-02
, 10:55
|
Posts: 1,751 |
Thanked: 844 times |
Joined on Feb 2010
@ Sweden
|
#35
|
thing is am not that advanced in commanding still
i just used my basic knowledge to do what i did
and i think thats as far as i can go
and if you would share what you know then heck ,why not?
and thanks in advance
if [ ! "`dpkg -l | grep 'rootsh'`" ]; then echo "not installed, exiting" exit else echo "installed, will continue" fi
if [ ! "`dpkg -l | grep 'rootsh'`" ]; then echo "not installed, exiting" exit elif [ ! "`dpkg -l | grep 'kernel-power'`" ]; then echo "not installed, exiting" exit elif [ ! "`dpkg -l | grep 'kernel-power-settings'`" ]; then echo "not installed, exiting" exit else echo "installed, will continue" fi
if [ ! "`dpkg -l | grep 'rootsh'`" ]; then echo "not installed, exiting" exit elif [ ! "`dpkg -l | grep 'kernel-power'`" ]; then echo "not installed, exiting" exit elif [ ! "`dpkg -l | grep 'kernel-power-settings'`" ]; then echo "not installed, exiting" exit fi
The Following User Says Thank You to AlMehdi For This Useful Post: | ||
|
2010-10-02
, 11:18
|
Posts: 429 |
Thanked: 217 times |
Joined on Apr 2010
@ Dubai
|
#36
|
I am not that advanced too
If you add this to the top of your script then it will find if the programs are installed.
Of course you need to change the "echo" to fit your script better. If you want to test it.. write something you don't have installed instead of "rootsh" and see what happens.Code:if [ ! "`dpkg -l | grep 'rootsh'`" ]; then echo "not installed, exiting" exit else echo "installed, will continue" fi
edit: or in this case you might wanna check for kernel-power also
or you could do this if you don't want an output on successful..Code:if [ ! "`dpkg -l | grep 'rootsh'`" ]; then echo "not installed, exiting" exit elif [ ! "`dpkg -l | grep 'kernel-power'`" ]; then echo "not installed, exiting" exit elif [ ! "`dpkg -l | grep 'kernel-power-settings'`" ]; then echo "not installed, exiting" exit else echo "installed, will continue" fi
Code:if [ ! "`dpkg -l | grep 'rootsh'`" ]; then echo "not installed, exiting" exit elif [ ! "`dpkg -l | grep 'kernel-power'`" ]; then echo "not installed, exiting" exit elif [ ! "`dpkg -l | grep 'kernel-power-settings'`" ]; then echo "not installed, exiting" exit fi
|
2010-10-02
, 11:22
|
Posts: 54 |
Thanked: 7 times |
Joined on Mar 2010
@ Slovakia, Žilina
|
#37
|
|
2010-10-02
, 11:47
|
Posts: 429 |
Thanked: 217 times |
Joined on Apr 2010
@ Dubai
|
#38
|
|
2010-10-02
, 12:15
|
Posts: 54 |
Thanked: 7 times |
Joined on Mar 2010
@ Slovakia, Žilina
|
#39
|
|
2010-10-02
, 12:25
|
Posts: 429 |
Thanked: 217 times |
Joined on Apr 2010
@ Dubai
|
#40
|
The Following User Says Thank You to bakuur For This Useful Post: | ||
kernel-config load ideal
same, outpout :