Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6070649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:57:26+00:00 2026-05-23T09:57:26+00:00

I have a master shell script which called a child script for each iteration

  • 0

I have a master shell script which called a child script for each iteration of a loop, like so:

#!/bin/bash

while read line
do
    if [[ $line != "" ]]
    then
        ./sslv2_check.sh $line
    fi
done < https-servers

If any of those calls land in this case (see shell script below)

message="FAIL! $1 supports SSLv2 on port $port"

then the master script will stop and not call the next batch. How do I make it continue?

#!/bin/bash

# Required Argument $1 = hostname
# Optional Argument $1 = port number
if [[ $1 == "" ]]
then
    echo Error: I expected a hostname to be passed as an argument but didn\'t find any
    exit 1
fi

if [[ $2 == "" ]]
then
    port=443
else
    port=$2
fi

date=$(date +"%Y-%m-%d")
datetime=$(date +"%Y-%m-%d-%H-%M")
errorlogfile=logs/$date.error.log
logfile=logs/$date.log
# Testing for SSLv2
output=$(openssl s_client -connect $1:$port -ssl2 2>&1)
if [[ $output == *"handshake failure"* ]]
then
    message="PASS! SSLv2 not supported by $1 on port $port"
elif [[ $output == *"104"* ]]
then
    message="PASS! SSLv2 is not supported by $1 on port $port"
elif [[ $output == *"null ssl method passed"* ]]
then
    message="ERROR! SSLv2 is not enabled on your local machine"
    # Log error
    echo "$datetime -- $message" >> $errorlogfile
    echo $output >> $errorlogfile
elif [[ $output == *"110"* ]]
then
    message="ERROR! Failed to connect to $1. Make sure you type in the hostname correctly etc."
    # Log error
    echo "$datetime -- $message" >> $errorlogfile
    echo $output >> $errorlogfile
elif [[ $output == *"BEGIN CERTIFICATE"* ]]
then
    message="FAIL! $1 supports SSLv2 on port $port"
    # Log error
    echo "$datetime -- $message" >> $errorlogfile
    echo $output >> $errorlogfile
else
    message="ERROR! An unknown error occurred. See $errorlogfile for details"
    echo "$datetime -- $message" >> $errorlogfile
    echo $output >> $errorlogfile
fi
#stdout the message
echo $message
#Log the message
echo "$datetime -- $message" >> $logfile
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:57:27+00:00Added an answer on May 23, 2026 at 9:57 am

    Once openssl connects, it waits for input before closing. I don’t know why but this is causing the master batch script to abort. The solution is as follows:

    replace

    output=$(openssl s_client -connect $1:$port -ssl2 2>&1)
    

    with

    output=$(echo 'GET HTTP/1.0' | openssl s_client -connect $1:$port -ssl2 2>&1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a single windows shell command I'd like to run (via EXEC master..xp_cmdshell)
I would like to have a shell script that copies some logs from a
I have a master page which all my views inherit from. The issue I
the procedure: i have a script which uploads images (via hmtl-form and php) for
I need a Bash (or a plain shell) script to put in a cronjob
I have a bash backup script run as root (cron) that delegates certain tasks
I'm trying to write a bash script which will, given the name of a
lets take for example i have a string declared: string master = 1.2.3.4; which
I have MASTER and SLAVE configured (ssh-slave-plugin). I would like to display output of
I have a master table like CityName, Month, Temperature A,Jan,20 .... A,Dec,1 B,Jan,30 ....

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.