#!/bin/bash

license_path1=/Users/Shared/SafeNet
license_path2=/Users/Shared/SafeNet/SAC

echo '-- Configuration Customization Postinstall --'

if [ ! -d "$license_path1" ]; then
    sudo mkdir -m 775 "$license_path1"
fi

if [ ! -d "$license_path2" ]; then
    sudo mkdir -m 755 "$license_path2"
fi

sudo mv /etc/SacCustomConf/SacLicense.lic "$license_path2"
sudo mv /etc/SacCustomConf/eToken.common.conf /etc/eToken.common.conf
sudo mv /etc/SacCustomConf/eToken.conf /etc/eToken.conf

sudo chmod 755 /Users/Shared/SafeNet/SAC/SacLicense.lic
sudo chmod 664 /etc/eToken.conf
sudo chmod 666 /etc/eToken.common.conf

sudo rm -rf /etc/SacCustomConf
