HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //usr/libexec/update/check_result_refreshed/dsm_update_cache_change.sh
#!/bin/sh
case $1 in
        --sdk-mod-ver)
                echo "1.0";
                ;;
        --name)
                echo "dsm update cache change service";
                ;;
        --pkg-ver)
                echo "1.0";
                ;;
        --vendor)
                echo "Synology";
                ;;
        --pre)
                ;;
        --post)
                update_ver=""
                promote_ver=""
                if [ "yes" = "${UPDATE_AVAILABLE}" ]; then
                    update_ver="-u ${UPDATE_BASE}N${UPDATE_NANO}"
                elif [ -z ${UPDATE_AVAILABLE+x} ]; then
                    if [ "true" = `cat /var/update/check_result/update  | jq .blAvailable` ]; then
                        build=`cat /var/update/check_result/update  | jq .version.iBuildNumber`
                        nano=`cat /var/update/check_result/update  | jq .version.iNano`
                        update_ver="-u ${build}N${nano}"
                    fi
                fi

                if [ "yes" = "${PROMOTION_AVAILABLE}" ]; then
                    promote_ver="-p ${PROMOTION_BASE}N${PROMOTION_NANO}"
                elif [ -z ${PROMOTION_AVAILABLE+x} ]; then
                    if [ "true" = `cat /var/update/check_result/promotion  | jq .blAvailable` ]; then
                        build=`cat /var/update/check_result/promotion  | jq .version.iBuildNumber`
                        nano=`cat /var/update/check_result/promotion  | jq .version.iNano`
                        promote_ver="-p ${build}N${nano}"
                    fi
                fi
                synostgdisk --update-disks-firmware-status -s ${update_ver} ${promote_ver}
                ;;
        *)
                echo "Usage: $0 --sdk-mod-ver|--name|--pkg-ver|--vendor|--pre|--post"
                ;;
esac