mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
5cd825ad13
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
31 lines
933 B
Bash
Executable File
31 lines
933 B
Bash
Executable File
#!/usr/bin/env ash
|
|
#
|
|
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
|
|
#
|
|
# This is free software, licensed under the MIT License.
|
|
# See /LICENSE for more information.
|
|
#
|
|
|
|
if [ "${1}" = "late" ]; then
|
|
echo "Installing addon addincards - ${1}"
|
|
mkdir -p "/tmpRoot/usr/arc/addons/"
|
|
cp -vf "${0}" "/tmpRoot/usr/arc/addons/"
|
|
|
|
MODEL="$(cat /proc/sys/kernel/syno_hw_version)"
|
|
FILE="/tmpRoot/usr/syno/etc/adapter_cards.conf"
|
|
|
|
[ ! -f "${FILE}.bak" ] && cp -f "${FILE}" "${FILE}.bak"
|
|
|
|
cp -f "${FILE}" "${FILE}.tmp"
|
|
echo -n "" >"${FILE}"
|
|
for N in $(cat "${FILE}.tmp" 2>/dev/null | grep '\['); do
|
|
echo "${N}" >>"${FILE}"
|
|
echo "${MODEL}=yes" >>"${FILE}"
|
|
done
|
|
rm -f "${FILE}.tmp"
|
|
elif [ "${1}" = "uninstall" ]; then
|
|
echo "Installing addon addincards - ${1}"
|
|
|
|
FILE="/tmpRoot/usr/syno/etc/adapter_cards.conf"
|
|
[ -f "${FILE}.bak" ] && mv -f "${FILE}.bak" "${FILE}"
|
|
fi |