#!/bin/sh

LPKGDIR="$1"
mkdir -p "${LPKGDIR}/bin" "${LPKGDIR}/app/upstart/applist"

cp -v dido_modbus_tcp "${LPKGDIR}/bin/"
[ $? -ne 0 ] && exit 1

cp -v -f dido_modbus_tcp.json "${LPKGDIR}/app/upstart/applist/$(printf "%03d" ${FTPIDX})-dido_modbus_tcp.json"
exit $?
