#!/bin/bash

./osslscan $1 -n 80 > temp.ssl

cat temp.ssl

VER1="`cat temp.ssl | awk '{print $3}'`"
VER2="`cat temp.ssl | awk '{print $4}'`"
VER3="`cat temp.ssl | awk '{print $5}'`"

VER="$VER1 $VER2 $VER3"

a="0"

if [ "$VER" = "Apache/1.3.23 (Unix) (Red-Hat/Linux)" ]; then
   echo "Yak, dapat $VER, mungkin bolong..."
   ./osslx -a 0x0b -c 40 $1
a="1"
fi

if [ "$VER" = "Apache/1.3.19 (Unix) (Red-Hat/Linux)" ]; then
   echo "Yak, dapat $VER, mungkin bolong..."
   ./osslx -a 0x08 -c 40 $1
a="1"
fi

if [ "$VER" = "Apache-AdvancedExtranetServer/1.3.14 (Linux-Mandrake/2mdk) mod_ssl/2.7.1" ]; then
   echo "Yak, dapat $VER, mungkin bolong..."
   ./osslx -a 0x12 -c 40 $1
a="1"
fi

if [ "$VER" = "Apache-AdvancedExtranetServer/1.3.23 (Mandrake Linux/4mdk)" ]; then
   echo "Yak, dapat $VER, mungkin bolong..."
   ./osslx -a 0x15 -c 40 $1
a="1"
fi

if [ "$VER" = "Apache-AdvancedExtranetServer/1.3.22 (Mandrake Linux/4mdk)" ]; then
   echo "Yak, dapat $VER, mungkin bolong..."
   ./osslx -a 0x14 -c 40 $1
a="1"
fi

if [ "$VER" = "Apache/1.3.26 (Unix) Debian" ]; then
   echo "Yak, dapat $VER, mungkin bolong..."
   ./osslx -a 0x01 -c 40 $1
a="1"
fi

if [ "$VER" = "Apache/1.3.12 (Unix) (Red" ]; then
   echo "Yak, dapat $VER Hat/Linux), mungkin bolong..."
   ./osslx -a 0x06 -c 40 $1
a="1"
fi

if [ "$VER" = "Apache/1.3.12 (Unix) (Red-Hat/Linux)" ]; then
   echo "Yak, dapat $VER, mungkin bolong..."
   ./osslx -a 0x07 -c 40 $1
a="1"
fi

if [ "$VER" = "Apache/1.3.20 (Unix) (Red-Hat/Linux)" ]; then
   echo "Yak, dapat $VER, mungkin bolong..."
   ./osslx -a 0x09 -c 40 $1
a="1"
fi

if [ "$VER" = "Apache/1.3.22 (Unix) (HancomLinux/Linux)" ]; then
   echo "Yak, dapat $VER, mungkin bolong..."
   ./osslx -a 0x09 -c 40 $1
a="1"
fi

if [ "$VER" = "Apache/1.3.22 (Unix) (Red-Hat/Linux)" ]; then
   echo "Yak, dapat $VER, mungkin bolong..."
   ./osslx -a 0x0b -c 40 $1
a="1"
fi

if [ "$a" = "0" ]; then
   echo "Weleh, $VER... "
fi

