mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-29 04:21:48 +08:00
17 lines
817 B
Bash
Executable File
17 lines
817 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ -n "$(uci -q get packagesync.config)" ] || sed -i "s|^config packagesync|config packagesync 'config'|" /etc/config/packagesync
|
|
|
|
download_url="$(uci -q get packagesync.config.download_url)"
|
|
rsync_url="$(uci -q get packagesync.config.rsync_url)"
|
|
[ -n "$download_url" ] || uci set packagesync.config.download_url='https://downloads.openwrt.org'
|
|
[ -n "$rsync_url" ] || uci set packagesync.config.rsync_url='rsync://rsync.openwrt.org/downloads'
|
|
|
|
# merging option target & option subtarget
|
|
for sid in $(uci -q show packagesync | sed -n 's|^.*\.\(@release[[0-9]*]\).subtarget=.*|\1|p'); do
|
|
uci set packagesync.$sid.target="$(uci -q get packagesync.$sid.target)/$(uci -q get packagesync.$sid.subtarget)"
|
|
uci delete packagesync.$sid.subtarget
|
|
done
|
|
|
|
[ -z "$(uci changes packagesync)" ] || uci commit packagesync
|