#!/usr/bin/env ash # # Copyright (C) 2023 AuxXxilium and Ing # # This is free software, licensed under the MIT License. # See /LICENSE for more information. # if [ "${1}" = "late" ]; then echo "Installing addon sensors - ${1}" mkdir -p "/tmpRoot/usr/arc/addons/" cp -pf "${0}" "/tmpRoot/usr/arc/addons/" tar -zxf /addons/sensors-7.1.tgz -C /tmpRoot/usr/ mv -f /tmpRoot/usr/etc/sensors* /tmpRoot/etc cp -pf /usr/bin/arc-sensors.sh /tmpRoot/usr/bin/arc-sensors.sh if [ ! -f /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db ]; then echo "copy esynoscheduler.db" mkdir -p /tmpRoot/usr/syno/etc/esynoscheduler cp -pf /addons/esynoscheduler.db /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db fi echo "insert sensors task to esynoscheduler.db" export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib if echo "SELECT * FROM task;" | /tmpRoot/bin/sqlite3 /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db | grep -q "Fancontrol||bootup||1|0|0|0||0|"; then echo "Fancontrol task already exists and it is enabled" else /tmpRoot/bin/sqlite3 /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db <