#!/bin/bash

# 需要降版本的套件
packages=(
    "MediaServer:2.1.0-3304"
    "VideoStation:3.1.0-3153"
    "CodecPack:3.1.0-3005"
    "SynologyPhotos:1.6.2-0710"
    "ContainerManager:20.10.23-1398"
    "PHP7.3:7.3.33-0170"
    "PHP7.4:7.4.30-0120"
    "PHP8.0:8.0.23-0111"
    "Node.js_v14:14.20.1-2012"
    "Node.js_v16:16.17.1-2010"
)

# 遍历所有包并设置值
for item in "${packages[@]}"; do
    package="${item%:*}"
    version="${item#*:}"
    echo "设置 $package 版本为 $version"
    
    /usr/syno/bin/synosetkeyvalue /etc.defaults/synopackageslimit.conf "$package" "$version"
    /usr/syno/bin/synosetkeyvalue /etc/synopackageslimit.conf "$package" "$version"
done

echo "所有包版本设置完成"