#!/bin/sh

UAFIP_CONFIG_DIR=/etc/exoligent/uafip

# create the uafip config directory if it does not exist
if [ ! -d "${UAFIP_CONFIG_DIR}" ];
then
    mkdir -p ${UAFIP_CONFIG_DIR}
fi

cp ./uafipd.service /etc/systemd/system/uafipd.service
cp ./uafip /etc/logrotate.d/uafip
cp -r ../config ${UAFIP_CONFIG_DIR}
cp ../uafipd /usr/bin/uafipd

chmod 644 /etc/systemd/system/uafipd.service
systemctl daemon-reload
systemctl start uafipd.service
systemctl enable uafipd.service