diff --git a/photosfacepatch/all/usr/bin/photosfacepatch.sh b/photosfacepatch/all/usr/bin/photosfacepatch.sh index 6496c98..3c1bd62 100755 --- a/photosfacepatch/all/usr/bin/photosfacepatch.sh +++ b/photosfacepatch/all/usr/bin/photosfacepatch.sh @@ -8,56 +8,51 @@ SO_FILE1="/var/packages/SynologyPhotos/target/usr/lib/libsynophoto-plugin-platform.so" SO_FILE2="/var/packages/SynologyPhotos/target/usr/lib/libsynophoto-plugin-platform.so.1.0" -if [ -f "${SO_FILE1}" ] || [ -f "${SO_FILE2}" ]; then - echo "SynologyPhotos installed -> Patching" -else +if [ ! -f "${SO_FILE1}" ] && [ ! -f "${SO_FILE2}" ]; then echo "SynologyPhotos not installed -> Exit" exit fi if [ -f "${SO_FILE1}" ]; then - SO_FILE="${SO_FILE1}" - if [ "${1}" = "-r" ]; then - if [ -f "${SO_FILE}.bak" ]; then - mv -f "${SO_FILE}.bak" "${SO_FILE}" + if [ -f "${SO_FILE1}.bak" ]; then + mv -f "${SO_FILE1}.bak" "${SO_FILE1}" fi exit fi - if [ ! -f "${SO_FILE}.bak" ]; then - echo "Backup ${SO_FILE}" - cp -vfp "${SO_FILE}" "${SO_FILE}.bak" + if [ ! -f "${SO_FILE1}.bak" ]; then + echo "Backup ${SO_FILE1}" + cp -vfp "${SO_FILE1}" "${SO_FILE1}.bak" fi - echo "Patching ${SO_FILE}" + echo "Patching ${SO_FILE1}" # support face and concept - PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform20IsSupportedIENetworkEv" "B8 00 00 00 00 C3" + PatchELFSharp "${SO_FILE1}" "_ZN9synophoto6plugin8platform20IsSupportedIENetworkEv" "B8 00 00 00 00 C3" # force to support concept - PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform18IsSupportedConceptEv" "B8 01 00 00 00 C3" + PatchELFSharp "${SO_FILE1}" "_ZN9synophoto6plugin8platform18IsSupportedConceptEv" "B8 01 00 00 00 C3" # force no Gpu - PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform23IsSupportedIENetworkGpuEv" "B8 00 00 00 00 C3" + PatchELFSharp "${SO_FILE1}" "_ZN9synophoto6plugin8platform23IsSupportedIENetworkGpuEv" "B8 00 00 00 00 C3" fi -if [ -f "${SO_FILE2}" ]; then - SO_FILE="${SO_FILE2}" +if [ -f "${SO_FILE2}" ]; then if [ "${1}" = "-r" ]; then - if [ -f "${SO_FILE}.bak" ]; then - mv -f "${SO_FILE}.bak" "${SO_FILE}" + if [ -f "${SO_FILE2}.bak" ]; then + mv -f "${SO_FILE2}.bak" "${SO_FILE2}" fi exit fi - if [ ! -f "${SO_FILE}.bak" ]; then - echo "Backup ${SO_FILE}" - cp -vfp "${SO_FILE}" "${SO_FILE}.bak" + if [ ! -f "${SO_FILE2}.bak" ]; then + echo "Backup ${SO_FILE2}" + cp -vfp "${SO_FILE2}" "${SO_FILE2}.bak" fi - echo "Patching ${SO_FILE}" + echo "Patching ${SO_FILE2}" # support face and concept - PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform20IsSupportedIENetworkEv" "B8 00 00 00 00 C3" + PatchELFSharp "${SO_FILE2}" "_ZN9synophoto6plugin8platform20IsSupportedIENetworkEv" "B8 00 00 00 00 C3" # force to support concept - PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform18IsSupportedConceptEv" "B8 01 00 00 00 C3" + PatchELFSharp "${SO_FILE2}" "_ZN9synophoto6plugin8platform18IsSupportedConceptEv" "B8 01 00 00 00 C3" # force no Gpu - PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform23IsSupportedIENetworkGpuEv" "B8 00 00 00 00 C3" + PatchELFSharp "${SO_FILE2}" "_ZN9synophoto6plugin8platform23IsSupportedIENetworkGpuEv" "B8 00 00 00 00 C3" fi \ No newline at end of file diff --git a/photosfacepatch/install.sh b/photosfacepatch/install.sh index 9e43619..ba5ffdf 100755 --- a/photosfacepatch/install.sh +++ b/photosfacepatch/install.sh @@ -23,7 +23,6 @@ Wants=smpkg-custom-install.service pkgctl-StorageManager.service After=smpkg-custom-install.service [Service] -User=root Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/photosfacepatch.sh