#!/bin/bash

# enter here the EPP server address and server port
EPP_SERVER_ADDRESS=127.0.0.1
EPP_SERVER_PORT=443
EPP_PACKAGE_NAME=EndpointProtectorClient.debug.pkg


# do NOT modify the script below this line

if [ $EPP_SERVER_ADDRESS == "127.0.0.1" ]; then
    echo "You have to set the EPP server address before running this script!"
    exit 1
fi

if [ -d $EPP_PACKAGE_NAME ]; then
    echo "Will install package: $EPP_PACKAGE_NAME"
else
    echo "$EPP_PACKAGE_NAME, file not found!"
    exit 1
fi

EPP_INSTALL_CONFIG="/tmp/epp-srv201f0dd30"
echo "ws_server=$EPP_SERVER_ADDRESS" >> $EPP_INSTALL_CONFIG
echo "ws_port=$EPP_SERVER_PORT"      >> $EPP_INSTALL_CONFIG

sudo installer -pkg $EPP_PACKAGE_NAME -target "/"
