From 87056c133d8e05740182d42901fa4151c16b84cd Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sat, 5 Oct 2024 19:34:45 +0200 Subject: [PATCH] amepatch: rework Signed-off-by: AuxXxilium --- amepatch/all/usr/bin/amepatch.sh | 6 ++++-- amepatch/install.sh | 3 ++- sspatch/all/usr/bin/sspatch.sh | 2 +- sspatch/install.sh | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/amepatch/all/usr/bin/amepatch.sh b/amepatch/all/usr/bin/amepatch.sh index 18cb202..b3afeed 100755 --- a/amepatch/all/usr/bin/amepatch.sh +++ b/amepatch/all/usr/bin/amepatch.sh @@ -21,8 +21,9 @@ if [ -d "/var/packages/CodecPack" ]; then lic_patched="/usr/arc/ame_license.patched" if [ -f "$lic_patched" ]; then - if "$ame_path/bin/synoame-bin-auto-install-needed-codec"; then + if "$ame_path/bin/synoame-bin-check-license" && "$ame_path/bin/synoame-bin-auto-install-needed-codec"; then echo -e "AME Patch: Already patched! -> Codec downloaded!" + echo "true" >"$lic_patched" exit 0 else echo -e "AME Patch: Already patched! -> Codec download failed!" @@ -70,12 +71,13 @@ if [ -d "/var/packages/CodecPack" ]; then if "$ame_path/bin/synoame-bin-check-license"; then echo -e "AME Patch: Downloading Codec!" - echo "true" >"${lic_patched}" if "$ame_path/bin/synoame-bin-auto-install-needed-codec"; then echo -e "AME Patch: Successful!" + echo "true" >"$lic_patched" exit 0 else echo -e "AME Patch: Failed!" + rm -f "$lic_patched" exit 1 fi else diff --git a/amepatch/install.sh b/amepatch/install.sh index 2179386..ebe38d1 100755 --- a/amepatch/install.sh +++ b/amepatch/install.sh @@ -17,7 +17,8 @@ if [ "${1}" = "late" ]; then cat <${DEST} [Unit] Description=addon amepatch -After=multi-user.target +Wants=smpkg-custom-install.service +After=smpkg-custom-install.service [Service] User=root diff --git a/sspatch/all/usr/bin/sspatch.sh b/sspatch/all/usr/bin/sspatch.sh index 77b06de..f59bb7c 100755 --- a/sspatch/all/usr/bin/sspatch.sh +++ b/sspatch/all/usr/bin/sspatch.sh @@ -100,7 +100,7 @@ if [ -d "${SSPATH}" ]; then fi sleep 5 - /usr/syno/bin/synopkg start SurveillanceStation + /usr/syno/bin/synopkg restart SurveillanceStation else rm -f "${ss_lic_patched}" fi diff --git a/sspatch/install.sh b/sspatch/install.sh index a320b79..f30339a 100755 --- a/sspatch/install.sh +++ b/sspatch/install.sh @@ -22,7 +22,6 @@ if [ "${1}" = "late" ]; then [Unit] Description=addon sspatch After=multi-user.target -After=amepatch.service [Service] User=root