From 7b457ea9cc35781669e30239a72f609dfb89c38e Mon Sep 17 00:00:00 2001 From: dw-loewe Date: Fri, 16 Dec 2022 14:24:28 +0000 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dieses Script muss ausführbar in /root/bin auf OpenWRT-Router hinterlegt sein. --- update-openwrt_opkg-packages.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 update-openwrt_opkg-packages.sh diff --git a/update-openwrt_opkg-packages.sh b/update-openwrt_opkg-packages.sh new file mode 100644 index 0000000..3024b55 --- /dev/null +++ b/update-openwrt_opkg-packages.sh @@ -0,0 +1,20 @@ +#!/bin/ash + +# script written by David Weber + +opkg update +# find out, if there are any upgradable packages +#UPGRADABLECNT=$(opkg list-upgradable | cut -f 1 -d ' ' | wc -l ) +opkg list-upgradable | cut -f 1 -d ' ' > upgradable-packages.list +UPGRADABLECNT=`wc -l upgradable-packages.list | awk '{ print $1 }'` + +if [ ${UPGRADABLECNT} -eq 0 ]; then + echo "no updates; exiting" + exit 1 +else + echo "available updates: ${UPGRADABLECNT}" + cat upgradable-packages.list | xargs opkg upgrade +# cat upgradable-packages.list | xargs opkg --download-only +# cat upgradable-packages.list | xargs opkg upgrade --cache +fi +