#!/bin/sh

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

cp -v -P -f src/rathole.toml "${LPKGDIR}/app/config/"
[ $? -ne 0 ] && exit 1

cp -v -f ipkg-skeleton/CONTROL/postinst "${LPKGDIR}/app/upstart/$(printf "%03d" ${FTPIDX})-rathole.sh"
exit $?
