User:Ikrustok: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Ikrustok (talk | contribs)
No edit summary
Ikrustok (talk | contribs)
No edit summary
Line 4: Line 4:
#!/bin/bash
#!/bin/bash
#Autor: Ivar Krustok A22, ikrustok@itcollege.ee
#Autor: Ivar Krustok A22, ikrustok@itcollege.ee
#Version: 1
#Version: 2
#Skript paki installi kontrolliks
#Skript paki installi kontrolliks
ARG=$1
PAKK=$1
if ! which $ARG > /dev/null; then
TARK=`/usr/bin/apt-cache policy $PAKK | grep Installed | awk '{print $2}'`
echo $TARK
if [ "$TARK" == "(none)" ]; then
         echo "0"
         echo "0"
else
else

Revision as of 09:08, 12 May 2011

Quest lahendus 11 - Skript paki installi kontrolliks

#!/bin/bash
#Autor: Ivar Krustok A22, ikrustok@itcollege.ee
#Version: 2
#Skript paki installi kontrolliks
PAKK=$1
TARK=`/usr/bin/apt-cache policy $PAKK | grep Installed | awk '{print $2}'`
echo $TARK
if [ "$TARK" == "(none)" ]; then
        echo "0"
else
        echo "1"
fi