797f465
#!/bin/bash
797f465
797f465
if [ ! -f "/etc/openwsman/serverkey.pem" ]; then
797f465
  if [ -f "/etc/ssl/servercerts/servercert.pem" \
797f465
       -a -f "/etc/ssl/servercerts/serverkey.pem" ]; then
797f465
    echo "Using common server certificate /etc/ssl/servercerts/servercert.pem"
797f465
    ln -s /etc/ssl/servercerts/server{cert,key}.pem /etc/openwsman
797f465
    exit 0
797f465
  else
797f465
    echo "FAILED: Starting openwsman server"
797f465
    echo "There is no ssl server key available for openwsman server to use."
797f465
    echo -e "Please generate one with the following script and start the openwsman service again:\n"
797f465
    echo "##################################"
797f465
    echo "/etc/openwsman/owsmangencert.sh"
797f465
    echo "================================="
797f465
    
797f465
    echo "NOTE: The script uses /dev/random device for generating some random bits while generating the server key."
797f465
    echo "      If this takes too long, you can replace the value of \"RANDFILE\" in /etc/openwsman/ssleay.cnf with /dev/urandom. Please understand the implications of replacing the RNADFILE."
797f465
    exit 1
797f465
  fi
797f465
fi