| Server IP : 82.208.35.60 / Your IP : 216.73.216.89 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/misc/openhab2/files/ |
Upload File : |
#!/bin/sh
: ${OPENHAB_USERDATA:="/var/db/openhab2/userdata"}
: ${OPENHAB_RUNTIME:="%%PREFIX%%/libexec/openhab2/runtime"}
: ${OPENHAB_REPL:="%%PREFIX%%/share/openhab2/etc"}
: ${OPENHAB_ETC:="%%PREFIX%%/etc/openhab2"}
rm -r $OPENHAB_USERDATA/cache/* $OPENHAB_USERDATA/tmp/*
rm -r $OPENHAB_USERDATA/kar
for file in $(cat $OPENHAB_RUNTIME/bin/userdata_sysfiles.lst); do
cp -pv $OPENHAB_REPL/$file $OPENHAB_USERDATA/etc/$file
done
FILES="$(grep -R org.eclipse.smarthome ${OPENHAB_ETC} | cut -d : -f 1 | sort -u | grep -v .sample)"
BKP_SUFFIX=pre_2.5.0
for file in ${FILES}; do
mv -v ${file} ${file}.${BKP_SUFFIX}
echo updating content of ${file}, keeping backup in ${file}.${BKP_SUFFIX}
sed -e 's/org.eclipse.smarthome.*://g' <${file}.${BKP_SUFFIX} >${file}
done
for file in ${OPENHAB_USERDATA}/jsondb/automation_rules.json ${OPENHAB_USERDATA}/jsondb/automation_rules_disabled.json ${OPENHAB_USERDATA}/jsondb/backup/*; do
if [ -e ${file} ]; then
mv -v ${file} ${file}.${BKP_SUFFIX}
echo updating next generation rule engine data in ${file}
sed -e 's/org.eclipse.smarthome.automation.dto.RuleDTO/org.eclipse.smarthome.automation.dto.RuleDTO/g' <${file}.${BKP_SUFFIX} >${file} && rm ${file}.${BKP_SUFFIX}
fi
done