sspatch: rework

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-08-31 14:52:10 -04:00
parent 196933618e
commit 5f7a730447
2 changed files with 18 additions and 22 deletions

View File

@ -28,27 +28,23 @@ if [ "${1}" = "late" ]; then
ADDONSPATH="/tmpRoot/usr/arc/addons" ADDONSPATH="/tmpRoot/usr/arc/addons"
if [ -d "${SSPATH}" ]; then if [ -d "${SSPATH}" ]; then
# Define the hosts entries to be added # Define the hosts entries to be added
ENTRIES=("0.0.0.0 synosurveillance.synology.com") if [ -f "/tmpRoot/etc/hosts" ]; then
for ENTRY in "${ENTRIES[@]}" # Check if the entry is already in the file
do if grep -Fxq "0.0.0.0 synosurveillance.synology.com" /tmpRoot/etc/hosts; then
if [ -f "/tmpRoot/etc/hosts" ]; then echo "Entry already exists"
# Check if the entry is already in the file else
if grep -Fxq "${ENTRY}" /tmpRoot/etc/hosts; then echo "Entry does not exist, adding now"
echo "Entry ${ENTRY} already exists" echo "0.0.0.0 synosurveillance.synology.com" >> /tmpRoot/etc/hosts
else fi
echo "Entry ${ENTRY} does not exist, adding now" fi
echo "${ENTRY}" >> /tmpRoot/etc/hosts if [ -f "/tmpRoot/etc.defaults/hosts" ]; then
fi if grep -Fxq "${ENTRY}" /tmpRoot/etc.defaults/hosts; then
fi echo "Entry ${ENTRY} already exists"
if [ -f "/tmpRoot/etc.defaults/hosts" ]; then else
if grep -Fxq "${ENTRY}" /tmpRoot/etc.defaults/hosts; then echo "Entry ${ENTRY} does not exist, adding now"
echo "Entry ${ENTRY} already exists" echo "${ENTRY}" >> /tmpRoot/etc.defaults/hosts
else fi
echo "Entry ${ENTRY} does not exist, adding now" fi
echo "${ENTRY}" >> /tmpRoot/etc.defaults/hosts
fi
fi
done
# Check Sha256sum for Patch # Check Sha256sum for Patch
CHECKSUM=$(sha256sum ${SSPATH}/lib/libssutils.so | cut -d' ' -f1) CHECKSUM=$(sha256sum ${SSPATH}/lib/libssutils.so | cut -d' ' -f1)

View File

@ -1,6 +1,6 @@
version: 1 version: 1
name: sspatch name: sspatch
description: "Dynamic License Patch for SS 9.2.0-11289 (Non DVA)" description: "Dynamic License Patch for SS 9.2.0-11289 (Not for DVA 32xx)"
system: false system: false
beta: true beta: true
all: all: