Curl

GNU/Linux BASH website probe using CURL

Small script I used to probe a website. Script should returns a message only when the state changes.

#!/bin/bash

function funcProbe {
  curl ${1} -k -I -s | grep "HTTP/1.1 200 OK" > /dev/null
  if [ $? -ne 0 ]; then
    if [ ! -f /tmp/prb-${2}-DOWN ]; then
      echo "[S2:Probe-${2}] Service DOWN Detected!"
    fi
    touch /tmp/prb-${2}-DOWN
    rm -f /tmp/prb-${2}-UP
  else
    if [ ! -f /tmp/prb-${2}-UP ]; then
      echo "[S2:Probe-${2}] Service UP Detected!"
    fi
    touch /tmp/prb-${2}-UP
    rm -f /tmp/prb-${2}-DOWN
  fi
}

funcProbe https://tech.ne7.nl/ Repository

GNU/Linux Curl SOAP Request using Mutual SSL

POST a Soap Message using curl using Mutual SSL…

curl -k --cert certchain.pem:password --key server.key -X POST \
-d "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tot=\"http://timvkn.nl/services/testservice\" ><soapenv:Header/><soapenv:Body><tot:getTest><Name>%</Name></tot:getTest></soapenv:Body></soapenv:Envelope>" \
-H 'Content-Type: application/soap+xml' \
-H 'SOAPAction: "http://timvkn.nl/services/testservice/getTest"' \
https://timvkn.nl/testservice/getTest --tlsv1.2 -o result.xml -v