#!/bin/sh
export PATH=/opt/lnxall_app/bin:/opt/lnxall_app/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
# TODO: Add post-installation instruction here, SUCH as restart service

mkdir -p /etc/facini
[ ! -s /etc/facini/rathole.toml ] && cp -v -f \
	/opt/lnxall_app/platspec/rathole.toml /etc/facini/

systemctl stop frpc
cp /opt/lnxall_app/platspec/frpc.service /usr/lib/systemd/system/
cp /opt/lnxall_app/bin/frpc-sn /usr/bin/
if [ ! -f "/etc/frpc.toml" ] ; then
	cp /opt/lnxall_app/platspec/frpc.toml /etc/
fi

systemctl daemon-reload
systemctl enable frpc
systemctl restart frpc

exit 0
