797f46
#!/bin/bash
797f46
797f46
if [ ! -f "/etc/openwsman/serverkey.pem" ]; then
797f46
  if [ -f "/etc/ssl/servercerts/servercert.pem" \
797f46
       -a -f "/etc/ssl/servercerts/serverkey.pem" ]; then
797f46
    echo "Using common server certificate /etc/ssl/servercerts/servercert.pem"
797f46
    ln -s /etc/ssl/servercerts/server{cert,key}.pem /etc/openwsman
797f46
    exit 0
797f46
  else
797f46
    echo "FAILED: Starting openwsman server"
797f46
    echo "There is no ssl server key available for openwsman server to use."
797f46
    echo -e "Please generate one with the following script and start the openwsman service again:\n"
797f46
    echo "##################################"
797f46
    echo "/etc/openwsman/owsmangencert.sh"
797f46
    echo "================================="
797f46
    
797f46
    echo "NOTE: The script uses /dev/random device for generating some random bits while generating the server key."
797f46
    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."
797f46
    exit 1
797f46
  fi
797f46
fi