#!/bin/sh

DEPMOD_DIR="/etc/depmod.d"
LUSTRE_DEPMOD_FILE="${DEPMOD_DIR}/lustre.conf"

[ ! -d ${DEPMOD_DIR} ] && { mkdir -p ${DEPMOD_DIR}; }
[ ! -e ${LUSTRE_DEPMOD_FILE} ] && { echo "search updates built-in" > ${LUSTRE_DEPMOD_FILE}; }

depmod -a

chmod +x /etc/cpfs/*.sh
mkdir -p /opt/cpfs/log

output=`systemctl status cpfs-client.service 2>/dev/null`
if [ "$?" != 0 ]; then
  systemctl daemon-reload
  systemctl enable cpfs-client
fi

