Opkg update on roids

how fast is your cdn
#!/bin/sh

cp /etc/opkg/distfeeds.conf /tmp/distfeeds.conf
echo "#" > /tmp/customfeeds.conf

sed -i 's!https!http!g' /tmp/distfeeds.conf
sed -i 's!downloads\.openwrt!downloads\.cdn\.openwrt!g' /tmp/distfeeds.conf

mount -o bind /tmp/distfeeds.conf /etc/opkg/distfeeds.conf
mount -o bind /tmp/customfeeds.conf /etc/opkg/customfeeds.conf

echo "############# run1 cdn cache fill"
time opkg update

echo "############# run2 cdn cache direct"
time opkg update

while [ ! -z "$(mount | grep feeds | cut -d' ' -f3)" ]; do
	umount $(mount | grep feeds | cut -d' ' -f3 | head -n1) 1>/dev/null 2>/dev/null
done; rm /tmp/distfeeds.conf 2>/dev/null rm /tmp/customfeeds.conf 2>/dev/null

1sec vs 15sec wholly guac-o-mole!

1 Like