#!/bin/sh
DIR=/opt/tm_cpps/bin
CFG=/opt/tm_cpps/cfg

mvCFG()
{
  [ -f "$CFG"/"$1" ] && mv -f "$CFG"/"$1" "$DIR"
}
mvCFGdir()
{
  [ -d "$CFG"/"$1" ] && mv -f "$CFG"/"$1" "$CFG"/"$1"
}

[ -d "$cfg" ] && {
  mvCFG pars_replace.json
}

chmod 755 /etc/init.d/tm_serverd
find "$DIR" -exec chmod 755 {} \;
/etc/init.d/tm_serverd enable
/etc/init.d/tm_serverd start > /dev/null 2>&1

exit 0
