#!/usr/bin/env ash # # Copyright (C) 2024 AuxXxilium and Ing # # This is free software, licensed under the MIT License. # See /LICENSE for more information. # if [ "${1}" = "late" ]; then echo "Installing addon beep - ${1}" mkdir -p "/tmpRoot/usr/arc/addons/" cp -pf "${0}" "/tmpRoot/usr/arc/addons/" export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib ESYNOSCHEDULER_DB="/tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db" if [ ! -f "${ESYNOSCHEDULER_DB}" ] || ! /tmpRoot/bin/sqlite3 "${ESYNOSCHEDULER_DB}" ".tables" | grep -qw "task"; then echo "copy esynoscheduler.db" mkdir -p "$(dirname "${ESYNOSCHEDULER_DB}")" cp -vpf /addons/esynoscheduler.db "${ESYNOSCHEDULER_DB}" fi if echo "SELECT * FROM task;" | /tmpRoot/bin/sqlite3 "${ESYNOSCHEDULER_DB}" | grep -qE "BeepOnBoot|BeepAtShutdown"; then echo "beep task already exists" else echo "insert beep task to esynoscheduler.db" /tmpRoot/bin/sqlite3 "${ESYNOSCHEDULER_DB}" <