#!/bin/sh
export PATH=/opt/lnxall_app/bin:/opt/lnxall_app/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
cd /opt/lnxall_app/platspec

cp -v -P -f ubuslog.service tmpubuslog.service /usr/lib/systemd/system/

if [ ! -f /etc/ubuslog.d/default.json ] ; then
	echo 'default.json not found in /etc. Copying ...'
	mkdir -p /etc/ubuslog.d
	cp -v -f default.json /etc/ubuslog.d/
fi

systemctl stop lnxlog
systemctl mask lnxlog

reload_ubuslog

systemctl daemon-reload
systemctl enable ubuslog tmpubuslog
systemctl restart ubuslog tmpubuslog

exit 0
